4545 multiple
4646 @failed =" onUploadFail"
4747 @uploaded =" onUpload" />
48+
49+ <NcActions :inline =" 1" force-name >
50+ <NcActionButton v-for =" action in enabledFileListActions"
51+ :key =" action.id"
52+ close-after-click
53+ @click =" () => action.exec(currentView, dirContents, { folder: currentFolder })" >
54+ <template #icon >
55+ <NcIconSvgWrapper :svg =" action.iconSvgInline(currentView)" />
56+ </template >
57+ {{ action.displayName(currentView) }}
58+ </NcActionButton >
59+ </NcActions >
4860 </template >
4961 </BreadCrumbs >
5062
@@ -138,7 +150,7 @@ import type { UserConfig } from '../types.ts'
138150
139151import { getCapabilities } from ' @nextcloud/capabilities'
140152import { emit , subscribe , unsubscribe } from ' @nextcloud/event-bus'
141- import { Folder , Node , Permission , sortNodes } from ' @nextcloud/files'
153+ import { Folder , Node , Permission , sortNodes , getFileListActions } from ' @nextcloud/files'
142154import { translate as t } from ' @nextcloud/l10n'
143155import { join , dirname , normalize } from ' path'
144156import { showError , showWarning } from ' @nextcloud/dialogs'
@@ -152,6 +164,8 @@ import IconReload from 'vue-material-design-icons/Reload.vue'
152164import LinkIcon from ' vue-material-design-icons/Link.vue'
153165import ListViewIcon from ' vue-material-design-icons/FormatListBulletedSquare.vue'
154166import NcAppContent from ' @nextcloud/vue/dist/Components/NcAppContent.js'
167+ import NcActions from ' @nextcloud/vue/dist/Components/NcActions.js'
168+ import NcActionButton from ' @nextcloud/vue/dist/Components/NcActionButton.js'
155169import NcButton from ' @nextcloud/vue/dist/Components/NcButton.js'
156170import NcEmptyContent from ' @nextcloud/vue/dist/Components/NcEmptyContent.js'
157171import NcIconSvgWrapper from ' @nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
@@ -190,6 +204,8 @@ export default defineComponent({
190204 LinkIcon ,
191205 ListViewIcon ,
192206 NcAppContent ,
207+ NcActions ,
208+ NcActionButton ,
193209 NcButton ,
194210 NcEmptyContent ,
195211 NcIconSvgWrapper ,
@@ -430,6 +446,19 @@ export default defineComponent({
430446 showCustomEmptyView() {
431447 return ! this .loading && this .isEmptyDir && this .currentView ?.emptyView !== undefined
432448 },
449+
450+ enabledFileListActions() {
451+ const actions = getFileListActions ()
452+ const enabledActions = actions
453+ .filter (action => {
454+ if (action .enabled === undefined ) {
455+ return true
456+ }
457+ return action .enabled (this .currentView , this .dirContents , { folder: this .currentFolder })
458+ })
459+ .toSorted ((a , b ) => a .order - b .order )
460+ return enabledActions
461+ },
433462 },
434463
435464 watch: {
0 commit comments