diff --git a/angular.json b/angular.json index b2bec7b52..03143501d 100644 --- a/angular.json +++ b/angular.json @@ -36,6 +36,7 @@ "stylePreprocessorOptions": { "includePaths": [ "app/src/app/ui", + "app/src/app/content-plugin/ui", "node_modules" ] }, @@ -252,7 +253,7 @@ "polyfills": "app/src/polyfills.ts", "stylePreprocessorOptions": { "includePaths": [ - "app/src/app/ui", + "app/src/app/content-plugin/ui", "node_modules" ] }, diff --git a/app/src/app/app-shell/app-shell.module.ts b/app/src/app/app-shell/app-shell.module.ts new file mode 100644 index 000000000..94f110d94 --- /dev/null +++ b/app/src/app/app-shell/app-shell.module.ts @@ -0,0 +1,72 @@ +/* + * Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved. + * + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. + */ + +import { CommonModule } from '@angular/common'; +import { ModuleWithProviders, NgModule } from '@angular/core'; +import { Routes, provideRoutes, RouterModule, Route } from '@angular/router'; +import { SHELL_LAYOUT_ROUTE } from './app-shell.routes'; +import { SidenavLayoutModule } from '@alfresco/adf-core'; +import { ExtensionsModule } from '@alfresco/adf-extensions'; +import { ShellLayoutComponent } from './components/shell/shell.component'; + +export interface AppShellRoutesConfig { + shellParentRoute?: Route; + shellChildren: Routes; +} + +@NgModule({ + imports: [SidenavLayoutModule, ExtensionsModule, RouterModule.forChild([]), CommonModule], + exports: [ShellLayoutComponent], + declarations: [ShellLayoutComponent] +}) +export class AppShellModule { + static withRoutes(routes: Routes | AppShellRoutesConfig): ModuleWithProviders { + if (Array.isArray(routes)) { + return getModuleForRoutes(routes); + } + + return getModuleForRouteConfig(routes); + } +} + +function getModuleForRoutes(routes: Routes): ModuleWithProviders { + const shellLayoutRoute = SHELL_LAYOUT_ROUTE; + + routes.forEach((childRoute) => { + shellLayoutRoute.children.push(childRoute); + }); + + return { + ngModule: AppShellModule, + providers: provideRoutes([shellLayoutRoute]) + }; +} + +function getModuleForRouteConfig(config: AppShellRoutesConfig): ModuleWithProviders { + const shellLayoutRoute = SHELL_LAYOUT_ROUTE; + + const shellParentRoute = config.shellParentRoute; + const shellChildrenRoutes = config.shellChildren; + + shellLayoutRoute.children.push(...shellChildrenRoutes); + + const rootRoute = shellParentRoute ? shellParentRoute : shellLayoutRoute; + + if (config.shellParentRoute) { + if (rootRoute.children === undefined) { + rootRoute.children = []; + } + + rootRoute.children.push(shellLayoutRoute); + } + + return { + ngModule: AppShellModule, + providers: provideRoutes([rootRoute]) + }; +} diff --git a/app/src/app/app-shell/app-shell.routes.ts b/app/src/app/app-shell/app-shell.routes.ts new file mode 100644 index 000000000..86a726bcb --- /dev/null +++ b/app/src/app/app-shell/app-shell.routes.ts @@ -0,0 +1,20 @@ +/* + * Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved. + * + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. + */ + +import { InjectionToken } from '@angular/core'; +import { CanActivate, CanActivateChild, Route } from '@angular/router'; +import { ShellLayoutComponent } from './components/shell/shell.component'; + +export const SHELL_AUTH_TOKEN = new InjectionToken('SHELL_AUTH_TOKEN'); + +export const SHELL_LAYOUT_ROUTE: Route = { + path: '', + component: ShellLayoutComponent, + canActivate: [SHELL_AUTH_TOKEN], + children: [] +}; diff --git a/app/src/app/app-shell/components/shell/shell.component.html b/app/src/app/app-shell/components/shell/shell.component.html new file mode 100644 index 000000000..3cd17c11f --- /dev/null +++ b/app/src/app/app-shell/components/shell/shell.component.html @@ -0,0 +1,48 @@ + + + +
+ + +
+
+
+ + + +
+ + +
+
+
+ + + + + + +
+ + + + + diff --git a/app/src/app/app-shell/components/shell/shell.component.scss b/app/src/app/app-shell/components/shell/shell.component.scss new file mode 100644 index 000000000..776563786 --- /dev/null +++ b/app/src/app/app-shell/components/shell/shell.component.scss @@ -0,0 +1,34 @@ +.app-shell { + display: flex; + flex-direction: column; + flex: 1; + height: 100%; + overflow: hidden; + min-height: 0; + + router-outlet[name='viewer'] + * { + width: 100%; + height: 100%; + z-index: 999; + position: absolute; + top: 0; + right: 0; + background-color: white; + } + + adf-file-uploading-dialog { + z-index: 1000; + } +} + +@media screen and (max-width: 599px) { + .adf-app-title { + display: none; + } +} + +@media screen and (max-width: 719px) { + .adf-app-logo { + display: none; + } +} diff --git a/app/src/app/app-shell/components/shell/shell.component.spec.ts b/app/src/app/app-shell/components/shell/shell.component.spec.ts new file mode 100644 index 000000000..962e911a4 --- /dev/null +++ b/app/src/app/app-shell/components/shell/shell.component.spec.ts @@ -0,0 +1,169 @@ +/* + * Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved. + * + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. + */ + +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { TestBed, ComponentFixture } from '@angular/core/testing'; +import { AppConfigService, SidenavLayoutModule } from '@alfresco/adf-core'; +import { ShellLayoutComponent } from './shell.component'; +import { Store } from '@ngrx/store'; +import { Router, NavigationStart, RouterModule } from '@angular/router'; +import { of, Subject } from 'rxjs'; +import { ExtensionsModule } from '@alfresco/adf-extensions'; +import { CommonModule } from '@angular/common'; +import { ShellAppService, SHELL_APP_SERVICE } from '../../services/shell-app.service'; +import { HttpClientModule } from '@angular/common/http'; +import { TranslateService } from '@ngx-translate/core'; +import { TranslateServiceMock } from '@alfresco/aca-shared'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; + +class MockRouter { + private url = 'some-url'; + private subject = new Subject(); + events = this.subject.asObservable(); + routerState = { snapshot: { url: this.url } }; + + navigateByUrl(url: string) { + const navigationStart = new NavigationStart(0, url); + this.subject.next(navigationStart); + } +} + +describe('AppLayoutComponent', () => { + let fixture: ComponentFixture; + let component: ShellLayoutComponent; + let appConfig: AppConfigService; + let shellAppService: ShellAppService; + + beforeEach(() => { + const shellService: ShellAppService = { + pageHeading$: of('Title'), + hideSidenavConditions: [], + minimizeSidenavConditions: [], + preferencesService: { + get: (_key: string) => 'true', + set: (_key: string, _value: any) => {} + } + }; + + TestBed.configureTestingModule({ + imports: [CommonModule, NoopAnimationsModule, HttpClientModule, SidenavLayoutModule, ExtensionsModule, RouterModule.forChild([])], + providers: [ + Store, + { + provide: Router, + useClass: MockRouter + }, + { + provide: SHELL_APP_SERVICE, + useValue: shellService + }, + { provide: TranslateService, useClass: TranslateServiceMock } + ], + declarations: [ShellLayoutComponent], + schemas: [NO_ERRORS_SCHEMA] + }); + + fixture = TestBed.createComponent(ShellLayoutComponent); + component = fixture.componentInstance; + appConfig = TestBed.inject(AppConfigService); + shellAppService = TestBed.inject(SHELL_APP_SERVICE); + }); + + beforeEach(() => { + appConfig.config.languages = []; + appConfig.config.locale = 'en'; + }); + + describe('sidenav state', () => { + it('should get state from configuration', () => { + appConfig.config.sideNav = { + expandedSidenav: false, + preserveState: false + }; + + fixture.detectChanges(); + + expect(component.expandedSidenav).toBe(false); + }); + + it('should resolve state to true is no configuration', () => { + appConfig.config.sidenav = {}; + + fixture.detectChanges(); + + expect(component.expandedSidenav).toBe(true); + }); + + it('should get state from user settings as true', () => { + appConfig.config.sideNav = { + expandedSidenav: false, + preserveState: true + }; + + spyOn(shellAppService.preferencesService, 'get').and.callFake((key) => { + if (key === 'expandedSidenav') { + return 'true'; + } + return 'false'; + }); + + fixture.detectChanges(); + + expect(component.expandedSidenav).toBe(true); + }); + + it('should get state from user settings as false', () => { + appConfig.config.sidenav = { + expandedSidenav: false, + preserveState: true + }; + + spyOn(shellAppService.preferencesService, 'get').and.callFake((key) => { + if (key === 'expandedSidenav') { + return 'false'; + } + return 'true'; + }); + + fixture.detectChanges(); + + expect(component.expandedSidenav).toBe(false); + }); + }); + + it('should close menu on mobile screen size', () => { + component.minimizeSidenav = false; + component.layout.container = { + isMobileScreenSize: true, + toggleMenu: () => {} + }; + + spyOn(component.layout.container, 'toggleMenu'); + fixture.detectChanges(); + + component.hideMenu({ preventDefault: () => {} } as any); + + expect(component.layout.container.toggleMenu).toHaveBeenCalled(); + }); + + it('should close menu on mobile screen size also when minimizeSidenav true', () => { + fixture.detectChanges(); + component.minimizeSidenav = true; + component.layout.container = { + isMobileScreenSize: true, + toggleMenu: () => {} + }; + + spyOn(component.layout.container, 'toggleMenu'); + fixture.detectChanges(); + + component.hideMenu({ preventDefault: () => {} } as any); + + expect(component.layout.container.toggleMenu).toHaveBeenCalled(); + }); +}); diff --git a/app/src/app/app-shell/components/shell/shell.component.ts b/app/src/app/app-shell/components/shell/shell.component.ts new file mode 100644 index 000000000..c4a8db82c --- /dev/null +++ b/app/src/app/app-shell/components/shell/shell.component.ts @@ -0,0 +1,123 @@ +/* + * Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved. + * + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. + */ + +import { AppConfigService, SidenavLayoutComponent } from '@alfresco/adf-core'; +import { Component, Inject, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; +import { NavigationEnd, Router } from '@angular/router'; +import { Subject, Observable } from 'rxjs'; +import { filter, takeUntil, map, withLatestFrom } from 'rxjs/operators'; +import { BreakpointObserver } from '@angular/cdk/layout'; +import { Directionality } from '@angular/cdk/bidi'; +import { SHELL_APP_SERVICE, ShellAppService } from '../../services/shell-app.service'; + +@Component({ + selector: 'app-shell', + templateUrl: './shell.component.html', + styleUrls: ['./shell.component.scss'], + encapsulation: ViewEncapsulation.None, + host: { class: 'app-shell' } +}) +export class ShellLayoutComponent implements OnInit, OnDestroy { + @ViewChild('layout', { static: true }) + layout: SidenavLayoutComponent; + + onDestroy$: Subject = new Subject(); + isSmallScreen$: Observable; + + expandedSidenav: boolean; + minimizeSidenav = false; + hideSidenav = false; + direction: Directionality; + + constructor( + private router: Router, + private appConfigService: AppConfigService, + private breakpointObserver: BreakpointObserver, + @Inject(SHELL_APP_SERVICE) private shellService: ShellAppService + ) {} + + ngOnInit() { + this.isSmallScreen$ = this.breakpointObserver.observe(['(max-width: 600px)']).pipe(map((result) => result.matches)); + + this.hideSidenav = this.shellService.hideSidenavConditions.some((el) => this.router.routerState.snapshot.url.includes(el)); + this.minimizeSidenav = this.shellService.minimizeSidenavConditions.some((el) => this.router.routerState.snapshot.url.includes(el)); + + if (!this.minimizeSidenav) { + this.expandedSidenav = this.getSidenavState(); + } else { + this.expandedSidenav = false; + } + + this.router.events + .pipe( + withLatestFrom(this.isSmallScreen$), + filter(([event, isSmallScreen]) => isSmallScreen && event instanceof NavigationEnd), + takeUntil(this.onDestroy$) + ) + .subscribe(() => { + this.layout.container.sidenav.close(); + }); + + this.router.events + .pipe( + filter((event) => event instanceof NavigationEnd), + takeUntil(this.onDestroy$) + ) + .subscribe((event: NavigationEnd) => { + this.minimizeSidenav = this.shellService.minimizeSidenavConditions.some((el) => event.urlAfterRedirects.includes(el)); + this.hideSidenav = this.shellService.hideSidenavConditions.some((el) => event.urlAfterRedirects.includes(el)); + + this.updateState(); + }); + } + + ngOnDestroy() { + this.onDestroy$.next(true); + this.onDestroy$.complete(); + } + + hideMenu(event: Event) { + if (this.layout.container.isMobileScreenSize) { + event.preventDefault(); + this.layout.container.toggleMenu(); + } + } + + private updateState() { + if (this.minimizeSidenav && !this.layout.isMenuMinimized) { + this.layout.isMenuMinimized = true; + if (!this.layout.container.isMobileScreenSize) { + this.layout.container.toggleMenu(); + } + } + + if (!this.minimizeSidenav) { + if (this.getSidenavState() && this.layout.isMenuMinimized) { + this.layout.isMenuMinimized = false; + this.layout.container.toggleMenu(); + } + } + } + + onExpanded(state: boolean) { + if (!this.minimizeSidenav && this.appConfigService.get('sideNav.preserveState')) { + this.shellService.preferencesService.set('expandedSidenav', state); + } + } + + private getSidenavState(): boolean { + const expand = this.appConfigService.get('sideNav.expandedSidenav', true); + const preserveState = this.appConfigService.get('sideNav.preserveState', true); + + if (preserveState) { + return this.shellService.preferencesService.get('expandedSidenav', expand.toString()) === 'true'; + } + + return expand; + } +} diff --git a/app/src/app/app-shell/index.ts b/app/src/app/app-shell/index.ts new file mode 100644 index 000000000..e0aad68ec --- /dev/null +++ b/app/src/app/app-shell/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved. + * + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. + */ + +export * from './app-shell.module'; +export * from './services/shell-app.service'; diff --git a/app/src/app/app-shell/services/shell-app.service.ts b/app/src/app/app-shell/services/shell-app.service.ts new file mode 100644 index 000000000..c2912517a --- /dev/null +++ b/app/src/app/app-shell/services/shell-app.service.ts @@ -0,0 +1,24 @@ +/* + * Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved. + * + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. + */ + +import { InjectionToken } from '@angular/core'; +import { Observable } from 'rxjs'; + +export interface ShellPreferencesService { + set(preferenceKey: string, value: any): void; + get(preferenceKey: string, defaultValue: string): string; +} + +export interface ShellAppService { + pageHeading$: Observable; + hideSidenavConditions: string[]; + minimizeSidenavConditions: string[]; + preferencesService: ShellPreferencesService; +} + +export const SHELL_APP_SERVICE = new InjectionToken('SHELL_APP_SERVICE'); diff --git a/app/src/app/app.component.html b/app/src/app/app.component.html index 451f9d17b..8d2522a86 100644 --- a/app/src/app/app.component.html +++ b/app/src/app/app.component.html @@ -1,2 +1,2 @@ -

{{ pageHeading | translate }}

+

{{ pageHeading | async | translate }}

diff --git a/app/src/app/app.component.spec.ts b/app/src/app/app.component.spec.ts deleted file mode 100644 index ed10f3336..000000000 --- a/app/src/app/app.component.spec.ts +++ /dev/null @@ -1,105 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2020 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 { AppComponent } from './app.component'; -import { SetInitialStateAction } from '@alfresco/aca-shared/store'; -import { Router } from '@angular/router'; -import { TestBed } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; - -describe('AppComponent', () => { - let component: AppComponent; - let router: Router; - - const storeMock: any = { - dispatch: jasmine.createSpy('dispatch') - }; - - const overlayContainerMock: any = { - getContainerElement: jasmine.createSpy('getContainerElement') - }; - - const configMock: any = { - get: (key: string) => { - if (key === 'baseShareUrl') { - return 'http://localhost:4200/#/preview/s'; - } - return null; - } - }; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [RouterTestingModule.withRoutes([{ path: 'fake-path', children: [] }])] - }); - - router = TestBed.inject(Router); - - component = new AppComponent(null, router, null, storeMock, configMock, null, null, null, null, null, null, null, null, overlayContainerMock); - - storeMock.dispatch = jasmine.createSpy('dispatch'); - }); - - it('should setup baseShareUrl as per config', (done) => { - storeMock.dispatch.and.callFake((action: SetInitialStateAction) => { - expect(action.payload.sharedUrl).toBe('http://localhost:4200/#/preview/s/'); - done(); - }); - - component.loadAppSettings(); - }); - - describe('onFileUploadedError', () => { - it('should dispatch 403 error message', () => { - component.onFileUploadedError({ error: { status: 403 } } as any); - expect(storeMock.dispatch['calls'].argsFor(0)[0].payload).toBe('APP.MESSAGES.UPLOAD.ERROR.403'); - }); - - it('should dispatch 404 error message', () => { - component.onFileUploadedError({ error: { status: 404 } } as any); - expect(storeMock.dispatch['calls'].argsFor(0)[0].payload).toBe('APP.MESSAGES.UPLOAD.ERROR.404'); - }); - - it('should dispatch 409 error message', () => { - component.onFileUploadedError({ error: { status: 409 } } as any); - expect(storeMock.dispatch['calls'].argsFor(0)[0].payload).toBe('APP.MESSAGES.UPLOAD.ERROR.CONFLICT'); - }); - - it('should dispatch 500 error message', () => { - component.onFileUploadedError({ error: { status: 500 } } as any); - expect(storeMock.dispatch['calls'].argsFor(0)[0].payload).toBe('APP.MESSAGES.UPLOAD.ERROR.500'); - }); - - it('should dispatch 504 error message', () => { - component.onFileUploadedError({ error: { status: 504 } } as any); - expect(storeMock.dispatch['calls'].argsFor(0)[0].payload).toBe('APP.MESSAGES.UPLOAD.ERROR.504'); - }); - - it('should dispatch generic error message', () => { - component.onFileUploadedError({ error: { status: 999 } } as any); - expect(storeMock.dispatch['calls'].argsFor(0)[0].payload).toBe('APP.MESSAGES.UPLOAD.ERROR.GENERIC'); - }); - }); -}); diff --git a/app/src/app/app.component.ts b/app/src/app/app.component.ts deleted file mode 100644 index b2a58ecc9..000000000 --- a/app/src/app/app.component.ts +++ /dev/null @@ -1,233 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2020 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 { - AlfrescoApiService, - AppConfigService, - AuthenticationService, - FileUploadErrorEvent, - PageTitleService, - UploadService, - SharedLinksApiService -} from '@alfresco/adf-core'; -import { GroupService } from '@alfresco/adf-content-services'; -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { ActivatedRoute, Router, ActivationEnd } from '@angular/router'; -import { Store } from '@ngrx/store'; -import { - AppStore, - AppState, - SetCurrentUrlAction, - SetInitialStateAction, - SetUserProfileAction, - SnackbarErrorAction, - CloseModalDialogsAction, - SetRepositoryInfoAction, - getCustomCssPath, - getCustomWebFontPath -} from '@alfresco/aca-shared/store'; -import { filter, takeUntil } from 'rxjs/operators'; -import { RouterExtensionService, AppService, ContentApiService } from '@alfresco/aca-shared'; -import { DiscoveryEntry, GroupEntry, Group } from '@alfresco/js-api'; -import { Subject } from 'rxjs'; -import { INITIAL_APP_STATE } from './store/initial-state'; -import { OverlayContainer } from '@angular/cdk/overlay'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] -}) -export class AppComponent implements OnInit, OnDestroy { - onDestroy$: Subject = new Subject(); - pageHeading = ''; - - constructor( - private route: ActivatedRoute, - private router: Router, - private pageTitle: PageTitleService, - private store: Store, - private config: AppConfigService, - private alfrescoApiService: AlfrescoApiService, - private authenticationService: AuthenticationService, - private uploadService: UploadService, - private routerExtensionService: RouterExtensionService, - private contentApi: ContentApiService, - private appService: AppService, - private sharedLinksApiService: SharedLinksApiService, - private groupService: GroupService, - private overlayContainer: OverlayContainer - ) {} - - ngOnInit() { - this.alfrescoApiService.getInstance().on('error', (error: { status: number; response: any }) => { - if (error.status === 401 && !this.alfrescoApiService.isExcludedErrorListener(error?.response?.req?.url)) { - if (!this.authenticationService.isLoggedIn()) { - this.store.dispatch(new CloseModalDialogsAction()); - - let redirectUrl = this.route.snapshot.queryParams['redirectUrl']; - if (!redirectUrl) { - redirectUrl = this.router.url; - } - - this.router.navigate(['/login'], { - queryParams: { redirectUrl } - }); - } - } - }); - - this.loadAppSettings(); - - this.loadCustomCss(); - this.loadCustomWebFont(); - - const { router, pageTitle } = this; - - this.router.events - .pipe(filter((event) => event instanceof ActivationEnd && event.snapshot.children.length === 0)) - .subscribe((event: ActivationEnd) => { - const snapshot: any = event.snapshot || {}; - const data: any = snapshot.data || {}; - - this.pageHeading = data.title || ''; - pageTitle.setTitle(data.title || ''); - this.store.dispatch(new SetCurrentUrlAction(router.url)); - }); - - this.routerExtensionService.mapExtensionRoutes(); - - this.uploadService.fileUploadError.subscribe((error) => this.onFileUploadedError(error)); - - this.sharedLinksApiService.error.pipe(takeUntil(this.onDestroy$)).subscribe((err: { message: string }) => { - this.store.dispatch(new SnackbarErrorAction(err.message)); - }); - - this.appService.ready$.pipe(takeUntil(this.onDestroy$)).subscribe((isReady) => { - if (isReady) { - this.loadRepositoryStatus(); - this.loadUserProfile(); - } - }); - - this.overlayContainer.getContainerElement().setAttribute('role', 'region'); - } - - ngOnDestroy() { - this.onDestroy$.next(true); - this.onDestroy$.complete(); - } - - private loadRepositoryStatus() { - this.contentApi.getRepositoryInformation().subscribe((response: DiscoveryEntry) => { - this.store.dispatch(new SetRepositoryInfoAction(response.entry.repository)); - }); - } - - private async loadUserProfile() { - const groupsEntries: GroupEntry[] = await this.groupService.listAllGroupMembershipsForPerson('-me-', { maxItems: 250 }); - - const groups: Group[] = []; - - if (groupsEntries) { - groups.push(...groupsEntries.map((obj) => obj.entry)); - } - - this.contentApi.getPerson('-me-').subscribe((person) => { - this.store.dispatch(new SetUserProfileAction({ person: person.entry, groups })); - }); - } - - loadAppSettings() { - let baseShareUrl = this.config.get('baseShareUrl'); - if (!baseShareUrl.endsWith('/')) { - baseShareUrl += '/'; - } - - const state: AppState = { - ...INITIAL_APP_STATE, - appName: this.config.get('application.name'), - headerColor: this.config.get('headerColor'), - headerTextColor: this.config.get('headerTextColor', '#000000'), - logoPath: this.config.get('application.logo'), - headerImagePath: this.config.get('application.headerImagePath'), - customCssPath: this.config.get('customCssPath'), - webFontPath: this.config.get('webFontPath'), - sharedUrl: baseShareUrl - }; - - this.store.dispatch(new SetInitialStateAction(state)); - } - - onFileUploadedError(error: FileUploadErrorEvent) { - let message = 'APP.MESSAGES.UPLOAD.ERROR.GENERIC'; - - if (error.error.status === 403) { - message = 'APP.MESSAGES.UPLOAD.ERROR.403'; - } - - if (error.error.status === 404) { - message = 'APP.MESSAGES.UPLOAD.ERROR.404'; - } - - if (error.error.status === 409) { - message = 'APP.MESSAGES.UPLOAD.ERROR.CONFLICT'; - } - - if (error.error.status === 500) { - message = 'APP.MESSAGES.UPLOAD.ERROR.500'; - } - - if (error.error.status === 504) { - message = 'APP.MESSAGES.UPLOAD.ERROR.504'; - } - - this.store.dispatch(new SnackbarErrorAction(message)); - } - - private loadCustomCss(): void { - this.store.select(getCustomCssPath).subscribe((cssPath) => { - if (cssPath) { - this.createLink(cssPath); - } - }); - } - - private loadCustomWebFont(): void { - this.store.select(getCustomWebFontPath).subscribe((fontUrl) => { - if (fontUrl) { - this.createLink(fontUrl); - } - }); - } - - private createLink(url: string): void { - const cssLinkElement = document.createElement('link'); - cssLinkElement.setAttribute('rel', 'stylesheet'); - cssLinkElement.setAttribute('type', 'text/css'); - cssLinkElement.setAttribute('href', url); - document.head.appendChild(cssLinkElement); - } -} diff --git a/app/src/app/app.components.ts b/app/src/app/app.components.ts new file mode 100644 index 000000000..d65a92eaa --- /dev/null +++ b/app/src/app/app.components.ts @@ -0,0 +1,43 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2020 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 } from '@angular/core'; +import { Observable, Subject } from 'rxjs'; +import { AppService } from '@alfresco/aca-shared'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'] +}) +export class AppComponent { + onDestroy$: Subject = new Subject(); + pageHeading: Observable; + + constructor(private appService: AppService) { + this.pageHeading = this.appService.pageHeading$; + this.appService.init(); + } +} diff --git a/app/src/app/app.module.ts b/app/src/app/app.module.ts index c618cc762..02c5ebb37 100644 --- a/app/src/app/app.module.ts +++ b/app/src/app/app.module.ts @@ -23,50 +23,15 @@ * along with Alfresco. If not, see . */ -import { BrowserModule, HammerModule } from '@angular/platform-browser'; +import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { TRANSLATION_PROVIDER, CoreModule, AppConfigService, DebugAppConfigService } from '@alfresco/adf-core'; -import { ContentModule, ContentVersionService } from '@alfresco/adf-content-services'; -import { SharedModule } from '@alfresco/aca-shared'; -import { AppComponent } from './app.component'; -import { APP_ROUTES } from './app.routes'; +import { TRANSLATION_PROVIDER, AppConfigService, DebugAppConfigService, CoreModule, AuthGuard } from '@alfresco/adf-core'; +import { AppService, SharedModule } from '@alfresco/aca-shared'; -import { FilesComponent } from './components/files/files.component'; -import { LibrariesComponent } from './components/libraries/libraries.component'; -import { FavoriteLibrariesComponent } from './components/favorite-libraries/favorite-libraries.component'; -import { ViewProfileModule } from './components/view-profile/view-profile.module'; - -import { AppStoreModule } from './store/app-store.module'; -import { MaterialModule } from './material.module'; import { AppExtensionsModule } from './extensions.module'; -import { CoreExtensionsModule } from './extensions/core.extensions.module'; -import { AppInfoDrawerModule } from './components/info-drawer/info.drawer.module'; -import { DirectivesModule } from './directives/directives.module'; -import { ContextMenuModule } from './components/context-menu/context-menu.module'; -import { ExtensionsModule } from '@alfresco/adf-extensions'; -import { AppToolbarModule } from './components/toolbar/toolbar.module'; -import { AppCreateMenuModule } from './components/create-menu/create-menu.module'; -import { AppSidenavModule } from './components/sidenav/sidenav.module'; -import { AppCommonModule } from './components/common/common.module'; -import { AppLayoutModule } from './components/layout/layout.module'; -import { AppSearchInputModule } from './components/search/search-input.module'; -import { DocumentListCustomComponentsModule } from './components/dl-custom-components/document-list-custom-components.module'; -import { AppSearchResultsModule } from './components/search/search-results.module'; -import { AppLoginModule } from './components/login/login.module'; -import { AppHeaderModule } from './components/header/header.module'; -import { AppNodeVersionModule } from './components/node-version/node-version.module'; -import { FavoritesComponent } from './components/favorites/favorites.component'; -import { RecentFilesComponent } from './components/recent-files/recent-files.component'; -import { SharedFilesComponent } from './components/shared-files/shared-files.component'; -import { CreateFromTemplateDialogComponent } from './dialogs/node-template/create-from-template.dialog'; import { environment } from '../environments/environment'; -import { DetailsComponent } from './components/details/details.component'; -import { ContentUrlService } from './services/content-url.service'; -import { HomeComponent } from './components/home/home.component'; import { registerLocaleData } from '@angular/common'; import localeFr from '@angular/common/locales/fr'; @@ -85,6 +50,18 @@ import localePl from '@angular/common/locales/pl'; import localeFi from '@angular/common/locales/fi'; import localeDa from '@angular/common/locales/da'; import localeSv from '@angular/common/locales/sv'; +import { AppShellModule, SHELL_APP_SERVICE } from './app-shell'; +import { TranslateModule } from '@ngx-translate/core'; +import { RouterModule } from '@angular/router'; +import { AppComponent } from './app.components'; +import { SHELL_AUTH_TOKEN } from './app-shell/app-shell.routes'; +import { CONTENT_LAYOUT_ROUTES } from './content-plugin/content.routes'; +import { ContentServiceExtensionModule } from './content-plugin/content-services-extension.module'; +import { CoreExtensionsModule } from './extensions/core.extensions.module'; +import { INITIAL_APP_STATE } from './content-plugin/store/initial-state'; +import { ContentVersionService } from '@alfresco/adf-content-services'; +import { ContentUrlService } from './content-plugin/services/content-url.service'; +import { STORE_INITIAL_APP_DATA } from '@alfresco/aca-shared/store'; registerLocaleData(localeFr); registerLocaleData(localeDe); @@ -106,54 +83,38 @@ registerLocaleData(localeSv); @NgModule({ imports: [ BrowserModule, + TranslateModule.forRoot(), + CoreModule.forRoot(), + SharedModule.forRoot(), + CoreExtensionsModule.forRoot(), environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule, - FormsModule, - ReactiveFormsModule, - RouterModule.forRoot(APP_ROUTES, { + RouterModule.forRoot([], { useHash: true, enableTracing: false, // enable for debug only relativeLinkResolution: 'legacy' }), - MaterialModule, - CoreModule.forRoot(), - ContentModule.forRoot(), - SharedModule.forRoot(), - AppStoreModule, - CoreExtensionsModule.forRoot(), - ExtensionsModule.forRoot(), AppExtensionsModule, - AppLoginModule, - AppCommonModule, - AppLayoutModule, - DirectivesModule, - ContextMenuModule, - AppInfoDrawerModule, - AppToolbarModule, - AppSidenavModule, - AppCreateMenuModule, - DocumentListCustomComponentsModule, - AppSearchInputModule, - AppSearchResultsModule, - AppHeaderModule, - AppNodeVersionModule, - HammerModule, - ViewProfileModule - ], - declarations: [ - AppComponent, - FilesComponent, - DetailsComponent, - LibrariesComponent, - FavoriteLibrariesComponent, - FavoritesComponent, - RecentFilesComponent, - SharedFilesComponent, - CreateFromTemplateDialogComponent, - HomeComponent + AppShellModule.withRoutes({ + shellChildren: [CONTENT_LAYOUT_ROUTES] + }), + ContentServiceExtensionModule ], providers: [ + { provide: AppService, useClass: AppService }, { provide: AppConfigService, useClass: DebugAppConfigService }, { provide: ContentVersionService, useClass: ContentUrlService }, + { + provide: SHELL_APP_SERVICE, + useClass: AppService + }, + { + provide: SHELL_AUTH_TOKEN, + useClass: AuthGuard + }, + { + provide: STORE_INITIAL_APP_DATA, + useValue: INITIAL_APP_STATE + }, { provide: TRANSLATION_PROVIDER, multi: true, @@ -163,6 +124,7 @@ registerLocaleData(localeSv); } } ], + declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule {} diff --git a/app/src/app/app.routes.ts b/app/src/app/app.routes.ts deleted file mode 100644 index 251258b64..000000000 --- a/app/src/app/app.routes.ts +++ /dev/null @@ -1,575 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2020 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 { Routes } from '@angular/router'; -import { AppLayoutComponent } from './components/layout/app-layout/app-layout.component'; -import { FilesComponent } from './components/files/files.component'; -import { LibrariesComponent } from './components/libraries/libraries.component'; -import { FavoriteLibrariesComponent } from './components/favorite-libraries/favorite-libraries.component'; -import { SearchResultsComponent } from './components/search/search-results/search-results.component'; -import { SearchLibrariesResultsComponent } from './components/search/search-libraries-results/search-libraries-results.component'; -import { LoginComponent } from './components/login/login.component'; -import { AppSharedRuleGuard, GenericErrorComponent, ExtensionsDataLoaderGuard } from '@alfresco/aca-shared'; -import { AuthGuard, BlankPageComponent } from '@alfresco/adf-core'; -import { FavoritesComponent } from './components/favorites/favorites.component'; -import { RecentFilesComponent } from './components/recent-files/recent-files.component'; -import { SharedFilesComponent } from './components/shared-files/shared-files.component'; -import { DetailsComponent } from './components/details/details.component'; -import { HomeComponent } from './components/home/home.component'; -import { ViewProfileComponent } from './components/view-profile/view-profile.component'; -import { ViewProfileRuleGuard } from './components/view-profile/view-profile.guard'; - -export const APP_ROUTES: Routes = [ - { - path: 'blank', - component: BlankPageComponent - }, - { - path: 'login', - component: LoginComponent, - data: { - title: 'APP.SIGN_IN' - } - }, - { - path: 'preview/s/:id', - loadChildren: () => import('./components/shared-link-view/shared-link-view.module').then((m) => m.AppSharedLinkViewModule) - }, - { - path: 'view', - component: AppLayoutComponent, - children: [ - { - path: ':nodeId', - outlet: 'viewer', - children: [ - { - path: '', - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - } - ] - }, - { - path: '', - component: AppLayoutComponent, - canActivate: [AuthGuard, ExtensionsDataLoaderGuard], - children: [ - { - path: 'profile', - canActivate: [ViewProfileRuleGuard], - component: ViewProfileComponent - }, - { - path: '', - component: HomeComponent - }, - { - path: 'personal-files', - children: [ - { - path: '', - component: FilesComponent, - data: { - sortingPreferenceKey: 'personal-files', - title: 'APP.BROWSE.PERSONAL.TITLE', - defaultNodeId: '-my-' - } - }, - { - path: 'details/:nodeId', - children: [ - { - path: '', - component: DetailsComponent, - data: { - navigateSource: 'personal-files' - } - }, - { - path: ':activeTab', - component: DetailsComponent, - data: { - title: 'APP.BROWSE.PERSONAL.PERMISSIONS.TITLE', - navigateSource: 'personal-files' - } - } - ] - }, - // deprecated, backwards compatibility with ACA 1.8 - { - path: 'preview/:nodeId', - loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), - data: { - navigateSource: 'personal-files' - } - }, - { - path: 'view/:nodeId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'personal-files' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - }, - { - path: 'view/:nodeId/:versionId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'personal-files' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - } - ] - }, - { - path: 'personal-files/:folderId', - children: [ - { - path: '', - component: FilesComponent, - data: { - title: 'APP.BROWSE.PERSONAL.TITLE', - sortingPreferenceKey: 'personal-files' - } - }, - { - path: 'view/:nodeId/:versionId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'personal-files' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - }, - // deprecated, backwards compatibility with ACA 1.8 - { - path: 'preview/:nodeId', - loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), - data: { - navigateSource: 'personal-files' - } - }, - // deprecated, backwards compatibility with ACA 1.8 - { - path: ':folderId/preview/:nodeId', - loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), - data: { - navigateSource: 'personal-files' - } - }, - { - path: 'view/:nodeId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'personal-files' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - } - ] - }, - { - path: 'libraries', - children: [ - { - path: '', - component: LibrariesComponent, - data: { - title: 'APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.TITLE', - sortingPreferenceKey: 'libraries' - } - } - ] - }, - { - path: 'libraries/:folderId', - children: [ - { - path: '', - component: FilesComponent, - data: { - title: 'APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.TITLE', - sortingPreferenceKey: 'libraries-files' - } - }, - // deprecated, backwards compatibility with ACA 1.8 - { - path: 'preview/:nodeId', - loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), - data: { - navigateSource: 'libraries' - } - }, - { - path: 'view/:nodeId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'libraries' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - }, - { - path: 'view/:nodeId/:versionId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'libraries' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - } - ] - }, - { - path: 'favorite', - children: [ - { - path: '', - pathMatch: 'full', - redirectTo: 'libraries' - }, - { - path: 'libraries', - component: FavoriteLibrariesComponent, - data: { - title: 'APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.TITLE', - sortingPreferenceKey: 'favorite-libraries' - } - } - ] - }, - { - path: 'favorite/libraries/:folderId', - children: [ - { - path: '', - component: FilesComponent, - data: { - title: 'APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.TITLE', - sortingPreferenceKey: 'libraries-files' - } - }, - { - path: 'view/:nodeId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'libraries' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - }, - { - path: 'view/:nodeId/:versionId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'libraries' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - } - ] - }, - { - path: 'favorites', - data: { - sortingPreferenceKey: 'favorites' - }, - children: [ - { - path: '', - component: FavoritesComponent, - data: { - title: 'APP.BROWSE.FAVORITES.TITLE', - sortingPreferenceKey: 'favorites' - } - // loadChildren: - // './components/favorites/favorites.module#AppFavoritesModule' - }, - // deprecated, backwards compatibility with ACA 1.8 - { - path: 'preview/:nodeId', - loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), - data: { - navigateSource: 'favorites' - } - }, - { - path: 'view/:nodeId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'favorites' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - }, - { - path: 'view/:nodeId/:versionId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'favorites' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - } - ] - }, - { - path: 'recent-files', - data: { - sortingPreferenceKey: 'recent-files' - }, - children: [ - { - path: '', - component: RecentFilesComponent, - data: { - title: 'APP.BROWSE.RECENT.TITLE' - } - // loadChildren: - // './components/recent-files/recent-files.module#AppRecentFilesModule' - }, - // deprecated, backwards compatibility with ACA 1.8 - { - path: 'preview/:nodeId', - loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), - data: { - navigateSource: 'recent-files' - } - }, - { - path: 'view/:nodeId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'recent-files' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - }, - { - path: 'view/:nodeId/:versionId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'recent-files' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - } - ] - }, - { - path: 'shared', - children: [ - { - path: '', - data: { - title: 'APP.BROWSE.SHARED.TITLE', - sortingPreferenceKey: 'shared-files' - }, - component: SharedFilesComponent - // loadChildren: - // './components/shared-files/shared-files.module#AppSharedFilesModule' - }, - // deprecated, backwards compatibility with ACA 1.8 - { - path: 'preview/:nodeId', - loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), - data: { - navigateSource: 'shared' - } - }, - { - path: 'view/:nodeId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'shared' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - }, - { - path: 'view/:nodeId/:versionId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'shared' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - } - ], - canActivateChild: [AppSharedRuleGuard], - canActivate: [AppSharedRuleGuard] - }, - { - path: 'trashcan', - loadChildren: () => import('./components/trashcan/trashcan.module').then((m) => m.AppTrashcanModule) - }, - { - path: 'search', - children: [ - { - path: '', - component: SearchResultsComponent, - data: { - title: 'APP.BROWSE.SEARCH.TITLE' - } - }, - // deprecated, backwards compatibility with ACA 1.8 - { - path: 'preview/:nodeId', - loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), - data: { - navigateSource: 'search' - } - }, - { - path: 'view/:nodeId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'search' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - }, - { - path: 'view/:nodeId/:versionId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'search' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - } - ] - }, - { - path: 'search-libraries', - children: [ - { - path: '', - component: SearchLibrariesResultsComponent, - data: { - title: 'APP.BROWSE.SEARCH.TITLE' - } - }, - { - path: 'view/:nodeId', - outlet: 'viewer', - children: [ - { - path: '', - data: { - navigateSource: 'search' - }, - loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) - } - ] - } - ] - }, - { - path: 'nodes/:nodeId', - children: [ - { - path: '', - loadChildren: () => import('@alfresco/aca-folder-rules').then((m) => m.AcaFolderRulesModule) - } - ] - }, - { - path: '**', - component: GenericErrorComponent - } - ], - canActivateChild: [AuthGuard] - } -]; diff --git a/app/src/app/components/common/common.module.ts b/app/src/app/content-plugin/components/common/common.module.ts similarity index 100% rename from app/src/app/components/common/common.module.ts rename to app/src/app/content-plugin/components/common/common.module.ts diff --git a/app/src/app/components/common/language-picker/language-picker.component.ts b/app/src/app/content-plugin/components/common/language-picker/language-picker.component.ts similarity index 100% rename from app/src/app/components/common/language-picker/language-picker.component.ts rename to app/src/app/content-plugin/components/common/language-picker/language-picker.component.ts diff --git a/app/src/app/components/common/location-link/location-link.component.ts b/app/src/app/content-plugin/components/common/location-link/location-link.component.ts similarity index 100% rename from app/src/app/components/common/location-link/location-link.component.ts rename to app/src/app/content-plugin/components/common/location-link/location-link.component.ts diff --git a/app/src/app/components/common/logout/logout.component.spec.ts b/app/src/app/content-plugin/components/common/logout/logout.component.spec.ts similarity index 100% rename from app/src/app/components/common/logout/logout.component.spec.ts rename to app/src/app/content-plugin/components/common/logout/logout.component.spec.ts diff --git a/app/src/app/components/common/logout/logout.component.ts b/app/src/app/content-plugin/components/common/logout/logout.component.ts similarity index 100% rename from app/src/app/components/common/logout/logout.component.ts rename to app/src/app/content-plugin/components/common/logout/logout.component.ts diff --git a/app/src/app/components/common/toggle-shared/toggle-shared.component.html b/app/src/app/content-plugin/components/common/toggle-shared/toggle-shared.component.html similarity index 100% rename from app/src/app/components/common/toggle-shared/toggle-shared.component.html rename to app/src/app/content-plugin/components/common/toggle-shared/toggle-shared.component.html diff --git a/app/src/app/components/common/toggle-shared/toggle-shared.component.spec.ts b/app/src/app/content-plugin/components/common/toggle-shared/toggle-shared.component.spec.ts similarity index 100% rename from app/src/app/components/common/toggle-shared/toggle-shared.component.spec.ts rename to app/src/app/content-plugin/components/common/toggle-shared/toggle-shared.component.spec.ts diff --git a/app/src/app/components/common/toggle-shared/toggle-shared.component.ts b/app/src/app/content-plugin/components/common/toggle-shared/toggle-shared.component.ts similarity index 100% rename from app/src/app/components/common/toggle-shared/toggle-shared.component.ts rename to app/src/app/content-plugin/components/common/toggle-shared/toggle-shared.component.ts diff --git a/app/src/app/components/context-menu/context-menu-item.component.html b/app/src/app/content-plugin/components/context-menu/context-menu-item.component.html similarity index 100% rename from app/src/app/components/context-menu/context-menu-item.component.html rename to app/src/app/content-plugin/components/context-menu/context-menu-item.component.html diff --git a/app/src/app/components/context-menu/context-menu-item.component.spec.ts b/app/src/app/content-plugin/components/context-menu/context-menu-item.component.spec.ts similarity index 100% rename from app/src/app/components/context-menu/context-menu-item.component.spec.ts rename to app/src/app/content-plugin/components/context-menu/context-menu-item.component.spec.ts diff --git a/app/src/app/components/context-menu/context-menu-item.component.ts b/app/src/app/content-plugin/components/context-menu/context-menu-item.component.ts similarity index 100% rename from app/src/app/components/context-menu/context-menu-item.component.ts rename to app/src/app/content-plugin/components/context-menu/context-menu-item.component.ts diff --git a/app/src/app/components/context-menu/context-menu-outside-event.directive.spec.ts b/app/src/app/content-plugin/components/context-menu/context-menu-outside-event.directive.spec.ts similarity index 100% rename from app/src/app/components/context-menu/context-menu-outside-event.directive.spec.ts rename to app/src/app/content-plugin/components/context-menu/context-menu-outside-event.directive.spec.ts diff --git a/app/src/app/components/context-menu/context-menu-outside-event.directive.ts b/app/src/app/content-plugin/components/context-menu/context-menu-outside-event.directive.ts similarity index 100% rename from app/src/app/components/context-menu/context-menu-outside-event.directive.ts rename to app/src/app/content-plugin/components/context-menu/context-menu-outside-event.directive.ts diff --git a/app/src/app/components/context-menu/context-menu-overlay.ts b/app/src/app/content-plugin/components/context-menu/context-menu-overlay.ts similarity index 100% rename from app/src/app/components/context-menu/context-menu-overlay.ts rename to app/src/app/content-plugin/components/context-menu/context-menu-overlay.ts diff --git a/app/src/app/components/context-menu/context-menu.component.html b/app/src/app/content-plugin/components/context-menu/context-menu.component.html similarity index 100% rename from app/src/app/components/context-menu/context-menu.component.html rename to app/src/app/content-plugin/components/context-menu/context-menu.component.html diff --git a/app/src/app/components/context-menu/context-menu.component.spec.ts b/app/src/app/content-plugin/components/context-menu/context-menu.component.spec.ts similarity index 100% rename from app/src/app/components/context-menu/context-menu.component.spec.ts rename to app/src/app/content-plugin/components/context-menu/context-menu.component.spec.ts diff --git a/app/src/app/components/context-menu/context-menu.component.ts b/app/src/app/content-plugin/components/context-menu/context-menu.component.ts similarity index 100% rename from app/src/app/components/context-menu/context-menu.component.ts rename to app/src/app/content-plugin/components/context-menu/context-menu.component.ts diff --git a/app/src/app/components/context-menu/context-menu.module.ts b/app/src/app/content-plugin/components/context-menu/context-menu.module.ts similarity index 96% rename from app/src/app/components/context-menu/context-menu.module.ts rename to app/src/app/content-plugin/components/context-menu/context-menu.module.ts index 627a405f8..72378becb 100644 --- a/app/src/app/components/context-menu/context-menu.module.ts +++ b/app/src/app/content-plugin/components/context-menu/context-menu.module.ts @@ -30,7 +30,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatListModule } from '@angular/material/list'; import { MatMenuModule } from '@angular/material/menu'; -import { CoreExtensionsModule } from '../../extensions/core.extensions.module'; +import { CoreExtensionsModule } from '../../../extensions/core.extensions.module'; import { AppCommonModule } from '../common/common.module'; import { ContextMenuItemComponent } from './context-menu-item.component'; import { OutsideEventDirective } from './context-menu-outside-event.directive'; diff --git a/app/src/app/components/context-menu/context-menu.service.spec.ts b/app/src/app/content-plugin/components/context-menu/context-menu.service.spec.ts similarity index 100% rename from app/src/app/components/context-menu/context-menu.service.spec.ts rename to app/src/app/content-plugin/components/context-menu/context-menu.service.spec.ts diff --git a/app/src/app/components/context-menu/context-menu.service.ts b/app/src/app/content-plugin/components/context-menu/context-menu.service.ts similarity index 100% rename from app/src/app/components/context-menu/context-menu.service.ts rename to app/src/app/content-plugin/components/context-menu/context-menu.service.ts diff --git a/app/src/app/components/context-menu/direction.token.ts b/app/src/app/content-plugin/components/context-menu/direction.token.ts similarity index 100% rename from app/src/app/components/context-menu/direction.token.ts rename to app/src/app/content-plugin/components/context-menu/direction.token.ts diff --git a/app/src/app/components/context-menu/interfaces.ts b/app/src/app/content-plugin/components/context-menu/interfaces.ts similarity index 100% rename from app/src/app/components/context-menu/interfaces.ts rename to app/src/app/content-plugin/components/context-menu/interfaces.ts diff --git a/app/src/app/components/create-menu/create-menu.component.html b/app/src/app/content-plugin/components/create-menu/create-menu.component.html similarity index 100% rename from app/src/app/components/create-menu/create-menu.component.html rename to app/src/app/content-plugin/components/create-menu/create-menu.component.html diff --git a/app/src/app/components/create-menu/create-menu.component.scss b/app/src/app/content-plugin/components/create-menu/create-menu.component.scss similarity index 100% rename from app/src/app/components/create-menu/create-menu.component.scss rename to app/src/app/content-plugin/components/create-menu/create-menu.component.scss diff --git a/app/src/app/components/create-menu/create-menu.component.spec.ts b/app/src/app/content-plugin/components/create-menu/create-menu.component.spec.ts similarity index 100% rename from app/src/app/components/create-menu/create-menu.component.spec.ts rename to app/src/app/content-plugin/components/create-menu/create-menu.component.spec.ts diff --git a/app/src/app/components/create-menu/create-menu.component.ts b/app/src/app/content-plugin/components/create-menu/create-menu.component.ts similarity index 100% rename from app/src/app/components/create-menu/create-menu.component.ts rename to app/src/app/content-plugin/components/create-menu/create-menu.component.ts diff --git a/app/src/app/components/create-menu/create-menu.module.ts b/app/src/app/content-plugin/components/create-menu/create-menu.module.ts similarity index 100% rename from app/src/app/components/create-menu/create-menu.module.ts rename to app/src/app/content-plugin/components/create-menu/create-menu.module.ts diff --git a/app/src/app/components/details/details.component.html b/app/src/app/content-plugin/components/details/details.component.html similarity index 100% rename from app/src/app/components/details/details.component.html rename to app/src/app/content-plugin/components/details/details.component.html diff --git a/app/src/app/components/details/details.component.scss b/app/src/app/content-plugin/components/details/details.component.scss similarity index 100% rename from app/src/app/components/details/details.component.scss rename to app/src/app/content-plugin/components/details/details.component.scss diff --git a/app/src/app/components/details/details.component.spec.ts b/app/src/app/content-plugin/components/details/details.component.spec.ts similarity index 95% rename from app/src/app/components/details/details.component.spec.ts rename to app/src/app/content-plugin/components/details/details.component.spec.ts index 991d26ba9..5e282573c 100644 --- a/app/src/app/components/details/details.component.spec.ts +++ b/app/src/app/content-plugin/components/details/details.component.spec.ts @@ -26,8 +26,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AppTestingModule } from '../../testing/app-testing.module'; import { DetailsComponent } from './details.component'; -import { MetadataTabComponent } from './../info-drawer/metadata-tab/metadata-tab.component'; -import { CommentsTabComponent } from './../info-drawer/comments-tab/comments-tab.component'; +import { MetadataTabComponent } from '../info-drawer/metadata-tab/metadata-tab.component'; +import { CommentsTabComponent } from '../info-drawer/comments-tab/comments-tab.component'; import { ActivatedRoute, Router } from '@angular/router'; import { of, Subject } from 'rxjs'; import { NO_ERRORS_SCHEMA } from '@angular/core'; diff --git a/app/src/app/components/details/details.component.ts b/app/src/app/content-plugin/components/details/details.component.ts similarity index 100% rename from app/src/app/components/details/details.component.ts rename to app/src/app/content-plugin/components/details/details.component.ts diff --git a/app/src/app/components/dl-custom-components/document-list-custom-components.module.ts b/app/src/app/content-plugin/components/dl-custom-components/document-list-custom-components.module.ts similarity index 96% rename from app/src/app/components/dl-custom-components/document-list-custom-components.module.ts rename to app/src/app/content-plugin/components/dl-custom-components/document-list-custom-components.module.ts index e35445291..28aa8423f 100644 --- a/app/src/app/components/dl-custom-components/document-list-custom-components.module.ts +++ b/app/src/app/content-plugin/components/dl-custom-components/document-list-custom-components.module.ts @@ -28,7 +28,7 @@ import { NgModule } from '@angular/core'; import { CustomNameColumnComponent } from './name-column/name-column.component'; import { LockedByModule } from '@alfresco/aca-shared'; import { ContentModule } from '@alfresco/adf-content-services'; -import { MaterialModule } from '../../material.module'; +import { MaterialModule } from '../../../material.module'; import { CoreModule } from '@alfresco/adf-core'; import { ThumbnailColumnComponent } from './thumbnail-column/thumbnail-column.component'; diff --git a/app/src/app/components/dl-custom-components/name-column/name-column.component.html b/app/src/app/content-plugin/components/dl-custom-components/name-column/name-column.component.html similarity index 100% rename from app/src/app/components/dl-custom-components/name-column/name-column.component.html rename to app/src/app/content-plugin/components/dl-custom-components/name-column/name-column.component.html diff --git a/app/src/app/components/dl-custom-components/name-column/name-column.component.scss b/app/src/app/content-plugin/components/dl-custom-components/name-column/name-column.component.scss similarity index 100% rename from app/src/app/components/dl-custom-components/name-column/name-column.component.scss rename to app/src/app/content-plugin/components/dl-custom-components/name-column/name-column.component.scss diff --git a/app/src/app/components/dl-custom-components/name-column/name-column.component.spec.ts b/app/src/app/content-plugin/components/dl-custom-components/name-column/name-column.component.spec.ts similarity index 100% rename from app/src/app/components/dl-custom-components/name-column/name-column.component.spec.ts rename to app/src/app/content-plugin/components/dl-custom-components/name-column/name-column.component.spec.ts diff --git a/app/src/app/components/dl-custom-components/name-column/name-column.component.ts b/app/src/app/content-plugin/components/dl-custom-components/name-column/name-column.component.ts similarity index 100% rename from app/src/app/components/dl-custom-components/name-column/name-column.component.ts rename to app/src/app/content-plugin/components/dl-custom-components/name-column/name-column.component.ts diff --git a/app/src/app/components/dl-custom-components/thumbnail-column/thumbnail-column.component.html b/app/src/app/content-plugin/components/dl-custom-components/thumbnail-column/thumbnail-column.component.html similarity index 100% rename from app/src/app/components/dl-custom-components/thumbnail-column/thumbnail-column.component.html rename to app/src/app/content-plugin/components/dl-custom-components/thumbnail-column/thumbnail-column.component.html diff --git a/app/src/app/components/dl-custom-components/thumbnail-column/thumbnail-column.component.ts b/app/src/app/content-plugin/components/dl-custom-components/thumbnail-column/thumbnail-column.component.ts similarity index 100% rename from app/src/app/components/dl-custom-components/thumbnail-column/thumbnail-column.component.ts rename to app/src/app/content-plugin/components/dl-custom-components/thumbnail-column/thumbnail-column.component.ts diff --git a/app/src/app/components/favorite-libraries/favorite-libraries.component.html b/app/src/app/content-plugin/components/favorite-libraries/favorite-libraries.component.html similarity index 100% rename from app/src/app/components/favorite-libraries/favorite-libraries.component.html rename to app/src/app/content-plugin/components/favorite-libraries/favorite-libraries.component.html diff --git a/app/src/app/components/favorite-libraries/favorite-libraries.component.spec.ts b/app/src/app/content-plugin/components/favorite-libraries/favorite-libraries.component.spec.ts similarity index 100% rename from app/src/app/components/favorite-libraries/favorite-libraries.component.spec.ts rename to app/src/app/content-plugin/components/favorite-libraries/favorite-libraries.component.spec.ts diff --git a/app/src/app/components/favorite-libraries/favorite-libraries.component.ts b/app/src/app/content-plugin/components/favorite-libraries/favorite-libraries.component.ts similarity index 100% rename from app/src/app/components/favorite-libraries/favorite-libraries.component.ts rename to app/src/app/content-plugin/components/favorite-libraries/favorite-libraries.component.ts diff --git a/app/src/app/components/favorites/favorites.component.html b/app/src/app/content-plugin/components/favorites/favorites.component.html similarity index 100% rename from app/src/app/components/favorites/favorites.component.html rename to app/src/app/content-plugin/components/favorites/favorites.component.html diff --git a/app/src/app/components/favorites/favorites.component.spec.ts b/app/src/app/content-plugin/components/favorites/favorites.component.spec.ts similarity index 100% rename from app/src/app/components/favorites/favorites.component.spec.ts rename to app/src/app/content-plugin/components/favorites/favorites.component.spec.ts diff --git a/app/src/app/components/favorites/favorites.component.ts b/app/src/app/content-plugin/components/favorites/favorites.component.ts similarity index 100% rename from app/src/app/components/favorites/favorites.component.ts rename to app/src/app/content-plugin/components/favorites/favorites.component.ts diff --git a/app/src/app/components/files/files.component.html b/app/src/app/content-plugin/components/files/files.component.html similarity index 100% rename from app/src/app/components/files/files.component.html rename to app/src/app/content-plugin/components/files/files.component.html diff --git a/app/src/app/components/files/files.component.spec.ts b/app/src/app/content-plugin/components/files/files.component.spec.ts similarity index 100% rename from app/src/app/components/files/files.component.spec.ts rename to app/src/app/content-plugin/components/files/files.component.spec.ts diff --git a/app/src/app/components/files/files.component.ts b/app/src/app/content-plugin/components/files/files.component.ts similarity index 100% rename from app/src/app/components/files/files.component.ts rename to app/src/app/content-plugin/components/files/files.component.ts diff --git a/app/src/app/components/header/header.component.html b/app/src/app/content-plugin/components/header/header.component.html similarity index 87% rename from app/src/app/components/header/header.component.html rename to app/src/app/content-plugin/components/header/header.component.html index 05620e337..6db2b8bf7 100644 --- a/app/src/app/components/header/header.component.html +++ b/app/src/app/content-plugin/components/header/header.component.html @@ -4,8 +4,8 @@ [tooltip]="appName$ | async" [color]="headerColor$ | async" [title]="appName$ | async" - (clicked)="toggleClicked.emit($event)" - [expandedSidenav]="expandedSidenav" + (clicked)="onToggleSidenav($event)" + [expandedSidenav]="isSidenavExpanded" >
diff --git a/app/src/app/components/header/header.component.scss b/app/src/app/content-plugin/components/header/header.component.scss similarity index 100% rename from app/src/app/components/header/header.component.scss rename to app/src/app/content-plugin/components/header/header.component.scss diff --git a/app/src/app/components/header/header.component.spec.ts b/app/src/app/content-plugin/components/header/header.component.spec.ts similarity index 100% rename from app/src/app/components/header/header.component.spec.ts rename to app/src/app/content-plugin/components/header/header.component.spec.ts diff --git a/app/src/app/components/header/header.component.ts b/app/src/app/content-plugin/components/header/header.component.ts similarity index 87% rename from app/src/app/components/header/header.component.ts rename to app/src/app/content-plugin/components/header/header.component.ts index f3c8f3189..8656c2884 100644 --- a/app/src/app/components/header/header.component.ts +++ b/app/src/app/content-plugin/components/header/header.component.ts @@ -30,7 +30,7 @@ import { ContentActionRef } from '@alfresco/adf-extensions'; import { AppStore, getHeaderColor, getAppName, getLogoPath, getHeaderImagePath, getHeaderTextColor } from '@alfresco/aca-shared/store'; import { AppExtensionService } from '@alfresco/aca-shared'; import { takeUntil } from 'rxjs/operators'; -import { AppConfigService } from '@alfresco/adf-core'; +import { AppConfigService, SidenavLayoutComponent } from '@alfresco/adf-core'; import { isContentServiceEnabled } from '@alfresco/aca-shared/rules'; @Component({ @@ -42,11 +42,18 @@ import { isContentServiceEnabled } from '@alfresco/aca-shared/rules'; }) export class AppHeaderComponent implements OnInit, OnDestroy { private onDestroy$: Subject = new Subject(); + @Output() toggleClicked = new EventEmitter(); @Input() expandedSidenav = true; + @Input() data: { layout?: SidenavLayoutComponent; isMenuMinimized?: boolean } = {}; + + get isSidenavExpanded(): boolean { + return !this.data.isMenuMinimized ?? this.expandedSidenav; + } + appName$: Observable; headerColor$: Observable; headerTextColor$: Observable; @@ -55,7 +62,7 @@ export class AppHeaderComponent implements OnInit, OnDestroy { actions: Array = []; - constructor(store: Store, private appExtensions: AppExtensionService, private appConfigService: AppConfigService) { + constructor(public store: Store, private appExtensions: AppExtensionService, private appConfigService: AppConfigService) { this.headerColor$ = store.select(getHeaderColor); this.headerTextColor$ = store.select(getHeaderTextColor); this.appName$ = store.select(getAppName); @@ -80,6 +87,10 @@ export class AppHeaderComponent implements OnInit, OnDestroy { }); } + onToggleSidenav(_event: boolean): void { + this.data.layout.toggleMenu(); + } + isContentServiceEnabled(): boolean { return isContentServiceEnabled(); } diff --git a/app/src/app/components/header/header.module.ts b/app/src/app/content-plugin/components/header/header.module.ts similarity index 100% rename from app/src/app/components/header/header.module.ts rename to app/src/app/content-plugin/components/header/header.module.ts diff --git a/app/src/app/components/home/home.component.spec.ts b/app/src/app/content-plugin/components/home/home.component.spec.ts similarity index 100% rename from app/src/app/components/home/home.component.spec.ts rename to app/src/app/content-plugin/components/home/home.component.spec.ts diff --git a/app/src/app/components/home/home.component.ts b/app/src/app/content-plugin/components/home/home.component.ts similarity index 100% rename from app/src/app/components/home/home.component.ts rename to app/src/app/content-plugin/components/home/home.component.ts diff --git a/app/src/app/components/info-drawer/comments-tab/comments-tab.component.spec.ts b/app/src/app/content-plugin/components/info-drawer/comments-tab/comments-tab.component.spec.ts similarity index 100% rename from app/src/app/components/info-drawer/comments-tab/comments-tab.component.spec.ts rename to app/src/app/content-plugin/components/info-drawer/comments-tab/comments-tab.component.spec.ts diff --git a/app/src/app/components/info-drawer/comments-tab/comments-tab.component.ts b/app/src/app/content-plugin/components/info-drawer/comments-tab/comments-tab.component.ts similarity index 100% rename from app/src/app/components/info-drawer/comments-tab/comments-tab.component.ts rename to app/src/app/content-plugin/components/info-drawer/comments-tab/comments-tab.component.ts diff --git a/app/src/app/components/info-drawer/info.drawer.module.ts b/app/src/app/content-plugin/components/info-drawer/info.drawer.module.ts similarity index 97% rename from app/src/app/components/info-drawer/info.drawer.module.ts rename to app/src/app/content-plugin/components/info-drawer/info.drawer.module.ts index db5e36fb2..34e7995ae 100644 --- a/app/src/app/components/info-drawer/info.drawer.module.ts +++ b/app/src/app/content-plugin/components/info-drawer/info.drawer.module.ts @@ -29,7 +29,7 @@ import { ExtensionsModule } from '@alfresco/adf-extensions'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { DirectivesModule } from '../../directives/directives.module'; -import { MaterialModule } from '../../material.module'; +import { MaterialModule } from '../../../material.module'; import { CommentsTabComponent } from './comments-tab/comments-tab.component'; import { MetadataTabComponent } from './metadata-tab/metadata-tab.component'; import { LibraryMetadataTabComponent } from './library-metadata-tab/library-metadata-tab.component'; diff --git a/app/src/app/components/info-drawer/library-metadata-tab/library-metadata-form.component.html b/app/src/app/content-plugin/components/info-drawer/library-metadata-tab/library-metadata-form.component.html similarity index 100% rename from app/src/app/components/info-drawer/library-metadata-tab/library-metadata-form.component.html rename to app/src/app/content-plugin/components/info-drawer/library-metadata-tab/library-metadata-form.component.html diff --git a/app/src/app/components/info-drawer/library-metadata-tab/library-metadata-form.component.spec.ts b/app/src/app/content-plugin/components/info-drawer/library-metadata-tab/library-metadata-form.component.spec.ts similarity index 100% rename from app/src/app/components/info-drawer/library-metadata-tab/library-metadata-form.component.spec.ts rename to app/src/app/content-plugin/components/info-drawer/library-metadata-tab/library-metadata-form.component.spec.ts diff --git a/app/src/app/components/info-drawer/library-metadata-tab/library-metadata-form.component.ts b/app/src/app/content-plugin/components/info-drawer/library-metadata-tab/library-metadata-form.component.ts similarity index 100% rename from app/src/app/components/info-drawer/library-metadata-tab/library-metadata-form.component.ts rename to app/src/app/content-plugin/components/info-drawer/library-metadata-tab/library-metadata-form.component.ts diff --git a/app/src/app/components/info-drawer/library-metadata-tab/library-metadata-tab.component.ts b/app/src/app/content-plugin/components/info-drawer/library-metadata-tab/library-metadata-tab.component.ts similarity index 100% rename from app/src/app/components/info-drawer/library-metadata-tab/library-metadata-tab.component.ts rename to app/src/app/content-plugin/components/info-drawer/library-metadata-tab/library-metadata-tab.component.ts diff --git a/app/src/app/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts b/app/src/app/content-plugin/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts similarity index 100% rename from app/src/app/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts rename to app/src/app/content-plugin/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts diff --git a/app/src/app/components/info-drawer/metadata-tab/metadata-tab.component.ts b/app/src/app/content-plugin/components/info-drawer/metadata-tab/metadata-tab.component.ts similarity index 100% rename from app/src/app/components/info-drawer/metadata-tab/metadata-tab.component.ts rename to app/src/app/content-plugin/components/info-drawer/metadata-tab/metadata-tab.component.ts diff --git a/app/src/app/components/info-drawer/versions-tab/versions-tab.component.spec.ts b/app/src/app/content-plugin/components/info-drawer/versions-tab/versions-tab.component.spec.ts similarity index 100% rename from app/src/app/components/info-drawer/versions-tab/versions-tab.component.spec.ts rename to app/src/app/content-plugin/components/info-drawer/versions-tab/versions-tab.component.spec.ts diff --git a/app/src/app/components/info-drawer/versions-tab/versions-tab.component.ts b/app/src/app/content-plugin/components/info-drawer/versions-tab/versions-tab.component.ts similarity index 100% rename from app/src/app/components/info-drawer/versions-tab/versions-tab.component.ts rename to app/src/app/content-plugin/components/info-drawer/versions-tab/versions-tab.component.ts diff --git a/app/src/app/components/layout/app-layout/app-layout.component.html b/app/src/app/content-plugin/components/layout/app-layout/app-layout.component.html similarity index 100% rename from app/src/app/components/layout/app-layout/app-layout.component.html rename to app/src/app/content-plugin/components/layout/app-layout/app-layout.component.html diff --git a/app/src/app/components/layout/app-layout/app-layout.component.scss b/app/src/app/content-plugin/components/layout/app-layout/app-layout.component.scss similarity index 100% rename from app/src/app/components/layout/app-layout/app-layout.component.scss rename to app/src/app/content-plugin/components/layout/app-layout/app-layout.component.scss diff --git a/app/src/app/components/layout/app-layout/app-layout.component.spec.ts b/app/src/app/content-plugin/components/layout/app-layout/app-layout.component.spec.ts similarity index 100% rename from app/src/app/components/layout/app-layout/app-layout.component.spec.ts rename to app/src/app/content-plugin/components/layout/app-layout/app-layout.component.spec.ts diff --git a/app/src/app/components/layout/app-layout/app-layout.component.ts b/app/src/app/content-plugin/components/layout/app-layout/app-layout.component.ts similarity index 100% rename from app/src/app/components/layout/app-layout/app-layout.component.ts rename to app/src/app/content-plugin/components/layout/app-layout/app-layout.component.ts diff --git a/app/src/app/components/layout/layout.module.ts b/app/src/app/content-plugin/components/layout/layout.module.ts similarity index 100% rename from app/src/app/components/layout/layout.module.ts rename to app/src/app/content-plugin/components/layout/layout.module.ts diff --git a/app/src/app/components/libraries/libraries.component.html b/app/src/app/content-plugin/components/libraries/libraries.component.html similarity index 100% rename from app/src/app/components/libraries/libraries.component.html rename to app/src/app/content-plugin/components/libraries/libraries.component.html diff --git a/app/src/app/components/libraries/libraries.component.spec.ts b/app/src/app/content-plugin/components/libraries/libraries.component.spec.ts similarity index 100% rename from app/src/app/components/libraries/libraries.component.spec.ts rename to app/src/app/content-plugin/components/libraries/libraries.component.spec.ts diff --git a/app/src/app/components/libraries/libraries.component.ts b/app/src/app/content-plugin/components/libraries/libraries.component.ts similarity index 100% rename from app/src/app/components/libraries/libraries.component.ts rename to app/src/app/content-plugin/components/libraries/libraries.component.ts diff --git a/app/src/app/components/login/login.component.html b/app/src/app/content-plugin/components/login/login.component.html similarity index 100% rename from app/src/app/components/login/login.component.html rename to app/src/app/content-plugin/components/login/login.component.html diff --git a/app/src/app/components/login/login.component.ts b/app/src/app/content-plugin/components/login/login.component.ts similarity index 100% rename from app/src/app/components/login/login.component.ts rename to app/src/app/content-plugin/components/login/login.component.ts diff --git a/app/src/app/components/login/login.module.ts b/app/src/app/content-plugin/components/login/login.module.ts similarity index 89% rename from app/src/app/components/login/login.module.ts rename to app/src/app/content-plugin/components/login/login.module.ts index a5ed6f199..24e4d2202 100644 --- a/app/src/app/components/login/login.module.ts +++ b/app/src/app/content-plugin/components/login/login.module.ts @@ -27,9 +27,11 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { CoreModule } from '@alfresco/adf-core'; import { LoginComponent } from './login.component'; +import { TranslateModule } from '@ngx-translate/core'; @NgModule({ - imports: [CommonModule, CoreModule.forChild()], + imports: [CommonModule, CoreModule.forChild(), TranslateModule.forChild()], + exports: [LoginComponent], declarations: [LoginComponent] }) export class AppLoginModule {} diff --git a/app/src/app/components/main-action/main-action.component.html b/app/src/app/content-plugin/components/main-action/main-action.component.html similarity index 100% rename from app/src/app/components/main-action/main-action.component.html rename to app/src/app/content-plugin/components/main-action/main-action.component.html diff --git a/app/src/app/components/main-action/main-action.component.scss b/app/src/app/content-plugin/components/main-action/main-action.component.scss similarity index 100% rename from app/src/app/components/main-action/main-action.component.scss rename to app/src/app/content-plugin/components/main-action/main-action.component.scss diff --git a/app/src/app/components/main-action/main-action.component.spec.ts b/app/src/app/content-plugin/components/main-action/main-action.component.spec.ts similarity index 100% rename from app/src/app/components/main-action/main-action.component.spec.ts rename to app/src/app/content-plugin/components/main-action/main-action.component.spec.ts diff --git a/app/src/app/components/main-action/main-action.component.ts b/app/src/app/content-plugin/components/main-action/main-action.component.ts similarity index 100% rename from app/src/app/components/main-action/main-action.component.ts rename to app/src/app/content-plugin/components/main-action/main-action.component.ts diff --git a/app/src/app/components/main-action/main-action.module.ts b/app/src/app/content-plugin/components/main-action/main-action.module.ts similarity index 100% rename from app/src/app/components/main-action/main-action.module.ts rename to app/src/app/content-plugin/components/main-action/main-action.module.ts diff --git a/app/src/app/components/node-version/node-version-form.component.html b/app/src/app/content-plugin/components/node-version/node-version-form.component.html similarity index 100% rename from app/src/app/components/node-version/node-version-form.component.html rename to app/src/app/content-plugin/components/node-version/node-version-form.component.html diff --git a/app/src/app/components/node-version/node-version-form.component.scss b/app/src/app/content-plugin/components/node-version/node-version-form.component.scss similarity index 100% rename from app/src/app/components/node-version/node-version-form.component.scss rename to app/src/app/content-plugin/components/node-version/node-version-form.component.scss diff --git a/app/src/app/components/node-version/node-version-form.component.spec.ts b/app/src/app/content-plugin/components/node-version/node-version-form.component.spec.ts similarity index 100% rename from app/src/app/components/node-version/node-version-form.component.spec.ts rename to app/src/app/content-plugin/components/node-version/node-version-form.component.spec.ts diff --git a/app/src/app/components/node-version/node-version-form.component.ts b/app/src/app/content-plugin/components/node-version/node-version-form.component.ts similarity index 100% rename from app/src/app/components/node-version/node-version-form.component.ts rename to app/src/app/content-plugin/components/node-version/node-version-form.component.ts diff --git a/app/src/app/components/node-version/node-version.module.ts b/app/src/app/content-plugin/components/node-version/node-version.module.ts similarity index 100% rename from app/src/app/components/node-version/node-version.module.ts rename to app/src/app/content-plugin/components/node-version/node-version.module.ts diff --git a/app/src/app/components/page.component.spec.ts b/app/src/app/content-plugin/components/page.component.spec.ts similarity index 100% rename from app/src/app/components/page.component.spec.ts rename to app/src/app/content-plugin/components/page.component.spec.ts diff --git a/app/src/app/components/page.component.ts b/app/src/app/content-plugin/components/page.component.ts similarity index 100% rename from app/src/app/components/page.component.ts rename to app/src/app/content-plugin/components/page.component.ts diff --git a/app/src/app/components/preview/preview.component.html b/app/src/app/content-plugin/components/preview/preview.component.html similarity index 100% rename from app/src/app/components/preview/preview.component.html rename to app/src/app/content-plugin/components/preview/preview.component.html diff --git a/app/src/app/components/preview/preview.component.scss b/app/src/app/content-plugin/components/preview/preview.component.scss similarity index 100% rename from app/src/app/components/preview/preview.component.scss rename to app/src/app/content-plugin/components/preview/preview.component.scss diff --git a/app/src/app/components/preview/preview.component.spec.ts b/app/src/app/content-plugin/components/preview/preview.component.spec.ts similarity index 100% rename from app/src/app/components/preview/preview.component.spec.ts rename to app/src/app/content-plugin/components/preview/preview.component.spec.ts diff --git a/app/src/app/components/preview/preview.component.ts b/app/src/app/content-plugin/components/preview/preview.component.ts similarity index 100% rename from app/src/app/components/preview/preview.component.ts rename to app/src/app/content-plugin/components/preview/preview.component.ts diff --git a/app/src/app/components/preview/preview.module.ts b/app/src/app/content-plugin/components/preview/preview.module.ts similarity index 96% rename from app/src/app/components/preview/preview.module.ts rename to app/src/app/content-plugin/components/preview/preview.module.ts index 80f879c53..324601522 100644 --- a/app/src/app/components/preview/preview.module.ts +++ b/app/src/app/content-plugin/components/preview/preview.module.ts @@ -28,7 +28,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { ContentDirectiveModule } from '@alfresco/adf-content-services'; -import { CoreExtensionsModule } from '../../extensions/core.extensions.module'; +import { CoreExtensionsModule } from '../../../extensions/core.extensions.module'; import { DirectivesModule } from '../../directives/directives.module'; import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module'; import { PreviewComponent } from './preview.component'; diff --git a/app/src/app/components/recent-files/recent-files.component.html b/app/src/app/content-plugin/components/recent-files/recent-files.component.html similarity index 100% rename from app/src/app/components/recent-files/recent-files.component.html rename to app/src/app/content-plugin/components/recent-files/recent-files.component.html diff --git a/app/src/app/components/recent-files/recent-files.component.spec.ts b/app/src/app/content-plugin/components/recent-files/recent-files.component.spec.ts similarity index 100% rename from app/src/app/components/recent-files/recent-files.component.spec.ts rename to app/src/app/content-plugin/components/recent-files/recent-files.component.spec.ts diff --git a/app/src/app/components/recent-files/recent-files.component.ts b/app/src/app/content-plugin/components/recent-files/recent-files.component.ts similarity index 100% rename from app/src/app/components/recent-files/recent-files.component.ts rename to app/src/app/content-plugin/components/recent-files/recent-files.component.ts diff --git a/app/src/app/components/search/search-action-menu/search-action-menu.component.html b/app/src/app/content-plugin/components/search/search-action-menu/search-action-menu.component.html similarity index 100% rename from app/src/app/components/search/search-action-menu/search-action-menu.component.html rename to app/src/app/content-plugin/components/search/search-action-menu/search-action-menu.component.html diff --git a/app/src/app/components/search/search-action-menu/search-action-menu.component.spec.ts b/app/src/app/content-plugin/components/search/search-action-menu/search-action-menu.component.spec.ts similarity index 100% rename from app/src/app/components/search/search-action-menu/search-action-menu.component.spec.ts rename to app/src/app/content-plugin/components/search/search-action-menu/search-action-menu.component.spec.ts diff --git a/app/src/app/components/search/search-action-menu/search-action-menu.component.ts b/app/src/app/content-plugin/components/search/search-action-menu/search-action-menu.component.ts similarity index 100% rename from app/src/app/components/search/search-action-menu/search-action-menu.component.ts rename to app/src/app/content-plugin/components/search/search-action-menu/search-action-menu.component.ts diff --git a/app/src/app/components/search/search-input-control/search-input-control.component.html b/app/src/app/content-plugin/components/search/search-input-control/search-input-control.component.html similarity index 100% rename from app/src/app/components/search/search-input-control/search-input-control.component.html rename to app/src/app/content-plugin/components/search/search-input-control/search-input-control.component.html diff --git a/app/src/app/components/search/search-input-control/search-input-control.component.scss b/app/src/app/content-plugin/components/search/search-input-control/search-input-control.component.scss similarity index 100% rename from app/src/app/components/search/search-input-control/search-input-control.component.scss rename to app/src/app/content-plugin/components/search/search-input-control/search-input-control.component.scss diff --git a/app/src/app/components/search/search-input-control/search-input-control.component.spec.ts b/app/src/app/content-plugin/components/search/search-input-control/search-input-control.component.spec.ts similarity index 100% rename from app/src/app/components/search/search-input-control/search-input-control.component.spec.ts rename to app/src/app/content-plugin/components/search/search-input-control/search-input-control.component.spec.ts diff --git a/app/src/app/components/search/search-input-control/search-input-control.component.ts b/app/src/app/content-plugin/components/search/search-input-control/search-input-control.component.ts similarity index 100% rename from app/src/app/components/search/search-input-control/search-input-control.component.ts rename to app/src/app/content-plugin/components/search/search-input-control/search-input-control.component.ts diff --git a/app/src/app/components/search/search-input.module.ts b/app/src/app/content-plugin/components/search/search-input.module.ts similarity index 100% rename from app/src/app/components/search/search-input.module.ts rename to app/src/app/content-plugin/components/search/search-input.module.ts diff --git a/app/src/app/components/search/search-input/search-input.component.html b/app/src/app/content-plugin/components/search/search-input/search-input.component.html similarity index 100% rename from app/src/app/components/search/search-input/search-input.component.html rename to app/src/app/content-plugin/components/search/search-input/search-input.component.html diff --git a/app/src/app/components/search/search-input/search-input.component.scss b/app/src/app/content-plugin/components/search/search-input/search-input.component.scss similarity index 100% rename from app/src/app/components/search/search-input/search-input.component.scss rename to app/src/app/content-plugin/components/search/search-input/search-input.component.scss diff --git a/app/src/app/components/search/search-input/search-input.component.spec.ts b/app/src/app/content-plugin/components/search/search-input/search-input.component.spec.ts similarity index 100% rename from app/src/app/components/search/search-input/search-input.component.spec.ts rename to app/src/app/content-plugin/components/search/search-input/search-input.component.spec.ts diff --git a/app/src/app/components/search/search-input/search-input.component.ts b/app/src/app/content-plugin/components/search/search-input/search-input.component.ts similarity index 100% rename from app/src/app/components/search/search-input/search-input.component.ts rename to app/src/app/content-plugin/components/search/search-input/search-input.component.ts diff --git a/app/src/app/components/search/search-libraries-results/search-libraries-query-builder.service.spec.ts b/app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-query-builder.service.spec.ts similarity index 100% rename from app/src/app/components/search/search-libraries-results/search-libraries-query-builder.service.spec.ts rename to app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-query-builder.service.spec.ts diff --git a/app/src/app/components/search/search-libraries-results/search-libraries-query-builder.service.ts b/app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-query-builder.service.ts similarity index 100% rename from app/src/app/components/search/search-libraries-results/search-libraries-query-builder.service.ts rename to app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-query-builder.service.ts diff --git a/app/src/app/components/search/search-libraries-results/search-libraries-results.component.html b/app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-results.component.html similarity index 100% rename from app/src/app/components/search/search-libraries-results/search-libraries-results.component.html rename to app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-results.component.html diff --git a/app/src/app/components/search/search-libraries-results/search-libraries-results.component.scss b/app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-results.component.scss similarity index 100% rename from app/src/app/components/search/search-libraries-results/search-libraries-results.component.scss rename to app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-results.component.scss diff --git a/app/src/app/components/search/search-libraries-results/search-libraries-results.component.spec.ts b/app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-results.component.spec.ts similarity index 100% rename from app/src/app/components/search/search-libraries-results/search-libraries-results.component.spec.ts rename to app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-results.component.spec.ts diff --git a/app/src/app/components/search/search-libraries-results/search-libraries-results.component.ts b/app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-results.component.ts similarity index 100% rename from app/src/app/components/search/search-libraries-results/search-libraries-results.component.ts rename to app/src/app/content-plugin/components/search/search-libraries-results/search-libraries-results.component.ts diff --git a/app/src/app/components/search/search-results-row/search-results-row.component.html b/app/src/app/content-plugin/components/search/search-results-row/search-results-row.component.html similarity index 100% rename from app/src/app/components/search/search-results-row/search-results-row.component.html rename to app/src/app/content-plugin/components/search/search-results-row/search-results-row.component.html diff --git a/app/src/app/components/search/search-results-row/search-results-row.component.scss b/app/src/app/content-plugin/components/search/search-results-row/search-results-row.component.scss similarity index 100% rename from app/src/app/components/search/search-results-row/search-results-row.component.scss rename to app/src/app/content-plugin/components/search/search-results-row/search-results-row.component.scss diff --git a/app/src/app/components/search/search-results-row/search-results-row.component.ts b/app/src/app/content-plugin/components/search/search-results-row/search-results-row.component.ts similarity index 100% rename from app/src/app/components/search/search-results-row/search-results-row.component.ts rename to app/src/app/content-plugin/components/search/search-results-row/search-results-row.component.ts diff --git a/app/src/app/components/search/search-results-row/search-results-row.components.spec.ts b/app/src/app/content-plugin/components/search/search-results-row/search-results-row.components.spec.ts similarity index 100% rename from app/src/app/components/search/search-results-row/search-results-row.components.spec.ts rename to app/src/app/content-plugin/components/search/search-results-row/search-results-row.components.spec.ts diff --git a/app/src/app/components/search/search-results.module.ts b/app/src/app/content-plugin/components/search/search-results.module.ts similarity index 100% rename from app/src/app/components/search/search-results.module.ts rename to app/src/app/content-plugin/components/search/search-results.module.ts diff --git a/app/src/app/components/search/search-results/search-results.component.html b/app/src/app/content-plugin/components/search/search-results/search-results.component.html similarity index 100% rename from app/src/app/components/search/search-results/search-results.component.html rename to app/src/app/content-plugin/components/search/search-results/search-results.component.html diff --git a/app/src/app/components/search/search-results/search-results.component.scss b/app/src/app/content-plugin/components/search/search-results/search-results.component.scss similarity index 100% rename from app/src/app/components/search/search-results/search-results.component.scss rename to app/src/app/content-plugin/components/search/search-results/search-results.component.scss diff --git a/app/src/app/components/search/search-results/search-results.component.spec.ts b/app/src/app/content-plugin/components/search/search-results/search-results.component.spec.ts similarity index 100% rename from app/src/app/components/search/search-results/search-results.component.spec.ts rename to app/src/app/content-plugin/components/search/search-results/search-results.component.spec.ts diff --git a/app/src/app/components/search/search-results/search-results.component.ts b/app/src/app/content-plugin/components/search/search-results/search-results.component.ts similarity index 100% rename from app/src/app/components/search/search-results/search-results.component.ts rename to app/src/app/content-plugin/components/search/search-results/search-results.component.ts diff --git a/app/src/app/components/shared-files/shared-files.component.html b/app/src/app/content-plugin/components/shared-files/shared-files.component.html similarity index 100% rename from app/src/app/components/shared-files/shared-files.component.html rename to app/src/app/content-plugin/components/shared-files/shared-files.component.html diff --git a/app/src/app/components/shared-files/shared-files.component.spec.ts b/app/src/app/content-plugin/components/shared-files/shared-files.component.spec.ts similarity index 100% rename from app/src/app/components/shared-files/shared-files.component.spec.ts rename to app/src/app/content-plugin/components/shared-files/shared-files.component.spec.ts diff --git a/app/src/app/components/shared-files/shared-files.component.ts b/app/src/app/content-plugin/components/shared-files/shared-files.component.ts similarity index 100% rename from app/src/app/components/shared-files/shared-files.component.ts rename to app/src/app/content-plugin/components/shared-files/shared-files.component.ts diff --git a/app/src/app/components/shared-link-view/shared-link-view.component.html b/app/src/app/content-plugin/components/shared-link-view/shared-link-view.component.html similarity index 100% rename from app/src/app/components/shared-link-view/shared-link-view.component.html rename to app/src/app/content-plugin/components/shared-link-view/shared-link-view.component.html diff --git a/app/src/app/components/shared-link-view/shared-link-view.component.scss b/app/src/app/content-plugin/components/shared-link-view/shared-link-view.component.scss similarity index 100% rename from app/src/app/components/shared-link-view/shared-link-view.component.scss rename to app/src/app/content-plugin/components/shared-link-view/shared-link-view.component.scss diff --git a/app/src/app/components/shared-link-view/shared-link-view.component.spec.ts b/app/src/app/content-plugin/components/shared-link-view/shared-link-view.component.spec.ts similarity index 100% rename from app/src/app/components/shared-link-view/shared-link-view.component.spec.ts rename to app/src/app/content-plugin/components/shared-link-view/shared-link-view.component.spec.ts diff --git a/app/src/app/components/shared-link-view/shared-link-view.component.ts b/app/src/app/content-plugin/components/shared-link-view/shared-link-view.component.ts similarity index 100% rename from app/src/app/components/shared-link-view/shared-link-view.component.ts rename to app/src/app/content-plugin/components/shared-link-view/shared-link-view.component.ts diff --git a/app/src/app/components/shared-link-view/shared-link-view.module.ts b/app/src/app/content-plugin/components/shared-link-view/shared-link-view.module.ts similarity index 96% rename from app/src/app/components/shared-link-view/shared-link-view.module.ts rename to app/src/app/content-plugin/components/shared-link-view/shared-link-view.module.ts index 6c4b28bd9..7bb8e92e0 100644 --- a/app/src/app/components/shared-link-view/shared-link-view.module.ts +++ b/app/src/app/content-plugin/components/shared-link-view/shared-link-view.module.ts @@ -32,7 +32,7 @@ import { DirectivesModule } from '../../directives/directives.module'; import { AppCommonModule } from '../common/common.module'; import { AppToolbarModule } from '../toolbar/toolbar.module'; import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module'; -import { CoreExtensionsModule } from '../../extensions/core.extensions.module'; +import { CoreExtensionsModule } from '../../../extensions/core.extensions.module'; const routes: Routes = [ { diff --git a/app/src/app/components/sidenav/components/button-menu.component.html b/app/src/app/content-plugin/components/sidenav/components/button-menu.component.html similarity index 100% rename from app/src/app/components/sidenav/components/button-menu.component.html rename to app/src/app/content-plugin/components/sidenav/components/button-menu.component.html diff --git a/app/src/app/components/sidenav/components/button-menu.component.spec.ts b/app/src/app/content-plugin/components/sidenav/components/button-menu.component.spec.ts similarity index 100% rename from app/src/app/components/sidenav/components/button-menu.component.spec.ts rename to app/src/app/content-plugin/components/sidenav/components/button-menu.component.spec.ts diff --git a/app/src/app/components/sidenav/components/button-menu.component.ts b/app/src/app/content-plugin/components/sidenav/components/button-menu.component.ts similarity index 100% rename from app/src/app/components/sidenav/components/button-menu.component.ts rename to app/src/app/content-plugin/components/sidenav/components/button-menu.component.ts diff --git a/app/src/app/components/sidenav/components/expand-menu.component.html b/app/src/app/content-plugin/components/sidenav/components/expand-menu.component.html similarity index 100% rename from app/src/app/components/sidenav/components/expand-menu.component.html rename to app/src/app/content-plugin/components/sidenav/components/expand-menu.component.html diff --git a/app/src/app/components/sidenav/components/expand-menu.component.spec.ts b/app/src/app/content-plugin/components/sidenav/components/expand-menu.component.spec.ts similarity index 100% rename from app/src/app/components/sidenav/components/expand-menu.component.spec.ts rename to app/src/app/content-plugin/components/sidenav/components/expand-menu.component.spec.ts diff --git a/app/src/app/components/sidenav/components/expand-menu.component.ts b/app/src/app/content-plugin/components/sidenav/components/expand-menu.component.ts similarity index 100% rename from app/src/app/components/sidenav/components/expand-menu.component.ts rename to app/src/app/content-plugin/components/sidenav/components/expand-menu.component.ts diff --git a/app/src/app/components/sidenav/directives/action.directive.spec.ts b/app/src/app/content-plugin/components/sidenav/directives/action.directive.spec.ts similarity index 100% rename from app/src/app/components/sidenav/directives/action.directive.spec.ts rename to app/src/app/content-plugin/components/sidenav/directives/action.directive.spec.ts diff --git a/app/src/app/components/sidenav/directives/action.directive.ts b/app/src/app/content-plugin/components/sidenav/directives/action.directive.ts similarity index 100% rename from app/src/app/components/sidenav/directives/action.directive.ts rename to app/src/app/content-plugin/components/sidenav/directives/action.directive.ts diff --git a/app/src/app/components/sidenav/directives/active-link.directive.spec.ts b/app/src/app/content-plugin/components/sidenav/directives/active-link.directive.spec.ts similarity index 100% rename from app/src/app/components/sidenav/directives/active-link.directive.spec.ts rename to app/src/app/content-plugin/components/sidenav/directives/active-link.directive.spec.ts diff --git a/app/src/app/components/sidenav/directives/active-link.directive.ts b/app/src/app/content-plugin/components/sidenav/directives/active-link.directive.ts similarity index 100% rename from app/src/app/components/sidenav/directives/active-link.directive.ts rename to app/src/app/content-plugin/components/sidenav/directives/active-link.directive.ts diff --git a/app/src/app/components/sidenav/directives/expansion-panel.directive.spec.ts b/app/src/app/content-plugin/components/sidenav/directives/expansion-panel.directive.spec.ts similarity index 100% rename from app/src/app/components/sidenav/directives/expansion-panel.directive.spec.ts rename to app/src/app/content-plugin/components/sidenav/directives/expansion-panel.directive.spec.ts diff --git a/app/src/app/components/sidenav/directives/expansion-panel.directive.ts b/app/src/app/content-plugin/components/sidenav/directives/expansion-panel.directive.ts similarity index 100% rename from app/src/app/components/sidenav/directives/expansion-panel.directive.ts rename to app/src/app/content-plugin/components/sidenav/directives/expansion-panel.directive.ts diff --git a/app/src/app/components/sidenav/directives/menu-panel.directive.spec.ts b/app/src/app/content-plugin/components/sidenav/directives/menu-panel.directive.spec.ts similarity index 100% rename from app/src/app/components/sidenav/directives/menu-panel.directive.spec.ts rename to app/src/app/content-plugin/components/sidenav/directives/menu-panel.directive.spec.ts diff --git a/app/src/app/components/sidenav/directives/menu-panel.directive.ts b/app/src/app/content-plugin/components/sidenav/directives/menu-panel.directive.ts similarity index 100% rename from app/src/app/components/sidenav/directives/menu-panel.directive.ts rename to app/src/app/content-plugin/components/sidenav/directives/menu-panel.directive.ts diff --git a/app/src/app/content-plugin/components/sidenav/sidenav-wrapper/sidenav-wrapper.component.html b/app/src/app/content-plugin/components/sidenav/sidenav-wrapper/sidenav-wrapper.component.html new file mode 100644 index 000000000..c52e69d20 --- /dev/null +++ b/app/src/app/content-plugin/components/sidenav/sidenav-wrapper/sidenav-wrapper.component.html @@ -0,0 +1,3 @@ + diff --git a/app/src/app/content-plugin/components/sidenav/sidenav-wrapper/sidenav-wrapper.component.ts b/app/src/app/content-plugin/components/sidenav/sidenav-wrapper/sidenav-wrapper.component.ts new file mode 100644 index 000000000..2f7eed7d4 --- /dev/null +++ b/app/src/app/content-plugin/components/sidenav/sidenav-wrapper/sidenav-wrapper.component.ts @@ -0,0 +1,39 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2020 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, Input } from '@angular/core'; + +/** + * This wrapper is designated to be used with 'adf-dynamic-component'. + * It forwards the dynamic component inputs to original sidenav. + */ +@Component({ + selector: 'aca-sidenav-wrapper', + templateUrl: './sidenav-wrapper.component.html' +}) +export class SidenavWrapperComponent { + @Input() + data: { mode?: 'collapsed' | 'expanded' } = {}; +} diff --git a/app/src/app/components/sidenav/sidenav.component.html b/app/src/app/content-plugin/components/sidenav/sidenav.component.html similarity index 100% rename from app/src/app/components/sidenav/sidenav.component.html rename to app/src/app/content-plugin/components/sidenav/sidenav.component.html diff --git a/app/src/app/components/sidenav/sidenav.component.scss b/app/src/app/content-plugin/components/sidenav/sidenav.component.scss similarity index 100% rename from app/src/app/components/sidenav/sidenav.component.scss rename to app/src/app/content-plugin/components/sidenav/sidenav.component.scss diff --git a/app/src/app/components/sidenav/sidenav.component.spec.ts b/app/src/app/content-plugin/components/sidenav/sidenav.component.spec.ts similarity index 100% rename from app/src/app/components/sidenav/sidenav.component.spec.ts rename to app/src/app/content-plugin/components/sidenav/sidenav.component.spec.ts diff --git a/app/src/app/components/sidenav/sidenav.component.ts b/app/src/app/content-plugin/components/sidenav/sidenav.component.ts similarity index 100% rename from app/src/app/components/sidenav/sidenav.component.ts rename to app/src/app/content-plugin/components/sidenav/sidenav.component.ts diff --git a/app/src/app/components/sidenav/sidenav.module.ts b/app/src/app/content-plugin/components/sidenav/sidenav.module.ts similarity index 92% rename from app/src/app/components/sidenav/sidenav.module.ts rename to app/src/app/content-plugin/components/sidenav/sidenav.module.ts index 52105760f..9141060c3 100644 --- a/app/src/app/components/sidenav/sidenav.module.ts +++ b/app/src/app/content-plugin/components/sidenav/sidenav.module.ts @@ -29,7 +29,7 @@ import { CommonModule } from '@angular/common'; import { CoreModule } from '@alfresco/adf-core'; import { RouterModule } from '@angular/router'; import { ExtensionsModule } from '@alfresco/adf-extensions'; -import { CoreExtensionsModule } from '../../extensions/core.extensions.module'; +import { CoreExtensionsModule } from '../../../extensions/core.extensions.module'; import { ExpansionPanelDirective } from './directives/expansion-panel.directive'; import { MenuPanelDirective } from './directives/menu-panel.directive'; import { SidenavComponent } from './sidenav.component'; @@ -38,6 +38,7 @@ import { ExpandMenuComponent } from './components/expand-menu.component'; import { ButtonMenuComponent } from './components/button-menu.component'; import { ActionDirective } from './directives/action.directive'; import { MainActionModule } from '../main-action/main-action.module'; +import { SidenavWrapperComponent } from './sidenav-wrapper/sidenav-wrapper.component'; @NgModule({ imports: [ @@ -56,7 +57,8 @@ import { MainActionModule } from '../main-action/main-action.module'; ActionDirective, ExpandMenuComponent, ButtonMenuComponent, - SidenavComponent + SidenavComponent, + SidenavWrapperComponent ], exports: [ MenuPanelDirective, diff --git a/app/src/app/components/toolbar/document-display-mode/document-display-mode.component.spec.ts b/app/src/app/content-plugin/components/toolbar/document-display-mode/document-display-mode.component.spec.ts similarity index 100% rename from app/src/app/components/toolbar/document-display-mode/document-display-mode.component.spec.ts rename to app/src/app/content-plugin/components/toolbar/document-display-mode/document-display-mode.component.spec.ts diff --git a/app/src/app/components/toolbar/document-display-mode/document-display-mode.component.ts b/app/src/app/content-plugin/components/toolbar/document-display-mode/document-display-mode.component.ts similarity index 100% rename from app/src/app/components/toolbar/document-display-mode/document-display-mode.component.ts rename to app/src/app/content-plugin/components/toolbar/document-display-mode/document-display-mode.component.ts diff --git a/app/src/app/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.spec.ts b/app/src/app/content-plugin/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.spec.ts similarity index 100% rename from app/src/app/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.spec.ts rename to app/src/app/content-plugin/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.spec.ts diff --git a/app/src/app/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts b/app/src/app/content-plugin/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts similarity index 100% rename from app/src/app/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts rename to app/src/app/content-plugin/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts diff --git a/app/src/app/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.spec.ts b/app/src/app/content-plugin/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.spec.ts similarity index 100% rename from app/src/app/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.spec.ts rename to app/src/app/content-plugin/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.spec.ts diff --git a/app/src/app/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.ts b/app/src/app/content-plugin/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.ts similarity index 100% rename from app/src/app/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.ts rename to app/src/app/content-plugin/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.ts diff --git a/app/src/app/components/toolbar/toggle-favorite/toggle-favorite.component.spec.ts b/app/src/app/content-plugin/components/toolbar/toggle-favorite/toggle-favorite.component.spec.ts similarity index 100% rename from app/src/app/components/toolbar/toggle-favorite/toggle-favorite.component.spec.ts rename to app/src/app/content-plugin/components/toolbar/toggle-favorite/toggle-favorite.component.spec.ts diff --git a/app/src/app/components/toolbar/toggle-favorite/toggle-favorite.component.ts b/app/src/app/content-plugin/components/toolbar/toggle-favorite/toggle-favorite.component.ts similarity index 100% rename from app/src/app/components/toolbar/toggle-favorite/toggle-favorite.component.ts rename to app/src/app/content-plugin/components/toolbar/toggle-favorite/toggle-favorite.component.ts diff --git a/app/src/app/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.spec.ts b/app/src/app/content-plugin/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.spec.ts similarity index 100% rename from app/src/app/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.spec.ts rename to app/src/app/content-plugin/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.spec.ts diff --git a/app/src/app/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.ts b/app/src/app/content-plugin/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.ts similarity index 100% rename from app/src/app/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.ts rename to app/src/app/content-plugin/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.ts diff --git a/app/src/app/components/toolbar/toggle-join-library/toggle-join-library-button.component.ts b/app/src/app/content-plugin/components/toolbar/toggle-join-library/toggle-join-library-button.component.ts similarity index 100% rename from app/src/app/components/toolbar/toggle-join-library/toggle-join-library-button.component.ts rename to app/src/app/content-plugin/components/toolbar/toggle-join-library/toggle-join-library-button.component.ts diff --git a/app/src/app/components/toolbar/toggle-join-library/toggle-join-library-menu.component.ts b/app/src/app/content-plugin/components/toolbar/toggle-join-library/toggle-join-library-menu.component.ts similarity index 100% rename from app/src/app/components/toolbar/toggle-join-library/toggle-join-library-menu.component.ts rename to app/src/app/content-plugin/components/toolbar/toggle-join-library/toggle-join-library-menu.component.ts diff --git a/app/src/app/components/toolbar/toggle-join-library/toggle-join-library.component.spec.ts b/app/src/app/content-plugin/components/toolbar/toggle-join-library/toggle-join-library.component.spec.ts similarity index 100% rename from app/src/app/components/toolbar/toggle-join-library/toggle-join-library.component.spec.ts rename to app/src/app/content-plugin/components/toolbar/toggle-join-library/toggle-join-library.component.spec.ts diff --git a/app/src/app/components/toolbar/toolbar.module.ts b/app/src/app/content-plugin/components/toolbar/toolbar.module.ts similarity index 100% rename from app/src/app/components/toolbar/toolbar.module.ts rename to app/src/app/content-plugin/components/toolbar/toolbar.module.ts diff --git a/app/src/app/components/toolbar/view-node/view-node.component.spec.ts b/app/src/app/content-plugin/components/toolbar/view-node/view-node.component.spec.ts similarity index 100% rename from app/src/app/components/toolbar/view-node/view-node.component.spec.ts rename to app/src/app/content-plugin/components/toolbar/view-node/view-node.component.spec.ts diff --git a/app/src/app/components/toolbar/view-node/view-node.component.ts b/app/src/app/content-plugin/components/toolbar/view-node/view-node.component.ts similarity index 100% rename from app/src/app/components/toolbar/view-node/view-node.component.ts rename to app/src/app/content-plugin/components/toolbar/view-node/view-node.component.ts diff --git a/app/src/app/components/trashcan/trashcan.component.html b/app/src/app/content-plugin/components/trashcan/trashcan.component.html similarity index 100% rename from app/src/app/components/trashcan/trashcan.component.html rename to app/src/app/content-plugin/components/trashcan/trashcan.component.html diff --git a/app/src/app/components/trashcan/trashcan.component.spec.ts b/app/src/app/content-plugin/components/trashcan/trashcan.component.spec.ts similarity index 100% rename from app/src/app/components/trashcan/trashcan.component.spec.ts rename to app/src/app/content-plugin/components/trashcan/trashcan.component.spec.ts diff --git a/app/src/app/components/trashcan/trashcan.component.ts b/app/src/app/content-plugin/components/trashcan/trashcan.component.ts similarity index 100% rename from app/src/app/components/trashcan/trashcan.component.ts rename to app/src/app/content-plugin/components/trashcan/trashcan.component.ts diff --git a/app/src/app/components/trashcan/trashcan.module.ts b/app/src/app/content-plugin/components/trashcan/trashcan.module.ts similarity index 100% rename from app/src/app/components/trashcan/trashcan.module.ts rename to app/src/app/content-plugin/components/trashcan/trashcan.module.ts diff --git a/app/src/app/content-plugin/components/upload-files-dialog/upload-files-dialog.component.html b/app/src/app/content-plugin/components/upload-files-dialog/upload-files-dialog.component.html new file mode 100644 index 000000000..9706ced53 --- /dev/null +++ b/app/src/app/content-plugin/components/upload-files-dialog/upload-files-dialog.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/app/src/app/content-plugin/components/upload-files-dialog/upload-files-dialog.component.ts b/app/src/app/content-plugin/components/upload-files-dialog/upload-files-dialog.component.ts new file mode 100644 index 000000000..db773565d --- /dev/null +++ b/app/src/app/content-plugin/components/upload-files-dialog/upload-files-dialog.component.ts @@ -0,0 +1,33 @@ +/* + * Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved. + * + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. + */ + +import { Component, OnDestroy, ViewEncapsulation } from '@angular/core'; +import { Observable, Subject } from 'rxjs'; +import { delay, takeUntil } from 'rxjs/operators'; +import { Store } from '@ngrx/store'; +import { AppStore, getFileUploadingDialog } from '@alfresco/aca-shared/store'; + +@Component({ + selector: 'aca-upload-files-dialog', + templateUrl: './upload-files-dialog.component.html', + encapsulation: ViewEncapsulation.None +}) +export class UploadFilesDialogComponent implements OnDestroy { + showFileUploadingDialog$: Observable; + + private onDestroy$: Subject = new Subject(); + + constructor(private store: Store) { + this.showFileUploadingDialog$ = this.store.select(getFileUploadingDialog).pipe(delay(0), takeUntil(this.onDestroy$)); + } + + ngOnDestroy() { + this.onDestroy$.next(true); + this.onDestroy$.complete(); + } +} diff --git a/app/src/app/components/view-profile/view-profile.component.html b/app/src/app/content-plugin/components/view-profile/view-profile.component.html similarity index 100% rename from app/src/app/components/view-profile/view-profile.component.html rename to app/src/app/content-plugin/components/view-profile/view-profile.component.html diff --git a/app/src/app/components/view-profile/view-profile.component.scss b/app/src/app/content-plugin/components/view-profile/view-profile.component.scss similarity index 100% rename from app/src/app/components/view-profile/view-profile.component.scss rename to app/src/app/content-plugin/components/view-profile/view-profile.component.scss diff --git a/app/src/app/components/view-profile/view-profile.component.spec.ts b/app/src/app/content-plugin/components/view-profile/view-profile.component.spec.ts similarity index 100% rename from app/src/app/components/view-profile/view-profile.component.spec.ts rename to app/src/app/content-plugin/components/view-profile/view-profile.component.spec.ts diff --git a/app/src/app/components/view-profile/view-profile.component.ts b/app/src/app/content-plugin/components/view-profile/view-profile.component.ts similarity index 100% rename from app/src/app/components/view-profile/view-profile.component.ts rename to app/src/app/content-plugin/components/view-profile/view-profile.component.ts diff --git a/app/src/app/components/view-profile/view-profile.guard.ts b/app/src/app/content-plugin/components/view-profile/view-profile.guard.ts similarity index 100% rename from app/src/app/components/view-profile/view-profile.guard.ts rename to app/src/app/content-plugin/components/view-profile/view-profile.guard.ts diff --git a/app/src/app/components/view-profile/view-profile.module.ts b/app/src/app/content-plugin/components/view-profile/view-profile.module.ts similarity index 100% rename from app/src/app/components/view-profile/view-profile.module.ts rename to app/src/app/content-plugin/components/view-profile/view-profile.module.ts diff --git a/app/src/app/components/viewer/viewer.component.html b/app/src/app/content-plugin/components/viewer/viewer.component.html similarity index 100% rename from app/src/app/components/viewer/viewer.component.html rename to app/src/app/content-plugin/components/viewer/viewer.component.html diff --git a/app/src/app/components/viewer/viewer.component.scss b/app/src/app/content-plugin/components/viewer/viewer.component.scss similarity index 100% rename from app/src/app/components/viewer/viewer.component.scss rename to app/src/app/content-plugin/components/viewer/viewer.component.scss diff --git a/app/src/app/components/viewer/viewer.component.ts b/app/src/app/content-plugin/components/viewer/viewer.component.ts similarity index 100% rename from app/src/app/components/viewer/viewer.component.ts rename to app/src/app/content-plugin/components/viewer/viewer.component.ts diff --git a/app/src/app/components/viewer/viewer.module.ts b/app/src/app/content-plugin/components/viewer/viewer.module.ts similarity index 96% rename from app/src/app/components/viewer/viewer.module.ts rename to app/src/app/content-plugin/components/viewer/viewer.module.ts index da783d3a3..f7c60b4cb 100644 --- a/app/src/app/components/viewer/viewer.module.ts +++ b/app/src/app/content-plugin/components/viewer/viewer.module.ts @@ -30,7 +30,7 @@ import { CoreModule } from '@alfresco/adf-core'; import { ContentDirectiveModule } from '@alfresco/adf-content-services'; import { DirectivesModule } from '../../directives/directives.module'; import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module'; -import { CoreExtensionsModule } from '../../extensions/core.extensions.module'; +import { CoreExtensionsModule } from '../../../extensions/core.extensions.module'; import { AppToolbarModule } from '../toolbar/toolbar.module'; import { AppViewerComponent } from './viewer.component'; diff --git a/app/src/app/content-plugin/content-services-extension.module.ts b/app/src/app/content-plugin/content-services-extension.module.ts new file mode 100644 index 000000000..d1d18f631 --- /dev/null +++ b/app/src/app/content-plugin/content-services-extension.module.ts @@ -0,0 +1,300 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2020 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 { BrowserModule, HammerModule } from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { + TRANSLATION_PROVIDER, + CoreModule, + AppConfigService, + DebugAppConfigService, + AuthGuardEcm, + LanguagePickerComponent, + NotificationHistoryComponent, + UserInfoComponent +} from '@alfresco/adf-core'; +import { + ContentModule, + ContentVersionService, + LibraryNameColumnComponent, + LibraryRoleColumnComponent, + LibraryStatusColumnComponent, + TrashcanNameColumnComponent +} from '@alfresco/adf-content-services'; +import { ExtensionsDataLoaderGuard, RouterExtensionService, SharedModule } from '@alfresco/aca-shared'; +import * as rules from '@alfresco/aca-shared/rules'; + +import { FilesComponent } from './components/files/files.component'; +import { LibrariesComponent } from './components/libraries/libraries.component'; +import { FavoriteLibrariesComponent } from './components/favorite-libraries/favorite-libraries.component'; +import { ViewProfileModule } from './components/view-profile/view-profile.module'; + +import { AppStoreModule } from './store/app-store.module'; +import { MaterialModule } from '../material.module'; +import { CoreExtensionsModule } from '../extensions/core.extensions.module'; +import { AppInfoDrawerModule } from './components/info-drawer/info.drawer.module'; +import { DirectivesModule } from './directives/directives.module'; +import { ContextMenuModule } from './components/context-menu/context-menu.module'; +import { ExtensionService, ExtensionsModule } from '@alfresco/adf-extensions'; +import { AppToolbarModule } from './components/toolbar/toolbar.module'; +import { AppCreateMenuModule } from './components/create-menu/create-menu.module'; +import { AppSidenavModule } from './components/sidenav/sidenav.module'; +import { AppCommonModule } from './components/common/common.module'; +import { AppLayoutModule } from './components/layout/layout.module'; +import { AppSearchInputModule } from './components/search/search-input.module'; +import { DocumentListCustomComponentsModule } from './components/dl-custom-components/document-list-custom-components.module'; +import { AppSearchResultsModule } from './components/search/search-results.module'; +import { AppLoginModule } from './components/login/login.module'; +import { AppHeaderModule } from './components/header/header.module'; +import { AppNodeVersionModule } from './components/node-version/node-version.module'; +import { FavoritesComponent } from './components/favorites/favorites.component'; +import { RecentFilesComponent } from './components/recent-files/recent-files.component'; +import { SharedFilesComponent } from './components/shared-files/shared-files.component'; +import { CreateFromTemplateDialogComponent } from './dialogs/node-template/create-from-template.dialog'; +import { environment } from '../../environments/environment'; +import { DetailsComponent } from './components/details/details.component'; +import { ContentUrlService } from './services/content-url.service'; +import { HomeComponent } from './components/home/home.component'; + +import { registerLocaleData } from '@angular/common'; +import localeFr from '@angular/common/locales/fr'; +import localeDe from '@angular/common/locales/de'; +import localeIt from '@angular/common/locales/it'; +import localeEs from '@angular/common/locales/es'; +import localeJa from '@angular/common/locales/ja'; +import localeNl from '@angular/common/locales/nl'; +import localePt from '@angular/common/locales/pt'; +import localeNb from '@angular/common/locales/nb'; +import localeRu from '@angular/common/locales/ru'; +import localeCh from '@angular/common/locales/zh'; +import localeAr from '@angular/common/locales/ar'; +import localeCs from '@angular/common/locales/cs'; +import localePl from '@angular/common/locales/pl'; +import localeFi from '@angular/common/locales/fi'; +import localeDa from '@angular/common/locales/da'; +import localeSv from '@angular/common/locales/sv'; +import { LocationLinkComponent } from './components/common/location-link/location-link.component'; +import { LogoutComponent } from './components/common/logout/logout.component'; +import { ToggleSharedComponent } from './components/common/toggle-shared/toggle-shared.component'; +import { CustomNameColumnComponent } from './components/dl-custom-components/name-column/name-column.component'; +import { AppHeaderComponent } from './components/header/header.component'; +import { CommentsTabComponent } from './components/info-drawer/comments-tab/comments-tab.component'; +import { LibraryMetadataTabComponent } from './components/info-drawer/library-metadata-tab/library-metadata-tab.component'; +import { MetadataTabComponent } from './components/info-drawer/metadata-tab/metadata-tab.component'; +import { VersionsTabComponent } from './components/info-drawer/versions-tab/versions-tab.component'; +import { PreviewComponent } from './components/preview/preview.component'; +import { DocumentDisplayModeComponent } from './components/toolbar/document-display-mode/document-display-mode.component'; +import { ToggleEditOfflineComponent } from './components/toolbar/toggle-edit-offline/toggle-edit-offline.component'; +import { ToggleFavoriteLibraryComponent } from './components/toolbar/toggle-favorite-library/toggle-favorite-library.component'; +import { ToggleFavoriteComponent } from './components/toolbar/toggle-favorite/toggle-favorite.component'; +import { ToggleInfoDrawerComponent } from './components/toolbar/toggle-info-drawer/toggle-info-drawer.component'; +import { ToggleJoinLibraryButtonComponent } from './components/toolbar/toggle-join-library/toggle-join-library-button.component'; +import { ToggleJoinLibraryMenuComponent } from './components/toolbar/toggle-join-library/toggle-join-library-menu.component'; +import { ViewNodeComponent } from './components/toolbar/view-node/view-node.component'; +import { CONTENT_ROUTES } from './content.routes'; +import { RouterModule } from '@angular/router'; +import { UploadFilesDialogComponent } from './components/upload-files-dialog/upload-files-dialog.component'; +import { SidenavWrapperComponent } from './components/sidenav/sidenav-wrapper/sidenav-wrapper.component'; + +registerLocaleData(localeFr); +registerLocaleData(localeDe); +registerLocaleData(localeIt); +registerLocaleData(localeEs); +registerLocaleData(localeJa); +registerLocaleData(localeNl); +registerLocaleData(localePt); +registerLocaleData(localeNb); +registerLocaleData(localeRu); +registerLocaleData(localeCh); +registerLocaleData(localeAr); +registerLocaleData(localeCs); +registerLocaleData(localePl); +registerLocaleData(localeFi); +registerLocaleData(localeDa); +registerLocaleData(localeSv); + +@NgModule({ + imports: [ + BrowserModule, + environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule, + FormsModule, + ReactiveFormsModule, + ContentModule.forRoot(), + RouterModule.forChild(CONTENT_ROUTES), + CoreModule.forChild(), + ExtensionsModule.forChild(), + CoreExtensionsModule.forChild(), + SharedModule, + MaterialModule, + AppStoreModule, + AppLoginModule, + AppCommonModule, + AppLayoutModule, + DirectivesModule, + ContextMenuModule, + AppInfoDrawerModule, + AppToolbarModule, + AppSidenavModule, + AppCreateMenuModule, + DocumentListCustomComponentsModule, + AppSearchInputModule, + AppSearchResultsModule, + AppHeaderModule, + AppNodeVersionModule, + HammerModule, + ViewProfileModule + ], + declarations: [ + FilesComponent, + DetailsComponent, + LibrariesComponent, + FavoriteLibrariesComponent, + FavoritesComponent, + RecentFilesComponent, + SharedFilesComponent, + CreateFromTemplateDialogComponent, + HomeComponent, + UploadFilesDialogComponent + ], + providers: [ + { provide: AppConfigService, useClass: DebugAppConfigService }, + { provide: ContentVersionService, useClass: ContentUrlService }, + { + provide: TRANSLATION_PROVIDER, + multi: true, + useValue: { + name: 'app', + source: 'assets' + } + } + ] +}) +export class ContentServiceExtensionModule { + constructor(public extensions: ExtensionService, public routeExtensionService: RouterExtensionService) { + extensions.setAuthGuards({ + 'app.auth': AuthGuardEcm, + 'app.extensions.dataLoaderGuard': ExtensionsDataLoaderGuard + }); + + extensions.setComponents({ + 'app.layout.header': AppHeaderComponent, + 'app.layout.sidenav': SidenavWrapperComponent, + 'app.shell.sibling': UploadFilesDialogComponent, + 'app.components.tabs.metadata': MetadataTabComponent, + 'app.components.tabs.library.metadata': LibraryMetadataTabComponent, + 'app.components.tabs.comments': CommentsTabComponent, + 'app.components.tabs.versions': VersionsTabComponent, + 'app.components.preview': PreviewComponent, + 'app.toolbar.toggleInfoDrawer': ToggleInfoDrawerComponent, + 'app.toolbar.toggleFavorite': ToggleFavoriteComponent, + 'app.toolbar.toggleFavoriteLibrary': ToggleFavoriteLibraryComponent, + 'app.toolbar.toggleJoinLibrary': ToggleJoinLibraryButtonComponent, + 'app.toolbar.cardView': DocumentDisplayModeComponent, + 'app.menu.toggleJoinLibrary': ToggleJoinLibraryMenuComponent, + 'app.shared-link.toggleSharedLink': ToggleSharedComponent, + 'app.columns.name': CustomNameColumnComponent, + 'app.columns.libraryName': LibraryNameColumnComponent, + 'app.columns.libraryRole': LibraryRoleColumnComponent, + 'app.columns.libraryStatus': LibraryStatusColumnComponent, + 'app.columns.trashcanName': TrashcanNameColumnComponent, + 'app.columns.location': LocationLinkComponent, + 'app.toolbar.toggleEditOffline': ToggleEditOfflineComponent, + 'app.toolbar.viewNode': ViewNodeComponent, + 'app.languagePicker': LanguagePickerComponent, + 'app.logout': LogoutComponent, + 'app.user': UserInfoComponent, + 'app.notification-center': NotificationHistoryComponent + }); + + extensions.setEvaluators({ + canCopyNode: rules.canCopyNode, + canToggleJoinLibrary: rules.canToggleJoinLibrary, + canEditFolder: rules.canEditFolder, + isTrashcanItemSelected: rules.isTrashcanItemSelected, + canViewFile: rules.canViewFile, + canLeaveLibrary: rules.canLeaveLibrary, + canToggleSharedLink: rules.canToggleSharedLink, + canShowInfoDrawer: rules.canShowInfoDrawer, + canManageFileVersions: rules.canManageFileVersions, + canManagePermissions: rules.canManagePermissions, + canToggleEditOffline: rules.canToggleEditOffline, + canToggleFavorite: rules.canToggleFavorite, + isLibraryManager: rules.isLibraryManager, + canEditAspects: rules.canEditAspects, + canInfoPreview: rules.canInfoPreview, + showInfoSelectionButton: rules.showInfoSelectionButton, + + 'app.selection.canDelete': rules.canDeleteSelection, + 'app.selection.file.canUnlock': rules.canUnlockFile, + 'app.selection.file.canLock': rules.canLockFile, + 'app.selection.canDownload': rules.canDownloadSelection, + 'app.selection.notEmpty': rules.hasSelection, + 'app.selection.canUnshare': rules.canUnshareNodes, + 'app.selection.canAddFavorite': rules.canAddFavorite, + 'app.selection.canRemoveFavorite': rules.canRemoveFavorite, + 'app.selection.first.canUpdate': rules.canUpdateSelectedNode, + 'app.selection.file': rules.hasFileSelected, + 'app.selection.file.canShare': rules.canShareFile, + 'app.selection.file.isShared': rules.isShared, + 'app.selection.file.isLocked': rules.hasLockedFiles, + 'app.selection.file.isLockOwner': rules.isUserWriteLockOwner, + 'app.selection.file.canUploadVersion': rules.canUploadVersion, + 'app.selection.library': rules.hasLibrarySelected, + 'app.selection.isPrivateLibrary': rules.isPrivateLibrary, + 'app.selection.hasLibraryRole': rules.hasLibraryRole, + 'app.selection.hasNoLibraryRole': rules.hasNoLibraryRole, + 'app.selection.folder': rules.hasFolderSelected, + 'app.selection.folder.canUpdate': rules.canUpdateSelectedFolder, + + 'app.navigation.folder.canCreate': rules.canCreateFolder, + 'app.navigation.folder.canUpload': rules.canUpload, + 'app.navigation.isTrashcan': rules.isTrashcan, + 'app.navigation.isNotTrashcan': rules.isNotTrashcan, + 'app.navigation.isLibraries': rules.isLibraries, + 'app.navigation.isLibraryFiles': rules.isLibraryFiles, + 'app.navigation.isPersonalFiles': rules.isPersonalFiles, + 'app.navigation.isNotLibraries': rules.isNotLibraries, + 'app.navigation.isSharedFiles': rules.isSharedFiles, + 'app.navigation.isNotSharedFiles': rules.isNotSharedFiles, + 'app.navigation.isFavorites': rules.isFavorites, + 'app.navigation.isNotFavorites': rules.isNotFavorites, + 'app.navigation.isRecentFiles': rules.isRecentFiles, + 'app.navigation.isNotRecentFiles': rules.isNotRecentFiles, + 'app.navigation.isSearchResults': rules.isSearchResults, + 'app.navigation.isNotSearchResults': rules.isNotSearchResults, + 'app.navigation.isPreview': rules.isPreview, + 'app.navigation.isSharedPreview': rules.isSharedPreview, + 'app.navigation.isFavoritesPreview': rules.isFavoritesPreview, + 'app.navigation.isSharedFileViewer': rules.isSharedFileViewer, + + 'repository.isQuickShareEnabled': rules.hasQuickShareEnabled, + 'user.isAdmin': rules.isAdmin, + 'app.canShowLogout': rules.canShowLogout, + 'app.isContentServiceEnabled': rules.isContentServiceEnabled + }); + } +} diff --git a/app/src/app/content-plugin/content.routes.ts b/app/src/app/content-plugin/content.routes.ts new file mode 100644 index 000000000..92140c037 --- /dev/null +++ b/app/src/app/content-plugin/content.routes.ts @@ -0,0 +1,575 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2020 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 { AppLayoutComponent } from './components/layout/app-layout/app-layout.component'; +import { FilesComponent } from './components/files/files.component'; +import { LibrariesComponent } from './components/libraries/libraries.component'; +import { FavoriteLibrariesComponent } from './components/favorite-libraries/favorite-libraries.component'; +import { SearchResultsComponent } from './components/search/search-results/search-results.component'; +import { SearchLibrariesResultsComponent } from './components/search/search-libraries-results/search-libraries-results.component'; +import { AppSharedRuleGuard, GenericErrorComponent, ExtensionRoute, ExtensionsDataLoaderGuard } from '@alfresco/aca-shared'; +import { AuthGuard, BlankPageComponent } from '@alfresco/adf-core'; +import { FavoritesComponent } from './components/favorites/favorites.component'; +import { RecentFilesComponent } from './components/recent-files/recent-files.component'; +import { SharedFilesComponent } from './components/shared-files/shared-files.component'; +import { DetailsComponent } from './components/details/details.component'; +import { HomeComponent } from './components/home/home.component'; +import { ViewProfileComponent } from './components/view-profile/view-profile.component'; +import { ViewProfileRuleGuard } from './components/view-profile/view-profile.guard'; +import { LoginComponent } from './components/login/login.component'; +import { Route } from '@angular/router'; + +export const CONTENT_ROUTES: ExtensionRoute[] = [ + { + path: 'blank', + component: BlankPageComponent + }, + { + path: 'preview/s/:id', + loadChildren: () => import('./components/shared-link-view/shared-link-view.module').then((m) => m.AppSharedLinkViewModule) + }, + { + path: 'login', + component: LoginComponent, + data: { + title: 'APP.SIGN_IN' + } + }, + { + path: 'view', + component: AppLayoutComponent, + children: [ + { + path: ':nodeId', + outlet: 'viewer', + children: [ + { + path: '', + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + } + ] + } +]; + +export const CONTENT_LAYOUT_ROUTES: Route = { + path: '', + canActivate: [ExtensionsDataLoaderGuard], + children: [ + { + path: 'profile', + canActivate: [ViewProfileRuleGuard], + component: ViewProfileComponent + }, + { + path: '', + component: HomeComponent + }, + { + path: 'personal-files', + children: [ + { + path: '', + component: FilesComponent, + data: { + sortingPreferenceKey: 'personal-files', + title: 'APP.BROWSE.PERSONAL.TITLE', + defaultNodeId: '-my-' + } + }, + { + path: 'details/:nodeId', + children: [ + { + path: '', + component: DetailsComponent, + data: { + navigateSource: 'personal-files' + } + }, + { + path: ':activeTab', + component: DetailsComponent, + data: { + title: 'APP.BROWSE.PERSONAL.PERMISSIONS.TITLE', + navigateSource: 'personal-files' + } + } + ] + }, + // deprecated, backwards compatibility with ACA 1.8 + { + path: 'preview/:nodeId', + loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), + data: { + navigateSource: 'personal-files' + } + }, + { + path: 'view/:nodeId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'personal-files' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + }, + { + path: 'view/:nodeId/:versionId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'personal-files' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + } + ] + }, + { + path: 'personal-files/:folderId', + children: [ + { + path: '', + component: FilesComponent, + data: { + title: 'APP.BROWSE.PERSONAL.TITLE', + sortingPreferenceKey: 'personal-files' + } + }, + { + path: 'view/:nodeId/:versionId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'personal-files' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + }, + // deprecated, backwards compatibility with ACA 1.8 + { + path: 'preview/:nodeId', + loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), + data: { + navigateSource: 'personal-files' + } + }, + // deprecated, backwards compatibility with ACA 1.8 + { + path: ':folderId/preview/:nodeId', + loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), + data: { + navigateSource: 'personal-files' + } + }, + { + path: 'view/:nodeId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'personal-files' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + } + ] + }, + { + path: 'libraries', + children: [ + { + path: '', + component: LibrariesComponent, + data: { + title: 'APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.TITLE', + sortingPreferenceKey: 'libraries' + } + } + ] + }, + { + path: 'libraries/:folderId', + children: [ + { + path: '', + component: FilesComponent, + data: { + title: 'APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.TITLE', + sortingPreferenceKey: 'libraries-files' + } + }, + // deprecated, backwards compatibility with ACA 1.8 + { + path: 'preview/:nodeId', + loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), + data: { + navigateSource: 'libraries' + } + }, + { + path: 'view/:nodeId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'libraries' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + }, + { + path: 'view/:nodeId/:versionId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'libraries' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + } + ] + }, + { + path: 'favorite', + children: [ + { + path: '', + pathMatch: 'full', + redirectTo: 'libraries' + }, + { + path: 'libraries', + component: FavoriteLibrariesComponent, + data: { + title: 'APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.TITLE', + sortingPreferenceKey: 'favorite-libraries' + } + } + ] + }, + { + path: 'favorite/libraries/:folderId', + children: [ + { + path: '', + component: FilesComponent, + data: { + title: 'APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.TITLE', + sortingPreferenceKey: 'libraries-files' + } + }, + { + path: 'view/:nodeId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'libraries' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + }, + { + path: 'view/:nodeId/:versionId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'libraries' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + } + ] + }, + { + path: 'favorites', + data: { + sortingPreferenceKey: 'favorites' + }, + children: [ + { + path: '', + component: FavoritesComponent, + data: { + title: 'APP.BROWSE.FAVORITES.TITLE', + sortingPreferenceKey: 'favorites' + } + // loadChildren: + // './components/favorites/favorites.module#AppFavoritesModule' + }, + // deprecated, backwards compatibility with ACA 1.8 + { + path: 'preview/:nodeId', + loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), + data: { + navigateSource: 'favorites' + } + }, + { + path: 'view/:nodeId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'favorites' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + }, + { + path: 'view/:nodeId/:versionId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'favorites' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + } + ] + }, + { + path: 'recent-files', + data: { + sortingPreferenceKey: 'recent-files' + }, + children: [ + { + path: '', + component: RecentFilesComponent, + data: { + title: 'APP.BROWSE.RECENT.TITLE' + } + // loadChildren: + // './components/recent-files/recent-files.module#AppRecentFilesModule' + }, + // deprecated, backwards compatibility with ACA 1.8 + { + path: 'preview/:nodeId', + loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), + data: { + navigateSource: 'recent-files' + } + }, + { + path: 'view/:nodeId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'recent-files' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + }, + { + path: 'view/:nodeId/:versionId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'recent-files' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + } + ] + }, + { + path: 'shared', + children: [ + { + path: '', + data: { + title: 'APP.BROWSE.SHARED.TITLE', + sortingPreferenceKey: 'shared-files' + }, + component: SharedFilesComponent + // loadChildren: + // './components/shared-files/shared-files.module#AppSharedFilesModule' + }, + // deprecated, backwards compatibility with ACA 1.8 + { + path: 'preview/:nodeId', + loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), + data: { + navigateSource: 'shared' + } + }, + { + path: 'view/:nodeId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'shared' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + }, + { + path: 'view/:nodeId/:versionId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'shared' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + } + ], + canActivateChild: [AppSharedRuleGuard], + canActivate: [AppSharedRuleGuard] + }, + { + path: 'trashcan', + loadChildren: () => import('./components/trashcan/trashcan.module').then((m) => m.AppTrashcanModule) + }, + { + path: 'search', + children: [ + { + path: '', + component: SearchResultsComponent, + data: { + title: 'APP.BROWSE.SEARCH.TITLE' + } + }, + // deprecated, backwards compatibility with ACA 1.8 + { + path: 'preview/:nodeId', + loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule), + data: { + navigateSource: 'search' + } + }, + { + path: 'view/:nodeId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'search' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + }, + { + path: 'view/:nodeId/:versionId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'search' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + } + ] + }, + { + path: 'search-libraries', + children: [ + { + path: '', + component: SearchLibrariesResultsComponent, + data: { + title: 'APP.BROWSE.SEARCH.TITLE' + } + }, + { + path: 'view/:nodeId', + outlet: 'viewer', + children: [ + { + path: '', + data: { + navigateSource: 'search' + }, + loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule) + } + ] + } + ] + }, + { + path: 'nodes/:nodeId', + children: [ + { + path: '', + loadChildren: () => import('@alfresco/aca-folder-rules').then((m) => m.AcaFolderRulesModule) + } + ] + }, + { + path: '**', + component: GenericErrorComponent + } + ], + canActivateChild: [AuthGuard] +}; diff --git a/app/src/app/dialogs/node-template/create-from-template.dialog.html b/app/src/app/content-plugin/dialogs/node-template/create-from-template.dialog.html similarity index 100% rename from app/src/app/dialogs/node-template/create-from-template.dialog.html rename to app/src/app/content-plugin/dialogs/node-template/create-from-template.dialog.html diff --git a/app/src/app/dialogs/node-template/create-from-template.dialog.scss b/app/src/app/content-plugin/dialogs/node-template/create-from-template.dialog.scss similarity index 100% rename from app/src/app/dialogs/node-template/create-from-template.dialog.scss rename to app/src/app/content-plugin/dialogs/node-template/create-from-template.dialog.scss diff --git a/app/src/app/dialogs/node-template/create-from-template.dialog.spec.ts b/app/src/app/content-plugin/dialogs/node-template/create-from-template.dialog.spec.ts similarity index 100% rename from app/src/app/dialogs/node-template/create-from-template.dialog.spec.ts rename to app/src/app/content-plugin/dialogs/node-template/create-from-template.dialog.spec.ts diff --git a/app/src/app/dialogs/node-template/create-from-template.dialog.ts b/app/src/app/content-plugin/dialogs/node-template/create-from-template.dialog.ts similarity index 100% rename from app/src/app/dialogs/node-template/create-from-template.dialog.ts rename to app/src/app/content-plugin/dialogs/node-template/create-from-template.dialog.ts diff --git a/app/src/app/directives/directives.module.ts b/app/src/app/content-plugin/directives/directives.module.ts similarity index 100% rename from app/src/app/directives/directives.module.ts rename to app/src/app/content-plugin/directives/directives.module.ts diff --git a/app/src/app/directives/document-list.directive.spec.ts b/app/src/app/content-plugin/directives/document-list.directive.spec.ts similarity index 100% rename from app/src/app/directives/document-list.directive.spec.ts rename to app/src/app/content-plugin/directives/document-list.directive.spec.ts diff --git a/app/src/app/directives/document-list.directive.ts b/app/src/app/content-plugin/directives/document-list.directive.ts similarity index 100% rename from app/src/app/directives/document-list.directive.ts rename to app/src/app/content-plugin/directives/document-list.directive.ts diff --git a/app/src/app/services/content-management.service.spec.ts b/app/src/app/content-plugin/services/content-management.service.spec.ts similarity index 100% rename from app/src/app/services/content-management.service.spec.ts rename to app/src/app/content-plugin/services/content-management.service.spec.ts diff --git a/app/src/app/services/content-management.service.ts b/app/src/app/content-plugin/services/content-management.service.ts similarity index 100% rename from app/src/app/services/content-management.service.ts rename to app/src/app/content-plugin/services/content-management.service.ts diff --git a/app/src/app/services/content-service-extension.service.spec.ts b/app/src/app/content-plugin/services/content-service-extension.service.spec.ts similarity index 100% rename from app/src/app/services/content-service-extension.service.spec.ts rename to app/src/app/content-plugin/services/content-service-extension.service.spec.ts diff --git a/app/src/app/services/content-service-extension.service.ts b/app/src/app/content-plugin/services/content-service-extension.service.ts similarity index 100% rename from app/src/app/services/content-service-extension.service.ts rename to app/src/app/content-plugin/services/content-service-extension.service.ts diff --git a/app/src/app/services/content-url.service.spec.ts b/app/src/app/content-plugin/services/content-url.service.spec.ts similarity index 100% rename from app/src/app/services/content-url.service.spec.ts rename to app/src/app/content-plugin/services/content-url.service.spec.ts diff --git a/app/src/app/services/content-url.service.ts b/app/src/app/content-plugin/services/content-url.service.ts similarity index 100% rename from app/src/app/services/content-url.service.ts rename to app/src/app/content-plugin/services/content-url.service.ts diff --git a/app/src/app/services/node-actions.service.spec.ts b/app/src/app/content-plugin/services/node-actions.service.spec.ts similarity index 100% rename from app/src/app/services/node-actions.service.spec.ts rename to app/src/app/content-plugin/services/node-actions.service.spec.ts diff --git a/app/src/app/services/node-actions.service.ts b/app/src/app/content-plugin/services/node-actions.service.ts similarity index 100% rename from app/src/app/services/node-actions.service.ts rename to app/src/app/content-plugin/services/node-actions.service.ts diff --git a/app/src/app/services/node-template.service.spec.ts b/app/src/app/content-plugin/services/node-template.service.spec.ts similarity index 100% rename from app/src/app/services/node-template.service.spec.ts rename to app/src/app/content-plugin/services/node-template.service.spec.ts diff --git a/app/src/app/services/node-template.service.ts b/app/src/app/content-plugin/services/node-template.service.ts similarity index 100% rename from app/src/app/services/node-template.service.ts rename to app/src/app/content-plugin/services/node-template.service.ts diff --git a/app/src/app/store/app-store.module.ts b/app/src/app/content-plugin/store/app-store.module.ts similarity index 97% rename from app/src/app/store/app-store.module.ts rename to app/src/app/content-plugin/store/app-store.module.ts index 1c7655c80..0e9105fee 100644 --- a/app/src/app/store/app-store.module.ts +++ b/app/src/app/content-plugin/store/app-store.module.ts @@ -28,7 +28,7 @@ import { StoreModule } from '@ngrx/store'; import { appReducer } from './reducers/app.reducer'; import { StoreRouterConnectingModule, FullRouterStateSerializer } from '@ngrx/router-store'; import { EffectsModule } from '@ngrx/effects'; -import { environment } from '../../environments/environment'; +import { environment } from '../../../environments/environment'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import { SharedStoreModule } from '@alfresco/aca-shared/store'; import { diff --git a/app/src/app/store/effects.ts b/app/src/app/content-plugin/store/effects.ts similarity index 100% rename from app/src/app/store/effects.ts rename to app/src/app/content-plugin/store/effects.ts diff --git a/app/src/app/store/effects/app.effects.ts b/app/src/app/content-plugin/store/effects/app.effects.ts similarity index 100% rename from app/src/app/store/effects/app.effects.ts rename to app/src/app/content-plugin/store/effects/app.effects.ts diff --git a/app/src/app/store/effects/contextmenu.effects.spec.ts b/app/src/app/content-plugin/store/effects/contextmenu.effects.spec.ts similarity index 100% rename from app/src/app/store/effects/contextmenu.effects.spec.ts rename to app/src/app/content-plugin/store/effects/contextmenu.effects.spec.ts diff --git a/app/src/app/store/effects/contextmenu.effects.ts b/app/src/app/content-plugin/store/effects/contextmenu.effects.ts similarity index 100% rename from app/src/app/store/effects/contextmenu.effects.ts rename to app/src/app/content-plugin/store/effects/contextmenu.effects.ts diff --git a/app/src/app/store/effects/download.effects.ts b/app/src/app/content-plugin/store/effects/download.effects.ts similarity index 100% rename from app/src/app/store/effects/download.effects.ts rename to app/src/app/content-plugin/store/effects/download.effects.ts diff --git a/app/src/app/store/effects/favorite.effects.ts b/app/src/app/content-plugin/store/effects/favorite.effects.ts similarity index 100% rename from app/src/app/store/effects/favorite.effects.ts rename to app/src/app/content-plugin/store/effects/favorite.effects.ts diff --git a/app/src/app/store/effects/library.effects.ts b/app/src/app/content-plugin/store/effects/library.effects.ts similarity index 100% rename from app/src/app/store/effects/library.effects.ts rename to app/src/app/content-plugin/store/effects/library.effects.ts diff --git a/app/src/app/store/effects/node.effects.spec.ts b/app/src/app/content-plugin/store/effects/node.effects.spec.ts similarity index 100% rename from app/src/app/store/effects/node.effects.spec.ts rename to app/src/app/content-plugin/store/effects/node.effects.spec.ts diff --git a/app/src/app/store/effects/node.effects.ts b/app/src/app/content-plugin/store/effects/node.effects.ts similarity index 100% rename from app/src/app/store/effects/node.effects.ts rename to app/src/app/content-plugin/store/effects/node.effects.ts diff --git a/app/src/app/store/effects/search.effects.spec.ts b/app/src/app/content-plugin/store/effects/search.effects.spec.ts similarity index 100% rename from app/src/app/store/effects/search.effects.spec.ts rename to app/src/app/content-plugin/store/effects/search.effects.spec.ts diff --git a/app/src/app/store/effects/search.effects.ts b/app/src/app/content-plugin/store/effects/search.effects.ts similarity index 100% rename from app/src/app/store/effects/search.effects.ts rename to app/src/app/content-plugin/store/effects/search.effects.ts diff --git a/app/src/app/store/effects/template.effects.spec.ts b/app/src/app/content-plugin/store/effects/template.effects.spec.ts similarity index 100% rename from app/src/app/store/effects/template.effects.spec.ts rename to app/src/app/content-plugin/store/effects/template.effects.spec.ts diff --git a/app/src/app/store/effects/template.effects.ts b/app/src/app/content-plugin/store/effects/template.effects.ts similarity index 100% rename from app/src/app/store/effects/template.effects.ts rename to app/src/app/content-plugin/store/effects/template.effects.ts diff --git a/app/src/app/store/effects/upload.effects.spec.ts b/app/src/app/content-plugin/store/effects/upload.effects.spec.ts similarity index 100% rename from app/src/app/store/effects/upload.effects.spec.ts rename to app/src/app/content-plugin/store/effects/upload.effects.spec.ts diff --git a/app/src/app/store/effects/upload.effects.ts b/app/src/app/content-plugin/store/effects/upload.effects.ts similarity index 100% rename from app/src/app/store/effects/upload.effects.ts rename to app/src/app/content-plugin/store/effects/upload.effects.ts diff --git a/app/src/app/store/effects/viewer.effects.spec.ts b/app/src/app/content-plugin/store/effects/viewer.effects.spec.ts similarity index 100% rename from app/src/app/store/effects/viewer.effects.spec.ts rename to app/src/app/content-plugin/store/effects/viewer.effects.spec.ts diff --git a/app/src/app/store/effects/viewer.effects.ts b/app/src/app/content-plugin/store/effects/viewer.effects.ts similarity index 100% rename from app/src/app/store/effects/viewer.effects.ts rename to app/src/app/content-plugin/store/effects/viewer.effects.ts diff --git a/app/src/app/store/initial-state.ts b/app/src/app/content-plugin/store/initial-state.ts similarity index 100% rename from app/src/app/store/initial-state.ts rename to app/src/app/content-plugin/store/initial-state.ts diff --git a/app/src/app/store/reducers/app.reducer.ts b/app/src/app/content-plugin/store/reducers/app.reducer.ts similarity index 100% rename from app/src/app/store/reducers/app.reducer.ts rename to app/src/app/content-plugin/store/reducers/app.reducer.ts diff --git a/app/src/app/testing/app-extension-service-mock.ts b/app/src/app/content-plugin/testing/app-extension-service-mock.ts similarity index 100% rename from app/src/app/testing/app-extension-service-mock.ts rename to app/src/app/content-plugin/testing/app-extension-service-mock.ts diff --git a/app/src/app/testing/app-testing.module.ts b/app/src/app/content-plugin/testing/app-testing.module.ts similarity index 96% rename from app/src/app/testing/app-testing.module.ts rename to app/src/app/content-plugin/testing/app-testing.module.ts index 197cc1434..8c02380f1 100644 --- a/app/src/app/testing/app-testing.module.ts +++ b/app/src/app/content-plugin/testing/app-testing.module.ts @@ -41,10 +41,10 @@ import { StoreModule } from '@ngrx/store'; import { appReducer } from '../store/reducers/app.reducer'; import { RouterTestingModule } from '@angular/router/testing'; import { EffectsModule } from '@ngrx/effects'; -import { MaterialModule } from '../material.module'; +import { MaterialModule } from '../../material.module'; import { INITIAL_STATE } from '../store/initial-state'; import { TranslatePipeMock } from './translate-pipe.directive'; -import { TranslateServiceMock } from './translation.service'; +import { TranslateServiceMock } from '@alfresco/aca-shared'; import { BehaviorSubject, Observable, of } from 'rxjs'; @NgModule({ diff --git a/app/src/app/testing/content-action-ref.ts b/app/src/app/content-plugin/testing/content-action-ref.ts similarity index 100% rename from app/src/app/testing/content-action-ref.ts rename to app/src/app/content-plugin/testing/content-action-ref.ts diff --git a/app/src/app/testing/translate-pipe.directive.ts b/app/src/app/content-plugin/testing/translate-pipe.directive.ts similarity index 100% rename from app/src/app/testing/translate-pipe.directive.ts rename to app/src/app/content-plugin/testing/translate-pipe.directive.ts diff --git a/app/src/app/ui/application.scss b/app/src/app/content-plugin/ui/application.scss similarity index 98% rename from app/src/app/ui/application.scss rename to app/src/app/content-plugin/ui/application.scss index 971b1e88f..7933a872a 100644 --- a/app/src/app/ui/application.scss +++ b/app/src/app/content-plugin/ui/application.scss @@ -31,6 +31,7 @@ body { overflow: hidden; } app-root, +app-shell, app-about, adf-layout-container, aca-search-results, diff --git a/app/src/app/ui/colors.scss b/app/src/app/content-plugin/ui/colors.scss similarity index 100% rename from app/src/app/ui/colors.scss rename to app/src/app/content-plugin/ui/colors.scss diff --git a/app/src/app/ui/custom-theme.scss b/app/src/app/content-plugin/ui/custom-theme.scss similarity index 100% rename from app/src/app/ui/custom-theme.scss rename to app/src/app/content-plugin/ui/custom-theme.scss diff --git a/app/src/app/ui/dynamic-theme/custom-background-color.scss b/app/src/app/content-plugin/ui/dynamic-theme/custom-background-color.scss similarity index 100% rename from app/src/app/ui/dynamic-theme/custom-background-color.scss rename to app/src/app/content-plugin/ui/dynamic-theme/custom-background-color.scss diff --git a/app/src/app/ui/dynamic-theme/custom-palette-creator.scss b/app/src/app/content-plugin/ui/dynamic-theme/custom-palette-creator.scss similarity index 100% rename from app/src/app/ui/dynamic-theme/custom-palette-creator.scss rename to app/src/app/content-plugin/ui/dynamic-theme/custom-palette-creator.scss diff --git a/app/src/app/ui/dynamic-theme/custom-text-color.scss b/app/src/app/content-plugin/ui/dynamic-theme/custom-text-color.scss similarity index 100% rename from app/src/app/ui/dynamic-theme/custom-text-color.scss rename to app/src/app/content-plugin/ui/dynamic-theme/custom-text-color.scss diff --git a/app/src/app/ui/dynamic-theme/custom-theme-palettes.scss b/app/src/app/content-plugin/ui/dynamic-theme/custom-theme-palettes.scss similarity index 100% rename from app/src/app/ui/dynamic-theme/custom-theme-palettes.scss rename to app/src/app/content-plugin/ui/dynamic-theme/custom-theme-palettes.scss diff --git a/app/src/app/ui/dynamic-theme/custom-theme.scss.tpl b/app/src/app/content-plugin/ui/dynamic-theme/custom-theme.scss.tpl similarity index 100% rename from app/src/app/ui/dynamic-theme/custom-theme.scss.tpl rename to app/src/app/content-plugin/ui/dynamic-theme/custom-theme.scss.tpl diff --git a/app/src/app/ui/dynamic-theme/index.scss b/app/src/app/content-plugin/ui/dynamic-theme/index.scss similarity index 100% rename from app/src/app/ui/dynamic-theme/index.scss rename to app/src/app/content-plugin/ui/dynamic-theme/index.scss diff --git a/app/src/app/ui/dynamic-theme/theme-configuration.scss.tpl b/app/src/app/content-plugin/ui/dynamic-theme/theme-configuration.scss.tpl similarity index 100% rename from app/src/app/ui/dynamic-theme/theme-configuration.scss.tpl rename to app/src/app/content-plugin/ui/dynamic-theme/theme-configuration.scss.tpl diff --git a/app/src/app/ui/dynamic-theme/typography.scss b/app/src/app/content-plugin/ui/dynamic-theme/typography.scss similarity index 100% rename from app/src/app/ui/dynamic-theme/typography.scss rename to app/src/app/content-plugin/ui/dynamic-theme/typography.scss diff --git a/app/src/app/ui/mixins.scss b/app/src/app/content-plugin/ui/mixins.scss similarity index 100% rename from app/src/app/ui/mixins.scss rename to app/src/app/content-plugin/ui/mixins.scss diff --git a/app/src/app/ui/overrides/adf-pagination.theme.scss b/app/src/app/content-plugin/ui/overrides/adf-pagination.theme.scss similarity index 100% rename from app/src/app/ui/overrides/adf-pagination.theme.scss rename to app/src/app/content-plugin/ui/overrides/adf-pagination.theme.scss diff --git a/app/src/app/ui/overrides/adf-style-fixes.theme.scss b/app/src/app/content-plugin/ui/overrides/adf-style-fixes.theme.scss similarity index 100% rename from app/src/app/ui/overrides/adf-style-fixes.theme.scss rename to app/src/app/content-plugin/ui/overrides/adf-style-fixes.theme.scss diff --git a/app/src/app/ui/theme.scss b/app/src/app/content-plugin/ui/theme.scss similarity index 100% rename from app/src/app/ui/theme.scss rename to app/src/app/content-plugin/ui/theme.scss diff --git a/app/src/app/ui/variables/font-family.scss b/app/src/app/content-plugin/ui/variables/font-family.scss similarity index 100% rename from app/src/app/ui/variables/font-family.scss rename to app/src/app/content-plugin/ui/variables/font-family.scss diff --git a/app/src/app/ui/variables/variables.scss b/app/src/app/content-plugin/ui/variables/variables.scss similarity index 100% rename from app/src/app/ui/variables/variables.scss rename to app/src/app/content-plugin/ui/variables/variables.scss diff --git a/app/src/app/extensions/core.extensions.module.ts b/app/src/app/extensions/core.extensions.module.ts index 9ab36596b..6bd627ed4 100644 --- a/app/src/app/extensions/core.extensions.module.ts +++ b/app/src/app/extensions/core.extensions.module.ts @@ -23,38 +23,11 @@ * along with Alfresco. If not, see . */ -import { CoreModule, AuthGuardEcm, UserInfoComponent, NotificationHistoryComponent } from '@alfresco/adf-core'; +import { CoreModule } from '@alfresco/adf-core'; import { CommonModule } from '@angular/common'; import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core'; -import { AppLayoutComponent } from '../components/layout/app-layout/app-layout.component'; -import * as rules from '@alfresco/aca-shared/rules'; -import { ToggleInfoDrawerComponent } from '../components/toolbar/toggle-info-drawer/toggle-info-drawer.component'; -import { ToggleFavoriteComponent } from '../components/toolbar/toggle-favorite/toggle-favorite.component'; -import { ToggleFavoriteLibraryComponent } from '../components/toolbar/toggle-favorite-library/toggle-favorite-library.component'; -import { MetadataTabComponent } from '../components/info-drawer/metadata-tab/metadata-tab.component'; -import { LibraryMetadataTabComponent } from '../components/info-drawer/library-metadata-tab/library-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'; -import { ExtensionsModule, ExtensionService } from '@alfresco/adf-extensions'; -import { LocationLinkComponent } from '../components/common/location-link/location-link.component'; -import { DocumentDisplayModeComponent } from '../components/toolbar/document-display-mode/document-display-mode.component'; -import { ToggleJoinLibraryButtonComponent } from '../components/toolbar/toggle-join-library/toggle-join-library-button.component'; -import { ToggleJoinLibraryMenuComponent } from '../components/toolbar/toggle-join-library/toggle-join-library-menu.component'; -import { ToggleEditOfflineComponent } from '../components/toolbar/toggle-edit-offline/toggle-edit-offline.component'; -import { CustomNameColumnComponent } from '../components/dl-custom-components/name-column/name-column.component'; -import { - LibraryNameColumnComponent, - LibraryStatusColumnComponent, - TrashcanNameColumnComponent, - LibraryRoleColumnComponent -} from '@alfresco/adf-content-services'; -import { ToggleSharedComponent } from '../components/common/toggle-shared/toggle-shared.component'; -import { ViewNodeComponent } from '../components/toolbar/view-node/view-node.component'; -import { LanguagePickerComponent } from '../components/common/language-picker/language-picker.component'; -import { LogoutComponent } from '../components/common/logout/logout.component'; -import { AppExtensionService, ExtensionsDataLoaderGuard } from '@alfresco/aca-shared'; -import { PreviewComponent } from '../components/preview/preview.component'; -import { ContentServiceExtensionService } from '../services/content-service-extension.service'; +import { ExtensionsModule } from '@alfresco/adf-extensions'; +import { AppExtensionService } from '@alfresco/aca-shared'; // eslint-disable-next-line prefer-arrow/prefer-arrow-functions export function setupExtensions(service: AppExtensionService): () => void { @@ -72,7 +45,7 @@ export class CoreExtensionsModule { { provide: APP_INITIALIZER, useFactory: setupExtensions, - deps: [AppExtensionService, ContentServiceExtensionService], + deps: [AppExtensionService], multi: true } ] @@ -84,106 +57,4 @@ export class CoreExtensionsModule { ngModule: CoreExtensionsModule }; } - - constructor(extensions: ExtensionService) { - extensions.setComponents({ - 'app.layout.main': AppLayoutComponent, - 'app.components.tabs.metadata': MetadataTabComponent, - 'app.components.tabs.library.metadata': LibraryMetadataTabComponent, - 'app.components.tabs.comments': CommentsTabComponent, - 'app.components.tabs.versions': VersionsTabComponent, - 'app.components.preview': PreviewComponent, - 'app.toolbar.toggleInfoDrawer': ToggleInfoDrawerComponent, - 'app.toolbar.toggleFavorite': ToggleFavoriteComponent, - 'app.toolbar.toggleFavoriteLibrary': ToggleFavoriteLibraryComponent, - 'app.toolbar.toggleJoinLibrary': ToggleJoinLibraryButtonComponent, - 'app.toolbar.cardView': DocumentDisplayModeComponent, - 'app.menu.toggleJoinLibrary': ToggleJoinLibraryMenuComponent, - 'app.shared-link.toggleSharedLink': ToggleSharedComponent, - 'app.columns.name': CustomNameColumnComponent, - 'app.columns.libraryName': LibraryNameColumnComponent, - 'app.columns.libraryRole': LibraryRoleColumnComponent, - 'app.columns.libraryStatus': LibraryStatusColumnComponent, - 'app.columns.trashcanName': TrashcanNameColumnComponent, - 'app.columns.location': LocationLinkComponent, - 'app.toolbar.toggleEditOffline': ToggleEditOfflineComponent, - 'app.toolbar.viewNode': ViewNodeComponent, - 'app.languagePicker': LanguagePickerComponent, - 'app.logout': LogoutComponent, - 'app.user': UserInfoComponent, - 'app.notification-center': NotificationHistoryComponent - }); - - extensions.setAuthGuards({ - 'app.auth': AuthGuardEcm, - 'app.extensions.dataLoaderGuard': ExtensionsDataLoaderGuard - }); - - extensions.setEvaluators({ - canCopyNode: rules.canCopyNode, - canToggleJoinLibrary: rules.canToggleJoinLibrary, - canEditFolder: rules.canEditFolder, - isTrashcanItemSelected: rules.isTrashcanItemSelected, - canViewFile: rules.canViewFile, - canLeaveLibrary: rules.canLeaveLibrary, - canToggleSharedLink: rules.canToggleSharedLink, - canShowInfoDrawer: rules.canShowInfoDrawer, - canManageFileVersions: rules.canManageFileVersions, - canManagePermissions: rules.canManagePermissions, - canToggleEditOffline: rules.canToggleEditOffline, - canToggleFavorite: rules.canToggleFavorite, - isLibraryManager: rules.isLibraryManager, - canEditAspects: rules.canEditAspects, - canInfoPreview: rules.canInfoPreview, - showInfoSelectionButton: rules.showInfoSelectionButton, - - 'app.selection.canDelete': rules.canDeleteSelection, - 'app.selection.file.canUnlock': rules.canUnlockFile, - 'app.selection.file.canLock': rules.canLockFile, - 'app.selection.canDownload': rules.canDownloadSelection, - 'app.selection.notEmpty': rules.hasSelection, - 'app.selection.canUnshare': rules.canUnshareNodes, - 'app.selection.canAddFavorite': rules.canAddFavorite, - 'app.selection.canRemoveFavorite': rules.canRemoveFavorite, - 'app.selection.first.canUpdate': rules.canUpdateSelectedNode, - 'app.selection.file': rules.hasFileSelected, - 'app.selection.file.canShare': rules.canShareFile, - 'app.selection.file.isShared': rules.isShared, - 'app.selection.file.isLocked': rules.hasLockedFiles, - 'app.selection.file.isLockOwner': rules.isUserWriteLockOwner, - 'app.selection.file.canUploadVersion': rules.canUploadVersion, - 'app.selection.library': rules.hasLibrarySelected, - 'app.selection.isPrivateLibrary': rules.isPrivateLibrary, - 'app.selection.hasLibraryRole': rules.hasLibraryRole, - 'app.selection.hasNoLibraryRole': rules.hasNoLibraryRole, - 'app.selection.folder': rules.hasFolderSelected, - 'app.selection.folder.canUpdate': rules.canUpdateSelectedFolder, - - 'app.navigation.folder.canCreate': rules.canCreateFolder, - 'app.navigation.folder.canUpload': rules.canUpload, - 'app.navigation.isTrashcan': rules.isTrashcan, - 'app.navigation.isNotTrashcan': rules.isNotTrashcan, - 'app.navigation.isLibraries': rules.isLibraries, - 'app.navigation.isLibraryFiles': rules.isLibraryFiles, - 'app.navigation.isPersonalFiles': rules.isPersonalFiles, - 'app.navigation.isNotLibraries': rules.isNotLibraries, - 'app.navigation.isSharedFiles': rules.isSharedFiles, - 'app.navigation.isNotSharedFiles': rules.isNotSharedFiles, - 'app.navigation.isFavorites': rules.isFavorites, - 'app.navigation.isNotFavorites': rules.isNotFavorites, - 'app.navigation.isRecentFiles': rules.isRecentFiles, - 'app.navigation.isNotRecentFiles': rules.isNotRecentFiles, - 'app.navigation.isSearchResults': rules.isSearchResults, - 'app.navigation.isNotSearchResults': rules.isNotSearchResults, - 'app.navigation.isPreview': rules.isPreview, - 'app.navigation.isSharedPreview': rules.isSharedPreview, - 'app.navigation.isFavoritesPreview': rules.isFavoritesPreview, - 'app.navigation.isSharedFileViewer': rules.isSharedFileViewer, - - 'repository.isQuickShareEnabled': rules.hasQuickShareEnabled, - 'user.isAdmin': rules.isAdmin, - 'app.canShowLogout': rules.canShowLogout, - 'app.isContentServiceEnabled': rules.isContentServiceEnabled - }); - } } diff --git a/app/src/styles.scss b/app/src/styles.scss index 2eada1fc5..581be0d33 100644 --- a/app/src/styles.scss +++ b/app/src/styles.scss @@ -1,6 +1,6 @@ /* You can add global styles to this file, and also import other style files */ -@import 'app/ui/application'; -@import './app/ui/variables/font-family'; +@import 'app/content-plugin/ui/application'; +@import 'app/content-plugin/ui/variables/font-family'; body, html { diff --git a/docs/extending/app-shell.md b/docs/extending/app-shell.md new file mode 100644 index 000000000..b3a5eeab1 --- /dev/null +++ b/docs/extending/app-shell.md @@ -0,0 +1,17 @@ +--- +Title: Shell +--- + +# Shell + +[AppShellModule](../../app/src/app/app-shell/app-shell.module.ts) is designated as a main layout for the application. + +I order to attach routes to appShell, `withRoutes(routes: Routes | AppShellRoutesConfig)` method should be used. + +Passed routes are going to be attached to [shell main route](../../app/src/app/app-shell/app-shell.routes.ts) + +If you would like to provide custom app guard, you can provide your own using [SHELL_AUTH_TOKEN](../../app/src/app/app-shell/app-shell.routes.ts) + +## Shell Service + +In order to use `shell`, you need to provide `SHELL_APP_SERVICE` which provides necessary options for shell component to work. \ No newline at end of file diff --git a/docs/extending/rules.md b/docs/extending/rules.md index d7e3d1300..2c63e0d03 100644 --- a/docs/extending/rules.md +++ b/docs/extending/rules.md @@ -202,7 +202,7 @@ for example mixing `core.every` and `core.not`. | 1.7.0 | app.navigation.isPersonalFiles | Current page is **Personal Files**. | | 1.7.0 | app.navigation.isLibraryFiles | Current page is **Library Files**. | -**Tip:** See the [Registration](/extending/registration) section for more details +**Tip:** See the [Registration](./registration) section for more details on how to register your own entries to be re-used at runtime. ### Example diff --git a/projects/aca-shared/rules/src/app.rules.ts b/projects/aca-shared/rules/src/app.rules.ts index f18781747..dcd82f748 100644 --- a/projects/aca-shared/rules/src/app.rules.ts +++ b/projects/aca-shared/rules/src/app.rules.ts @@ -483,8 +483,14 @@ export const isLibraryManager = (context: RuleContext): boolean => * * @param context Rule execution context */ -export const canInfoPreview = (context: RuleContext): boolean => - navigation.isSearchResults(context) && !isMultiselection(context) && !hasFolderSelected(context) && !navigation.isPreview(context); +export const canInfoPreview = (context: RuleContext): boolean => { + const isSearchResult = navigation.isSearchResults(context); + const isNotMultiselect = !isMultiselection(context); + const isFileSelected = !hasFolderSelected(context); + const isPreview = !navigation.isPreview(context); + + return isSearchResult && isNotMultiselect && isFileSelected && isPreview; +}; export const showInfoSelectionButton = (context: RuleContext): boolean => navigation.isSearchResults(context) && !navigation.isPreview(context); diff --git a/projects/aca-shared/src/lib/services/app.service.spec.ts b/projects/aca-shared/src/lib/services/app.service.spec.ts index a87c6ebe3..f516b8ced 100644 --- a/projects/aca-shared/src/lib/services/app.service.spec.ts +++ b/projects/aca-shared/src/lib/services/app.service.spec.ts @@ -25,23 +25,91 @@ import { AppService } from './app.service'; import { TestBed } from '@angular/core/testing'; -import { AuthenticationService, AppConfigService, AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-core'; -import { Subject } from 'rxjs'; +import { + AuthenticationService, + AppConfigService, + AlfrescoApiService, + PageTitleService, + UserPreferencesService, + UploadService, + SharedLinksApiService, + AlfrescoApiServiceMock, + TranslationMock, + TranslationService, + DiscoveryApiService +} from '@alfresco/adf-core'; +import { BehaviorSubject, Observable, of, Subject } from 'rxjs'; import { HttpClientModule } from '@angular/common/http'; -import { SearchQueryBuilderService } from '@alfresco/adf-content-services'; +import { GroupService, SearchQueryBuilderService } from '@alfresco/adf-content-services'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ContentApiService } from './content-api.service'; +import { RouterExtensionService } from './router.extension.service'; +import { OverlayContainer } from '@angular/cdk/overlay'; +import { AppStore, STORE_INITIAL_APP_DATA } from '../../../store/src/states/app.state'; +import { MockStore, provideMockStore } from '@ngrx/store/testing'; +import { CommonModule } from '@angular/common'; +import { TranslateService } from '@ngx-translate/core'; +import { TranslateServiceMock } from '../testing/translation.service'; +import { RouterTestingModule } from '@angular/router/testing'; +import { RepositoryInfo } from '@alfresco/js-api'; describe('AppService', () => { let service: AppService; let auth: AuthenticationService; let appConfig: AppConfigService; let searchQueryBuilderService: SearchQueryBuilderService; + let userPreferencesService: UserPreferencesService; + let router: Router; + let activatedRoute: ActivatedRoute; + let routerExtensionService: RouterExtensionService; + let pageTitleService: PageTitleService; + let uploadService: UploadService; + let contentApiService: ContentApiService; + let sharedLinksApiService: SharedLinksApiService; + let overlayContainer: OverlayContainer; + let alfrescoApiService: AlfrescoApiService; + let groupService: GroupService; + let storeInitialAppData: any; + let store: MockStore; beforeEach(() => { TestBed.configureTestingModule({ - imports: [HttpClientModule], + imports: [HttpClientModule, RouterTestingModule.withRoutes([])], providers: [ - { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }, + CommonModule, SearchQueryBuilderService, + UserPreferencesService, + RouterExtensionService, + UploadService, + ContentApiService, + SharedLinksApiService, + OverlayContainer, + provideMockStore({}), + { + provide: PageTitleService, + useValue: {} + }, + { + provide: DiscoveryApiService, + useValue: { + ecmProductInfo$: new BehaviorSubject(null), + getEcmProductInfo: (): Observable => of(new RepositoryInfo({ version: '10.0.0' })) + } + }, + { + provide: ActivatedRoute, + useValue: { + snapshot: {} + } + }, + { + provide: STORE_INITIAL_APP_DATA, + useValue: {} + }, + { + provide: AlfrescoApiService, + useClass: AlfrescoApiServiceMock + }, { provide: AuthenticationService, useValue: { @@ -49,15 +117,47 @@ describe('AppService', () => { onLogout: new Subject(), isLoggedIn: () => false } - } + }, + { provide: TranslationService, useClass: TranslationMock }, + { provide: TranslateService, useClass: TranslateServiceMock } ] }); - auth = TestBed.inject(AuthenticationService); appConfig = TestBed.inject(AppConfigService); searchQueryBuilderService = TestBed.inject(SearchQueryBuilderService); + userPreferencesService = TestBed.inject(UserPreferencesService); + router = TestBed.inject(Router); + activatedRoute = TestBed.inject(ActivatedRoute); + routerExtensionService = TestBed.inject(RouterExtensionService); + pageTitleService = TestBed.inject(PageTitleService); + uploadService = TestBed.inject(UploadService); + contentApiService = TestBed.inject(ContentApiService); + sharedLinksApiService = TestBed.inject(SharedLinksApiService); + overlayContainer = TestBed.inject(OverlayContainer); + alfrescoApiService = TestBed.inject(AlfrescoApiService); + groupService = TestBed.inject(GroupService); + storeInitialAppData = TestBed.inject(STORE_INITIAL_APP_DATA); + store = TestBed.inject(MockStore); + auth = TestBed.inject(AuthenticationService); - service = new AppService(auth, appConfig, searchQueryBuilderService); + service = new AppService( + userPreferencesService, + auth, + store, + router, + activatedRoute, + appConfig, + pageTitleService, + alfrescoApiService, + uploadService, + routerExtensionService, + contentApiService, + sharedLinksApiService, + groupService, + overlayContainer, + storeInitialAppData, + searchQueryBuilderService + ); }); it('should be ready if [withCredentials] mode is used', (done) => { @@ -67,7 +167,25 @@ describe('AppService', () => { } }; - const instance = new AppService(auth, appConfig, searchQueryBuilderService); + const instance = new AppService( + userPreferencesService, + auth, + store, + router, + activatedRoute, + appConfig, + pageTitleService, + alfrescoApiService, + uploadService, + routerExtensionService, + contentApiService, + sharedLinksApiService, + groupService, + overlayContainer, + storeInitialAppData, + searchQueryBuilderService + ); + expect(instance.withCredentials).toBeTruthy(); instance.ready$.subscribe(() => { diff --git a/projects/aca-shared/src/lib/services/app.service.ts b/projects/aca-shared/src/lib/services/app.service.ts index f0497bb26..c364acf12 100644 --- a/projects/aca-shared/src/lib/services/app.service.ts +++ b/projects/aca-shared/src/lib/services/app.service.ts @@ -23,18 +23,56 @@ * along with Alfresco. If not, see . */ -import { Injectable } from '@angular/core'; -import { AuthenticationService, AppConfigService } from '@alfresco/adf-core'; -import { Observable, BehaviorSubject } from 'rxjs'; -import { SearchQueryBuilderService } from '@alfresco/adf-content-services'; +import { Inject, Injectable, OnDestroy } from '@angular/core'; +import { + AuthenticationService, + AppConfigService, + AlfrescoApiService, + SharedLinksApiService, + UploadService, + FileUploadErrorEvent, + PageTitleService, + UserPreferencesService +} from '@alfresco/adf-core'; +import { Observable, BehaviorSubject, Subject } from 'rxjs'; +import { GroupService, SearchQueryBuilderService } from '@alfresco/adf-content-services'; +import { OverlayContainer } from '@angular/cdk/overlay'; +import { ActivatedRoute, ActivationEnd, NavigationStart, Router } from '@angular/router'; +import { filter, map, takeUntil, tap } from 'rxjs/operators'; +import { + AppState, + AppStore, + CloseModalDialogsAction, + getCustomCssPath, + getCustomWebFontPath, + STORE_INITIAL_APP_DATA, + SetCurrentUrlAction, + SetInitialStateAction, + SetRepositoryInfoAction, + SetUserProfileAction, + SnackbarErrorAction, + ResetSelectionAction +} from '../../../store/src/public-api'; +import { ContentApiService } from './content-api.service'; +import { RouterExtensionService } from './router.extension.service'; +import { Store } from '@ngrx/store'; +import { DiscoveryEntry, GroupEntry, Group } from '@alfresco/js-api'; @Injectable({ providedIn: 'root' }) -export class AppService { +// After moving shell to ADF to core, AppService will implement ShellAppService +export class AppService implements OnDestroy { private ready: BehaviorSubject; ready$: Observable; + pageHeading$: Observable; + + hideSidenavConditions = ['/preview/']; + minimizeSidenavConditions = ['search']; + + onDestroy$ = new Subject(); + /** * Whether `withCredentials` mode is enabled. * Usually means that `Kerberos` mode is used. @@ -43,16 +81,193 @@ export class AppService { return this.config.get('auth.withCredentials', false); } - constructor(auth: AuthenticationService, private config: AppConfigService, searchQueryBuilderService: SearchQueryBuilderService) { - this.ready = new BehaviorSubject(auth.isLoggedIn() || this.withCredentials); + constructor( + public preferencesService: UserPreferencesService, + private authenticationService: AuthenticationService, + private store: Store, + private router: Router, + private activatedRoute: ActivatedRoute, + private config: AppConfigService, + private pageTitle: PageTitleService, + private alfrescoApiService: AlfrescoApiService, + private uploadService: UploadService, + private routerExtensionService: RouterExtensionService, + private contentApi: ContentApiService, + private sharedLinksApiService: SharedLinksApiService, + private groupService: GroupService, + private overlayContainer: OverlayContainer, + @Inject(STORE_INITIAL_APP_DATA) private initialAppState: AppState, + searchQueryBuilderService: SearchQueryBuilderService + ) { + this.ready = new BehaviorSubject(this.authenticationService.isLoggedIn() || this.withCredentials); this.ready$ = this.ready.asObservable(); - auth.onLogin.subscribe(() => { + this.authenticationService.onLogin.subscribe(() => { this.ready.next(true); }); - auth.onLogout.subscribe(() => { + this.authenticationService.onLogout.subscribe(() => { searchQueryBuilderService.resetToDefaults(); }); + + this.pageHeading$ = this.router.events.pipe( + filter((event) => event instanceof ActivationEnd && event.snapshot.children.length === 0), + map((event: ActivationEnd) => event.snapshot?.data?.title ?? ''), + tap((title) => this.pageTitle.setTitle(title)) + ); + } + + ngOnDestroy(): void { + this.onDestroy$.next(true); + this.onDestroy$.complete(); + } + + init(): void { + this.alfrescoApiService.getInstance().on('error', (error: { status: number; response: any }) => { + if (error.status === 401 && !this.alfrescoApiService.isExcludedErrorListener(error?.response?.req?.url)) { + if (!this.authenticationService.isLoggedIn()) { + this.store.dispatch(new CloseModalDialogsAction()); + + let redirectUrl = this.activatedRoute.snapshot.queryParams['redirectUrl']; + if (!redirectUrl) { + redirectUrl = this.router.url; + } + + this.router.navigate(['/login'], { + queryParams: { redirectUrl } + }); + } + } + }); + + this.loadAppSettings(); + + this.loadCustomCss(); + this.loadCustomWebFont(); + + const { router } = this; + + this.router.events + .pipe(filter((event) => event instanceof ActivationEnd && event.snapshot.children.length === 0)) + .subscribe((_event: ActivationEnd) => { + this.store.dispatch(new SetCurrentUrlAction(router.url)); + }); + + this.router.events + .pipe( + filter((event) => event instanceof NavigationStart), + takeUntil(this.onDestroy$) + ) + .subscribe(() => { + this.store.dispatch(new ResetSelectionAction()); + }); + + this.routerExtensionService.mapExtensionRoutes(); + + this.uploadService.fileUploadError.subscribe((error) => this.onFileUploadedError(error)); + + this.sharedLinksApiService.error.pipe(takeUntil(this.onDestroy$)).subscribe((err: { message: string }) => { + this.store.dispatch(new SnackbarErrorAction(err.message)); + }); + + this.ready$.pipe(takeUntil(this.onDestroy$)).subscribe((isReady) => { + if (isReady) { + this.loadRepositoryStatus(); + this.loadUserProfile(); + } + }); + + this.overlayContainer.getContainerElement().setAttribute('role', 'region'); + } + + private loadRepositoryStatus() { + this.contentApi.getRepositoryInformation().subscribe((response: DiscoveryEntry) => { + this.store.dispatch(new SetRepositoryInfoAction(response.entry.repository)); + }); + } + + private async loadUserProfile() { + const groupsEntries: GroupEntry[] = await this.groupService.listAllGroupMembershipsForPerson('-me-', { maxItems: 250 }); + + const groups: Group[] = []; + + if (groupsEntries) { + groups.push(...groupsEntries.map((obj) => obj.entry)); + } + + this.contentApi.getPerson('-me-').subscribe((person) => { + this.store.dispatch(new SetUserProfileAction({ person: person.entry, groups })); + }); + } + + loadAppSettings() { + let baseShareUrl = this.config.get('baseShareUrl'); + if (!baseShareUrl.endsWith('/')) { + baseShareUrl += '/'; + } + + const state: AppState = { + ...this.initialAppState, + appName: this.config.get('application.name'), + headerColor: this.config.get('headerColor'), + headerTextColor: this.config.get('headerTextColor', '#000000'), + logoPath: this.config.get('application.logo'), + headerImagePath: this.config.get('application.headerImagePath'), + customCssPath: this.config.get('customCssPath'), + webFontPath: this.config.get('webFontPath'), + sharedUrl: baseShareUrl + }; + + this.store.dispatch(new SetInitialStateAction(state)); + } + + onFileUploadedError(error: FileUploadErrorEvent) { + let message = 'APP.MESSAGES.UPLOAD.ERROR.GENERIC'; + + if (error.error.status === 403) { + message = 'APP.MESSAGES.UPLOAD.ERROR.403'; + } + + if (error.error.status === 404) { + message = 'APP.MESSAGES.UPLOAD.ERROR.404'; + } + + if (error.error.status === 409) { + message = 'APP.MESSAGES.UPLOAD.ERROR.CONFLICT'; + } + + if (error.error.status === 500) { + message = 'APP.MESSAGES.UPLOAD.ERROR.500'; + } + + if (error.error.status === 504) { + message = 'APP.MESSAGES.UPLOAD.ERROR.504'; + } + + this.store.dispatch(new SnackbarErrorAction(message)); + } + + private loadCustomCss(): void { + this.store.select(getCustomCssPath).subscribe((cssPath) => { + if (cssPath) { + this.createLink(cssPath); + } + }); + } + + private loadCustomWebFont(): void { + this.store.select(getCustomWebFontPath).subscribe((fontUrl) => { + if (fontUrl) { + this.createLink(fontUrl); + } + }); + } + + private createLink(url: string): void { + const cssLinkElement = document.createElement('link'); + cssLinkElement.setAttribute('rel', 'stylesheet'); + cssLinkElement.setAttribute('type', 'text/css'); + cssLinkElement.setAttribute('href', url); + document.head.appendChild(cssLinkElement); } } diff --git a/projects/aca-shared/src/lib/services/router.extension.service.ts b/projects/aca-shared/src/lib/services/router.extension.service.ts index 053f7feaa..31251cbb0 100644 --- a/projects/aca-shared/src/lib/services/router.extension.service.ts +++ b/projects/aca-shared/src/lib/services/router.extension.service.ts @@ -62,7 +62,7 @@ export class RouterExtensionService { return { path: route.path, - component: this.getComponentById(route.layout || this.defaults.layout), + component: this.getComponentById(route.layout ?? this.defaults.layout), canActivateChild: guards, canActivate: guards, parentRoute: route.parentRoute, diff --git a/app/src/app/testing/translation.service.ts b/projects/aca-shared/src/lib/testing/translation.service.ts similarity index 100% rename from app/src/app/testing/translation.service.ts rename to projects/aca-shared/src/lib/testing/translation.service.ts diff --git a/projects/aca-shared/src/public-api.ts b/projects/aca-shared/src/public-api.ts index 30f128936..c7d316b65 100644 --- a/projects/aca-shared/src/public-api.ts +++ b/projects/aca-shared/src/public-api.ts @@ -62,3 +62,4 @@ export * from './lib/services/alfresco-office-extension.service'; export * from './lib/utils/node.utils'; export * from './lib/shared.module'; export * from './lib/testing/lib-testing-module'; +export * from './lib/testing/translation.service'; diff --git a/projects/aca-shared/store/src/states/app.state.ts b/projects/aca-shared/store/src/states/app.state.ts index da6ffb032..bfd65eee1 100644 --- a/projects/aca-shared/store/src/states/app.state.ts +++ b/projects/aca-shared/store/src/states/app.state.ts @@ -25,6 +25,9 @@ import { SelectionState, ProfileState, NavigationState } from '@alfresco/adf-extensions'; import { RepositoryInfo, VersionEntry } from '@alfresco/js-api'; +import { InjectionToken } from '@angular/core'; + +export const STORE_INITIAL_APP_DATA = new InjectionToken('STORE_INITIAL_APP_DATA'); export interface AppState { appName: string; diff --git a/projects/aca-testing-shared/src/pages/page.ts b/projects/aca-testing-shared/src/pages/page.ts index 18a03355f..afc7b807e 100755 --- a/projects/aca-testing-shared/src/pages/page.ts +++ b/projects/aca-testing-shared/src/pages/page.ts @@ -33,7 +33,7 @@ import { UploadFilesDialog } from '../components/dialog/upload-files-dialog'; export abstract class Page { appRoot = 'app-root'; - layout = this.byCss('app-layout'); + layout = this.byCss('app-shell'); overlay = this.byCss('.cdk-overlay-container'); snackBar = this.byCss(`[data-automation-id='adf-snackbar-message-content-action-button']`); dialogContainer = this.byCss('.mat-dialog-container');