unified format for viewer sub-menus (#901)

* unified format for viewer sub-menus

* fix tests

* update prettier
This commit is contained in:
Denys Vuika 2019-01-20 11:13:55 +00:00 committed by GitHub
parent d2e0f688e8
commit da3527b0db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 976 additions and 947 deletions

View File

@ -30,7 +30,6 @@ All the customizations are stored in the `features` section of the configuration
"contextMenu": [], "contextMenu": [],
"viewer": { "viewer": {
"toolbarActions:": [], "toolbarActions:": [],
"toolbarMoreMenu:": [],
"openWith": [], "openWith": [],
"content": [] "content": []
}, },
@ -242,14 +241,14 @@ on how to register your own entries to be re-used at runtime.
### Tab properties ### Tab properties
| Name | Description | | Name | Description |
| ------------- | ----------------------------------------------------------- | | ------------- | ----------------------------------------------------------------- |
| **id** | Unique identifier. | | **id** | Unique identifier. |
| **component** | The main [component](/extending/components) to use for the route. | | **component** | The main [component](/extending/components) to use for the route. |
| **title** | Tab title or resource key. | | **title** | Tab title or resource key. |
| icon | Tab icon | | icon | Tab icon |
| disabled | Toggles disabled state. Can be assigned from other plugins. | | disabled | Toggles disabled state. Can be assigned from other plugins. |
| order | The order of the element. | | order | The order of the element. |
### Tab components ### Tab components
@ -378,7 +377,6 @@ Viewer component in ACA supports the following extension points:
"viewer": { "viewer": {
"content": [], "content": [],
"toolbarActions:": [], "toolbarActions:": [],
"toolbarMoreMenu:": [],
"openWith": [] "openWith": []
} }
} }
@ -451,15 +449,13 @@ New viewer toolbar actions can also be added from the extensions config:
"visible": "app.toolbar.versions" "visible": "app.toolbar.versions"
} }
} }
], ]
"toolbarMoreMenu": [...]
} }
} }
} }
``` ```
The ADF Viewer component allows you to provide custom entries for the `More` menu button on the toolbar. You can also provide sub-menus:
The ACA provides an extension point for this menu that you can utilize to populate custom menu items:
```json ```json
{ {
@ -469,19 +465,27 @@ The ACA provides an extension point for this menu that you can utilize to popula
"features": { "features": {
"viewer": { "viewer": {
"toolbarActions": [...], "toolbarActions": [
"toolbarMoreMenu": [
{ {
"id": "app.viewer.share", "id": "app.toolbar.more",
"order": 300, "type": "menu",
"title": "Share", "order": 10000,
"icon": "share", "icon": "more_vert",
"actions": { "title": "APP.ACTIONS.MORE",
"click": "SHARE_NODE" "children": [
}, {
"rules": { "id": "app.viewer.share",
"visible": "app.selection.file.canShare" "order": 300,
} "title": "Share",
"icon": "share",
"actions": {
"click": "SHARE_NODE"
},
"rules": {
"visible": "app.selection.file.canShare"
}
}
]
} }
] ]
} }
@ -532,69 +536,74 @@ As with other content actions, custom plugins can disable, update or extend `Ope
## Content metadata presets ## Content metadata presets
The content metadata presets are needed by the [Content Metadata Component](https://alfresco.github.io/adf-component-catalog/components/ContentMetadataComponent.html#readme) to render the properties of metadata aspects for a given node. The content metadata presets are needed by the [Content Metadata Component](https://alfresco.github.io/adf-component-catalog/components/ContentMetadataComponent.html#readme) to render the properties of metadata aspects for a given node.
The different aspects and their properties are configured in the `app.config.json` file, but they can also be set on runtime through extension files. The different aspects and their properties are configured in the `app.config.json` file, but they can also be set on runtime through extension files.
Configuring these presets from `app.extensions.json` will overwrite the default application setting. Configuring these presets from `app.extensions.json` will overwrite the default application setting.
Settings them from custom plugins allows user to disable, update or extend these presets. Settings them from custom plugins allows user to disable, update or extend these presets.
Check out more info about merging extensions [here](/extending/extension-format#merging-properties). Check out more info about merging extensions [here](/extending/extension-format#merging-properties).
The `content-metadata-presets` elements can be switched off by setting the `disabled` property. The `content-metadata-presets` elements can be switched off by setting the `disabled` property.
This can be applied also for nested items, allowing disabling down to aspect level. This can be applied also for nested items, allowing disabling down to aspect level.
<p class="tip"> <p class="tip">
In order to modify or disable existing entries, you need to know the id of the target element, along with its parents ids. In order to modify or disable existing entries, you need to know the id of the target element, along with its parents ids.
</p> </p>
Your extensions can perform the following actions at runtime: Your extensions can perform the following actions at runtime:
* Add new presets items.
* Add new items to existing presets at any level. - Add new presets items.
* Disable specific items down to the aspect level. - Add new items to existing presets at any level.
* Modify any existing item based on id. - Disable specific items down to the aspect level.
- Modify any existing item based on id.
Regarding properties, you can either: Regarding properties, you can either:
* Add new properties to existing aspect, or
* Redefine the properties of an aspect.
Review this code snippet to see how you can overwrite the properties for `exif:exif` aspect from an external plugin:
```json
{
"$schema": "../../../extension.schema.json",
"$version": "1.0.0",
"$name": "plugin1",
"features": { - Add new properties to existing aspect, or
"content-metadata-presets": [ - Redefine the properties of an aspect.
{
"id": "app.content.metadata.custom", Review this code snippet to see how you can overwrite the properties for `exif:exif` aspect from an external plugin:
"custom": [
{ ```json
"id": "app.content.metadata.customGroup", {
"items": [ "$schema": "../../../extension.schema.json",
{ "$version": "1.0.0",
"id": "app.content.metadata.exifAspect", "$name": "plugin1",
"disabled": true
}, "features": {
{ "content-metadata-presets": [
"id": "app.content.metadata.exifAspect2", {
"aspect": "exif:exif", "id": "app.content.metadata.custom",
"properties": [ "custom": [
"exif:orientation", {
"exif:manufacturer", "id": "app.content.metadata.customGroup",
"exif:model", "items": [
"exif:software" {
] "id": "app.content.metadata.exifAspect",
} "disabled": true
] },
} {
] "id": "app.content.metadata.exifAspect2",
} "aspect": "exif:exif",
] "properties": [
} "exif:orientation",
} "exif:manufacturer",
``` "exif:model",
This external plugin disables the initial `exif:exif` aspect already defined in the `app.extensions.json` and defines other properties for the `exif:exif` aspect. "exif:software"
]
}
]
}
]
}
]
}
}
```
This external plugin disables the initial `exif:exif` aspect already defined in the `app.extensions.json` and defines other properties for the `exif:exif` aspect.
Here is the initial setting from `app.extension.json`: Here is the initial setting from `app.extension.json`:
```json ```json
... ...
"content-metadata-presets": [ "content-metadata-presets": [
@ -630,7 +639,8 @@ Here is the initial setting from `app.extension.json`:
] ]
... ...
``` ```
<p class="tip"> <p class="tip">
In order to allow the content-metadata presets to be extended, the settings from `app.config.json` must be copied to the `app.extensions.json` file and its ids must be added to all the items. In order to allow the content-metadata presets to be extended, the settings from `app.config.json` must be copied to the `app.extensions.json` file and its ids must be added to all the items.
Having ids allows external plugins to extend the current setting. Having ids allows external plugins to extend the current setting.

View File

@ -759,111 +759,118 @@
"rules": { "rules": {
"visible": "app.toolbar.canViewFile" "visible": "app.toolbar.canViewFile"
} }
}
],
"toolbarMoreMenu": [
{
"id": "app.viewer.favorite.add",
"order": 100,
"title": "APP.ACTIONS.FAVORITE",
"icon": "star_border",
"actions": {
"click": "ADD_FAVORITE"
},
"rules": {
"visible": "app.toolbar.favorite.canAdd"
}
}, },
{ {
"id": "app.viewer.favorite.remove", "id": "app.toolbar.more",
"order": 200, "type": "menu",
"title": "APP.ACTIONS.FAVORITE", "order": 10000,
"icon": "star", "icon": "more_vert",
"actions": { "title": "APP.ACTIONS.MORE",
"click": "REMOVE_FAVORITE" "children": [
}, {
"rules": { "id": "app.viewer.favorite.add",
"visible": "app.toolbar.favorite.canRemove" "order": 100,
} "title": "APP.ACTIONS.FAVORITE",
}, "icon": "star_border",
{ "actions": {
"id": "app.viewer.favorite", "click": "ADD_FAVORITE"
"comment": "workaround for Recent Files and Search API issue", },
"type": "custom", "rules": {
"order": 101, "visible": "app.toolbar.favorite.canAdd"
"component": "app.toolbar.toggleFavorite", }
"rules": { },
"visible": "app.toolbar.favorite.canToggle" {
} "id": "app.viewer.favorite.remove",
}, "order": 200,
{ "title": "APP.ACTIONS.FAVORITE",
"id": "app.viewer.share", "icon": "star",
"type": "custom", "actions": {
"order": 300, "click": "REMOVE_FAVORITE"
"component": "app.shared-link.toggleSharedLink", },
"rules": { "rules": {
"visible": "app.selection.file.canShare" "visible": "app.toolbar.favorite.canRemove"
} }
}, },
{ {
"id": "app.viewer.copy", "id": "app.viewer.favorite",
"order": 400, "comment": "workaround for Recent Files and Search API issue",
"title": "APP.ACTIONS.COPY", "type": "custom",
"icon": "content_copy", "order": 101,
"actions": { "component": "app.toolbar.toggleFavorite",
"click": "COPY_NODES" "rules": {
}, "visible": "app.toolbar.favorite.canToggle"
"rules": { }
"visible": "app.toolbar.canCopyNode" },
} {
}, "id": "app.viewer.share",
{ "type": "custom",
"id": "app.viewer.move", "order": 300,
"order": 500, "component": "app.shared-link.toggleSharedLink",
"title": "APP.ACTIONS.MOVE", "rules": {
"icon": "library_books", "visible": "app.selection.file.canShare"
"actions": { }
"click": "MOVE_NODES" },
}, {
"rules": { "id": "app.viewer.copy",
"visible": "app.selection.canDelete" "order": 400,
} "title": "APP.ACTIONS.COPY",
}, "icon": "content_copy",
{ "actions": {
"id": "app.viewer.delete", "click": "COPY_NODES"
"order": 600, },
"title": "APP.ACTIONS.DELETE", "rules": {
"icon": "delete", "visible": "app.toolbar.canCopyNode"
"actions": { }
"click": "DELETE_NODES" },
}, {
"rules": { "id": "app.viewer.move",
"visible": "app.selection.canDelete" "order": 500,
} "title": "APP.ACTIONS.MOVE",
}, "icon": "library_books",
{ "actions": {
"id": "app.viewer.versions", "click": "MOVE_NODES"
"order": 700, },
"title": "APP.ACTIONS.VERSIONS", "rules": {
"icon": "history", "visible": "app.selection.canDelete"
"actions": { }
"click": "MANAGE_VERSIONS" },
}, {
"rules": { "id": "app.viewer.delete",
"visible": "app.toolbar.versions" "order": 600,
} "title": "APP.ACTIONS.DELETE",
}, "icon": "delete",
{ "actions": {
"id": "app.viewer.permissions", "click": "DELETE_NODES"
"order": 800, },
"title": "APP.ACTIONS.PERMISSIONS", "rules": {
"icon": "settings_input_component", "visible": "app.selection.canDelete"
"actions": { }
"click": "MANAGE_PERMISSIONS" },
}, {
"rules": { "id": "app.viewer.versions",
"visible": "app.toolbar.permissions" "order": 700,
} "title": "APP.ACTIONS.VERSIONS",
"icon": "history",
"actions": {
"click": "MANAGE_VERSIONS"
},
"rules": {
"visible": "app.toolbar.versions"
}
},
{
"id": "app.viewer.permissions",
"order": 800,
"title": "APP.ACTIONS.PERMISSIONS",
"icon": "settings_input_component",
"actions": {
"click": "MANAGE_PERMISSIONS"
},
"rules": {
"visible": "app.toolbar.permissions"
}
}
]
} }
], ],
"content": [ "content": [

View File

@ -692,111 +692,118 @@
"rules": { "rules": {
"visible": "app.toolbar.canViewFile" "visible": "app.toolbar.canViewFile"
} }
}
],
"toolbarMoreMenu": [
{
"id": "app.viewer.favorite.add",
"order": 100,
"title": "APP.ACTIONS.FAVORITE",
"icon": "star_border",
"actions": {
"click": "ADD_FAVORITE"
},
"rules": {
"visible": "app.toolbar.favorite.canAdd"
}
}, },
{ {
"id": "app.viewer.favorite.remove", "id": "app.toolbar.more",
"order": 200, "type": "menu",
"title": "APP.ACTIONS.FAVORITE", "order": 10000,
"icon": "star", "icon": "more_vert",
"actions": { "title": "APP.ACTIONS.MORE",
"click": "REMOVE_FAVORITE" "children": [
}, {
"rules": { "id": "app.viewer.favorite.add",
"visible": "app.toolbar.favorite.canRemove" "order": 100,
} "title": "APP.ACTIONS.FAVORITE",
}, "icon": "star_border",
{ "actions": {
"id": "app.viewer.favorite", "click": "ADD_FAVORITE"
"comment": "workaround for Recent Files and Search API issue", },
"type": "custom", "rules": {
"order": 101, "visible": "app.toolbar.favorite.canAdd"
"component": "app.toolbar.toggleFavorite", }
"rules": { },
"visible": "app.toolbar.favorite.canToggle" {
} "id": "app.viewer.favorite.remove",
}, "order": 200,
{ "title": "APP.ACTIONS.FAVORITE",
"id": "app.viewer.share", "icon": "star",
"type": "custom", "actions": {
"order": 300, "click": "REMOVE_FAVORITE"
"component": "app.shared-link.toggleSharedLink", },
"rules": { "rules": {
"visible": "app.selection.file.canShare" "visible": "app.toolbar.favorite.canRemove"
} }
}, },
{ {
"id": "app.viewer.copy", "id": "app.viewer.favorite",
"order": 400, "comment": "workaround for Recent Files and Search API issue",
"title": "APP.ACTIONS.COPY", "type": "custom",
"icon": "content_copy", "order": 101,
"actions": { "component": "app.toolbar.toggleFavorite",
"click": "COPY_NODES" "rules": {
}, "visible": "app.toolbar.favorite.canToggle"
"rules": { }
"visible": "app.toolbar.canCopyNode" },
} {
}, "id": "app.viewer.share",
{ "type": "custom",
"id": "app.viewer.move", "order": 300,
"order": 500, "component": "app.shared-link.toggleSharedLink",
"title": "APP.ACTIONS.MOVE", "rules": {
"icon": "library_books", "visible": "app.selection.file.canShare"
"actions": { }
"click": "MOVE_NODES" },
}, {
"rules": { "id": "app.viewer.copy",
"visible": "app.selection.canDelete" "order": 400,
} "title": "APP.ACTIONS.COPY",
}, "icon": "content_copy",
{ "actions": {
"id": "app.viewer.delete", "click": "COPY_NODES"
"order": 600, },
"title": "APP.ACTIONS.DELETE", "rules": {
"icon": "delete", "visible": "app.toolbar.canCopyNode"
"actions": { }
"click": "DELETE_NODES" },
}, {
"rules": { "id": "app.viewer.move",
"visible": "app.selection.canDelete" "order": 500,
} "title": "APP.ACTIONS.MOVE",
}, "icon": "library_books",
{ "actions": {
"id": "app.viewer.versions", "click": "MOVE_NODES"
"order": 700, },
"title": "APP.ACTIONS.VERSIONS", "rules": {
"icon": "history", "visible": "app.selection.canDelete"
"actions": { }
"click": "MANAGE_VERSIONS" },
}, {
"rules": { "id": "app.viewer.delete",
"visible": "app.toolbar.versions" "order": 600,
} "title": "APP.ACTIONS.DELETE",
}, "icon": "delete",
{ "actions": {
"id": "app.viewer.permissions", "click": "DELETE_NODES"
"order": 800, },
"title": "APP.ACTIONS.PERMISSIONS", "rules": {
"icon": "settings_input_component", "visible": "app.selection.canDelete"
"actions": { }
"click": "MANAGE_PERMISSIONS" },
}, {
"rules": { "id": "app.viewer.versions",
"visible": "app.toolbar.permissions" "order": 700,
} "title": "APP.ACTIONS.VERSIONS",
"icon": "history",
"actions": {
"click": "MANAGE_VERSIONS"
},
"rules": {
"visible": "app.toolbar.versions"
}
},
{
"id": "app.viewer.permissions",
"order": 800,
"title": "APP.ACTIONS.PERMISSIONS",
"icon": "settings_input_component",
"actions": {
"click": "MANAGE_PERMISSIONS"
},
"rules": {
"visible": "app.toolbar.permissions"
}
}
]
} }
], ],
"content": [ "content": [

View File

@ -674,114 +674,121 @@
"rules": { "rules": {
"visible": "app.toolbar.canViewFile" "visible": "app.toolbar.canViewFile"
} }
}
],
"toolbarMoreMenu": [
{
"id": "app.viewer.favorite.add",
"order": 100,
"title": "APP.ACTIONS.FAVORITE",
"icon": "star_border",
"actions": {
"click": "ADD_FAVORITE"
},
"rules": {
"visible": "app.toolbar.favorite.canAdd"
}
}, },
{ {
"id": "app.viewer.favorite.remove", "id": "app.toolbar.more",
"order": 200, "type": "menu",
"title": "APP.ACTIONS.FAVORITE", "order": 10000,
"icon": "star", "icon": "more_vert",
"actions": { "title": "APP.ACTIONS.MORE",
"click": "REMOVE_FAVORITE" "children": [
}, {
"rules": { "id": "app.viewer.favorite.add",
"visible": "app.toolbar.favorite.canRemove" "order": 100,
} "title": "APP.ACTIONS.FAVORITE",
}, "icon": "star_border",
{ "actions": {
"id": "app.viewer.favorite", "click": "ADD_FAVORITE"
"comment": "workaround for Recent Files and Search API issue", },
"type": "custom", "rules": {
"order": 101, "visible": "app.toolbar.favorite.canAdd"
"component": "app.toolbar.toggleFavorite", }
"rules": { },
"visible": "app.toolbar.favorite.canToggle" {
} "id": "app.viewer.favorite.remove",
}, "order": 200,
{ "title": "APP.ACTIONS.FAVORITE",
"id": "app.viewer.share", "icon": "star",
"order": 300, "actions": {
"title": "APP.ACTIONS.SHARE", "click": "REMOVE_FAVORITE"
"icon": "share", },
"actions": { "rules": {
"click": "SHARE_NODE" "visible": "app.toolbar.favorite.canRemove"
}, }
"rules": { },
"visible": "app.selection.file.canShare" {
} "id": "app.viewer.favorite",
}, "comment": "workaround for Recent Files and Search API issue",
{ "type": "custom",
"id": "app.viewer.copy", "order": 101,
"order": 400, "component": "app.toolbar.toggleFavorite",
"title": "APP.ACTIONS.COPY", "rules": {
"icon": "content_copy", "visible": "app.toolbar.favorite.canToggle"
"actions": { }
"click": "COPY_NODES" },
}, {
"rules": { "id": "app.viewer.share",
"visible": "app.toolbar.canCopyNode" "order": 300,
} "title": "APP.ACTIONS.SHARE",
}, "icon": "share",
{ "actions": {
"id": "app.viewer.move", "click": "SHARE_NODE"
"order": 500, },
"title": "APP.ACTIONS.MOVE", "rules": {
"icon": "library_books", "visible": "app.selection.file.canShare"
"actions": { }
"click": "MOVE_NODES" },
}, {
"rules": { "id": "app.viewer.copy",
"visible": "app.selection.canDelete" "order": 400,
} "title": "APP.ACTIONS.COPY",
}, "icon": "content_copy",
{ "actions": {
"id": "app.viewer.delete", "click": "COPY_NODES"
"order": 600, },
"title": "APP.ACTIONS.DELETE", "rules": {
"icon": "delete", "visible": "app.toolbar.canCopyNode"
"actions": { }
"click": "DELETE_NODES" },
}, {
"rules": { "id": "app.viewer.move",
"visible": "app.selection.canDelete" "order": 500,
} "title": "APP.ACTIONS.MOVE",
}, "icon": "library_books",
{ "actions": {
"id": "app.viewer.versions", "click": "MOVE_NODES"
"order": 700, },
"title": "APP.ACTIONS.VERSIONS", "rules": {
"icon": "history", "visible": "app.selection.canDelete"
"actions": { }
"click": "MANAGE_VERSIONS" },
}, {
"rules": { "id": "app.viewer.delete",
"visible": "app.toolbar.versions" "order": 600,
} "title": "APP.ACTIONS.DELETE",
}, "icon": "delete",
{ "actions": {
"id": "app.viewer.permissions", "click": "DELETE_NODES"
"order": 800, },
"title": "APP.ACTIONS.PERMISSIONS", "rules": {
"icon": "settings_input_component", "visible": "app.selection.canDelete"
"actions": { }
"click": "MANAGE_PERMISSIONS" },
}, {
"rules": { "id": "app.viewer.versions",
"visible": "app.toolbar.permissions" "order": 700,
} "title": "APP.ACTIONS.VERSIONS",
"icon": "history",
"actions": {
"click": "MANAGE_VERSIONS"
},
"rules": {
"visible": "app.toolbar.versions"
}
},
{
"id": "app.viewer.permissions",
"order": 800,
"title": "APP.ACTIONS.PERMISSIONS",
"icon": "settings_input_component",
"actions": {
"click": "MANAGE_PERMISSIONS"
},
"rules": {
"visible": "app.toolbar.permissions"
}
}
]
} }
], ],
"content": [ "content": [

View File

@ -710,114 +710,121 @@
"rules": { "rules": {
"visible": "app.toolbar.canViewFile" "visible": "app.toolbar.canViewFile"
} }
}
],
"toolbarMoreMenu": [
{
"id": "app.viewer.favorite.add",
"order": 100,
"title": "APP.ACTIONS.FAVORITE",
"icon": "star_border",
"actions": {
"click": "ADD_FAVORITE"
},
"rules": {
"visible": "app.toolbar.favorite.canAdd"
}
}, },
{ {
"id": "app.viewer.favorite.remove", "id": "app.toolbar.more",
"order": 200, "type": "menu",
"title": "APP.ACTIONS.FAVORITE", "order": 10000,
"icon": "star", "icon": "more_vert",
"actions": { "title": "APP.ACTIONS.MORE",
"click": "REMOVE_FAVORITE" "children": [
}, {
"rules": { "id": "app.viewer.favorite.add",
"visible": "app.toolbar.favorite.canRemove" "order": 100,
} "title": "APP.ACTIONS.FAVORITE",
}, "icon": "star_border",
{ "actions": {
"id": "app.viewer.favorite", "click": "ADD_FAVORITE"
"comment": "workaround for Recent Files and Search API issue", },
"type": "custom", "rules": {
"order": 101, "visible": "app.toolbar.favorite.canAdd"
"component": "app.toolbar.toggleFavorite", }
"rules": { },
"visible": "app.toolbar.favorite.canToggle" {
} "id": "app.viewer.favorite.remove",
}, "order": 200,
{ "title": "APP.ACTIONS.FAVORITE",
"id": "app.viewer.share", "icon": "star",
"order": 300, "actions": {
"title": "APP.ACTIONS.SHARE", "click": "REMOVE_FAVORITE"
"icon": "share", },
"actions": { "rules": {
"click": "SHARE_NODE" "visible": "app.toolbar.favorite.canRemove"
}, }
"rules": { },
"visible": "app.selection.file.canShare" {
} "id": "app.viewer.favorite",
}, "comment": "workaround for Recent Files and Search API issue",
{ "type": "custom",
"id": "app.viewer.copy", "order": 101,
"order": 400, "component": "app.toolbar.toggleFavorite",
"title": "APP.ACTIONS.COPY", "rules": {
"icon": "content_copy", "visible": "app.toolbar.favorite.canToggle"
"actions": { }
"click": "COPY_NODES" },
}, {
"rules": { "id": "app.viewer.share",
"visible": "app.toolbar.canCopyNode" "order": 300,
} "title": "APP.ACTIONS.SHARE",
}, "icon": "share",
{ "actions": {
"id": "app.viewer.move", "click": "SHARE_NODE"
"order": 500, },
"title": "APP.ACTIONS.MOVE", "rules": {
"icon": "library_books", "visible": "app.selection.file.canShare"
"actions": { }
"click": "MOVE_NODES" },
}, {
"rules": { "id": "app.viewer.copy",
"visible": "app.selection.canDelete" "order": 400,
} "title": "APP.ACTIONS.COPY",
}, "icon": "content_copy",
{ "actions": {
"id": "app.viewer.delete", "click": "COPY_NODES"
"order": 600, },
"title": "APP.ACTIONS.DELETE", "rules": {
"icon": "delete", "visible": "app.toolbar.canCopyNode"
"actions": { }
"click": "DELETE_NODES" },
}, {
"rules": { "id": "app.viewer.move",
"visible": "app.selection.canDelete" "order": 500,
} "title": "APP.ACTIONS.MOVE",
}, "icon": "library_books",
{ "actions": {
"id": "app.viewer.versions", "click": "MOVE_NODES"
"order": 700, },
"title": "APP.ACTIONS.VERSIONS", "rules": {
"icon": "history", "visible": "app.selection.canDelete"
"actions": { }
"click": "MANAGE_VERSIONS" },
}, {
"rules": { "id": "app.viewer.delete",
"visible": "app.toolbar.versions" "order": 600,
} "title": "APP.ACTIONS.DELETE",
}, "icon": "delete",
{ "actions": {
"id": "app.viewer.permissions", "click": "DELETE_NODES"
"order": 800, },
"title": "APP.ACTIONS.PERMISSIONS", "rules": {
"icon": "settings_input_component", "visible": "app.selection.canDelete"
"actions": { }
"click": "MANAGE_PERMISSIONS" },
}, {
"rules": { "id": "app.viewer.versions",
"visible": "app.toolbar.permissions" "order": 700,
} "title": "APP.ACTIONS.VERSIONS",
"icon": "history",
"actions": {
"click": "MANAGE_VERSIONS"
},
"rules": {
"visible": "app.toolbar.versions"
}
},
{
"id": "app.viewer.permissions",
"order": 800,
"title": "APP.ACTIONS.PERMISSIONS",
"icon": "settings_input_component",
"actions": {
"click": "MANAGE_PERMISSIONS"
},
"rules": {
"visible": "app.toolbar.permissions"
}
}
]
} }
], ],
"content": [ "content": [

View File

@ -709,114 +709,121 @@
"rules": { "rules": {
"visible": "app.toolbar.canViewFile" "visible": "app.toolbar.canViewFile"
} }
}
],
"toolbarMoreMenu": [
{
"id": "app.viewer.favorite.add",
"order": 100,
"title": "APP.ACTIONS.FAVORITE",
"icon": "star_border",
"actions": {
"click": "ADD_FAVORITE"
},
"rules": {
"visible": "app.toolbar.favorite.canAdd"
}
}, },
{ {
"id": "app.viewer.favorite.remove", "id": "app.toolbar.more",
"order": 200, "type": "menu",
"title": "APP.ACTIONS.FAVORITE", "order": 10000,
"icon": "star", "icon": "more_vert",
"actions": { "title": "APP.ACTIONS.MORE",
"click": "REMOVE_FAVORITE" "children": [
}, {
"rules": { "id": "app.viewer.favorite.add",
"visible": "app.toolbar.favorite.canRemove" "order": 100,
} "title": "APP.ACTIONS.FAVORITE",
}, "icon": "star_border",
{ "actions": {
"id": "app.viewer.favorite", "click": "ADD_FAVORITE"
"comment": "workaround for Recent Files and Search API issue", },
"type": "custom", "rules": {
"order": 101, "visible": "app.toolbar.favorite.canAdd"
"component": "app.toolbar.toggleFavorite", }
"rules": { },
"visible": "app.toolbar.favorite.canToggle" {
} "id": "app.viewer.favorite.remove",
}, "order": 200,
{ "title": "APP.ACTIONS.FAVORITE",
"id": "app.viewer.share", "icon": "star",
"order": 300, "actions": {
"title": "APP.ACTIONS.SHARE", "click": "REMOVE_FAVORITE"
"icon": "share", },
"actions": { "rules": {
"click": "SHARE_NODE" "visible": "app.toolbar.favorite.canRemove"
}, }
"rules": { },
"visible": "app.selection.file.canShare" {
} "id": "app.viewer.favorite",
}, "comment": "workaround for Recent Files and Search API issue",
{ "type": "custom",
"id": "app.viewer.copy", "order": 101,
"order": 400, "component": "app.toolbar.toggleFavorite",
"title": "APP.ACTIONS.COPY", "rules": {
"icon": "content_copy", "visible": "app.toolbar.favorite.canToggle"
"actions": { }
"click": "COPY_NODES" },
}, {
"rules": { "id": "app.viewer.share",
"visible": "app.toolbar.canCopyNode" "order": 300,
} "title": "APP.ACTIONS.SHARE",
}, "icon": "share",
{ "actions": {
"id": "app.viewer.move", "click": "SHARE_NODE"
"order": 500, },
"title": "APP.ACTIONS.MOVE", "rules": {
"icon": "library_books", "visible": "app.selection.file.canShare"
"actions": { }
"click": "MOVE_NODES" },
}, {
"rules": { "id": "app.viewer.copy",
"visible": "app.selection.canDelete" "order": 400,
} "title": "APP.ACTIONS.COPY",
}, "icon": "content_copy",
{ "actions": {
"id": "app.viewer.delete", "click": "COPY_NODES"
"order": 600, },
"title": "APP.ACTIONS.DELETE", "rules": {
"icon": "delete", "visible": "app.toolbar.canCopyNode"
"actions": { }
"click": "DELETE_NODES" },
}, {
"rules": { "id": "app.viewer.move",
"visible": "app.selection.canDelete" "order": 500,
} "title": "APP.ACTIONS.MOVE",
}, "icon": "library_books",
{ "actions": {
"id": "app.viewer.versions", "click": "MOVE_NODES"
"order": 700, },
"title": "APP.ACTIONS.VERSIONS", "rules": {
"icon": "history", "visible": "app.selection.canDelete"
"actions": { }
"click": "MANAGE_VERSIONS" },
}, {
"rules": { "id": "app.viewer.delete",
"visible": "app.toolbar.versions" "order": 600,
} "title": "APP.ACTIONS.DELETE",
}, "icon": "delete",
{ "actions": {
"id": "app.viewer.permissions", "click": "DELETE_NODES"
"order": 800, },
"title": "APP.ACTIONS.PERMISSIONS", "rules": {
"icon": "settings_input_component", "visible": "app.selection.canDelete"
"actions": { }
"click": "MANAGE_PERMISSIONS" },
}, {
"rules": { "id": "app.viewer.versions",
"visible": "app.toolbar.permissions" "order": 700,
} "title": "APP.ACTIONS.VERSIONS",
"icon": "history",
"actions": {
"click": "MANAGE_VERSIONS"
},
"rules": {
"visible": "app.toolbar.versions"
}
},
{
"id": "app.viewer.permissions",
"order": 800,
"title": "APP.ACTIONS.PERMISSIONS",
"icon": "settings_input_component",
"actions": {
"click": "MANAGE_PERMISSIONS"
},
"rules": {
"visible": "app.toolbar.permissions"
}
}
]
} }
], ],
"content": [ "content": [

View File

@ -689,127 +689,134 @@
"rules": { "rules": {
"visible": "app.toolbar.canViewFile" "visible": "app.toolbar.canViewFile"
} }
}
],
"toolbarMoreMenu": [
{
"id": "app.viewer.favorite.add",
"order": 100,
"title": "APP.ACTIONS.FAVORITE",
"icon": "star_border",
"actions": {
"click": "ADD_FAVORITE"
},
"rules": {
"visible": "app.toolbar.favorite.canAdd"
}
}, },
{ {
"id": "app.viewer.favorite.remove", "id": "app.toolbar.more",
"order": 200, "type": "menu",
"title": "APP.ACTIONS.FAVORITE", "order": 10000,
"icon": "star", "icon": "more_vert",
"actions": { "title": "APP.ACTIONS.MORE",
"click": "REMOVE_FAVORITE" "children": [
{
"id": "app.viewer.favorite.add",
"order": 100,
"title": "APP.ACTIONS.FAVORITE",
"icon": "star_border",
"actions": {
"click": "ADD_FAVORITE"
},
"rules": {
"visible": "app.toolbar.favorite.canAdd"
}
}, },
"rules": { {
"visible": "app.toolbar.favorite.canRemove" "id": "app.viewer.favorite.remove",
} "order": 200,
}, "title": "APP.ACTIONS.FAVORITE",
{ "icon": "star",
"id": "app.viewer.favorite", "actions": {
"comment": "workaround for Recent Files and Search API issue", "click": "REMOVE_FAVORITE"
"type": "custom", },
"order": 101, "rules": {
"component": "app.toolbar.toggleFavorite", "visible": "app.toolbar.favorite.canRemove"
"rules": { }
"visible": "app.toolbar.favorite.canToggle"
}
},
{
"id": "app.toolbar.my-secondary-action",
"order": 150,
"title": "My secondary action",
"icon": "alarm",
"actions": {
"click": "PRINT_FILE"
}, },
"rules": { {
"visible": "app.toolbar.canViewFile" "id": "app.viewer.favorite",
} "comment": "workaround for Recent Files and Search API issue",
}, "type": "custom",
{ "order": 101,
"id": "app.viewer.share", "component": "app.toolbar.toggleFavorite",
"order": 300, "rules": {
"title": "APP.ACTIONS.SHARE", "visible": "app.toolbar.favorite.canToggle"
"icon": "share", }
"actions": {
"click": "SHARE_NODE"
}, },
"rules": { {
"visible": "app.selection.file.canShare" "id": "app.toolbar.my-secondary-action",
} "order": 150,
}, "title": "My secondary action",
{ "icon": "alarm",
"id": "app.viewer.copy", "actions": {
"order": 400, "click": "PRINT_FILE"
"title": "APP.ACTIONS.COPY", },
"icon": "content_copy", "rules": {
"actions": { "visible": "app.toolbar.canViewFile"
"click": "COPY_NODES" }
}, },
"rules": { {
"visible": "app.toolbar.canCopyNode" "id": "app.viewer.share",
} "order": 300,
}, "title": "APP.ACTIONS.SHARE",
{ "icon": "share",
"id": "app.viewer.move", "actions": {
"order": 500, "click": "SHARE_NODE"
"title": "My new title", },
"icon": "library_books", "rules": {
"actions": { "visible": "app.selection.file.canShare"
"click": "MOVE_NODES" }
}, },
"rules": { {
"visible": "app.selection.canDelete" "id": "app.viewer.copy",
} "order": 400,
}, "title": "APP.ACTIONS.COPY",
{ "icon": "content_copy",
"id": "app.viewer.delete", "actions": {
"order": 600, "click": "COPY_NODES"
"title": "APP.ACTIONS.DELETE", },
"icon": "delete", "rules": {
"actions": { "visible": "app.toolbar.canCopyNode"
"click": "DELETE_NODES" }
}, },
"rules": { {
"visible": "app.selection.canDelete" "id": "app.viewer.move",
} "order": 500,
}, "title": "My new title",
{ "icon": "library_books",
"id": "app.viewer.versions", "actions": {
"order": 700, "click": "MOVE_NODES"
"title": "APP.ACTIONS.VERSIONS", },
"icon": "history", "rules": {
"actions": { "visible": "app.selection.canDelete"
"click": "MANAGE_VERSIONS" }
}, },
"rules": { {
"visible": "app.toolbar.versions" "id": "app.viewer.delete",
} "order": 600,
}, "title": "APP.ACTIONS.DELETE",
{ "icon": "delete",
"id": "app.viewer.permissions", "actions": {
"order": 800, "click": "DELETE_NODES"
"title": "APP.ACTIONS.PERMISSIONS", },
"disabled": true, "rules": {
"icon": "settings_input_component", "visible": "app.selection.canDelete"
"actions": { }
"click": "MANAGE_PERMISSIONS"
}, },
"rules": { {
"visible": "app.toolbar.permissions" "id": "app.viewer.versions",
"order": 700,
"title": "APP.ACTIONS.VERSIONS",
"icon": "history",
"actions": {
"click": "MANAGE_VERSIONS"
},
"rules": {
"visible": "app.toolbar.versions"
}
},
{
"id": "app.viewer.permissions",
"order": 800,
"title": "APP.ACTIONS.PERMISSIONS",
"disabled": true,
"icon": "settings_input_component",
"actions": {
"click": "MANAGE_PERMISSIONS"
},
"rules": {
"visible": "app.toolbar.permissions"
}
} }
]
} }
], ],
"content": [ "content": [

View File

@ -674,12 +674,6 @@
"items": { "$ref": "#/definitions/contentActionRef" }, "items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1 "minItems": 1
}, },
"toolbarMoreMenu": {
"description": "Toolbar entries from the More actions menu",
"type": "array",
"items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"toolbarActions": { "toolbarActions": {
"description": "Toolbar entries from outside the More menu", "description": "Toolbar entries from outside the More menu",
"type": "array", "type": "array",

51
package-lock.json generated
View File

@ -3100,6 +3100,7 @@
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
"integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"kind-of": "^3.0.2", "kind-of": "^3.0.2",
"longest": "^1.0.1", "longest": "^1.0.1",
@ -6443,7 +6444,8 @@
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true "dev": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -6467,13 +6469,15 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true "dev": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -6490,19 +6494,22 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true "dev": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true "dev": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -6633,7 +6640,8 @@
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true "dev": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -6647,6 +6655,7 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -6663,6 +6672,7 @@
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -6671,13 +6681,15 @@
"version": "0.0.8", "version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true "dev": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.2.4", "version": "2.2.4",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz", "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz",
"integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.1", "safe-buffer": "^5.1.1",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -6698,6 +6710,7 @@
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -6786,7 +6799,8 @@
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"dev": true "dev": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -6800,6 +6814,7 @@
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -6895,7 +6910,8 @@
"version": "5.1.1", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
"dev": true "dev": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -6937,6 +6953,7 @@
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -6958,6 +6975,7 @@
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -7006,13 +7024,15 @@
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true "dev": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz",
"integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=",
"dev": true "dev": true,
"optional": true
} }
} }
}, },
@ -10366,7 +10386,8 @@
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
"integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
"dev": true "dev": true,
"optional": true
}, },
"loose-envify": { "loose-envify": {
"version": "1.4.0", "version": "1.4.0",
@ -12665,9 +12686,9 @@
"dev": true "dev": true
}, },
"prettier": { "prettier": {
"version": "1.15.3", "version": "1.16.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.15.3.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.0.tgz",
"integrity": "sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg==", "integrity": "sha512-MCBCYeAuZfejUPdEpkleLWvpRBwLii/Sp5jQs0eb8Ul/drGIDjkL6tAU24tk6yCGf0KPV5rhPPPlczfBmN2pWQ==",
"dev": true "dev": true
}, },
"pretty-format": { "pretty-format": {

View File

@ -20,7 +20,7 @@
"e2e:docker": "npm run start:docker && npm run e2e && npm run stop:docker", "e2e:docker": "npm run start:docker && npm run e2e && npm run stop:docker",
"spellcheck": "cspell 'src/**/*.ts' 'e2e/**/*.ts' 'projects/**/*.ts'", "spellcheck": "cspell 'src/**/*.ts' 'e2e/**/*.ts' 'projects/**/*.ts'",
"inspect.bundle": "ng build app --prod --stats-json && npx webpack-bundle-analyzer dist/app/stats.json", "inspect.bundle": "ng build app --prod --stats-json && npx webpack-bundle-analyzer dist/app/stats.json",
"format:check": "prettier --list-different \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"", "format:check": "prettier --check \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"",
"format:fix": "prettier --write \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"", "format:fix": "prettier --write \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"",
"build.tomcat": "npm run build -- --base-href ./ && jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .", "build.tomcat": "npm run build -- --base-href ./ && jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .",
"build.tomcat.e2e": "./build-tomcat-e2e.sh", "build.tomcat.e2e": "./build-tomcat-e2e.sh",
@ -93,7 +93,7 @@
"lint-staged": "^8.1.0", "lint-staged": "^8.1.0",
"ng-packagr": "^4.4.0", "ng-packagr": "^4.4.0",
"pre-commit": "^1.2.2", "pre-commit": "^1.2.2",
"prettier": "^1.15.3", "prettier": "^1.16.0",
"protractor": "^5.4.0", "protractor": "^5.4.0",
"rimraf": "2.6.2", "rimraf": "2.6.2",
"rxjs-tslint-rules": "^4.11.0", "rxjs-tslint-rules": "^4.11.0",

View File

@ -59,7 +59,6 @@ export abstract class PageComponent implements OnInit, OnDestroy {
sharedPreviewUrl$: Observable<string>; sharedPreviewUrl$: Observable<string>;
actions: Array<ContentActionRef> = []; actions: Array<ContentActionRef> = [];
viewerToolbarActions: Array<ContentActionRef> = []; viewerToolbarActions: Array<ContentActionRef> = [];
viewerToolbarMoreActions: Array<ContentActionRef> = [];
canUpdateNode = false; canUpdateNode = false;
canUpload = false; canUpload = false;
@ -101,7 +100,6 @@ export abstract class PageComponent implements OnInit, OnDestroy {
this.selection = selection; this.selection = selection;
this.actions = this.extensions.getAllowedToolbarActions(); this.actions = this.extensions.getAllowedToolbarActions();
this.viewerToolbarActions = this.extensions.getViewerToolbarActions(); this.viewerToolbarActions = this.extensions.getViewerToolbarActions();
this.viewerToolbarMoreActions = this.extensions.getViewerToolbarMoreActions();
this.canUpdateNode = this.canUpdateNode =
this.selection.count === 1 && this.selection.count === 1 &&
this.content.canUpdateNode(selection.first); this.content.canUpdateNode(selection.first);

View File

@ -32,17 +32,6 @@
</ng-container> </ng-container>
</adf-viewer-toolbar-actions> </adf-viewer-toolbar-actions>
<adf-viewer-more-actions *ngIf="viewerToolbarMoreActions.length">
<ng-container
*ngFor="
let action of viewerToolbarMoreActions;
trackBy: trackByActionId
"
>
<app-toolbar-menu-item [actionRef]="action"></app-toolbar-menu-item>
</ng-container>
</adf-viewer-more-actions>
<ng-container *ngFor="let ext of contentExtensions"> <ng-container *ngFor="let ext of contentExtensions">
<adf-viewer-extension [supportedExtensions]="[ext.fileExtension]"> <adf-viewer-extension [supportedExtensions]="[ext.fileExtension]">
<ng-template let-url="urlFileContent" let-extension="extension"> <ng-template let-url="urlFileContent" let-extension="extension">

View File

@ -3,22 +3,16 @@
height: 100%; height: 100%;
} }
.hide-last-divider .adf-viewer-toolbar .mat-toolbar { .adf-viewer-toolbar .adf-toolbar-divider {
> adf-toolbar-divider:last-of-type { display: none;
display: none;
}
> button:last-of-type {
right: 40px;
}
}
#adf-viewer-moreactions {
right: -40px;
} }
.adf-viewer-toolbar-actions { .adf-viewer-toolbar-actions {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
.adf-toolbar-divider {
display: inline;
}
} }

View File

@ -586,7 +586,7 @@ describe('AppExtensionService', () => {
}); });
it('should filter out all disabled items', () => { it('should filter out all disabled items', () => {
const items = [ const items: any[] = [
{ id: '1', disabled: true }, { id: '1', disabled: true },
{ {
id: '2', id: '2',

View File

@ -71,7 +71,6 @@ export class AppExtensionService implements RuleContext {
headerActions: Array<ContentActionRef> = []; headerActions: Array<ContentActionRef> = [];
toolbarActions: Array<ContentActionRef> = []; toolbarActions: Array<ContentActionRef> = [];
viewerToolbarActions: Array<ContentActionRef> = []; viewerToolbarActions: Array<ContentActionRef> = [];
viewerToolbarMoreActions: Array<ContentActionRef> = [];
viewerContentExtensions: Array<ViewerExtensionRef> = []; viewerContentExtensions: Array<ViewerExtensionRef> = [];
contextMenuActions: Array<ContentActionRef> = []; contextMenuActions: Array<ContentActionRef> = [];
openWithActions: Array<ContentActionRef> = []; openWithActions: Array<ContentActionRef> = [];
@ -148,10 +147,6 @@ export class AppExtensionService implements RuleContext {
config, config,
'features.viewer.toolbarActions' 'features.viewer.toolbarActions'
); );
this.viewerToolbarMoreActions = this.loader.getContentActions(
config,
'features.viewer.toolbarMoreMenu'
);
this.viewerContentExtensions = this.loader.getElements<ViewerExtensionRef>( this.viewerContentExtensions = this.loader.getElements<ViewerExtensionRef>(
config, config,
'features.viewer.content' 'features.viewer.content'
@ -295,7 +290,7 @@ export class AppExtensionService implements RuleContext {
return { presets }; return { presets };
} }
filterDisabled(object) { filterDisabled(object: Array<{ disabled: boolean }> | { disabled: boolean }) {
if (Array.isArray(object)) { if (Array.isArray(object)) {
return object return object
.filter(item => !item.disabled) .filter(item => !item.disabled)
@ -398,45 +393,8 @@ export class AppExtensionService implements RuleContext {
return actionRef; return actionRef;
} }
// evaluates content actions for the selection and parent folder node private getAllowedActions(actions: ContentActionRef[]): ContentActionRef[] {
getAllowedToolbarActions(): Array<ContentActionRef> { return (actions || [])
return this.toolbarActions
.filter(action => this.filterByRules(action))
.map(action => {
if (action.type === ContentActionType.menu) {
const copy = this.copyAction(action);
if (copy.children && copy.children.length > 0) {
copy.children = copy.children
.filter(childAction => this.filterByRules(childAction))
.sort(sortByOrder)
.reduce(reduceSeparators, []);
}
return copy;
}
return action;
})
.reduce(reduceEmptyMenus, [])
.reduce(reduceSeparators, []);
}
getViewerToolbarActions(): Array<ContentActionRef> {
return this.viewerToolbarActions.filter(action =>
this.filterByRules(action)
);
}
getHeaderActions(): Array<ContentActionRef> {
return this.headerActions.filter(action => this.filterByRules(action));
}
getViewerToolbarMoreActions(): Array<ContentActionRef> {
return this.viewerToolbarMoreActions.filter(action =>
this.filterByRules(action)
);
}
getAllowedContextMenuActions(): Array<ContentActionRef> {
return this.contextMenuActions
.filter(action => this.filterByRules(action)) .filter(action => this.filterByRules(action))
.map(action => { .map(action => {
if (action.type === ContentActionType.menu) { if (action.type === ContentActionType.menu) {
@ -456,6 +414,22 @@ export class AppExtensionService implements RuleContext {
.reduce(reduceSeparators, []); .reduce(reduceSeparators, []);
} }
getAllowedToolbarActions(): Array<ContentActionRef> {
return this.getAllowedActions(this.toolbarActions);
}
getViewerToolbarActions(): Array<ContentActionRef> {
return this.getAllowedActions(this.viewerToolbarActions);
}
getHeaderActions(): Array<ContentActionRef> {
return this.headerActions.filter(action => this.filterByRules(action));
}
getAllowedContextMenuActions(): Array<ContentActionRef> {
return this.getAllowedActions(this.contextMenuActions);
}
copyAction(action: ContentActionRef): ContentActionRef { copyAction(action: ContentActionRef): ContentActionRef {
return { return {
...action, ...action,

View File

@ -850,6 +850,47 @@
], ],
"viewer": { "viewer": {
"toolbarActions": [ "toolbarActions": [
{
"id": "app.viewer.fullscreen",
"order": 100,
"title": "APP.ACTIONS.FULLSCREEN",
"icon": "fullscreen",
"actions": {
"click": "FULLSCREEN_VIEWER"
},
"rules": {
"visible": "app.toolbar.canViewFile"
}
},
{
"id": "app.viewer.separator.1",
"type": "separator",
"order": 180
},
{
"id": "app.viewer.share",
"order": 200,
"title": "APP.ACTIONS.SHARE",
"icon": "link",
"actions": {
"click": "SHARE_NODE"
},
"rules": {
"visible": "app.toolbar.canShare"
}
},
{
"id": "app.viewer.share.edit",
"order": 250,
"title": "APP.ACTIONS.SHARE_EDIT",
"icon": "link",
"actions": {
"click": "SHARE_NODE"
},
"rules": {
"visible": "app.selection.file.isShared"
}
},
{ {
"id": "app.viewer.download", "id": "app.viewer.download",
"order": 300, "order": 300,
@ -875,151 +916,117 @@
} }
}, },
{ {
"id": "app.viewer.share", "id": "app.viewer.toolbar.more",
"order": 200, "type": "menu",
"title": "APP.ACTIONS.SHARE", "order": 10000,
"icon": "link", "icon": "more_vert",
"actions": { "title": "APP.ACTIONS.MORE",
"click": "SHARE_NODE" "children": [
}, {
"rules": { "id": "app.viewer.favorite.add",
"visible": "app.toolbar.canShare" "order": 100,
} "title": "APP.ACTIONS.FAVORITE",
}, "icon": "star_border",
{ "actions": {
"id": "app.viewer.share.edit", "click": "ADD_FAVORITE"
"order": 201, },
"title": "APP.ACTIONS.SHARE_EDIT", "rules": {
"icon": "link", "visible": "app.toolbar.favorite.canAdd"
"actions": { }
"click": "SHARE_NODE" },
}, {
"rules": { "id": "app.viewer.favorite.remove",
"visible": "app.selection.file.isShared" "order": 200,
} "title": "APP.ACTIONS.FAVORITE",
}, "icon": "star",
{ "actions": {
"id": "app.viewer.fullscreen", "click": "REMOVE_FAVORITE"
"order": 100, },
"title": "APP.ACTIONS.FULLSCREEN", "rules": {
"icon": "fullscreen", "visible": "app.toolbar.favorite.canRemove"
"actions": { }
"click": "FULLSCREEN_VIEWER" },
}, {
"rules": { "id": "app.viewer.favorite",
"visible": "app.toolbar.canViewFile" "comment": "workaround for Recent Files and Search API issue",
} "type": "custom",
}, "order": 101,
{ "component": "app.toolbar.toggleFavorite",
"id": "app.viewer.separator.1", "rules": {
"type": "separator", "visible": "app.toolbar.favorite.canToggle"
"order": 180 }
} },
], {
"toolbarMoreMenu": [ "id": "app.viewer.more.separator.1",
{ "type": "separator",
"id": "app.viewer.favorite.add", "order": 280
"order": 100, },
"title": "APP.ACTIONS.FAVORITE", {
"icon": "star_border", "id": "app.viewer.copy",
"actions": { "order": 400,
"click": "ADD_FAVORITE" "title": "APP.ACTIONS.COPY",
}, "icon": "content_copy",
"rules": { "actions": {
"visible": "app.toolbar.favorite.canAdd" "click": "COPY_NODES"
} },
}, "rules": {
{ "visible": "app.toolbar.canCopyNode"
"id": "app.viewer.favorite.remove", }
"order": 200, },
"title": "APP.ACTIONS.FAVORITE", {
"icon": "star", "id": "app.viewer.move",
"actions": { "order": 500,
"click": "REMOVE_FAVORITE" "title": "APP.ACTIONS.MOVE",
}, "icon": "adf:move_file",
"rules": { "actions": {
"visible": "app.toolbar.favorite.canRemove" "click": "MOVE_NODES"
} },
}, "rules": {
{ "visible": "app.selection.canDelete"
"id": "app.viewer.favorite", }
"comment": "workaround for Recent Files and Search API issue", },
"type": "custom", {
"order": 101, "id": "app.viewer.delete",
"component": "app.toolbar.toggleFavorite", "order": 600,
"rules": { "title": "APP.ACTIONS.DELETE",
"visible": "app.toolbar.favorite.canToggle" "icon": "delete",
} "actions": {
}, "click": "DELETE_NODES"
{ },
"id": "app.viewer.more.separator.1", "rules": {
"type": "separator", "visible": "app.selection.canDelete"
"order": 280 }
}, },
{ {
"id": "app.viewer.copy", "id": "app.viewer.more.separator.2",
"order": 400, "type": "separator",
"title": "APP.ACTIONS.COPY", "order": 680
"icon": "content_copy", },
"actions": { {
"click": "COPY_NODES" "id": "app.viewer.versions",
}, "order": 700,
"rules": { "title": "APP.ACTIONS.VERSIONS",
"visible": "app.toolbar.canCopyNode" "icon": "history",
} "actions": {
}, "click": "MANAGE_VERSIONS"
{ },
"id": "app.viewer.move", "rules": {
"order": 500, "visible": "app.toolbar.versions"
"title": "APP.ACTIONS.MOVE", }
"icon": "adf:move_file", },
"actions": { {
"click": "MOVE_NODES" "id": "app.viewer.permissions",
}, "order": 800,
"rules": { "title": "APP.ACTIONS.PERMISSIONS",
"visible": "app.selection.canDelete" "icon": "settings_input_component",
} "actions": {
}, "click": "MANAGE_PERMISSIONS"
{ },
"id": "app.viewer.delete", "rules": {
"order": 600, "visible": "app.toolbar.permissions"
"title": "APP.ACTIONS.DELETE", }
"icon": "delete", }
"actions": { ]
"click": "DELETE_NODES"
},
"rules": {
"visible": "app.selection.canDelete"
}
},
{
"id": "app.viewer.more.separator.2",
"type": "separator",
"order": 680
},
{
"id": "app.viewer.versions",
"order": 700,
"title": "APP.ACTIONS.VERSIONS",
"icon": "history",
"actions": {
"click": "MANAGE_VERSIONS"
},
"rules": {
"visible": "app.toolbar.versions"
}
},
{
"id": "app.viewer.permissions",
"order": 800,
"title": "APP.ACTIONS.PERMISSIONS",
"icon": "settings_input_component",
"actions": {
"click": "MANAGE_PERMISSIONS"
},
"rules": {
"visible": "app.toolbar.permissions"
}
} }
], ],
"content": [ "content": [