diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 7dda8ed0f..8df0cfa59 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -71,11 +71,9 @@ import { PermissionsManagerComponent } from './components/permission-manager/per import { AppRouteReuseStrategy } from './app.routes.strategy'; import { AppInfoDrawerModule } from './components/info-drawer/info.drawer.module'; import { DirectivesModule } from './directives/directives.module'; -import { ToggleInfoDrawerComponent } from './components/toolbar/toggle-info-drawer/toggle-info-drawer.component'; -import { DocumentDisplayModeComponent } from './components/toolbar/document-display-mode/document-display-mode.component'; -import { ToggleFavoriteComponent } from './components/toolbar/toggle-favorite/toggle-favorite.component'; import { ContextMenuModule } from './components/context-menu/context-menu.module'; import { ExtensionsModule } from '@alfresco/adf-extensions'; +import { AppToolbarModule } from './components/toolbar/toolbar.module'; @NgModule({ imports: [ @@ -97,7 +95,8 @@ import { ExtensionsModule } from '@alfresco/adf-extensions'; DirectivesModule, ContextMenuModule.forRoot(), - AppInfoDrawerModule + AppInfoDrawerModule, + AppToolbarModule ], declarations: [ AppComponent, @@ -123,10 +122,7 @@ import { ExtensionsModule } from '@alfresco/adf-extensions'; PermissionsManagerComponent, SearchResultsComponent, SettingsComponent, - SharedLinkViewComponent, - ToggleInfoDrawerComponent, - DocumentDisplayModeComponent, - ToggleFavoriteComponent + SharedLinkViewComponent ], providers: [ { provide: RouteReuseStrategy, useClass: AppRouteReuseStrategy }, @@ -149,10 +145,7 @@ import { ExtensionsModule } from '@alfresco/adf-extensions'; entryComponents: [ LibraryDialogComponent, NodeVersionsDialogComponent, - NodePermissionsDialogComponent, - ToggleInfoDrawerComponent, - DocumentDisplayModeComponent, - ToggleFavoriteComponent + NodePermissionsDialogComponent ], bootstrap: [AppComponent] }) diff --git a/src/app/extensions/components/toolbar/toolbar-action.component.html b/src/app/components/toolbar/toolbar-action/toolbar-action.component.html similarity index 100% rename from src/app/extensions/components/toolbar/toolbar-action.component.html rename to src/app/components/toolbar/toolbar-action/toolbar-action.component.html diff --git a/src/app/extensions/components/toolbar/toolbar-action.component.ts b/src/app/components/toolbar/toolbar-action/toolbar-action.component.ts similarity index 96% rename from src/app/extensions/components/toolbar/toolbar-action.component.ts rename to src/app/components/toolbar/toolbar-action/toolbar-action.component.ts index 78eeceb8c..acaece0d0 100644 --- a/src/app/extensions/components/toolbar/toolbar-action.component.ts +++ b/src/app/components/toolbar/toolbar-action/toolbar-action.component.ts @@ -31,8 +31,8 @@ import { } from '@angular/core'; import { AppStore } from '../../../store/states'; import { Store } from '@ngrx/store'; -import { AppExtensionService } from '../../extension.service'; import { ContentActionRef } from '@alfresco/adf-extensions'; +import { AppExtensionService } from '../../../extensions/extension.service'; @Component({ selector: 'aca-toolbar-action', diff --git a/src/app/components/toolbar/toolbar-button/toolbar-button.component.html b/src/app/components/toolbar/toolbar-button/toolbar-button.component.html new file mode 100644 index 000000000..a8b484f68 --- /dev/null +++ b/src/app/components/toolbar/toolbar-button/toolbar-button.component.html @@ -0,0 +1,28 @@ + + + + + + + + diff --git a/src/app/extensions/components/toolbar/toolbar-button.component.ts b/src/app/components/toolbar/toolbar-button/toolbar-button.component.ts similarity index 62% rename from src/app/extensions/components/toolbar/toolbar-button.component.ts rename to src/app/components/toolbar/toolbar-button/toolbar-button.component.ts index e05a3d50f..345413ef4 100644 --- a/src/app/extensions/components/toolbar/toolbar-button.component.ts +++ b/src/app/components/toolbar/toolbar-button/toolbar-button.component.ts @@ -25,11 +25,11 @@ import { Component, Input } from '@angular/core'; import { ContentActionRef } from '@alfresco/adf-extensions'; -import { AppExtensionService } from '../../extension.service'; import { Store } from '@ngrx/store'; import { AppStore } from '../../../store/states'; import { appSelection } from '../../../store/selectors/app.selectors'; import { take } from 'rxjs/operators'; +import { AppExtensionService } from '../../../extensions/extension.service'; export enum ToolbarButtonType { ICON_BUTTON = 'icon-button', @@ -38,36 +38,7 @@ export enum ToolbarButtonType { @Component({ selector: 'app-toolbar-button', - template: ` - - - - - - - - - ` + templateUrl: 'toolbar-button.component.html' }) export class ToolbarButtonComponent { @Input() type: ToolbarButtonType = ToolbarButtonType.ICON_BUTTON; diff --git a/src/app/components/toolbar/toolbar.module.ts b/src/app/components/toolbar/toolbar.module.ts new file mode 100644 index 000000000..c499242c3 --- /dev/null +++ b/src/app/components/toolbar/toolbar.module.ts @@ -0,0 +1,56 @@ +/*! + * @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 { DocumentDisplayModeComponent } from './document-display-mode/document-display-mode.component'; +import { ToggleFavoriteComponent } from './toggle-favorite/toggle-favorite.component'; +import { ToggleInfoDrawerComponent } from './toggle-info-drawer/toggle-info-drawer.component'; +import { CommonModule } from '@angular/common'; +import { CoreModule } from '@alfresco/adf-core'; +import { ToolbarButtonComponent } from './toolbar-button/toolbar-button.component'; +import { ToolbarActionComponent } from './toolbar-action/toolbar-action.component'; +import { ExtensionsModule } from '@alfresco/adf-extensions'; + +export function components() { + return [ + DocumentDisplayModeComponent, + ToggleFavoriteComponent, + ToggleInfoDrawerComponent, + ToolbarButtonComponent, + ToolbarActionComponent + ]; +} + +@NgModule({ + imports: [ + CommonModule, + CoreModule.forChild(), + ExtensionsModule.forChild() + ], + declarations: components(), + exports: components(), + entryComponents: components() +}) +export class AppToolbarModule {} diff --git a/src/app/extensions/core.extensions.module.ts b/src/app/extensions/core.extensions.module.ts index f1ee331de..da2648e87 100644 --- a/src/app/extensions/core.extensions.module.ts +++ b/src/app/extensions/core.extensions.module.ts @@ -28,13 +28,11 @@ import { CommonModule } from '@angular/common'; import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core'; import { LayoutComponent } from '../components/layout/layout.component'; import { TrashcanComponent } from '../components/trashcan/trashcan.component'; -import { ToolbarActionComponent } from './components/toolbar/toolbar-action.component'; import * as app from './evaluators/app.evaluators'; import * as nav from './evaluators/navigation.evaluators'; import { AppExtensionService } from './extension.service'; import { ToggleInfoDrawerComponent } from '../components/toolbar/toggle-info-drawer/toggle-info-drawer.component'; import { ToggleFavoriteComponent } from '../components/toolbar/toggle-favorite/toggle-favorite.component'; -import { ToolbarButtonComponent } from './components/toolbar/toolbar-button.component'; import { MetadataTabComponent } from '../components/info-drawer/metadata-tab/metadata-tab.component'; import { CommentsTabComponent } from '../components/info-drawer/comments-tab/comments-tab.component'; import { VersionsTabComponent } from '../components/info-drawer/versions-tab/versions-tab.component'; @@ -49,14 +47,6 @@ export function setupExtensions(service: AppExtensionService): Function { CommonModule, CoreModule.forChild(), ExtensionsModule.forChild() - ], - declarations: [ - ToolbarActionComponent, - ToolbarButtonComponent - ], - exports: [ - ToolbarActionComponent, - ToolbarButtonComponent ] }) export class CoreExtensionsModule {