159159 <NcActionSeparator />
160160
161161 <!-- external actions -->
162- <ExternalShareAction v-for =" action in externalLinkActions"
162+ <NcActionButton v-for =" action in sortedExternalShareActions"
163+ :key =" action.id"
164+ @click =" action.exec(share, fileInfo.node)" >
165+ <template #icon >
166+ <NcIconSvgWrapper :svg =" action.iconSvg" />
167+ </template >
168+ {{ action.label(share, fileInfo.node) }}
169+ </NcActionButton >
170+
171+ <SidebarTabExternalActionLegacy v-for =" action in externalLegacyShareActions"
163172 :id =" action.id"
164173 :key =" action.id"
165174 :action =" action"
@@ -230,6 +239,8 @@ import { t } from '@nextcloud/l10n'
230239import moment from ' @nextcloud/moment'
231240import { generateUrl , getBaseUrl } from ' @nextcloud/router'
232241import { ShareType } from ' @nextcloud/sharing'
242+ import { getSidebarInlineActions } from ' @nextcloud/sharing/ui'
243+ import { toRaw } from ' vue'
233244
234245import VueQrcode from ' @chenfengyuan/vue-qrcode'
235246import NcActionButton from ' @nextcloud/vue/components/NcActionButton'
@@ -255,8 +266,8 @@ import PlusIcon from 'vue-material-design-icons/Plus.vue'
255266
256267import SharingEntryQuickShareSelect from ' ./SharingEntryQuickShareSelect.vue'
257268import ShareExpiryTime from ' ./ShareExpiryTime.vue'
269+ import SidebarTabExternalActionLegacy from ' ./SidebarTabExternal/SidebarTabExternalActionLegacy.vue'
258270
259- import ExternalShareAction from ' ./ExternalShareAction.vue'
260271import GeneratePassword from ' ../utils/GeneratePassword.ts'
261272import Share from ' ../models/Share.ts'
262273import SharesMixin from ' ../mixins/SharesMixin.js'
@@ -267,7 +278,6 @@ export default {
267278 name: ' SharingEntryLink' ,
268279
269280 components: {
270- ExternalShareAction,
271281 NcActions,
272282 NcActionButton,
273283 NcActionCheckbox,
@@ -290,6 +300,7 @@ export default {
290300 PlusIcon,
291301 SharingEntryQuickShareSelect,
292302 ShareExpiryTime,
303+ SidebarTabExternalActionLegacy,
293304 },
294305
295306 mixins: [SharesMixin, ShareDetails],
@@ -323,6 +334,7 @@ export default {
323334
324335 ExternalLegacyLinkActions: OCA .Sharing .ExternalLinkActions .state ,
325336 ExternalShareActions: OCA .Sharing .ExternalShareActions .state ,
337+ externalShareActions: getSidebarInlineActions (),
326338
327339 // tracks whether modal should be opened or not
328340 showQRCode: false ,
@@ -568,13 +580,25 @@ export default {
568580 *
569581 * @return {Array}
570582 */
571- externalLinkActions () {
583+ externalLegacyShareActions () {
572584 const filterValidAction = (action ) => (action .shareType .includes (ShareType .Link ) || action .shareType .includes (ShareType .Email )) && ! action .advanced
573585 // filter only the registered actions for said link
586+ console .error (' external legacy' , this .ExternalShareActions , this .ExternalShareActions .actions .filter (filterValidAction))
574587 return this .ExternalShareActions .actions
575588 .filter (filterValidAction)
576589 },
577590
591+ /**
592+ * Additional actions for the menu
593+ *
594+ * @return {import('@nextcloud/sharing/ui').ISidebarInlineAction[]}
595+ */
596+ sortedExternalShareActions () {
597+ return this .externalShareActions
598+ .filter ((action ) => action .enabled (toRaw (this .share ), toRaw (this .fileInfo .node )))
599+ .sort ((a , b ) => a .order - b .order )
600+ },
601+
578602 isPasswordPolicyEnabled () {
579603 return typeof this .config .passwordPolicy === ' object'
580604 },
0 commit comments