diff --git a/cspell.json b/cspell.json index 173a3ba33..d922314af 100644 --- a/cspell.json +++ b/cspell.json @@ -5,6 +5,7 @@ "succes", "sharedlinks", "Redistributable", + "fullscreen", "ngrx", "ngstack", diff --git a/docs/extending.md b/docs/extending.md index 5bec7c1a2..82f47124f 100644 --- a/docs/extending.md +++ b/docs/extending.md @@ -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_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. | -| 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. | +| 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. | +| LOGOUT | n/a | Log out and redirect to Login screen | ## Rules diff --git a/e2e/suites/actions/delete-undo-delete.test.ts b/e2e/suites/actions/delete-undo-delete.test.ts index 62de6d442..1d3b1082d 100755 --- a/e2e/suites/actions/delete-undo-delete.test.ts +++ b/e2e/suites/actions/delete-undo-delete.test.ts @@ -414,7 +414,7 @@ describe('Delete and undo delete', () => { 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(); await dataTable.selectMultipleItems([favoriteFile1, favoriteFile2]); diff --git a/extension.schema.json b/extension.schema.json index 5633b211f..e801b081f 100644 --- a/extension.schema.json +++ b/extension.schema.json @@ -1,408 +1,414 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://github.com/Alfresco/alfresco-content-app/blob/development/extension.schema.json", - "title": "ACA Extension Schema", - "description": "Provides a validation schema for ACA extensions", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://github.com/Alfresco/alfresco-content-app/blob/development/extension.schema.json", + "title": "ACA Extension Schema", + "description": "Provides a validation schema for ACA extensions", - "definitions": { - "ruleRef": { - "type": "object", - "required": ["id", "type"], - "properties": { - "id": { - "description": "Unique rule definition id", - "type": "string" - }, - "type": { - "description": "Rule evaluator type", - "type": "string" - }, - "parameters": { - "description": "Rule evaluator parameters", - "type": "array", - "items": { "$ref": "#/definitions/ruleParameter" }, - "minItems": 1 - } - } + "definitions": { + "ruleRef": { + "type": "object", + "required": ["id", "type"], + "properties": { + "id": { + "description": "Unique rule definition id", + "type": "string" }, - "ruleParameter": { - "type": "object", - "required": ["type", "value"], - "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 - } - } + "type": { + "description": "Rule evaluator type", + "type": "string" }, - "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" - }, - "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" - } - } + "parameters": { + "description": "Rule evaluator parameters", + "type": "array", + "items": { "$ref": "#/definitions/ruleParameter" }, + "minItems": 1 } + } }, - - "type": "object", - "required": ["$name", "$version"], - "properties": { - "$name": { - "description": "Extension name", + "ruleParameter": { + "type": "object", + "required": ["type", "value"], + "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": { + "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" + }, + "minLength": 1, + "uniqueItems": true }, - "$version": { - "description": "Extension version", - "type": "string" + "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" }, - "$description": { - "description": "Brief description on what the extension does" + "type": { + "description": "Action type", + "type": "string" }, - "$references": { - "description": "References to external files", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "uniqueItems": true + "payload": { + "description": "Action payload value (string or expression)", + "type": "string" + } + } + }, + "contentActionRef": { + "type": "object", + "required": ["id"], + "properties": { + "id": { + "description": "Unique action identifier.", + "type": "string" }, - "rules": { - "description": "List of rule definitions", - "type": "array", - "items": { "$ref": "#/definitions/ruleRef" }, - "minItems": 1 + "type": { + "description": "Element type", + "type": "string", + "enum": ["default", "button", "separator", "menu", "custom"] }, - "routes": { - "description": "List of custom application routes", - "type": "array", - "items": { "$ref": "#/definitions/routeRef" }, - "minItems": 1 + "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": "List of action definitions", - "type": "array", - "items": { "$ref": "#/definitions/actionRef" }, - "minItems": 1 - }, - "features": { - "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 - } + "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" + } + } } + }, + + "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 + } + } + } + } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a5061d637..dacb1bedd 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -63,6 +63,7 @@ import { AppCurrentUserModule } from './components/current-user/current-user.mod import { AppSearchInputModule } from './components/search/search-input.module'; import { AppSearchResultsModule } from './components/search/search-results.module'; import { AppLoginModule } from './components/login/login.module'; +import { AppHeaderModule } from './components/header/header.module'; @NgModule({ imports: [ @@ -93,7 +94,8 @@ import { AppLoginModule } from './components/login/login.module'; AppCreateMenuModule, AppPermissionsModule, AppSearchInputModule, - AppSearchResultsModule + AppSearchResultsModule, + AppHeaderModule ], declarations: [ AppComponent, diff --git a/src/app/components/current-user/current-user.component.html b/src/app/components/current-user/current-user.component.html index 7228fe4b8..1c566f2da 100644 --- a/src/app/components/current-user/current-user.component.html +++ b/src/app/components/current-user/current-user.component.html @@ -13,18 +13,6 @@ {{ 'APP.LANGUAGE' | translate }} - - - - diff --git a/src/app/components/header/header.component.html b/src/app/components/header/header.component.html new file mode 100644 index 000000000..4cfee6db6 --- /dev/null +++ b/src/app/components/header/header.component.html @@ -0,0 +1,25 @@ + + +
+ + + + + + + + + + + + + +
diff --git a/src/app/components/header/header.component.ts b/src/app/components/header/header.component.ts new file mode 100644 index 000000000..5814b000e --- /dev/null +++ b/src/app/components/header/header.component.ts @@ -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 . + */ + +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; + headerColor$: Observable; + logo$: Observable; + + isSmallScreen = false; + actions: Array = []; + + constructor( + store: Store, + 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; + } +} diff --git a/src/app/components/header/header.module.ts b/src/app/components/header/header.module.ts new file mode 100644 index 000000000..dc2de0fc7 --- /dev/null +++ b/src/app/components/header/header.module.ts @@ -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 . + */ + +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 {} diff --git a/src/app/components/layout/layout.component.html b/src/app/components/layout/layout.component.html index e9864a81c..595a71916 100644 --- a/src/app/components/layout/layout.component.html +++ b/src/app/components/layout/layout.component.html @@ -4,6 +4,7 @@ [disabled]="!canUpload"> - - - -
- - - - - - - - -
+ +
diff --git a/src/app/components/layout/layout.component.ts b/src/app/components/layout/layout.component.ts index 44431905e..0dc1f8b7b 100644 --- a/src/app/components/layout/layout.component.ts +++ b/src/app/components/layout/layout.component.ts @@ -30,20 +30,14 @@ import { ViewChild, ViewEncapsulation } from '@angular/core'; -import { Observable, Subject } from 'rxjs'; +import { Subject } from 'rxjs'; import { MinimalNodeEntryEntity } from 'alfresco-js-api'; import { NodePermissionService } from '../../services/node-permission.service'; import { SidenavViewsManagerDirective } from './sidenav-views-manager.directive'; import { Store } from '@ngrx/store'; import { AppStore } from '../../store/states'; -import { - currentFolder, - selectAppName, - selectHeaderColor, - selectLogoPath -} from '../../store/selectors/app.selectors'; +import { currentFolder } from '../../store/selectors/app.selectors'; import { takeUntil } from 'rxjs/operators'; -import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; @Component({ selector: 'app-layout', @@ -61,21 +55,10 @@ export class LayoutComponent implements OnInit, OnDestroy { node: MinimalNodeEntryEntity; canUpload = false; - appName$: Observable; - headerColor$: Observable; - logo$: Observable; - - isSmallScreen = false; - constructor( protected store: Store, - private permission: NodePermissionService, - private breakpointObserver: BreakpointObserver - ) { - this.headerColor$ = store.select(selectHeaderColor); - this.appName$ = store.select(selectAppName); - this.logo$ = store.select(selectLogoPath); - } + private permission: NodePermissionService + ) {} ngOnInit() { if (!this.manager.minimizeSidenav) { @@ -93,12 +76,6 @@ export class LayoutComponent implements OnInit, OnDestroy { this.node = node; this.canUpload = node && this.permission.check(node, ['create']); }); - - this.breakpointObserver - .observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape]) - .subscribe(result => { - this.isSmallScreen = result.matches; - }); } ngOnDestroy() { diff --git a/src/app/components/layout/layout.module.ts b/src/app/components/layout/layout.module.ts index 4fcbc295a..5719f47f5 100644 --- a/src/app/components/layout/layout.module.ts +++ b/src/app/components/layout/layout.module.ts @@ -32,8 +32,7 @@ import { ContentModule } from '@alfresco/adf-content-services'; import { RouterModule } from '@angular/router'; import { AppSidenavModule } from '../sidenav/sidenav.module'; import { AppCommonModule } from '../common/common.module'; -import { AppCurrentUserModule } from '../current-user/current-user.module'; -import { AppSearchInputModule } from '../search/search-input.module'; +import { AppHeaderModule } from '../header/header.module'; @NgModule({ imports: [ @@ -43,8 +42,7 @@ import { AppSearchInputModule } from '../search/search-input.module'; ContentModule.forChild(), AppCommonModule, AppSidenavModule, - AppCurrentUserModule, - AppSearchInputModule + AppHeaderModule ], declarations: [LayoutComponent, SidenavViewsManagerDirective], exports: [LayoutComponent] diff --git a/src/app/components/toolbar/toolbar-action/toolbar-action.component.html b/src/app/components/toolbar/toolbar-action/toolbar-action.component.html index 36d720518..605a475eb 100644 --- a/src/app/components/toolbar/toolbar-action/toolbar-action.component.html +++ b/src/app/components/toolbar/toolbar-action/toolbar-action.component.html @@ -1,20 +1,31 @@ - - - + + + + - - - + + + + - + - - - + + + + - - - + + + diff --git a/src/app/components/toolbar/toolbar-action/toolbar-action.component.ts b/src/app/components/toolbar/toolbar-action/toolbar-action.component.ts index 23f5036db..716c1065b 100644 --- a/src/app/components/toolbar/toolbar-action/toolbar-action.component.ts +++ b/src/app/components/toolbar/toolbar-action/toolbar-action.component.ts @@ -42,6 +42,9 @@ export class ToolbarActionComponent { @Input() type = 'icon-button'; + @Input() + color = 'primary'; + @Input() actionRef: ContentActionRef; } diff --git a/src/app/components/toolbar/toolbar-button/toolbar-button.component.html b/src/app/components/toolbar/toolbar-button/toolbar-button.component.html index 896928bf7..5511768f0 100644 --- a/src/app/components/toolbar/toolbar-button/toolbar-button.component.html +++ b/src/app/components/toolbar/toolbar-button/toolbar-button.component.html @@ -3,7 +3,7 @@