From e712104e58db906d8d0859d2f920c74b78825089 Mon Sep 17 00:00:00 2001
From: Ferdinand Thiessen <opensource@fthiessen.de>
Date: Sat, 22 Feb 2025 13:25:18 +0100
Subject: feat(files): allow to ignore warning to change file type

* Missing pieces of https://github.com/nextcloud/server/issues/46528
  * Add checkbox to not show this dialog again
  * Add user config as suggested by designers in files settings to
    reenable or diable this behavior.
  * Fix behavior of dialog: It says "keep .ext" but it does not keep the
    extension but cancels the operation. From the button label the user
    expects that the operation is continued but with the old extension.
  * Added more test coverage by adding component tests.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
---
 apps/files/src/components/FileEntry/FileEntryName.vue | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

(limited to 'apps/files/src/components/FileEntry/FileEntryName.vue')

diff --git a/apps/files/src/components/FileEntry/FileEntryName.vue b/apps/files/src/components/FileEntry/FileEntryName.vue
index bc6b61ad54c..2fec9e5d556 100644
--- a/apps/files/src/components/FileEntry/FileEntryName.vue
+++ b/apps/files/src/components/FileEntry/FileEntryName.vue
@@ -23,7 +23,6 @@
 	<component :is="linkTo.is"
 		v-else
 		ref="basename"
-		:aria-hidden="isRenaming"
 		class="files-list__row-name-link"
 		data-cy-files-list-row-name-link
 		v-bind="linkTo.params">
@@ -117,11 +116,11 @@ export default defineComponent({
 			return this.isRenaming && this.filesListWidth < 512
 		},
 		newName: {
-			get() {
-				return this.renamingStore.newName
+			get(): string {
+				return this.renamingStore.newNodeName
 			},
-			set(newName) {
-				this.renamingStore.newName = newName
+			set(newName: string) {
+				this.renamingStore.newNodeName = newName
 			},
 		},
 
@@ -249,7 +248,9 @@ export default defineComponent({
 			try {
 				const status = await this.renamingStore.rename()
 				if (status) {
-					showSuccess(t('files', 'Renamed "{oldName}" to "{newName}"', { oldName, newName }))
+					showSuccess(
+						t('files', 'Renamed "{oldName}" to "{newName}"', { oldName, newName: this.source.basename }),
+					)
 					this.$nextTick(() => {
 						const nameContainer = this.$refs.basename as HTMLElement | undefined
 						nameContainer?.focus()
-- 
cgit v1.2.3

