[ACA-1548][ACA-1802] add actions to viewer toolbar via extensions (#637)

* [ACA-1548] rename viewer toolbar extension of More menu

* [ACA-1548][ACA-1802] add actions to the viewer toolbar via extensions
This commit is contained in:
Suzana Dirla
2018-09-17 15:14:27 +03:00
committed by Denys Vuika
parent 2f4048a859
commit e373064fd1
6 changed files with 52 additions and 7 deletions

View File

@@ -58,6 +58,7 @@ export class AppExtensionService implements RuleContext {
toolbarActions: Array<ContentActionRef> = [];
viewerToolbarActions: Array<ContentActionRef> = [];
viewerToolbarMoreActions: Array<ContentActionRef> = [];
viewerContentExtensions: Array<ViewerExtensionRef> = [];
contextMenuActions: Array<ContentActionRef> = [];
openWithActions: Array<ContentActionRef> = [];
@@ -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<ViewerExtensionRef>(
config,
@@ -226,6 +231,12 @@ export class AppExtensionService implements RuleContext {
);
}
getViewerToolbarMoreActions(): Array<ContentActionRef> {
return this.viewerToolbarMoreActions.filter(action =>
this.filterByRules(action)
);
}
getAllowedContextMenuActions(): Array<ContentActionRef> {
return this.contextMenuActions.filter(action => this.filterByRules(action));
}