aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBenjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>2024-10-02 14:55:02 +0200
committerGitHub <noreply@github.com>2024-10-02 14:55:02 +0200
commit56d88f74eeaf713693206b3433c95e3e07811e23 (patch)
tree4520fc8c236b3be0384d9f3f6ee733ae267d7636 /apps
parent39c6aafe72984c732ff6e27ad82684a69877efc9 (diff)
parent1cbd3cea9a997a140281093f83ec237cb1f4a724 (diff)
downloadnextcloud-server-56d88f74eeaf713693206b3433c95e3e07811e23.tar.gz
nextcloud-server-56d88f74eeaf713693206b3433c95e3e07811e23.zip
Merge pull request #48516 from nextcloud/backport/48512/stable30
Diffstat (limited to 'apps')
-rw-r--r--apps/files/src/views/FileReferencePickerElement.vue23
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
},