diff --git a/extension.schema.json b/extension.schema.json index 346411af4..5633b211f 100644 --- a/extension.schema.json +++ b/extension.schema.json @@ -358,8 +358,14 @@ "items": { "$ref": "#/definitions/contentActionRef" }, "minItems": 1 }, - "toolbar": { - "description": "Toolbar entries", + "toolbarMoreMenu": { + "description": "Toolbar entries from the More actions menu", + "type": "array", + "items": { "$ref": "#/definitions/contentActionRef" }, + "minItems": 1 + }, + "toolbarActions": { + "description": "Toolbar entries from outside the More menu", "type": "array", "items": { "$ref": "#/definitions/contentActionRef" }, "minItems": 1 diff --git a/src/app/components/page.component.ts b/src/app/components/page.component.ts index dfded30db..7a16762f8 100644 --- a/src/app/components/page.component.ts +++ b/src/app/components/page.component.ts @@ -59,6 +59,7 @@ export abstract class PageComponent implements OnInit, OnDestroy { sharedPreviewUrl$: Observable; actions: Array = []; viewerToolbarActions: Array = []; + viewerToolbarMoreActions: Array = []; canUpdateNode = false; canUpload = false; @@ -89,6 +90,7 @@ export abstract class PageComponent implements OnInit, OnDestroy { this.selection = selection; this.actions = this.extensions.getAllowedToolbarActions(); this.viewerToolbarActions = this.extensions.getViewerToolbarActions(); + this.viewerToolbarMoreActions = this.extensions.getViewerToolbarMoreActions(); this.canUpdateNode = this.selection.count === 1 && this.content.canUpdateNode(selection.first); diff --git a/src/app/components/preview/preview.component.html b/src/app/components/preview/preview.component.html index 634d1a474..13cc1d165 100644 --- a/src/app/components/preview/preview.component.html +++ b/src/app/components/preview/preview.component.html @@ -22,8 +22,14 @@ - + + + + + + + diff --git a/src/app/extensions/extension.service.ts b/src/app/extensions/extension.service.ts index f4004c113..800cef727 100644 --- a/src/app/extensions/extension.service.ts +++ b/src/app/extensions/extension.service.ts @@ -58,6 +58,7 @@ export class AppExtensionService implements RuleContext { toolbarActions: Array = []; viewerToolbarActions: Array = []; + viewerToolbarMoreActions: Array = []; viewerContentExtensions: Array = []; contextMenuActions: Array = []; openWithActions: Array = []; @@ -99,7 +100,11 @@ export class AppExtensionService implements RuleContext { ); this.viewerToolbarActions = this.loader.getContentActions( config, - 'features.viewer.toolbar' + 'features.viewer.toolbarActions' + ); + this.viewerToolbarMoreActions = this.loader.getContentActions( + config, + 'features.viewer.toolbarMoreMenu' ); this.viewerContentExtensions = this.loader.getElements( config, @@ -226,6 +231,12 @@ export class AppExtensionService implements RuleContext { ); } + getViewerToolbarMoreActions(): Array { + return this.viewerToolbarMoreActions.filter(action => + this.filterByRules(action) + ); + } + getAllowedContextMenuActions(): Array { return this.contextMenuActions.filter(action => this.filterByRules(action)); } diff --git a/src/assets/app.extensions.json b/src/assets/app.extensions.json index bff960893..ad849a7bf 100644 --- a/src/assets/app.extensions.json +++ b/src/assets/app.extensions.json @@ -626,7 +626,21 @@ } ], "viewer": { - "toolbar": [ + "toolbarActions": [ + { + "id": "app.viewer.share", + "order": 100, + "title": "APP.ACTIONS.SHARE", + "icon": "share", + "actions": { + "click": "SHARE_NODE" + }, + "rules": { + "visible": "app.selection.file.canShare" + } + } + ], + "toolbarMoreMenu": [ { "id": "app.viewer.favorite.add", "order": 100, diff --git a/src/assets/extension.schema.json b/src/assets/extension.schema.json index 346411af4..5633b211f 100644 --- a/src/assets/extension.schema.json +++ b/src/assets/extension.schema.json @@ -358,8 +358,14 @@ "items": { "$ref": "#/definitions/contentActionRef" }, "minItems": 1 }, - "toolbar": { - "description": "Toolbar entries", + "toolbarMoreMenu": { + "description": "Toolbar entries from the More actions menu", + "type": "array", + "items": { "$ref": "#/definitions/contentActionRef" }, + "minItems": 1 + }, + "toolbarActions": { + "description": "Toolbar entries from outside the More menu", "type": "array", "items": { "$ref": "#/definitions/contentActionRef" }, "minItems": 1