mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
fix(files): ensure that new names are checked even for hidden files
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
d09b8c99de
commit
d07441443d
3 changed files with 7 additions and 18 deletions
|
|
@ -40,7 +40,6 @@
|
|||
ref="name"
|
||||
:basename="basename"
|
||||
:extension="extension"
|
||||
:nodes="nodes"
|
||||
:source="source"
|
||||
@auxclick.native="execDefaultAction"
|
||||
@click.native="execDefaultAction" />
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@
|
|||
ref="renameInput"
|
||||
v-model="newName"
|
||||
:label="renameLabel"
|
||||
:autofocus="true"
|
||||
autofocus
|
||||
required
|
||||
:minlength="1"
|
||||
:required="true"
|
||||
enterkeyhint="done"
|
||||
@keyup.esc="stopRenaming" />
|
||||
</form>
|
||||
|
|
@ -45,6 +45,7 @@ import type { PropType } from 'vue'
|
|||
import { showError } from '@nextcloud/dialogs'
|
||||
import { FileType, NodeStatus } from '@nextcloud/files'
|
||||
import { translate as t } from '@nextcloud/l10n'
|
||||
import { basename } from '@nextcloud/paths'
|
||||
import { defineComponent, inject } from 'vue'
|
||||
import NcTextField from '@nextcloud/vue/components/NcTextField'
|
||||
import { useFileListWidth } from '../../composables/useFileListWidth.ts'
|
||||
|
|
@ -78,20 +79,10 @@ export default defineComponent({
|
|||
required: true,
|
||||
},
|
||||
|
||||
nodes: {
|
||||
type: Array as PropType<Node[]>,
|
||||
required: true,
|
||||
},
|
||||
|
||||
source: {
|
||||
type: Object as PropType<Node>,
|
||||
required: true,
|
||||
},
|
||||
|
||||
gridMode: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
setup() {
|
||||
|
|
@ -153,8 +144,8 @@ export default defineComponent({
|
|||
if (this.defaultFileAction) {
|
||||
const displayName = this.defaultFileAction.displayName({
|
||||
nodes: [this.source],
|
||||
view: this.activeView,
|
||||
folder: this.activeFolder,
|
||||
view: this.activeView!,
|
||||
folder: this.activeFolder!,
|
||||
contents: [],
|
||||
})
|
||||
return {
|
||||
|
|
@ -215,7 +206,8 @@ export default defineComponent({
|
|||
|
||||
methods: {
|
||||
checkIfNodeExists(name: string) {
|
||||
return this.nodes.find((node) => node.basename === name && node !== this.source)
|
||||
const sources: string[] = (this.activeFolder as { _children?: string[] })?._children || []
|
||||
return sources.some((sourceName) => basename(sourceName) === name)
|
||||
},
|
||||
|
||||
startRenaming() {
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@
|
|||
ref="name"
|
||||
:basename="basename"
|
||||
:extension="extension"
|
||||
:grid-mode="true"
|
||||
:nodes="nodes"
|
||||
:source="source"
|
||||
@auxclick.native="execDefaultAction"
|
||||
@click.native="execDefaultAction" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue