diff options
author | Pytal <24800714+Pytal@users.noreply.github.com> | 2024-10-02 02:07:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-02 02:07:50 -0700 |
commit | 7cc1b2a1025f3e4d54bbc47dfb1ebcc3552b444f (patch) | |
tree | a0b55dae195f476664cea6133adac2e9d72074dd /apps | |
parent | e333bc3c8f67c6bb685f36bdad386cbfad49474d (diff) | |
parent | 2d4fe1cc088eb5ba170d859e05fe10966783faea (diff) | |
download | nextcloud-server-7cc1b2a1025f3e4d54bbc47dfb1ebcc3552b444f.tar.gz nextcloud-server-7cc1b2a1025f3e4d54bbc47dfb1ebcc3552b444f.zip |
Merge pull request #48512 from nextcloud/fix/pick-folder-smart-picker
fix(files): Fix folders not being selectable in the smart picker
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/views/FileReferencePickerElement.vue | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/apps/files/src/views/FileReferencePickerElement.vue b/apps/files/src/views/FileReferencePickerElement.vue index c2a502ee1a8..b4d4bc54f14 100644 --- a/apps/files/src/views/FileReferencePickerElement.vue +++ b/apps/files/src/views/FileReferencePickerElement.vue @@ -39,7 +39,7 @@ export default defineComponent({ }, filepickerOptions() { return { - allowPickDirectory: false, + allowPickDirectory: true, buttons: this.buttonFactory, container: `#${this.containerId}`, multiselect: false, @@ -53,18 +53,17 @@ export default defineComponent({ buttonFactory(selected: NcNode[]): IFilePickerButton[] { const buttons = [] as IFilePickerButton[] if (selected.length === 0) { - buttons.push({ - label: t('files', 'Choose file'), - type: 'tertiary' as never, - callback: this.onClose, - }) - } else { - buttons.push({ - label: t('files', 'Choose {file}', { file: selected[0].basename }), - type: 'primary', - callback: this.onClose, - }) + return [] + } + const node = selected.at(0) + if (node.path === '/') { + return [] // Do not allow selecting the users root folder } + buttons.push({ + label: t('files', 'Choose {file}', { file: node.displayname }), + type: 'primary', + callback: this.onClose, + }) return buttons }, |