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

fix(files): Only add copy suffix before file extension for files (not folders) #44417

Merged
merged 2 commits into from
Mar 23, 2024

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Mar 22, 2024

Summary

For files keep the behavior (file.name -> file (copy).name) but for folders ignore the extension (folder.name -> folder.name (copy)).

vokoscreenNG-2024-03-22_18-33-07.mp4

Checklist

@susnux susnux added this to the Nextcloud 29 milestone Mar 22, 2024
@susnux susnux requested a review from a team March 22, 2024 17:34
@susnux susnux requested a review from skjnldsv as a code owner March 22, 2024 17:34
@susnux susnux requested review from szaimen, emoral435 and Pytal and removed request for a team March 22, 2024 17:34
@susnux susnux changed the title Fix/files suffix folders fix(files): Only add copy suffix before file extension for files (not folders) Mar 22, 2024
@susnux
Copy link
Contributor Author

susnux commented Mar 22, 2024

/backport to stable28

apps/files/src/utils/fileUtils.ts Outdated Show resolved Hide resolved
…re file extension

Co-authored-by: Pytal <24800714+Pytal@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
Copy link
Contributor Author

susnux commented Mar 22, 2024

/compile amend

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
* @return Either the initial name, if unique, or the name with the suffix so that the name is unique
*/
export const getUniqueName = (name: string, otherNames: string[], suffix = (n: number) => `(${n})`): string => {
export const getUniqueName = (
Copy link
Member

Choose a reason for hiding this comment

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

todo: move to @nextcloud/vue 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nextcloud/files ?

Copy link
Member

Choose a reason for hiding this comment

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

yes, brain died while writing my message 🙈

@susnux susnux merged commit b058af0 into master Mar 23, 2024
104 checks passed
@susnux susnux deleted the fix/files-suffix-folders branch March 23, 2024 09:50
@Altahrim Altahrim mentioned this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Bug]: String (copy) misplaced with some filenames
3 participants