mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
extra app modules (#596)
* toolbar module
* lazy load Settings
* fix build
* remove duplicate build for e2e
* Revert "remove duplicate build for e2e"
This reverts commit 94b872239b
.
This commit is contained in:
@@ -56,7 +56,6 @@ import { ContentManagementService } from './services/content-management.service'
|
|||||||
import { NodeActionsService } from './services/node-actions.service';
|
import { NodeActionsService } from './services/node-actions.service';
|
||||||
import { NodePermissionService } from './services/node-permission.service';
|
import { NodePermissionService } from './services/node-permission.service';
|
||||||
import { SearchResultsComponent } from './components/search/search-results/search-results.component';
|
import { SearchResultsComponent } from './components/search/search-results/search-results.component';
|
||||||
import { SettingsComponent } from './components/settings/settings.component';
|
|
||||||
import { ProfileResolver } from './services/profile.resolver';
|
import { ProfileResolver } from './services/profile.resolver';
|
||||||
import { ExperimentalGuard } from './services/experimental-guard.service';
|
import { ExperimentalGuard } from './services/experimental-guard.service';
|
||||||
|
|
||||||
@@ -71,11 +70,9 @@ import { PermissionsManagerComponent } from './components/permission-manager/per
|
|||||||
import { AppRouteReuseStrategy } from './app.routes.strategy';
|
import { AppRouteReuseStrategy } from './app.routes.strategy';
|
||||||
import { AppInfoDrawerModule } from './components/info-drawer/info.drawer.module';
|
import { AppInfoDrawerModule } from './components/info-drawer/info.drawer.module';
|
||||||
import { DirectivesModule } from './directives/directives.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 { ContextMenuModule } from './components/context-menu/context-menu.module';
|
||||||
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||||
|
import { AppToolbarModule } from './components/toolbar/toolbar.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -97,7 +94,8 @@ import { ExtensionsModule } from '@alfresco/adf-extensions';
|
|||||||
|
|
||||||
DirectivesModule,
|
DirectivesModule,
|
||||||
ContextMenuModule.forRoot(),
|
ContextMenuModule.forRoot(),
|
||||||
AppInfoDrawerModule
|
AppInfoDrawerModule,
|
||||||
|
AppToolbarModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
@@ -122,11 +120,7 @@ import { ExtensionsModule } from '@alfresco/adf-extensions';
|
|||||||
NodePermissionsDialogComponent,
|
NodePermissionsDialogComponent,
|
||||||
PermissionsManagerComponent,
|
PermissionsManagerComponent,
|
||||||
SearchResultsComponent,
|
SearchResultsComponent,
|
||||||
SettingsComponent,
|
SharedLinkViewComponent
|
||||||
SharedLinkViewComponent,
|
|
||||||
ToggleInfoDrawerComponent,
|
|
||||||
DocumentDisplayModeComponent,
|
|
||||||
ToggleFavoriteComponent
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: RouteReuseStrategy, useClass: AppRouteReuseStrategy },
|
{ provide: RouteReuseStrategy, useClass: AppRouteReuseStrategy },
|
||||||
@@ -149,10 +143,7 @@ import { ExtensionsModule } from '@alfresco/adf-extensions';
|
|||||||
entryComponents: [
|
entryComponents: [
|
||||||
LibraryDialogComponent,
|
LibraryDialogComponent,
|
||||||
NodeVersionsDialogComponent,
|
NodeVersionsDialogComponent,
|
||||||
NodePermissionsDialogComponent,
|
NodePermissionsDialogComponent
|
||||||
ToggleInfoDrawerComponent,
|
|
||||||
DocumentDisplayModeComponent,
|
|
||||||
ToggleFavoriteComponent
|
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
})
|
})
|
||||||
|
@@ -39,7 +39,6 @@ import { TrashcanComponent } from './components/trashcan/trashcan.component';
|
|||||||
import { LoginComponent } from './components/login/login.component';
|
import { LoginComponent } from './components/login/login.component';
|
||||||
import { GenericErrorComponent } from './components/generic-error/generic-error.component';
|
import { GenericErrorComponent } from './components/generic-error/generic-error.component';
|
||||||
import { SearchResultsComponent } from './components/search/search-results/search-results.component';
|
import { SearchResultsComponent } from './components/search/search-results/search-results.component';
|
||||||
import { SettingsComponent } from './components/settings/settings.component';
|
|
||||||
|
|
||||||
import { ProfileResolver } from './services/profile.resolver';
|
import { ProfileResolver } from './services/profile.resolver';
|
||||||
|
|
||||||
@@ -53,7 +52,7 @@ export const APP_ROUTES: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'settings',
|
path: 'settings',
|
||||||
component: SettingsComponent,
|
loadChildren: 'src/app/components/settings/settings.module#AppSettingsModule',
|
||||||
data: {
|
data: {
|
||||||
title: 'Settings'
|
title: 'Settings'
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,7 @@ import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module';
|
|||||||
import { PreviewComponent } from './preview.component';
|
import { PreviewComponent } from './preview.component';
|
||||||
import { ViewUtilService } from './view-util.service';
|
import { ViewUtilService } from './view-util.service';
|
||||||
import { PreviewExtensionComponent } from './preview-extension.component';
|
import { PreviewExtensionComponent } from './preview-extension.component';
|
||||||
|
import { AppToolbarModule } from '../toolbar/toolbar.module';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
@@ -50,7 +51,8 @@ const routes: Routes = [
|
|||||||
ContentDirectiveModule,
|
ContentDirectiveModule,
|
||||||
DirectivesModule,
|
DirectivesModule,
|
||||||
AppInfoDrawerModule,
|
AppInfoDrawerModule,
|
||||||
CoreExtensionsModule.forChild()
|
CoreExtensionsModule.forChild(),
|
||||||
|
AppToolbarModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
PreviewComponent,
|
PreviewComponent,
|
||||||
|
47
src/app/components/settings/settings.module.ts
Normal file
47
src/app/components/settings/settings.module.ts
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/*!
|
||||||
|
* @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 { SettingsComponent } from './settings.component';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { CoreModule } from '@alfresco/adf-core';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: SettingsComponent
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
CoreModule.forChild(),
|
||||||
|
RouterModule.forChild(routes)
|
||||||
|
],
|
||||||
|
declarations: [SettingsComponent]
|
||||||
|
})
|
||||||
|
export class AppSettingsModule {}
|
@@ -31,8 +31,8 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { AppStore } from '../../../store/states';
|
import { AppStore } from '../../../store/states';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { AppExtensionService } from '../../extension.service';
|
|
||||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||||
|
import { AppExtensionService } from '../../../extensions/extension.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'aca-toolbar-action',
|
selector: 'aca-toolbar-action',
|
@@ -0,0 +1,28 @@
|
|||||||
|
<ng-container [ngSwitch]="type">
|
||||||
|
<ng-container *ngSwitchCase="'icon-button'">
|
||||||
|
<button
|
||||||
|
[id]="actionRef.id"
|
||||||
|
mat-icon-button
|
||||||
|
color="primary"
|
||||||
|
[attr.title]="(actionRef.description || actionRef.title) | translate"
|
||||||
|
(click)="runAction()">
|
||||||
|
<mat-icon>{{ actionRef.icon }}</mat-icon>
|
||||||
|
</button>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="'menu-item'">
|
||||||
|
<button
|
||||||
|
[id]="actionRef.id"
|
||||||
|
mat-menu-item
|
||||||
|
color="primary"
|
||||||
|
[disabled]="actionRef.disabled"
|
||||||
|
[attr.title]="(
|
||||||
|
actionRef.disabled
|
||||||
|
? actionRef['description-disabled']
|
||||||
|
: actionRef.description || actionRef.title
|
||||||
|
) | translate"
|
||||||
|
(click)="runAction()">
|
||||||
|
<mat-icon>{{ actionRef.icon }}</mat-icon>
|
||||||
|
<span>{{ actionRef.title | translate }}</span>
|
||||||
|
</button>
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
@@ -25,11 +25,11 @@
|
|||||||
|
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||||
import { AppExtensionService } from '../../extension.service';
|
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { AppStore } from '../../../store/states';
|
import { AppStore } from '../../../store/states';
|
||||||
import { appSelection } from '../../../store/selectors/app.selectors';
|
import { appSelection } from '../../../store/selectors/app.selectors';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
|
import { AppExtensionService } from '../../../extensions/extension.service';
|
||||||
|
|
||||||
export enum ToolbarButtonType {
|
export enum ToolbarButtonType {
|
||||||
ICON_BUTTON = 'icon-button',
|
ICON_BUTTON = 'icon-button',
|
||||||
@@ -38,36 +38,7 @@ export enum ToolbarButtonType {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-toolbar-button',
|
selector: 'app-toolbar-button',
|
||||||
template: `
|
templateUrl: 'toolbar-button.component.html'
|
||||||
<ng-container [ngSwitch]="type">
|
|
||||||
<ng-container *ngSwitchCase="'icon-button'">
|
|
||||||
<button
|
|
||||||
[id]="actionRef.id"
|
|
||||||
mat-icon-button
|
|
||||||
color="primary"
|
|
||||||
[attr.title]="(actionRef.description || actionRef.title) | translate"
|
|
||||||
(click)="runAction()">
|
|
||||||
<mat-icon>{{ actionRef.icon }}</mat-icon>
|
|
||||||
</button>
|
|
||||||
</ng-container>
|
|
||||||
<ng-container *ngSwitchCase="'menu-item'">
|
|
||||||
<button
|
|
||||||
[id]="actionRef.id"
|
|
||||||
mat-menu-item
|
|
||||||
color="primary"
|
|
||||||
[disabled]="actionRef.disabled"
|
|
||||||
[attr.title]="(
|
|
||||||
actionRef.disabled
|
|
||||||
? actionRef['description-disabled']
|
|
||||||
: actionRef.description || actionRef.title
|
|
||||||
) | translate"
|
|
||||||
(click)="runAction()">
|
|
||||||
<mat-icon>{{ actionRef.icon }}</mat-icon>
|
|
||||||
<span>{{ actionRef.title | translate }}</span>
|
|
||||||
</button>
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
`
|
|
||||||
})
|
})
|
||||||
export class ToolbarButtonComponent {
|
export class ToolbarButtonComponent {
|
||||||
@Input() type: ToolbarButtonType = ToolbarButtonType.ICON_BUTTON;
|
@Input() type: ToolbarButtonType = ToolbarButtonType.ICON_BUTTON;
|
56
src/app/components/toolbar/toolbar.module.ts
Normal file
56
src/app/components/toolbar/toolbar.module.ts
Normal file
@@ -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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 {}
|
@@ -28,13 +28,11 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core';
|
import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core';
|
||||||
import { LayoutComponent } from '../components/layout/layout.component';
|
import { LayoutComponent } from '../components/layout/layout.component';
|
||||||
import { TrashcanComponent } from '../components/trashcan/trashcan.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 app from './evaluators/app.evaluators';
|
||||||
import * as nav from './evaluators/navigation.evaluators';
|
import * as nav from './evaluators/navigation.evaluators';
|
||||||
import { AppExtensionService } from './extension.service';
|
import { AppExtensionService } from './extension.service';
|
||||||
import { ToggleInfoDrawerComponent } from '../components/toolbar/toggle-info-drawer/toggle-info-drawer.component';
|
import { ToggleInfoDrawerComponent } from '../components/toolbar/toggle-info-drawer/toggle-info-drawer.component';
|
||||||
import { ToggleFavoriteComponent } from '../components/toolbar/toggle-favorite/toggle-favorite.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 { MetadataTabComponent } from '../components/info-drawer/metadata-tab/metadata-tab.component';
|
||||||
import { CommentsTabComponent } from '../components/info-drawer/comments-tab/comments-tab.component';
|
import { CommentsTabComponent } from '../components/info-drawer/comments-tab/comments-tab.component';
|
||||||
import { VersionsTabComponent } from '../components/info-drawer/versions-tab/versions-tab.component';
|
import { VersionsTabComponent } from '../components/info-drawer/versions-tab/versions-tab.component';
|
||||||
@@ -49,14 +47,6 @@ export function setupExtensions(service: AppExtensionService): Function {
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
CoreModule.forChild(),
|
CoreModule.forChild(),
|
||||||
ExtensionsModule.forChild()
|
ExtensionsModule.forChild()
|
||||||
],
|
|
||||||
declarations: [
|
|
||||||
ToolbarActionComponent,
|
|
||||||
ToolbarButtonComponent
|
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
ToolbarActionComponent,
|
|
||||||
ToolbarButtonComponent
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class CoreExtensionsModule {
|
export class CoreExtensionsModule {
|
||||||
|
Reference in New Issue
Block a user