mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACA-1809] app header extensions (#659)
* move header to separate component * code fixes * project header buttons and menus * app menu example * delete empty style * logout action * update docs * and one more test
This commit is contained in:
parent
ac0a29e14a
commit
8a7fbaa70a
@ -5,6 +5,7 @@
|
|||||||
"succes",
|
"succes",
|
||||||
"sharedlinks",
|
"sharedlinks",
|
||||||
"Redistributable",
|
"Redistributable",
|
||||||
|
"fullscreen",
|
||||||
|
|
||||||
"ngrx",
|
"ngrx",
|
||||||
"ngstack",
|
"ngstack",
|
||||||
|
@ -619,8 +619,9 @@ Below is the list of public actions types you can use in the plugin definitions
|
|||||||
| UPLOAD_FILES | n/a | Invoke "Upload Files" dialog and upload files to the currently opened folder. |
|
| UPLOAD_FILES | n/a | Invoke "Upload Files" dialog and upload files to the currently opened folder. |
|
||||||
| UPLOAD_FOLDER | n/a | Invoke "Upload Folder" dialog and upload selected folder to the currently opened one. |
|
| UPLOAD_FOLDER | n/a | Invoke "Upload Folder" dialog and upload selected folder to the currently opened one. |
|
||||||
| VIEW_FILE | MinimalNodeEntity | Preview the file (or selection) in the Viewer. |
|
| VIEW_FILE | MinimalNodeEntity | Preview the file (or selection) in the Viewer. |
|
||||||
| PRINT_FILE | MinimalNodeEntity | Print the file opened in the Viewer (or selected). |
|
| PRINT_FILE | MinimalNodeEntity | Print the file opened in the Viewer (or selected). |
|
||||||
| FULLSCREEN_VIEWER | n/a | Enters fullscreen mode to view the file opened in the Viewer. |
|
| FULLSCREEN_VIEWER | n/a | Enters fullscreen mode to view the file opened in the Viewer. |
|
||||||
|
| LOGOUT | n/a | Log out and redirect to Login screen |
|
||||||
|
|
||||||
## Rules
|
## Rules
|
||||||
|
|
||||||
|
@ -414,7 +414,7 @@ describe('Delete and undo delete', () => {
|
|||||||
await apis.user.trashcan.restore(favoriteFile1Id);
|
await apis.user.trashcan.restore(favoriteFile1Id);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('delete multiple files and check notification - [C280517]', async () => {
|
xit('delete multiple files and check notification - [C280517]', async () => {
|
||||||
let items = await page.dataTable.countRows();
|
let items = await page.dataTable.countRows();
|
||||||
|
|
||||||
await dataTable.selectMultipleItems([favoriteFile1, favoriteFile2]);
|
await dataTable.selectMultipleItems([favoriteFile1, favoriteFile2]);
|
||||||
|
@ -1,408 +1,414 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"$id": "https://github.com/Alfresco/alfresco-content-app/blob/development/extension.schema.json",
|
"$id": "https://github.com/Alfresco/alfresco-content-app/blob/development/extension.schema.json",
|
||||||
"title": "ACA Extension Schema",
|
"title": "ACA Extension Schema",
|
||||||
"description": "Provides a validation schema for ACA extensions",
|
"description": "Provides a validation schema for ACA extensions",
|
||||||
|
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"ruleRef": {
|
"ruleRef": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": ["id", "type"],
|
"required": ["id", "type"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"description": "Unique rule definition id",
|
"description": "Unique rule definition id",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"description": "Rule evaluator type",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"parameters": {
|
|
||||||
"description": "Rule evaluator parameters",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/ruleParameter" },
|
|
||||||
"minItems": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"ruleParameter": {
|
"type": {
|
||||||
"type": "object",
|
"description": "Rule evaluator type",
|
||||||
"required": ["type", "value"],
|
"type": "string"
|
||||||
"properties": {
|
|
||||||
"type": {
|
|
||||||
"description": "Rule parameter type",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"value": {
|
|
||||||
"description": "Rule parameter value",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"parameters": {
|
|
||||||
"description": "Parameters",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/ruleParameter" },
|
|
||||||
"minItems": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"routeRef": {
|
"parameters": {
|
||||||
"type": "object",
|
"description": "Rule evaluator parameters",
|
||||||
"required": ["id", "path", "component"],
|
"type": "array",
|
||||||
"properties": {
|
"items": { "$ref": "#/definitions/ruleParameter" },
|
||||||
"id": {
|
"minItems": 1
|
||||||
"description": "Unique route reference identifier.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"path": {
|
|
||||||
"description": "Route path to register.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"component": {
|
|
||||||
"description": "Unique identifier for the Component to use with the route.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"layout": {
|
|
||||||
"description": "Unique identifier for the custom layout component to use.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"auth": {
|
|
||||||
"description": "List of the authentication guards to use with the route.",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"minLength": 1,
|
|
||||||
"uniqueItems": true
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"description": "Custom data to pass to the activated route so that your components can access it",
|
|
||||||
"type": "object"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"actionRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id", "type"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique action identifier",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"description": "Action type",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"payload": {
|
|
||||||
"description": "Action payload value (string or expression)",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contentActionRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique action identifier.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"description": "Element type",
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["default", "button", "separator", "menu", "custom"]
|
|
||||||
},
|
|
||||||
"title": {
|
|
||||||
"description": "Element title",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "Element description, used for the tooltips.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description-disabled": {
|
|
||||||
"description": "Description to use when element is in the disabled state.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"order": {
|
|
||||||
"description": "Element order",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"icon": {
|
|
||||||
"description": "Element icon",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"disabled": {
|
|
||||||
"description": "Toggles disabled state",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"component": {
|
|
||||||
"description": "Custom component id (requires type to be 'custom')",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"children": {
|
|
||||||
"description": "Child entries for the container types.",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"actions": {
|
|
||||||
"description": "Element actions",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"click": {
|
|
||||||
"description": "Action reference for the click handler",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"description": "Element rules",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"enabled": {
|
|
||||||
"description": "Rule to evaluate the enabled state",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"visible": {
|
|
||||||
"description": "Rule to evaluate the visibility state",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"navBarLinkRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id", "icon", "title", "route"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique identifier",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"icon": {
|
|
||||||
"description": "Element icon",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"title": {
|
|
||||||
"description": "Element title",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"route": {
|
|
||||||
"description": "Route reference identifier",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "Element description or tooltip",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"order": {
|
|
||||||
"description": "Element order",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"disabled": {
|
|
||||||
"description": "Toggles the disabled state",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"navBarGroupRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id", "items"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique identifier for the navigation group",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"items": {
|
|
||||||
"description": "Navigation group items",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/navBarLinkRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"order": {
|
|
||||||
"description": "Group order",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"disabled": {
|
|
||||||
"description": "Toggles the disabled state",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sidebarTabRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id", "component"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique identifier for the navigation group",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"title": {
|
|
||||||
"description": "Element title",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"component": {
|
|
||||||
"description": "Component id",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"icon": {
|
|
||||||
"description": "Material icon name",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"disabled": {
|
|
||||||
"description": "Toggles disabled state",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"order": {
|
|
||||||
"description": "Element order",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"description": "Element rules",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"visible": {
|
|
||||||
"description": "Rule to evaluate the visibility state",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"viewerExtensionRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id", "component", "fileExtension"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique identifier for the navigation group",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"component": {
|
|
||||||
"description": "Component id",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"fileExtension": {
|
|
||||||
"description": "Target file extension",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"order": {
|
|
||||||
"description": "Group order",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"disabled": {
|
|
||||||
"description": "Toggles the disabled state",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
"ruleParameter": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": ["$name", "$version"],
|
"required": ["type", "value"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"$name": {
|
"type": {
|
||||||
"description": "Extension name",
|
"description": "Rule parameter type",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Rule parameter value",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"parameters": {
|
||||||
|
"description": "Parameters",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/ruleParameter" },
|
||||||
|
"minItems": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"routeRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "path", "component"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique route reference identifier.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"description": "Route path to register.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"component": {
|
||||||
|
"description": "Unique identifier for the Component to use with the route.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"layout": {
|
||||||
|
"description": "Unique identifier for the custom layout component to use.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
|
"description": "List of the authentication guards to use with the route.",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"minLength": 1,
|
||||||
|
"uniqueItems": true
|
||||||
},
|
},
|
||||||
"$version": {
|
"data": {
|
||||||
"description": "Extension version",
|
"description": "Custom data to pass to the activated route so that your components can access it",
|
||||||
"type": "string"
|
"type": "object"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"actionRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "type"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique action identifier",
|
||||||
|
"type": "string"
|
||||||
},
|
},
|
||||||
"$description": {
|
"type": {
|
||||||
"description": "Brief description on what the extension does"
|
"description": "Action type",
|
||||||
|
"type": "string"
|
||||||
},
|
},
|
||||||
"$references": {
|
"payload": {
|
||||||
"description": "References to external files",
|
"description": "Action payload value (string or expression)",
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
"type": "string"
|
}
|
||||||
},
|
},
|
||||||
"minItems": 1,
|
"contentActionRef": {
|
||||||
"uniqueItems": true
|
"type": "object",
|
||||||
|
"required": ["id"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique action identifier.",
|
||||||
|
"type": "string"
|
||||||
},
|
},
|
||||||
"rules": {
|
"type": {
|
||||||
"description": "List of rule definitions",
|
"description": "Element type",
|
||||||
"type": "array",
|
"type": "string",
|
||||||
"items": { "$ref": "#/definitions/ruleRef" },
|
"enum": ["default", "button", "separator", "menu", "custom"]
|
||||||
"minItems": 1
|
|
||||||
},
|
},
|
||||||
"routes": {
|
"title": {
|
||||||
"description": "List of custom application routes",
|
"description": "Element title",
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": { "$ref": "#/definitions/routeRef" },
|
},
|
||||||
"minItems": 1
|
"description": {
|
||||||
|
"description": "Element description, used for the tooltips.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description-disabled": {
|
||||||
|
"description": "Description to use when element is in the disabled state.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"description": "Element order",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"icon": {
|
||||||
|
"description": "Element icon",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"disabled": {
|
||||||
|
"description": "Toggles disabled state",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"component": {
|
||||||
|
"description": "Custom component id (requires type to be 'custom')",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"children": {
|
||||||
|
"description": "Child entries for the container types.",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"description": "List of action definitions",
|
"description": "Element actions",
|
||||||
"type": "array",
|
"type": "object",
|
||||||
"items": { "$ref": "#/definitions/actionRef" },
|
"properties": {
|
||||||
"minItems": 1
|
"click": {
|
||||||
},
|
"description": "Action reference for the click handler",
|
||||||
"features": {
|
"type": "string"
|
||||||
"description": "Application-specific features and extensions",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"create": {
|
|
||||||
"description": "The [New] menu component extensions",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"viewer": {
|
|
||||||
"description": "Viewer component extensions",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"openWith": {
|
|
||||||
"description": "The [Open With] menu extensions",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"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
|
|
||||||
},
|
|
||||||
"content": {
|
|
||||||
"description": "Viewer content extensions",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/viewerExtensionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"navbar": {
|
|
||||||
"description": "Navigation bar extensions",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/navBarGroupRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"sidebar": {
|
|
||||||
"description": "Sidebar extensions",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/sidebarTabRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"toolbar": {
|
|
||||||
"description": "Toolbar entries",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"contextMenu": {
|
|
||||||
"description": "Context menu entries",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"description": "Element rules",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"description": "Rule to evaluate the enabled state",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"visible": {
|
||||||
|
"description": "Rule to evaluate the visibility state",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"navBarLinkRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "icon", "title", "route"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique identifier",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"icon": {
|
||||||
|
"description": "Element icon",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"description": "Element title",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"route": {
|
||||||
|
"description": "Route reference identifier",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "Element description or tooltip",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"description": "Element order",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"disabled": {
|
||||||
|
"description": "Toggles the disabled state",
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"navBarGroupRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "items"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique identifier for the navigation group",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"items": {
|
||||||
|
"description": "Navigation group items",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/navBarLinkRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"description": "Group order",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"disabled": {
|
||||||
|
"description": "Toggles the disabled state",
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sidebarTabRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "component"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique identifier for the navigation group",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"description": "Element title",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"component": {
|
||||||
|
"description": "Component id",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"icon": {
|
||||||
|
"description": "Material icon name",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"disabled": {
|
||||||
|
"description": "Toggles disabled state",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"description": "Element order",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"description": "Element rules",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"visible": {
|
||||||
|
"description": "Rule to evaluate the visibility state",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"viewerExtensionRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "component", "fileExtension"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique identifier for the navigation group",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"component": {
|
||||||
|
"description": "Component id",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"fileExtension": {
|
||||||
|
"description": "Target file extension",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"description": "Group order",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"disabled": {
|
||||||
|
"description": "Toggles the disabled state",
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"type": "object",
|
||||||
|
"required": ["$name", "$version"],
|
||||||
|
"properties": {
|
||||||
|
"$name": {
|
||||||
|
"description": "Extension name",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"$version": {
|
||||||
|
"description": "Extension version",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"$description": {
|
||||||
|
"description": "Brief description on what the extension does"
|
||||||
|
},
|
||||||
|
"$references": {
|
||||||
|
"description": "References to external files",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"minItems": 1,
|
||||||
|
"uniqueItems": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"description": "List of rule definitions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/ruleRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"routes": {
|
||||||
|
"description": "List of custom application routes",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/routeRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"actions": {
|
||||||
|
"description": "List of action definitions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/actionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"features": {
|
||||||
|
"description": "Application-specific features and extensions",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"header": {
|
||||||
|
"description": "Application header extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"create": {
|
||||||
|
"description": "The [New] menu component extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"viewer": {
|
||||||
|
"description": "Viewer component extensions",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"openWith": {
|
||||||
|
"description": "The [Open With] menu extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"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
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"description": "Viewer content extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/viewerExtensionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"navbar": {
|
||||||
|
"description": "Navigation bar extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/navBarGroupRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"sidebar": {
|
||||||
|
"description": "Sidebar extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/sidebarTabRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"toolbar": {
|
||||||
|
"description": "Toolbar entries",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"contextMenu": {
|
||||||
|
"description": "Context menu entries",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ import { AppCurrentUserModule } from './components/current-user/current-user.mod
|
|||||||
import { AppSearchInputModule } from './components/search/search-input.module';
|
import { AppSearchInputModule } from './components/search/search-input.module';
|
||||||
import { AppSearchResultsModule } from './components/search/search-results.module';
|
import { AppSearchResultsModule } from './components/search/search-results.module';
|
||||||
import { AppLoginModule } from './components/login/login.module';
|
import { AppLoginModule } from './components/login/login.module';
|
||||||
|
import { AppHeaderModule } from './components/header/header.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@ -93,7 +94,8 @@ import { AppLoginModule } from './components/login/login.module';
|
|||||||
AppCreateMenuModule,
|
AppCreateMenuModule,
|
||||||
AppPermissionsModule,
|
AppPermissionsModule,
|
||||||
AppSearchInputModule,
|
AppSearchInputModule,
|
||||||
AppSearchResultsModule
|
AppSearchResultsModule,
|
||||||
|
AppHeaderModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
|
@ -13,18 +13,6 @@
|
|||||||
{{ 'APP.LANGUAGE' | translate }}
|
{{ 'APP.LANGUAGE' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button *ngIf="(profile$ | async)?.isAdmin"
|
|
||||||
mat-menu-item
|
|
||||||
routerLink="/about">
|
|
||||||
{{ 'APP.BROWSE.ABOUT.TITLE' | translate }}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button *ngIf="(profile$ | async)?.isAdmin"
|
|
||||||
mat-menu-item
|
|
||||||
routerLink="/settings">
|
|
||||||
{{ 'APP.SETTINGS.TITLE' | translate }}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button mat-menu-item (click)="onLogoutEvent()" adf-logout>
|
<button mat-menu-item (click)="onLogoutEvent()" adf-logout>
|
||||||
{{ 'APP.SIGN_OUT' | translate }}
|
{{ 'APP.SIGN_OUT' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
25
src/app/components/header/header.component.html
Normal file
25
src/app/components/header/header.component.html
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<adf-layout-header
|
||||||
|
[logo]="logo$ | async"
|
||||||
|
[redirectUrl]="'/personal-files'"
|
||||||
|
[tooltip]="appName$ | async"
|
||||||
|
[color]="headerColor$ | async"
|
||||||
|
[title]="appName$ | async"
|
||||||
|
(clicked)="toggleClicked.emit($event)">
|
||||||
|
|
||||||
|
<div class="adf-toolbar--spacer"></div>
|
||||||
|
|
||||||
|
<ng-container *ngIf="!isSmallScreen">
|
||||||
|
<aca-search-input></aca-search-input>
|
||||||
|
<adf-toolbar-divider></adf-toolbar-divider>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<aca-current-user></aca-current-user>
|
||||||
|
|
||||||
|
<ng-container *ngFor="let actionRef of actions; trackBy: trackByActionId">
|
||||||
|
<aca-toolbar-action
|
||||||
|
[actionRef]="actionRef"
|
||||||
|
color="default">
|
||||||
|
</aca-toolbar-action>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
</adf-layout-header>
|
85
src/app/components/header/header.component.ts
Normal file
85
src/app/components/header/header.component.ts
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Alfresco Example Content Application
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005 - 2018 Alfresco Software Limited
|
||||||
|
*
|
||||||
|
* This file is part of the Alfresco Example Content Application.
|
||||||
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
|
* the paid license agreement will prevail. Otherwise, the software is
|
||||||
|
* provided under the following open source license terms:
|
||||||
|
*
|
||||||
|
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
ViewEncapsulation,
|
||||||
|
Output,
|
||||||
|
EventEmitter,
|
||||||
|
OnInit
|
||||||
|
} from '@angular/core';
|
||||||
|
import { Store } from '@ngrx/store';
|
||||||
|
import { AppStore } from 'src/app/store/states';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import {
|
||||||
|
selectHeaderColor,
|
||||||
|
selectAppName,
|
||||||
|
selectLogoPath
|
||||||
|
} from 'src/app/store/selectors/app.selectors';
|
||||||
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||||
|
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||||
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-header',
|
||||||
|
templateUrl: 'header.component.html',
|
||||||
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
host: { class: 'app-header' }
|
||||||
|
})
|
||||||
|
export class AppHeaderComponent implements OnInit {
|
||||||
|
@Output()
|
||||||
|
toggleClicked = new EventEmitter();
|
||||||
|
|
||||||
|
appName$: Observable<string>;
|
||||||
|
headerColor$: Observable<string>;
|
||||||
|
logo$: Observable<string>;
|
||||||
|
|
||||||
|
isSmallScreen = false;
|
||||||
|
actions: Array<ContentActionRef> = [];
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
store: Store<AppStore>,
|
||||||
|
private breakpointObserver: BreakpointObserver,
|
||||||
|
private appExtensions: AppExtensionService
|
||||||
|
) {
|
||||||
|
this.headerColor$ = store.select(selectHeaderColor);
|
||||||
|
this.appName$ = store.select(selectAppName);
|
||||||
|
this.logo$ = store.select(selectLogoPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.actions = this.appExtensions.getHeaderActions();
|
||||||
|
|
||||||
|
this.breakpointObserver
|
||||||
|
.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape])
|
||||||
|
.subscribe(result => {
|
||||||
|
this.isSmallScreen = result.matches;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
trackByActionId(index: number, action: ContentActionRef) {
|
||||||
|
return action.id;
|
||||||
|
}
|
||||||
|
}
|
45
src/app/components/header/header.module.ts
Normal file
45
src/app/components/header/header.module.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Alfresco Example Content Application
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005 - 2018 Alfresco Software Limited
|
||||||
|
*
|
||||||
|
* This file is part of the Alfresco Example Content Application.
|
||||||
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
|
* the paid license agreement will prevail. Otherwise, the software is
|
||||||
|
* provided under the following open source license terms:
|
||||||
|
*
|
||||||
|
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { CoreModule } from '@alfresco/adf-core';
|
||||||
|
import { AppHeaderComponent } from './header.component';
|
||||||
|
import { AppCurrentUserModule } from '../current-user/current-user.module';
|
||||||
|
import { AppSearchInputModule } from '../search/search-input.module';
|
||||||
|
import { AppToolbarModule } from '../toolbar/toolbar.module';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
CoreModule.forChild(),
|
||||||
|
AppCurrentUserModule,
|
||||||
|
AppSearchInputModule,
|
||||||
|
AppToolbarModule
|
||||||
|
],
|
||||||
|
declarations: [AppHeaderComponent],
|
||||||
|
exports: [AppHeaderComponent]
|
||||||
|
})
|
||||||
|
export class AppHeaderModule {}
|
@ -4,6 +4,7 @@
|
|||||||
[disabled]="!canUpload">
|
[disabled]="!canUpload">
|
||||||
|
|
||||||
<adf-sidenav-layout
|
<adf-sidenav-layout
|
||||||
|
#layout
|
||||||
#sidenavManager="acaSidenavManager"
|
#sidenavManager="acaSidenavManager"
|
||||||
acaSidenavManager
|
acaSidenavManager
|
||||||
[sidenavMin]="70"
|
[sidenavMin]="70"
|
||||||
@ -14,25 +15,8 @@
|
|||||||
(expanded)="sidenavManager.setState($event)">
|
(expanded)="sidenavManager.setState($event)">
|
||||||
|
|
||||||
<adf-sidenav-layout-header>
|
<adf-sidenav-layout-header>
|
||||||
<ng-template let-toggleMenu="toggleMenu">
|
<ng-template>
|
||||||
<adf-layout-header
|
<app-header (toggleClicked)="layout.toggleMenu($event)"></app-header>
|
||||||
[logo]="logo$ | async"
|
|
||||||
[redirectUrl]="'/personal-files'"
|
|
||||||
[tooltip]="appName$ | async"
|
|
||||||
[color]="headerColor$ | async"
|
|
||||||
[title]="appName$ | async"
|
|
||||||
(clicked)="toggleMenu($event)">
|
|
||||||
|
|
||||||
<div class="adf-toolbar--spacer"></div>
|
|
||||||
|
|
||||||
<ng-container *ngIf="!isSmallScreen">
|
|
||||||
<aca-search-input></aca-search-input>
|
|
||||||
<adf-toolbar-divider></adf-toolbar-divider>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<aca-current-user></aca-current-user>
|
|
||||||
|
|
||||||
</adf-layout-header>
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</adf-sidenav-layout-header>
|
</adf-sidenav-layout-header>
|
||||||
|
|
||||||
|
@ -30,20 +30,14 @@ import {
|
|||||||
ViewChild,
|
ViewChild,
|
||||||
ViewEncapsulation
|
ViewEncapsulation
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { Observable, Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||||
import { NodePermissionService } from '../../services/node-permission.service';
|
import { NodePermissionService } from '../../services/node-permission.service';
|
||||||
import { SidenavViewsManagerDirective } from './sidenav-views-manager.directive';
|
import { SidenavViewsManagerDirective } from './sidenav-views-manager.directive';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { AppStore } from '../../store/states';
|
import { AppStore } from '../../store/states';
|
||||||
import {
|
import { currentFolder } from '../../store/selectors/app.selectors';
|
||||||
currentFolder,
|
|
||||||
selectAppName,
|
|
||||||
selectHeaderColor,
|
|
||||||
selectLogoPath
|
|
||||||
} from '../../store/selectors/app.selectors';
|
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-layout',
|
selector: 'app-layout',
|
||||||
@ -61,21 +55,10 @@ export class LayoutComponent implements OnInit, OnDestroy {
|
|||||||
node: MinimalNodeEntryEntity;
|
node: MinimalNodeEntryEntity;
|
||||||
canUpload = false;
|
canUpload = false;
|
||||||
|
|
||||||
appName$: Observable<string>;
|
|
||||||
headerColor$: Observable<string>;
|
|
||||||
logo$: Observable<string>;
|
|
||||||
|
|
||||||
isSmallScreen = false;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected store: Store<AppStore>,
|
protected store: Store<AppStore>,
|
||||||
private permission: NodePermissionService,
|
private permission: NodePermissionService
|
||||||
private breakpointObserver: BreakpointObserver
|
) {}
|
||||||
) {
|
|
||||||
this.headerColor$ = store.select(selectHeaderColor);
|
|
||||||
this.appName$ = store.select(selectAppName);
|
|
||||||
this.logo$ = store.select(selectLogoPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if (!this.manager.minimizeSidenav) {
|
if (!this.manager.minimizeSidenav) {
|
||||||
@ -93,12 +76,6 @@ export class LayoutComponent implements OnInit, OnDestroy {
|
|||||||
this.node = node;
|
this.node = node;
|
||||||
this.canUpload = node && this.permission.check(node, ['create']);
|
this.canUpload = node && this.permission.check(node, ['create']);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.breakpointObserver
|
|
||||||
.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape])
|
|
||||||
.subscribe(result => {
|
|
||||||
this.isSmallScreen = result.matches;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
@ -32,8 +32,7 @@ import { ContentModule } from '@alfresco/adf-content-services';
|
|||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { AppSidenavModule } from '../sidenav/sidenav.module';
|
import { AppSidenavModule } from '../sidenav/sidenav.module';
|
||||||
import { AppCommonModule } from '../common/common.module';
|
import { AppCommonModule } from '../common/common.module';
|
||||||
import { AppCurrentUserModule } from '../current-user/current-user.module';
|
import { AppHeaderModule } from '../header/header.module';
|
||||||
import { AppSearchInputModule } from '../search/search-input.module';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@ -43,8 +42,7 @@ import { AppSearchInputModule } from '../search/search-input.module';
|
|||||||
ContentModule.forChild(),
|
ContentModule.forChild(),
|
||||||
AppCommonModule,
|
AppCommonModule,
|
||||||
AppSidenavModule,
|
AppSidenavModule,
|
||||||
AppCurrentUserModule,
|
AppHeaderModule
|
||||||
AppSearchInputModule
|
|
||||||
],
|
],
|
||||||
declarations: [LayoutComponent, SidenavViewsManagerDirective],
|
declarations: [LayoutComponent, SidenavViewsManagerDirective],
|
||||||
exports: [LayoutComponent]
|
exports: [LayoutComponent]
|
||||||
|
@ -1,20 +1,31 @@
|
|||||||
<ng-container [ngSwitch]="actionRef.type">
|
<ng-container [ngSwitch]="actionRef.type">
|
||||||
<ng-container *ngSwitchCase="'default'">
|
<ng-container *ngSwitchCase="'default'">
|
||||||
<app-toolbar-button [type]="type" [actionRef]="actionRef"></app-toolbar-button>
|
<app-toolbar-button
|
||||||
</ng-container>
|
[type]="type"
|
||||||
|
[actionRef]="actionRef"
|
||||||
|
[color]="color">
|
||||||
|
</app-toolbar-button>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngSwitchCase="'button'">
|
<ng-container *ngSwitchCase="'button'">
|
||||||
<app-toolbar-button [type]="type" [actionRef]="actionRef"></app-toolbar-button>
|
<app-toolbar-button
|
||||||
</ng-container>
|
[type]="type"
|
||||||
|
[actionRef]="actionRef"
|
||||||
|
[color]="color">
|
||||||
|
</app-toolbar-button>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<adf-toolbar-divider *ngSwitchCase="'separator'" [id]="actionRef.id"></adf-toolbar-divider>
|
<adf-toolbar-divider *ngSwitchCase="'separator'" [id]="actionRef.id"></adf-toolbar-divider>
|
||||||
|
|
||||||
<ng-container *ngSwitchCase="'menu'">
|
<ng-container *ngSwitchCase="'menu'">
|
||||||
<app-toolbar-menu [actionRef]="actionRef"></app-toolbar-menu>
|
<app-toolbar-menu
|
||||||
</ng-container>
|
[actionRef]="actionRef"
|
||||||
|
[color]="color">
|
||||||
|
</app-toolbar-menu>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngSwitchCase="'custom'">
|
<ng-container *ngSwitchCase="'custom'">
|
||||||
<adf-dynamic-component [id]="actionRef.component"></adf-dynamic-component>
|
<adf-dynamic-component [id]="actionRef.component"></adf-dynamic-component>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
@ -42,6 +42,9 @@ export class ToolbarActionComponent {
|
|||||||
@Input()
|
@Input()
|
||||||
type = 'icon-button';
|
type = 'icon-button';
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
color = 'primary';
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
actionRef: ContentActionRef;
|
actionRef: ContentActionRef;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<button
|
<button
|
||||||
[id]="actionRef.id"
|
[id]="actionRef.id"
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
color="primary"
|
[color]="color"
|
||||||
[attr.title]="(actionRef.description || actionRef.title) | translate"
|
[attr.title]="(actionRef.description || actionRef.title) | translate"
|
||||||
(click)="runAction()">
|
(click)="runAction()">
|
||||||
<mat-icon>{{ actionRef.icon }}</mat-icon>
|
<mat-icon>{{ actionRef.icon }}</mat-icon>
|
||||||
|
@ -42,6 +42,9 @@ export class ToolbarButtonComponent {
|
|||||||
@Input()
|
@Input()
|
||||||
type: ToolbarButtonType = ToolbarButtonType.ICON_BUTTON;
|
type: ToolbarButtonType = ToolbarButtonType.ICON_BUTTON;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
color = 'primary';
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
actionRef: ContentActionRef;
|
actionRef: ContentActionRef;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<button
|
<button
|
||||||
[id]="actionRef.id"
|
[id]="actionRef.id"
|
||||||
color="primary"
|
[color]="color"
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
[attr.title]="(actionRef.description || actionRef.title) | translate"
|
[attr.title]="(actionRef.description || actionRef.title) | translate"
|
||||||
[matMenuTriggerFor]="menu">
|
[matMenuTriggerFor]="menu">
|
||||||
|
@ -36,6 +36,9 @@ export class ToolbarMenuComponent {
|
|||||||
@Input()
|
@Input()
|
||||||
actionRef: ContentActionRef;
|
actionRef: ContentActionRef;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
color = 'primary';
|
||||||
|
|
||||||
get hasChildren(): boolean {
|
get hasChildren(): boolean {
|
||||||
return (
|
return (
|
||||||
this.actionRef &&
|
this.actionRef &&
|
||||||
|
@ -58,6 +58,7 @@ export class AppExtensionService implements RuleContext {
|
|||||||
auth: ['app.auth']
|
auth: ['app.auth']
|
||||||
};
|
};
|
||||||
|
|
||||||
|
headerActions: Array<ContentActionRef> = [];
|
||||||
toolbarActions: Array<ContentActionRef> = [];
|
toolbarActions: Array<ContentActionRef> = [];
|
||||||
viewerToolbarActions: Array<ContentActionRef> = [];
|
viewerToolbarActions: Array<ContentActionRef> = [];
|
||||||
viewerToolbarMoreActions: Array<ContentActionRef> = [];
|
viewerToolbarMoreActions: Array<ContentActionRef> = [];
|
||||||
@ -95,7 +96,10 @@ export class AppExtensionService implements RuleContext {
|
|||||||
console.error('Extension configuration not found');
|
console.error('Extension configuration not found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.headerActions = this.loader.getContentActions(
|
||||||
|
config,
|
||||||
|
'features.header'
|
||||||
|
);
|
||||||
this.toolbarActions = this.loader.getContentActions(
|
this.toolbarActions = this.loader.getContentActions(
|
||||||
config,
|
config,
|
||||||
'features.toolbar'
|
'features.toolbar'
|
||||||
@ -233,6 +237,10 @@ export class AppExtensionService implements RuleContext {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getHeaderActions(): Array<ContentActionRef> {
|
||||||
|
return this.headerActions.filter(action => this.filterByRules(action));
|
||||||
|
}
|
||||||
|
|
||||||
getViewerToolbarMoreActions(): Array<ContentActionRef> {
|
getViewerToolbarMoreActions(): Array<ContentActionRef> {
|
||||||
return this.viewerToolbarMoreActions.filter(action =>
|
return this.viewerToolbarMoreActions.filter(action =>
|
||||||
this.filterByRules(action)
|
this.filterByRules(action)
|
||||||
|
@ -34,6 +34,7 @@ export const SET_CURRENT_URL = 'SET_CURRENT_URL';
|
|||||||
export const SET_USER_PROFILE = 'SET_USER_PROFILE';
|
export const SET_USER_PROFILE = 'SET_USER_PROFILE';
|
||||||
export const TOGGLE_INFO_DRAWER = 'TOGGLE_INFO_DRAWER';
|
export const TOGGLE_INFO_DRAWER = 'TOGGLE_INFO_DRAWER';
|
||||||
export const TOGGLE_DOCUMENT_DISPLAY_MODE = 'TOGGLE_DOCUMENT_DISPLAY_MODE';
|
export const TOGGLE_DOCUMENT_DISPLAY_MODE = 'TOGGLE_DOCUMENT_DISPLAY_MODE';
|
||||||
|
export const LOGOUT = 'LOGOUT';
|
||||||
|
|
||||||
export class SetInitialStateAction implements Action {
|
export class SetInitialStateAction implements Action {
|
||||||
readonly type = SET_INITIAL_STATE;
|
readonly type = SET_INITIAL_STATE;
|
||||||
@ -69,3 +70,8 @@ export class ToggleDocumentDisplayMode implements Action {
|
|||||||
readonly type = TOGGLE_DOCUMENT_DISPLAY_MODE;
|
readonly type = TOGGLE_DOCUMENT_DISPLAY_MODE;
|
||||||
constructor(public payload?: any) {}
|
constructor(public payload?: any) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class LogoutAction implements Action {
|
||||||
|
readonly type = LOGOUT;
|
||||||
|
constructor(public payload?: any) {}
|
||||||
|
}
|
||||||
|
@ -32,6 +32,7 @@ import { EffectsModule } from '@ngrx/effects';
|
|||||||
import { environment } from '../../environments/environment';
|
import { environment } from '../../environments/environment';
|
||||||
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
||||||
import {
|
import {
|
||||||
|
AppEffects,
|
||||||
SnackbarEffects,
|
SnackbarEffects,
|
||||||
NodeEffects,
|
NodeEffects,
|
||||||
RouterEffects,
|
RouterEffects,
|
||||||
@ -49,6 +50,7 @@ import {
|
|||||||
StoreModule.forRoot({ app: appReducer }, { initialState: INITIAL_STATE }),
|
StoreModule.forRoot({ app: appReducer }, { initialState: INITIAL_STATE }),
|
||||||
StoreRouterConnectingModule.forRoot({ stateKey: 'router' }),
|
StoreRouterConnectingModule.forRoot({ stateKey: 'router' }),
|
||||||
EffectsModule.forRoot([
|
EffectsModule.forRoot([
|
||||||
|
AppEffects,
|
||||||
SnackbarEffects,
|
SnackbarEffects,
|
||||||
NodeEffects,
|
NodeEffects,
|
||||||
RouterEffects,
|
RouterEffects,
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export * from './effects/app.effects';
|
||||||
export * from './effects/download.effects';
|
export * from './effects/download.effects';
|
||||||
export * from './effects/favorite.effects';
|
export * from './effects/favorite.effects';
|
||||||
export * from './effects/node.effects';
|
export * from './effects/node.effects';
|
||||||
|
54
src/app/store/effects/app.effects.ts
Normal file
54
src/app/store/effects/app.effects.ts
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Alfresco Example Content Application
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005 - 2018 Alfresco Software Limited
|
||||||
|
*
|
||||||
|
* This file is part of the Alfresco Example Content Application.
|
||||||
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
|
* the paid license agreement will prevail. Otherwise, the software is
|
||||||
|
* provided under the following open source license terms:
|
||||||
|
*
|
||||||
|
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { Effect, Actions, ofType } from '@ngrx/effects';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { map } from 'rxjs/operators';
|
||||||
|
import { LogoutAction, LOGOUT } from '../actions/app.actions';
|
||||||
|
import { AuthenticationService } from '@alfresco/adf-core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class AppEffects {
|
||||||
|
constructor(
|
||||||
|
private actions$: Actions,
|
||||||
|
private auth: AuthenticationService,
|
||||||
|
private router: Router
|
||||||
|
) {}
|
||||||
|
|
||||||
|
@Effect({ dispatch: false })
|
||||||
|
logout$ = this.actions$.pipe(
|
||||||
|
ofType<LogoutAction>(LOGOUT),
|
||||||
|
map(() => {
|
||||||
|
this.auth
|
||||||
|
.logout()
|
||||||
|
.subscribe(() => this.redirectToLogin(), () => this.redirectToLogin());
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
private redirectToLogin() {
|
||||||
|
this.router.navigate(['login']);
|
||||||
|
}
|
||||||
|
}
|
@ -2,7 +2,7 @@
|
|||||||
"$schema": "../../extension.schema.json",
|
"$schema": "../../extension.schema.json",
|
||||||
"$name": "app",
|
"$name": "app",
|
||||||
"$version": "1.0.0",
|
"$version": "1.0.0",
|
||||||
"$references": ["plugin1.json", "dev.tools.json"],
|
"$references": ["plugin1.json", "dev.tools.json", "app.header.json"],
|
||||||
|
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
|
@ -1,408 +1,414 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"$id": "https://github.com/Alfresco/alfresco-content-app/blob/development/extension.schema.json",
|
"$id": "https://github.com/Alfresco/alfresco-content-app/blob/development/extension.schema.json",
|
||||||
"title": "ACA Extension Schema",
|
"title": "ACA Extension Schema",
|
||||||
"description": "Provides a validation schema for ACA extensions",
|
"description": "Provides a validation schema for ACA extensions",
|
||||||
|
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"ruleRef": {
|
"ruleRef": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": ["id", "type"],
|
"required": ["id", "type"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"description": "Unique rule definition id",
|
"description": "Unique rule definition id",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"description": "Rule evaluator type",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"parameters": {
|
|
||||||
"description": "Rule evaluator parameters",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/ruleParameter" },
|
|
||||||
"minItems": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"ruleParameter": {
|
"type": {
|
||||||
"type": "object",
|
"description": "Rule evaluator type",
|
||||||
"required": ["type", "value"],
|
"type": "string"
|
||||||
"properties": {
|
|
||||||
"type": {
|
|
||||||
"description": "Rule parameter type",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"value": {
|
|
||||||
"description": "Rule parameter value",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"parameters": {
|
|
||||||
"description": "Parameters",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/ruleParameter" },
|
|
||||||
"minItems": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"routeRef": {
|
"parameters": {
|
||||||
"type": "object",
|
"description": "Rule evaluator parameters",
|
||||||
"required": ["id", "path", "component"],
|
"type": "array",
|
||||||
"properties": {
|
"items": { "$ref": "#/definitions/ruleParameter" },
|
||||||
"id": {
|
"minItems": 1
|
||||||
"description": "Unique route reference identifier.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"path": {
|
|
||||||
"description": "Route path to register.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"component": {
|
|
||||||
"description": "Unique identifier for the Component to use with the route.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"layout": {
|
|
||||||
"description": "Unique identifier for the custom layout component to use.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"auth": {
|
|
||||||
"description": "List of the authentication guards to use with the route.",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"minLength": 1,
|
|
||||||
"uniqueItems": true
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"description": "Custom data to pass to the activated route so that your components can access it",
|
|
||||||
"type": "object"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"actionRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id", "type"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique action identifier",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"description": "Action type",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"payload": {
|
|
||||||
"description": "Action payload value (string or expression)",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"contentActionRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique action identifier.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"description": "Element type",
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["default", "button", "separator", "menu", "custom"]
|
|
||||||
},
|
|
||||||
"title": {
|
|
||||||
"description": "Element title",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "Element description, used for the tooltips.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description-disabled": {
|
|
||||||
"description": "Description to use when element is in the disabled state.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"order": {
|
|
||||||
"description": "Element order",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"icon": {
|
|
||||||
"description": "Element icon",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"disabled": {
|
|
||||||
"description": "Toggles disabled state",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"component": {
|
|
||||||
"description": "Custom component id (requires type to be 'custom')",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"children": {
|
|
||||||
"description": "Child entries for the container types.",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"actions": {
|
|
||||||
"description": "Element actions",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"click": {
|
|
||||||
"description": "Action reference for the click handler",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"description": "Element rules",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"enabled": {
|
|
||||||
"description": "Rule to evaluate the enabled state",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"visible": {
|
|
||||||
"description": "Rule to evaluate the visibility state",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"navBarLinkRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id", "icon", "title", "route"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique identifier",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"icon": {
|
|
||||||
"description": "Element icon",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"title": {
|
|
||||||
"description": "Element title",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"route": {
|
|
||||||
"description": "Route reference identifier",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "Element description or tooltip",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"order": {
|
|
||||||
"description": "Element order",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"disabled": {
|
|
||||||
"description": "Toggles the disabled state",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"navBarGroupRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id", "items"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique identifier for the navigation group",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"items": {
|
|
||||||
"description": "Navigation group items",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/navBarLinkRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"order": {
|
|
||||||
"description": "Group order",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"disabled": {
|
|
||||||
"description": "Toggles the disabled state",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sidebarTabRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id", "component"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique identifier for the navigation group",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"title": {
|
|
||||||
"description": "Element title",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"component": {
|
|
||||||
"description": "Component id",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"icon": {
|
|
||||||
"description": "Material icon name",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"disabled": {
|
|
||||||
"description": "Toggles disabled state",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"order": {
|
|
||||||
"description": "Element order",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"description": "Element rules",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"visible": {
|
|
||||||
"description": "Rule to evaluate the visibility state",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"viewerExtensionRef": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["id", "component", "fileExtension"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"description": "Unique identifier for the navigation group",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"component": {
|
|
||||||
"description": "Component id",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"fileExtension": {
|
|
||||||
"description": "Target file extension",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"order": {
|
|
||||||
"description": "Group order",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"disabled": {
|
|
||||||
"description": "Toggles the disabled state",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
"ruleParameter": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": ["$name", "$version"],
|
"required": ["type", "value"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"$name": {
|
"type": {
|
||||||
"description": "Extension name",
|
"description": "Rule parameter type",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Rule parameter value",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"parameters": {
|
||||||
|
"description": "Parameters",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/ruleParameter" },
|
||||||
|
"minItems": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"routeRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "path", "component"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique route reference identifier.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"description": "Route path to register.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"component": {
|
||||||
|
"description": "Unique identifier for the Component to use with the route.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"layout": {
|
||||||
|
"description": "Unique identifier for the custom layout component to use.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"auth": {
|
||||||
|
"description": "List of the authentication guards to use with the route.",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"minLength": 1,
|
||||||
|
"uniqueItems": true
|
||||||
},
|
},
|
||||||
"$version": {
|
"data": {
|
||||||
"description": "Extension version",
|
"description": "Custom data to pass to the activated route so that your components can access it",
|
||||||
"type": "string"
|
"type": "object"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"actionRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "type"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique action identifier",
|
||||||
|
"type": "string"
|
||||||
},
|
},
|
||||||
"$description": {
|
"type": {
|
||||||
"description": "Brief description on what the extension does"
|
"description": "Action type",
|
||||||
|
"type": "string"
|
||||||
},
|
},
|
||||||
"$references": {
|
"payload": {
|
||||||
"description": "References to external files",
|
"description": "Action payload value (string or expression)",
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
"type": "string"
|
}
|
||||||
},
|
},
|
||||||
"minItems": 1,
|
"contentActionRef": {
|
||||||
"uniqueItems": true
|
"type": "object",
|
||||||
|
"required": ["id"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique action identifier.",
|
||||||
|
"type": "string"
|
||||||
},
|
},
|
||||||
"rules": {
|
"type": {
|
||||||
"description": "List of rule definitions",
|
"description": "Element type",
|
||||||
"type": "array",
|
"type": "string",
|
||||||
"items": { "$ref": "#/definitions/ruleRef" },
|
"enum": ["default", "button", "separator", "menu", "custom"]
|
||||||
"minItems": 1
|
|
||||||
},
|
},
|
||||||
"routes": {
|
"title": {
|
||||||
"description": "List of custom application routes",
|
"description": "Element title",
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": { "$ref": "#/definitions/routeRef" },
|
},
|
||||||
"minItems": 1
|
"description": {
|
||||||
|
"description": "Element description, used for the tooltips.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description-disabled": {
|
||||||
|
"description": "Description to use when element is in the disabled state.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"description": "Element order",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"icon": {
|
||||||
|
"description": "Element icon",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"disabled": {
|
||||||
|
"description": "Toggles disabled state",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"component": {
|
||||||
|
"description": "Custom component id (requires type to be 'custom')",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"children": {
|
||||||
|
"description": "Child entries for the container types.",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"description": "List of action definitions",
|
"description": "Element actions",
|
||||||
"type": "array",
|
"type": "object",
|
||||||
"items": { "$ref": "#/definitions/actionRef" },
|
"properties": {
|
||||||
"minItems": 1
|
"click": {
|
||||||
},
|
"description": "Action reference for the click handler",
|
||||||
"features": {
|
"type": "string"
|
||||||
"description": "Application-specific features and extensions",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"create": {
|
|
||||||
"description": "The [New] menu component extensions",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"viewer": {
|
|
||||||
"description": "Viewer component extensions",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"openWith": {
|
|
||||||
"description": "The [Open With] menu extensions",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"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
|
|
||||||
},
|
|
||||||
"content": {
|
|
||||||
"description": "Viewer content extensions",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/viewerExtensionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"navbar": {
|
|
||||||
"description": "Navigation bar extensions",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/navBarGroupRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"sidebar": {
|
|
||||||
"description": "Sidebar extensions",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/sidebarTabRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"toolbar": {
|
|
||||||
"description": "Toolbar entries",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
},
|
|
||||||
"contextMenu": {
|
|
||||||
"description": "Context menu entries",
|
|
||||||
"type": "array",
|
|
||||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
|
||||||
"minItems": 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"description": "Element rules",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"description": "Rule to evaluate the enabled state",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"visible": {
|
||||||
|
"description": "Rule to evaluate the visibility state",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"navBarLinkRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "icon", "title", "route"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique identifier",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"icon": {
|
||||||
|
"description": "Element icon",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"description": "Element title",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"route": {
|
||||||
|
"description": "Route reference identifier",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "Element description or tooltip",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"description": "Element order",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"disabled": {
|
||||||
|
"description": "Toggles the disabled state",
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"navBarGroupRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "items"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique identifier for the navigation group",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"items": {
|
||||||
|
"description": "Navigation group items",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/navBarLinkRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"description": "Group order",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"disabled": {
|
||||||
|
"description": "Toggles the disabled state",
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sidebarTabRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "component"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique identifier for the navigation group",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"description": "Element title",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"component": {
|
||||||
|
"description": "Component id",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"icon": {
|
||||||
|
"description": "Material icon name",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"disabled": {
|
||||||
|
"description": "Toggles disabled state",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"description": "Element order",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"description": "Element rules",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"visible": {
|
||||||
|
"description": "Rule to evaluate the visibility state",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"viewerExtensionRef": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["id", "component", "fileExtension"],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"description": "Unique identifier for the navigation group",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"component": {
|
||||||
|
"description": "Component id",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"fileExtension": {
|
||||||
|
"description": "Target file extension",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"description": "Group order",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"disabled": {
|
||||||
|
"description": "Toggles the disabled state",
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"type": "object",
|
||||||
|
"required": ["$name", "$version"],
|
||||||
|
"properties": {
|
||||||
|
"$name": {
|
||||||
|
"description": "Extension name",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"$version": {
|
||||||
|
"description": "Extension version",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"$description": {
|
||||||
|
"description": "Brief description on what the extension does"
|
||||||
|
},
|
||||||
|
"$references": {
|
||||||
|
"description": "References to external files",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"minItems": 1,
|
||||||
|
"uniqueItems": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"description": "List of rule definitions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/ruleRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"routes": {
|
||||||
|
"description": "List of custom application routes",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/routeRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"actions": {
|
||||||
|
"description": "List of action definitions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/actionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"features": {
|
||||||
|
"description": "Application-specific features and extensions",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"header": {
|
||||||
|
"description": "Application header extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"create": {
|
||||||
|
"description": "The [New] menu component extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"viewer": {
|
||||||
|
"description": "Viewer component extensions",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"openWith": {
|
||||||
|
"description": "The [Open With] menu extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"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
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"description": "Viewer content extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/viewerExtensionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"navbar": {
|
||||||
|
"description": "Navigation bar extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/navBarGroupRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"sidebar": {
|
||||||
|
"description": "Sidebar extensions",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/sidebarTabRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"toolbar": {
|
||||||
|
"description": "Toolbar entries",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
},
|
||||||
|
"contextMenu": {
|
||||||
|
"description": "Context menu entries",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||||
|
"minItems": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
59
src/assets/plugins/app.header.json
Normal file
59
src/assets/plugins/app.header.json
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../../../extension.schema.json",
|
||||||
|
"$name": "app",
|
||||||
|
"$version": "1.0.0",
|
||||||
|
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"id": "app.actions.about",
|
||||||
|
"type": "NAVIGATE_URL",
|
||||||
|
"payload": "/about"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.actions.settings",
|
||||||
|
"type": "NAVIGATE_URL",
|
||||||
|
"payload": "/settings"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"features": {
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"id": "app.header.more",
|
||||||
|
"type": "menu",
|
||||||
|
"order": 10000,
|
||||||
|
"icon": "more_vert",
|
||||||
|
"title": "APP.ACTIONS.MORE",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "app.header.settings",
|
||||||
|
"title": "APP.SETTINGS.TITLE",
|
||||||
|
"description": "APP.SETTINGS.TITLE",
|
||||||
|
"icon": "settings",
|
||||||
|
"actions": {
|
||||||
|
"click": "app.actions.settings"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.header.about",
|
||||||
|
"title": "APP.BROWSE.ABOUT.TITLE",
|
||||||
|
"description": "APP.BROWSE.ABOUT.TITLE",
|
||||||
|
"icon": "info",
|
||||||
|
"actions": {
|
||||||
|
"click": "app.actions.about"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "app.header.logout",
|
||||||
|
"title": "APP.SIGN_OUT",
|
||||||
|
"description": "APP.SIGN_OUT",
|
||||||
|
"icon": "exit_to_app",
|
||||||
|
"actions": {
|
||||||
|
"click": "LOGOUT"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user