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

files: fix upload of files with special characters in filename #324

Closed
wants to merge 1 commit into from

Conversation

vgranata
Copy link
Contributor

@vgranata vgranata commented Sep 14, 2022

Unicode normalize filenames

Co-Authored-by: Valeria Granata valeria@chaw.com

Why are you opening this PR?

rero/sonar#861

Code review check list

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?
  • Extracted translations?

@@ -40,7 +40,7 @@
</ng-container>
<ng-template #downloadLink>
<ng-container *ngIf="showDownload && file.links.download; else noLink">
<a href="{{ file.links.download }}?download" *ngIf="showDownload && file.links.download">
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you remove ngIf the property showDownload still used in the component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it is already in the line above:
<ng-container *ngIf="showDownload && file.links.download; else noLink">

Object.keys(file.links).forEach((key) => {
if (['download', 'preview'].includes(key)) {
if (file.links[key]) {
file.links[key] = file.links[key].replace(file.key, file.key.normalize('NFD'));
Copy link
Contributor

Choose a reason for hiding this comment

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

I would use a pipe instead. Original data should stay untouched.

@vgranata vgranata force-pushed the grv-861-fix-file-broken-link branch from c1c208b to de9ef31 Compare October 5, 2022 12:03
Co-Authored-by: Valeria Granata <valeria@chaw.com>
@vgranata vgranata force-pushed the grv-861-fix-file-broken-link branch from de9ef31 to 719c8eb Compare October 5, 2022 12:11
@github-actions
Copy link

github-actions bot commented Apr 4, 2023

This PR is stale because it has been open 6 months with no activity.

@github-actions github-actions bot added the stale Stale label Apr 4, 2023
@github-actions github-actions bot closed this Apr 4, 2023
@mmo mmo removed the stale Stale label Apr 4, 2023
@mmo mmo reopened this Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants