Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-8818] Mime type icons are now updated with file names in the viewer #10506

Closed

Conversation

swapnil-verma-gl
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)
When switching between files from within the viewer, there was case where the file icon would load a split second after the file name was changed

What is the new behaviour?
File icon and name are now changed simultaneously

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:
https://hyland.atlassian.net/browse/ACS-8818

@@ -348,13 +349,11 @@ export class AlfrescoViewerComponent implements OnChanges, OnInit {

const nodeMimeType = nodeData?.content?.mimeType;
const renditionMimeType = nodeRendition.mimeType;
mimeType = renditionMimeType || nodeMimeType;
this.mimeType = renditionMimeType || nodeMimeType;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we cover that with some small unit test case check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if a unit test would make a difference here really. If you see in the earlier code, this.mimetype would have anyways gotten updated in the same function execution in line num 357. We only added an assignment earlier in the function execution to make sure it gets updated in the same change detection cycle as the file name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think with #10508 this PR might be obsolete, currently when renditions are generated with this approach the icon is changed twice and ultimately is not correct, the other fixes both issues

@swapnil-verma-gl
Copy link
Contributor Author

A quick test shows that the fixes in #10508 also fix the issues in this PR and ticket. Therefore, this PR is no longer needed and is obsolete. Closing this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants