Skip to content

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

Merged
susnux merged 2 commits into
masterfrom
fix/files-suffix-folders
Mar 23, 2024
Merged

fix(files): Only add copy suffix before file extension for files (not folders)#44417
susnux merged 2 commits into
masterfrom
fix/files-suffix-folders

Conversation

@susnux

@susnuxsusnux commented Mar 22, 2024

Copy link
Copy Markdown
Contributor

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

@susnuxsusnux added this to the Nextcloud 29 milestone Mar 22, 2024
@susnux
susnux requested a review from a teamMarch 22, 2024 17:34
@susnux
susnux requested a review from skjnldsv as a code ownerMarch 22, 2024 17:34
@susnux
susnux requested review from Pytal, emoral435 and szaimen and removed request for a teamMarch 22, 2024 17:34
@susnuxsusnux changed the title Fix/files suffix foldersfix(files): Only add copy suffix before file extension for files (not folders)Mar 22, 2024
@susnux

Copy link
Copy Markdown
ContributorAuthor

/backport to stable28

Comment threadapps/files/src/utils/fileUtils.ts Outdated
…re file extension
Co-authored-by: Pytal <24800714+Pytal@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnuxforce-pushed the fix/files-suffix-folders branch from c061de9 to 387c2ffCompareMarch 22, 2024 18:13
@susnux

Copy link
Copy Markdown
ContributorAuthor

/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
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@nextcloud/files ?

Copy link
Copy Markdown
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 masterMar 23, 2024
@susnux
susnux deleted the fix/files-suffix-folders branch March 23, 2024 09:50
@AltahrimAltahrim mentioned this pull request Mar 25, 2024
Sign up for freeto 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

@susnux@skjnldsv@Pytal