From dd88fa03a41e1ead5f3c7f5333feb570683684cb Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 25 Jul 2024 22:51:12 +0200 Subject: fix(files): Correctly validate new node name * Resolves https://github.com/nextcloud/server/issues/45409 This includes two fixes: 1. The name in the "new node" dialog is correctly selected (e.g. `file.txt` only `file` is selected by default), to allow quick naming 2. `@nextcloud/files` functions for filename validation are used, this allows to use new Nextcloud 30 capabilities (e.g. reserved names) Signed-off-by: Ferdinand Thiessen Signed-off-by: nextcloud-command --- .../src/components/FileEntry/FileEntryName.vue | 6 +- apps/files/src/components/NewNodeDialog.vue | 279 +++++++++------------ 2 files changed, 115 insertions(+), 170 deletions(-) (limited to 'apps/files/src') diff --git a/apps/files/src/components/FileEntry/FileEntryName.vue b/apps/files/src/components/FileEntry/FileEntryName.vue index be491db016f..7a6ad2a1051 100644 --- a/apps/files/src/components/FileEntry/FileEntryName.vue +++ b/apps/files/src/components/FileEntry/FileEntryName.vue @@ -27,7 +27,7 @@ class="files-list__row-name-link" data-cy-files-list-row-name-link v-bind="linkTo.params"> - + @@ -123,7 +123,7 @@ export default defineComponent({ renameLabel() { const matchLabel: Record = { - [FileType.File]: t('files', 'File name'), + [FileType.File]: t('files', 'Filename'), [FileType.Folder]: t('files', 'Folder name'), } return matchLabel[this.source.type] @@ -173,7 +173,7 @@ export default defineComponent({ watch: { /** - * If renaming starts, select the file name + * If renaming starts, select the filename * in the input, without the extension. * @param renaming */ diff --git a/apps/files/src/components/NewNodeDialog.vue b/apps/files/src/components/NewNodeDialog.vue index 7a99c3062d5..b4647724de3 100644 --- a/apps/files/src/components/NewNodeDialog.vue +++ b/apps/files/src/components/NewNodeDialog.vue @@ -8,205 +8,150 @@ :open="open" close-on-click-outside out-transition - @update:open="onClose"> + @update:open="emit('close', null)"> -
- + + :value.sync="localDefaultName" /> - - -- cgit v1.2.3