diff options
author | Cyrille Bollu <cyrille@debian-BULLSEYE-live-builder-AMD64> | 2024-05-31 17:32:23 +0200 |
---|---|---|
committer | Cyrille Bollu <cyrille@debian-BULLSEYE-live-builder-AMD64> | 2024-05-31 17:32:23 +0200 |
commit | 386b3126d935314b2f351f50f54aa39a125732bf (patch) | |
tree | ef864eb3701bb845ed41de7e2225c11a979bb1d8 | |
parent | 4a857680f854aa4516ee9f4b1df625b69c39bf0b (diff) | |
download | nextcloud-server-issue_45523_actionmenu_in_multiple_actions_menu_bar.tar.gz nextcloud-server-issue_45523_actionmenu_in_multiple_actions_menu_bar.zip |
Adds submenu entries in menu entries in Multiple files action barissue_45523_actionmenu_in_multiple_actions_menu_bar
Signed-off-by: Cyrille Bollu <cyrille@debian-BULLSEYE-live-builder-AMD64>
-rw-r--r-- | apps/files/src/components/FilesListTableHeaderActions.vue | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/apps/files/src/components/FilesListTableHeaderActions.vue b/apps/files/src/components/FilesListTableHeaderActions.vue index 7ea4e99a615..7811d65181e 100644 --- a/apps/files/src/components/FilesListTableHeaderActions.vue +++ b/apps/files/src/components/FilesListTableHeaderActions.vue @@ -27,18 +27,22 @@ :inline="inlineActions" :menu-name="inlineActions <= 1 ? t('files', 'Actions') : null" :open.sync="openedMenu"> - <NcActionButton v-for="action in enabledToplevelMenuActions" + <NcActions v-for="action in enabledToplevelMenuActions" :key="action.id" - :class="'files-list__row-actions-batch-' + action.id" - :close-after-click="false" - :is-menu="true" - @click="onActionClick(action)"> - <template #icon> - <NcLoadingIcon v-if="loading === action.id" :size="18" /> - <NcIconSvgWrapper v-else :svg="action.iconSvgInline(nodes, currentView)" /> - </template> - {{ action.displayName(nodes, currentView) }} - </NcActionButton> + :menuName="action.displayName(nodes, currentView)" > + <NcActionButton v-for="action in enabledSubLevelMenuActions(action)" + :key="action.id" + :class="'files-list__row-actions-batch-' + action.id" + :close-after-click="true" + :is-menu="false" + @click="onActionClick(action)"> + <template #icon> + <NcLoadingIcon v-if="loading === action.id" :size="18" /> + <NcIconSvgWrapper v-else :svg="action.iconSvgInline(nodes, currentView)" /> + </template> + {{ action.displayName(nodes, currentView) }} + </NcActionButton> + </NcActions> <NcActionButton v-for="action in enabledToplevelNonMenuActions" :key="action.id" :class="'files-list__row-actions-batch-' + action.id" @@ -104,7 +108,6 @@ export default defineComponent({ const actionsMenuStore = useActionsMenuStore() const filesStore = useFilesStore() const selectionStore = useSelectionStore() - console.log('CYRILLE', actions) return { actionsMenuStore, filesStore, @@ -132,7 +135,7 @@ export default defineComponent({ enabledToplevelMenuActions() { return this.enabledActions - .filter(action => !action.parent) + .filter(action => typeof action.parent === 'undefined') .filter(action => this.isMenu(action.id)) .sort((a, b) => (a.order || 0) - (b.order || 0)) }, @@ -204,6 +207,12 @@ export default defineComponent({ return this.enabledSubmenuActions[id]?.length > 0 }, + enabledSubLevelMenuActions(action) { + return this.enabledActions + .filter(subAction => subAction.parent === action.id) + .sort((a, b) => (a.order || 0) - (b.order || 0)) + }, + async onActionClick(action) { const displayName = action.displayName(this.nodes, this.currentView) const selectionIds = this.selectedNodes |