mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Merge pull request #48512 from nextcloud/fix/pick-folder-smart-picker
fix(files): Fix folders not being selectable in the smart picker
This commit is contained in:
commit
7cc1b2a102
3 changed files with 14 additions and 15 deletions
|
|
@ -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
|
||||
},
|
||||
|
||||
|
|
|
|||
4
dist/files-reference-files.js
vendored
4
dist/files-reference-files.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-reference-files.js.map
vendored
2
dist/files-reference-files.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue