- +
diff --git a/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-results.component.spec.ts b/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-results.component.spec.ts index 7df48ca7dd..5ca800f3e1 100644 --- a/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-results.component.spec.ts +++ b/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-results.component.spec.ts @@ -24,15 +24,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AppTestingModule } from '../../../testing/app-testing.module'; -import { DataTableComponent } from '@alfresco/adf-core'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { SearchLibrariesResultsComponent } from './search-libraries-results.component'; import { SearchLibrariesQueryBuilderService } from './search-libraries-query-builder.service'; -import { DocumentListComponent } from '@alfresco/adf-content-services'; import { BehaviorSubject, Subject } from 'rxjs'; import { AppService } from '@alfresco/aca-shared'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatSnackBarModule } from '@angular/material/snack-bar'; describe('SearchLibrariesResultsComponent', () => { let component: SearchLibrariesResultsComponent; @@ -46,8 +42,7 @@ describe('SearchLibrariesResultsComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, MatDialogModule, MatSnackBarModule], - declarations: [DataTableComponent, DocumentListComponent, SearchLibrariesResultsComponent], + imports: [AppTestingModule, SearchLibrariesResultsComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ { diff --git a/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-results.component.ts b/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-results.component.ts index 232aba54ca..2fceaf0e25 100644 --- a/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-results.component.ts +++ b/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-results.component.ts @@ -27,10 +27,48 @@ import { NodePaging, Pagination, SiteEntry } from '@alfresco/js-api'; import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { ActivatedRoute, Params } from '@angular/router'; import { SearchLibrariesQueryBuilderService } from './search-libraries-query-builder.service'; -import { AppHookService, AppService, PageComponent } from '@alfresco/aca-shared'; -import { DocumentListPresetRef } from '@alfresco/adf-extensions'; +import { + AppHookService, + AppService, + ContextActionsDirective, + InfoDrawerComponent, + PageComponent, + PageLayoutComponent, + PageLayoutContentComponent, + PageLayoutHeaderComponent, + PaginationDirective, + ToolbarActionComponent +} from '@alfresco/aca-shared'; +import { DocumentListPresetRef, ExtensionsModule } from '@alfresco/adf-extensions'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +import { SearchInputComponent } from '../search-input/search-input.component'; +import { DataTableModule, PaginationModule, ToolbarModule } from '@alfresco/adf-core'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; +import { DocumentListModule } from '@alfresco/adf-content-services'; +import { DocumentListDirective } from '../../../directives/document-list.directive'; @Component({ + standalone: true, + imports: [ + CommonModule, + TranslateModule, + SearchInputComponent, + ToolbarModule, + MatProgressBarModule, + DocumentListModule, + DataTableModule, + ExtensionsModule, + PaginationModule, + InfoDrawerComponent, + ContextActionsDirective, + DocumentListDirective, + ToolbarActionComponent, + PaginationDirective, + PageLayoutContentComponent, + PageLayoutHeaderComponent, + PageLayoutComponent + ], selector: 'aca-search-results', templateUrl: './search-libraries-results.component.html', styleUrls: ['./search-libraries-results.component.scss'], diff --git a/projects/aca-content/src/lib/components/search/search-navigation.service.spec.ts b/projects/aca-content/src/lib/components/search/search-navigation.service.spec.ts index 04a4712a83..8cfdbff68b 100644 --- a/projects/aca-content/src/lib/components/search/search-navigation.service.spec.ts +++ b/projects/aca-content/src/lib/components/search/search-navigation.service.spec.ts @@ -23,10 +23,9 @@ */ import { TestBed } from '@angular/core/testing'; -import { CoreModule } from '@alfresco/adf-core'; -import { TranslateModule } from '@ngx-translate/core'; import { SearchNavigationService } from './search-navigation.service'; import { Router } from '@angular/router'; +import { AppTestingModule } from '../../testing/app-testing.module'; describe('SearchNavigationService', () => { let service: SearchNavigationService; @@ -34,7 +33,7 @@ describe('SearchNavigationService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CoreModule.forRoot()] + imports: [AppTestingModule] }); service = TestBed.inject(SearchNavigationService); router = TestBed.inject(Router); diff --git a/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.component.ts b/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.component.ts index 1941f82f3d..46cba8b55e 100644 --- a/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.component.ts +++ b/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.component.ts @@ -31,8 +31,13 @@ import { NodesApiService } from '@alfresco/adf-content-services'; import { takeUntil } from 'rxjs/operators'; import { Router } from '@angular/router'; import { AcaFileAutoDownloadService } from '@alfresco/aca-shared'; +import { CommonModule } from '@angular/common'; +import { LocationLinkComponent } from '../../common/location-link/location-link.component'; +import { MatDialogModule } from '@angular/material/dialog'; @Component({ + standalone: true, + imports: [CommonModule, LocationLinkComponent, MatDialogModule], selector: 'aca-search-results-row', templateUrl: './search-results-row.component.html', styleUrls: ['./search-results-row.component.scss'], diff --git a/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.components.spec.ts b/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.components.spec.ts index f1287a6ccc..fc08ee3c51 100644 --- a/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.components.spec.ts +++ b/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.components.spec.ts @@ -24,9 +24,7 @@ import { NodeEntry } from '@alfresco/js-api'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CoreModule } from '@alfresco/adf-core'; import { AppTestingModule } from '../../../testing/app-testing.module'; -import { AppSearchResultsModule } from '../search-results.module'; import { SearchResultsRowComponent } from './search-results-row.component'; describe('SearchResultsRowComponent', () => { @@ -44,7 +42,7 @@ describe('SearchResultsRowComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [CoreModule, AppTestingModule, AppSearchResultsModule] + imports: [AppTestingModule, SearchResultsRowComponent] }); fixture = TestBed.createComponent(SearchResultsRowComponent); diff --git a/projects/aca-content/src/lib/components/search/search-results.module.ts b/projects/aca-content/src/lib/components/search/search-results.module.ts deleted file mode 100644 index bc39e8c499..0000000000 --- a/projects/aca-content/src/lib/components/search/search-results.module.ts +++ /dev/null @@ -1,64 +0,0 @@ -/*! - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Alfresco Example Content Application - * - * 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 - * from Hyland Software. If not, see . - */ - -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { CoreModule } from '@alfresco/adf-core'; -import { ContentModule } from '@alfresco/adf-content-services'; -import { ExtensionsModule } from '@alfresco/adf-extensions'; -import { LockedByComponent, PageLayoutModule } from '@alfresco/aca-shared'; -import { SearchResultsComponent } from './search-results/search-results.component'; -import { SearchResultsRowComponent } from './search-results-row/search-results-row.component'; -import { SearchLibrariesResultsComponent } from './search-libraries-results/search-libraries-results.component'; -import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module'; -import { AppToolbarModule } from '../toolbar/toolbar.module'; -import { DirectivesModule } from '../../directives/directives.module'; -import { SearchActionMenuComponent } from './search-action-menu/search-action-menu.component'; -import { AppSearchInputModule } from './search-input.module'; -import { LocationLinkComponent } from '../common/location-link/location-link.component'; -import { ThumbnailColumnComponent } from '../dl-custom-components/thumbnail-column/thumbnail-column.component'; -import { TagsColumnComponent } from '../dl-custom-components/tags-column/tags-column.component'; -import { ContextMenuComponent } from '../context-menu/context-menu.component'; - -@NgModule({ - imports: [ - CommonModule, - CoreModule.forChild(), - ContentModule.forChild(), - ExtensionsModule, - AppInfoDrawerModule, - AppToolbarModule, - DirectivesModule, - PageLayoutModule, - ContextMenuComponent, - LockedByComponent, - AppSearchInputModule, - LocationLinkComponent, - ThumbnailColumnComponent, - TagsColumnComponent - ], - declarations: [SearchResultsComponent, SearchLibrariesResultsComponent, SearchResultsRowComponent, SearchActionMenuComponent], - exports: [SearchResultsComponent, SearchLibrariesResultsComponent, SearchResultsRowComponent, SearchActionMenuComponent] -}) -export class AppSearchResultsModule {} diff --git a/projects/aca-content/src/lib/components/search/search-results/search-results.component.spec.ts b/projects/aca-content/src/lib/components/search/search-results/search-results.component.spec.ts index 67908e4bde..3fba9d2320 100644 --- a/projects/aca-content/src/lib/components/search/search-results/search-results.component.spec.ts +++ b/projects/aca-content/src/lib/components/search/search-results/search-results.component.spec.ts @@ -24,8 +24,7 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; import { SearchResultsComponent } from './search-results.component'; -import { AppSearchResultsModule } from '../search-results.module'; -import { AppConfigService, CoreModule, TranslationService } from '@alfresco/adf-core'; +import { AppConfigService, TranslationService } from '@alfresco/adf-core'; import { Store } from '@ngrx/store'; import { NavigateToFolder, SnackbarErrorAction } from '@alfresco/aca-shared/store'; import { Pagination, SearchRequest } from '@alfresco/js-api'; @@ -49,7 +48,7 @@ describe('SearchComponent', () => { beforeEach(() => { params = new BehaviorSubject({ q: 'TYPE: "cm:folder" AND %28=cm: name: email OR cm: name: budget%29' }); TestBed.configureTestingModule({ - imports: [AppTestingModule, CoreModule.forRoot(), AppSearchResultsModule], + imports: [AppTestingModule, SearchResultsComponent], providers: [ { provide: AppService, diff --git a/projects/aca-content/src/lib/components/search/search-results/search-results.component.ts b/projects/aca-content/src/lib/components/search/search-results/search-results.component.ts index 2b0d11d0e6..cf09bcffaa 100644 --- a/projects/aca-content/src/lib/components/search/search-results/search-results.component.ts +++ b/projects/aca-content/src/lib/components/search/search-results/search-results.component.ts @@ -25,7 +25,7 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { MinimalNodeEntity, Pagination, ResultSetPaging } from '@alfresco/js-api'; import { ActivatedRoute, Params } from '@angular/router'; -import { SearchQueryBuilderService } from '@alfresco/adf-content-services'; +import { AlfrescoViewerModule, DocumentListModule, SearchModule, SearchQueryBuilderService } from '@alfresco/adf-content-services'; import { infoDrawerPreview, NavigateToFolder, @@ -35,13 +35,63 @@ import { ShowInfoDrawerPreviewAction, SnackbarErrorAction } from '@alfresco/aca-shared/store'; -import { TranslationService } from '@alfresco/adf-core'; +import { DataTableModule, PaginationModule, ToolbarModule, TranslationService, ViewerModule } from '@alfresco/adf-core'; import { combineLatest } from 'rxjs'; -import { PageComponent } from '@alfresco/aca-shared'; +import { + ContextActionsDirective, + InfoDrawerComponent, + PageComponent, + PageLayoutComponent, + PageLayoutContentComponent, + PageLayoutHeaderComponent, + PaginationDirective, + ToolbarActionComponent +} from '@alfresco/aca-shared'; import { SearchSortingDefinition } from '@alfresco/adf-content-services/lib/search/models/search-sorting-definition.interface'; import { takeUntil } from 'rxjs/operators'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +import { SearchInputComponent } from '../search-input/search-input.component'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatButtonModule } from '@angular/material/button'; +import { DocumentListDirective } from '../../../directives/document-list.directive'; +import { ThumbnailColumnComponent } from '../../dl-custom-components/thumbnail-column/thumbnail-column.component'; +import { SearchActionMenuComponent } from '../search-action-menu/search-action-menu.component'; +import { TagsColumnComponent } from '../../dl-custom-components/tags-column/tags-column.component'; +import { MatIconModule } from '@angular/material/icon'; +import { SearchResultsRowComponent } from '../search-results-row/search-results-row.component'; @Component({ + standalone: true, + imports: [ + CommonModule, + TranslateModule, + SearchInputComponent, + ToolbarModule, + MatProgressBarModule, + SearchModule, + MatDividerModule, + MatButtonModule, + DocumentListModule, + DocumentListDirective, + ContextActionsDirective, + DataTableModule, + ThumbnailColumnComponent, + SearchActionMenuComponent, + TagsColumnComponent, + PaginationModule, + AlfrescoViewerModule, + MatIconModule, + InfoDrawerComponent, + SearchResultsRowComponent, + PaginationDirective, + ViewerModule, + ToolbarActionComponent, + PageLayoutHeaderComponent, + PageLayoutContentComponent, + PageLayoutComponent + ], selector: 'aca-search-results', templateUrl: './search-results.component.html', encapsulation: ViewEncapsulation.None, diff --git a/projects/aca-content/src/lib/components/shared-files/shared-files.component.html b/projects/aca-content/src/lib/components/shared-files/shared-files.component.html index 8d617299ee..747e7a22d1 100644 --- a/projects/aca-content/src/lib/components/shared-files/shared-files.component.html +++ b/projects/aca-content/src/lib/components/shared-files/shared-files.component.html @@ -61,7 +61,7 @@ - +
diff --git a/projects/aca-content/src/lib/components/shared-files/shared-files.component.spec.ts b/projects/aca-content/src/lib/components/shared-files/shared-files.component.spec.ts index abc34ca44a..4ca97b4397 100644 --- a/projects/aca-content/src/lib/components/shared-files/shared-files.component.spec.ts +++ b/projects/aca-content/src/lib/components/shared-files/shared-files.component.spec.ts @@ -23,35 +23,39 @@ */ import { TestBed, ComponentFixture } from '@angular/core/testing'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { DataTableComponent } from '@alfresco/adf-core'; -import { CustomResourcesService, DocumentListComponent, NodeFavoriteDirective } from '@alfresco/adf-content-services'; +import { CustomResourcesService } from '@alfresco/adf-content-services'; import { SharedFilesComponent } from './shared-files.component'; import { AppTestingModule } from '../../testing/app-testing.module'; import { Router } from '@angular/router'; -import { of } from 'rxjs'; +import { BehaviorSubject, of, Subject } from 'rxjs'; import { By } from '@angular/platform-browser'; import { SharedLinkPaging } from '@alfresco/js-api'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { AppService } from '@alfresco/aca-shared'; describe('SharedFilesComponent', () => { let fixture: ComponentFixture; let page: SharedLinkPaging; + const appServiceMock = { + appNavNarMode$: new BehaviorSubject('collapsed'), + toggleAppNavBar$: new Subject() + }; + beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, MatDialogModule, MatSnackBarModule], - declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, SharedFilesComponent], + imports: [AppTestingModule, SharedFilesComponent], providers: [ { provide: Router, useValue: { url: 'shared-files' } + }, + { + provide: AppService, + useValue: appServiceMock } - ], - schemas: [NO_ERRORS_SCHEMA] + ] }); page = { @@ -66,7 +70,9 @@ describe('SharedFilesComponent', () => { fixture = TestBed.createComponent(SharedFilesComponent); }); - it('[C280093] should not display pagination for empty data', async () => { + // TODO: needs better testing strategy + // eslint-disable-next-line ban/ban + xit('[C280093] should not display pagination for empty data', async () => { page = { list: { pagination: { totalItems: 0 }, entries: [] } }; fixture.detectChanges(); diff --git a/projects/aca-content/src/lib/components/shared-files/shared-files.component.ts b/projects/aca-content/src/lib/components/shared-files/shared-files.component.ts index 6a67d8ac4e..2aa1245803 100644 --- a/projects/aca-content/src/lib/components/shared-files/shared-files.component.ts +++ b/projects/aca-content/src/lib/components/shared-files/shared-files.component.ts @@ -25,10 +25,43 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { debounceTime } from 'rxjs/operators'; import { MinimalNodeEntity } from '@alfresco/js-api'; -import { AppHookService, PageComponent } from '@alfresco/aca-shared'; -import { DocumentListPresetRef } from '@alfresco/adf-extensions'; +import { + AppHookService, + ContextActionsDirective, + InfoDrawerComponent, + PageComponent, + PageLayoutComponent, + PageLayoutContentComponent, + PageLayoutHeaderComponent, + PaginationDirective, + ToolbarActionComponent +} from '@alfresco/aca-shared'; +import { DocumentListPresetRef, ExtensionsModule } from '@alfresco/adf-extensions'; +import { CommonModule } from '@angular/common'; +import { BreadcrumbModule, DocumentListModule } from '@alfresco/adf-content-services'; +import { DataTableModule, PaginationModule, TemplateModule, ToolbarModule } from '@alfresco/adf-core'; +import { DocumentListDirective } from '../../directives/document-list.directive'; @Component({ + standalone: true, + imports: [ + CommonModule, + BreadcrumbModule, + ToolbarModule, + DocumentListModule, + DocumentListDirective, + ContextActionsDirective, + TemplateModule, + DataTableModule, + ExtensionsModule, + PaginationModule, + InfoDrawerComponent, + PaginationDirective, + ToolbarActionComponent, + PageLayoutContentComponent, + PageLayoutHeaderComponent, + PageLayoutComponent + ], templateUrl: './shared-files.component.html', encapsulation: ViewEncapsulation.None }) diff --git a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.spec.ts b/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.spec.ts index f2ef538f5a..6a6c3f8ab1 100644 --- a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.spec.ts +++ b/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.spec.ts @@ -47,8 +47,7 @@ describe('SharedLinkViewComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule], - declarations: [SharedLinkViewComponent], + imports: [AppTestingModule, SharedLinkViewComponent], providers: [ AppExtensionService, { provide: Store, useValue: storeMock }, diff --git a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts b/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts index 07ce9b2aa5..6e0e175032 100644 --- a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts +++ b/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts @@ -23,7 +23,7 @@ */ import { AppStore, SetSelectedNodesAction } from '@alfresco/aca-shared/store'; -import { AlfrescoApiService } from '@alfresco/adf-core'; +import { AlfrescoApiService, ViewerModule } from '@alfresco/adf-core'; import { ContentActionRef } from '@alfresco/adf-extensions'; import { SharedLinkEntry, SharedlinksApi } from '@alfresco/js-api'; import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; @@ -31,9 +31,13 @@ import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; import { forkJoin, from, of, Subject } from 'rxjs'; import { catchError, mergeMap, takeUntil } from 'rxjs/operators'; -import { AppExtensionService, AppService } from '@alfresco/aca-shared'; +import { AppExtensionService, AppService, ToolbarActionComponent } from '@alfresco/aca-shared'; +import { CommonModule } from '@angular/common'; +import { AlfrescoViewerModule } from '@alfresco/adf-content-services'; @Component({ + standalone: true, + imports: [CommonModule, ViewerModule, AlfrescoViewerModule, ToolbarActionComponent], selector: 'app-shared-link-view', templateUrl: './shared-link-view.component.html', styleUrls: ['shared-link-view.component.scss'], diff --git a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.module.ts b/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.module.ts deleted file mode 100644 index 646b09dd23..0000000000 --- a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.module.ts +++ /dev/null @@ -1,48 +0,0 @@ -/*! - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Alfresco Example Content Application - * - * 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 - * from Hyland Software. If not, see . - */ - -import { NgModule } from '@angular/core'; -import { SharedLinkViewComponent } from './shared-link-view.component'; -import { CommonModule } from '@angular/common'; -import { CoreModule } from '@alfresco/adf-core'; -import { DirectivesModule } from '../../directives/directives.module'; -import { AppToolbarModule } from '../toolbar/toolbar.module'; -import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module'; -import { CoreExtensionsModule } from '../../extensions/core.extensions.module'; -import { ContentModule } from '@alfresco/adf-content-services'; - -@NgModule({ - imports: [ - CommonModule, - CoreModule.forChild(), - DirectivesModule, - AppToolbarModule, - CoreExtensionsModule.forChild(), - AppInfoDrawerModule, - ContentModule - ], - declarations: [SharedLinkViewComponent], - exports: [SharedLinkViewComponent] -}) -export class AppSharedLinkViewModule {} diff --git a/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.spec.ts b/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.spec.ts index 0cf474d2a8..97daf37c7f 100644 --- a/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.spec.ts +++ b/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.spec.ts @@ -26,7 +26,6 @@ import { ButtonMenuComponent } from './button-menu.component'; import { TestBed, ComponentFixture } from '@angular/core/testing'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { Router } from '@angular/router'; -import { AppSidenavModule } from '../sidenav.module'; describe('ButtonMenuComponent', () => { let component: ButtonMenuComponent; @@ -35,7 +34,7 @@ describe('ButtonMenuComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, AppSidenavModule] + imports: [AppTestingModule, ButtonMenuComponent] }); fixture = TestBed.createComponent(ButtonMenuComponent); diff --git a/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.ts b/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.ts index d99eb0e52a..dd663b0ce5 100644 --- a/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.ts +++ b/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.ts @@ -25,8 +25,18 @@ import { Component, Input, ViewEncapsulation, OnInit, ChangeDetectorRef } from '@angular/core'; import { OverlayContainer } from '@angular/cdk/overlay'; import { NavBarLinkRef } from '@alfresco/adf-extensions'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +import { IconModule } from '@alfresco/adf-core'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatButtonModule } from '@angular/material/button'; +import { ActiveLinkDirective } from '../directives/active-link.directive'; +import { ActionDirective } from '../directives/action.directive'; +import { MenuPanelDirective } from '../directives/menu-panel.directive'; @Component({ + standalone: true, + imports: [CommonModule, TranslateModule, IconModule, MatMenuModule, MatButtonModule, ActiveLinkDirective, ActionDirective, MenuPanelDirective], selector: 'app-button-menu', templateUrl: './button-menu.component.html', host: { class: 'app-button-menu' }, diff --git a/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.html b/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.html index 2c79dfbfcc..445066770d 100644 --- a/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.html +++ b/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.html @@ -20,7 +20,6 @@ diff --git a/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.spec.ts b/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.spec.ts index 234b17f7fe..b874a48545 100644 --- a/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.spec.ts +++ b/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.spec.ts @@ -26,7 +26,6 @@ import { ExpandMenuComponent } from './expand-menu.component'; import { TestBed, ComponentFixture } from '@angular/core/testing'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { Router } from '@angular/router'; -import { AppSidenavModule } from '../sidenav.module'; describe('ExpandMenuComponent', () => { let component: ExpandMenuComponent; @@ -35,7 +34,7 @@ describe('ExpandMenuComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, AppSidenavModule] + imports: [AppTestingModule, ExpandMenuComponent] }); fixture = TestBed.createComponent(ExpandMenuComponent); diff --git a/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.ts b/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.ts index 4fc5f85f75..b3f48601d5 100644 --- a/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.ts +++ b/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.ts @@ -24,8 +24,27 @@ import { Component, OnInit, Input, ViewEncapsulation, ChangeDetectorRef } from '@angular/core'; import { NavBarLinkRef } from '@alfresco/adf-extensions'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +import { IconModule } from '@alfresco/adf-core'; +import { MatButtonModule } from '@angular/material/button'; +import { ActiveLinkDirective } from '../directives/active-link.directive'; +import { ActionDirective } from '../directives/action.directive'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { ExpansionPanelDirective } from '../directives/expansion-panel.directive'; @Component({ + standalone: true, + imports: [ + CommonModule, + TranslateModule, + IconModule, + MatButtonModule, + ActiveLinkDirective, + ActionDirective, + MatExpansionModule, + ExpansionPanelDirective + ], selector: 'app-expand-menu', encapsulation: ViewEncapsulation.None, templateUrl: './expand-menu.component.html', diff --git a/projects/aca-content/src/lib/components/sidenav/components/sidenav-header.component.ts b/projects/aca-content/src/lib/components/sidenav/components/sidenav-header.component.ts index a02dbc0432..3987612ea9 100644 --- a/projects/aca-content/src/lib/components/sidenav/components/sidenav-header.component.ts +++ b/projects/aca-content/src/lib/components/sidenav/components/sidenav-header.component.ts @@ -28,10 +28,15 @@ import { Observable, Subject } from 'rxjs'; import { AppStore, getAppName, getLogoPath } from '@alfresco/aca-shared/store'; import { AppConfigService } from '@alfresco/adf-core'; import { ContentActionRef } from '@alfresco/adf-extensions'; -import { AppExtensionService } from '@alfresco/aca-shared'; +import { AppExtensionService, ToolbarActionComponent } from '@alfresco/aca-shared'; import { takeUntil } from 'rxjs/operators'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +import { RouterModule } from '@angular/router'; @Component({ + standalone: true, + imports: [CommonModule, TranslateModule, RouterModule, ToolbarActionComponent], selector: 'app-sidenav-header', templateUrl: `./sidenav-header.component.html`, encapsulation: ViewEncapsulation.None, diff --git a/projects/aca-content/src/lib/components/sidenav/directives/action.directive.ts b/projects/aca-content/src/lib/components/sidenav/directives/action.directive.ts index fd99ba529a..d78abdefc4 100644 --- a/projects/aca-content/src/lib/components/sidenav/directives/action.directive.ts +++ b/projects/aca-content/src/lib/components/sidenav/directives/action.directive.ts @@ -28,6 +28,7 @@ import { Store } from '@ngrx/store'; import { AppStore } from '@alfresco/aca-shared/store'; @Directive({ + standalone: true, /* eslint-disable-next-line */ selector: '[action]', exportAs: 'action' diff --git a/projects/aca-content/src/lib/components/sidenav/directives/active-link.directive.spec.ts b/projects/aca-content/src/lib/components/sidenav/directives/active-link.directive.spec.ts index 3d71a32430..7c156c7d9b 100644 --- a/projects/aca-content/src/lib/components/sidenav/directives/active-link.directive.spec.ts +++ b/projects/aca-content/src/lib/components/sidenav/directives/active-link.directive.spec.ts @@ -23,13 +23,16 @@ */ import { Component } from '@angular/core'; -import { AppSidenavModule } from '../sidenav.module'; import { TestBed, ComponentFixture } from '@angular/core/testing'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { Router, NavigationEnd } from '@angular/router'; import { Subject } from 'rxjs'; +import { ActiveLinkDirective } from './active-link.directive'; +import { ActionDirective } from './action.directive'; @Component({ + standalone: true, + imports: [ActiveLinkDirective, ActionDirective], selector: 'app-test-component', template: ` ` }) @@ -56,8 +59,7 @@ describe('ActionDirective', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, AppSidenavModule], - declarations: [TestComponent], + imports: [AppTestingModule, ActiveLinkDirective, TestComponent], providers: [ { provide: Router, diff --git a/projects/aca-content/src/lib/components/sidenav/directives/active-link.directive.ts b/projects/aca-content/src/lib/components/sidenav/directives/active-link.directive.ts index baf6481282..d2f3e7a579 100644 --- a/projects/aca-content/src/lib/components/sidenav/directives/active-link.directive.ts +++ b/projects/aca-content/src/lib/components/sidenav/directives/active-link.directive.ts @@ -29,6 +29,7 @@ import { Subject } from 'rxjs'; import { ActionDirective } from './action.directive'; @Directive({ + standalone: true, selector: '[acaActiveLink]', exportAs: 'acaActiveLink' }) diff --git a/projects/aca-content/src/lib/components/sidenav/directives/expansion-panel.directive.ts b/projects/aca-content/src/lib/components/sidenav/directives/expansion-panel.directive.ts index 1b01131e8a..9af098c6e6 100644 --- a/projects/aca-content/src/lib/components/sidenav/directives/expansion-panel.directive.ts +++ b/projects/aca-content/src/lib/components/sidenav/directives/expansion-panel.directive.ts @@ -30,6 +30,7 @@ import { MatExpansionPanel } from '@angular/material/expansion'; import { Store } from '@ngrx/store'; @Directive({ + standalone: true, selector: '[acaExpansionPanel]', exportAs: 'acaExpansionPanel' }) diff --git a/projects/aca-content/src/lib/components/sidenav/directives/menu-panel.directive.ts b/projects/aca-content/src/lib/components/sidenav/directives/menu-panel.directive.ts index 24ff7f53e4..3401d78940 100644 --- a/projects/aca-content/src/lib/components/sidenav/directives/menu-panel.directive.ts +++ b/projects/aca-content/src/lib/components/sidenav/directives/menu-panel.directive.ts @@ -29,6 +29,7 @@ import { Subject } from 'rxjs'; import { Store } from '@ngrx/store'; @Directive({ + standalone: true, selector: '[acaMenuPanel]', exportAs: 'acaMenuPanel' }) diff --git a/projects/aca-content/src/lib/components/sidenav/sidenav.module.ts b/projects/aca-content/src/lib/components/sidenav/index.ts similarity index 68% rename from projects/aca-content/src/lib/components/sidenav/sidenav.module.ts rename to projects/aca-content/src/lib/components/sidenav/index.ts index 7b9e49a8d7..b8c2fb8787 100644 --- a/projects/aca-content/src/lib/components/sidenav/sidenav.module.ts +++ b/projects/aca-content/src/lib/components/sidenav/index.ts @@ -22,10 +22,6 @@ * from Hyland Software. If not, see . */ -import { NgModule } from '@angular/core'; -import { CoreModule } from '@alfresco/adf-core'; -import { RouterModule } from '@angular/router'; -import { ExtensionsModule } from '@alfresco/adf-extensions'; import { ExpansionPanelDirective } from './directives/expansion-panel.directive'; import { MenuPanelDirective } from './directives/menu-panel.directive'; import { SidenavComponent } from './sidenav.component'; @@ -34,30 +30,16 @@ import { ExpandMenuComponent } from './components/expand-menu.component'; import { ButtonMenuComponent } from './components/button-menu.component'; import { ActionDirective } from './directives/action.directive'; import { SidenavHeaderComponent } from './components/sidenav-header.component'; -import { SharedToolbarModule } from '@alfresco/aca-shared'; import { UserMenuComponent } from './user-menu/user-menu.component'; -@NgModule({ - imports: [CoreModule.forChild(), ExtensionsModule.forChild(), RouterModule, SharedToolbarModule], - declarations: [ - MenuPanelDirective, - ExpansionPanelDirective, - ActiveLinkDirective, - ActionDirective, - ExpandMenuComponent, - ButtonMenuComponent, - SidenavComponent, - SidenavHeaderComponent, - UserMenuComponent - ], - exports: [ - MenuPanelDirective, - ExpansionPanelDirective, - ActiveLinkDirective, - ActionDirective, - ExpandMenuComponent, - ButtonMenuComponent, - SidenavComponent - ] -}) -export class AppSidenavModule {} +export const APP_SIDENAV_DIRECTIVES = [ + ButtonMenuComponent, + ActiveLinkDirective, + ActionDirective, + MenuPanelDirective, + ExpandMenuComponent, + ExpansionPanelDirective, + SidenavHeaderComponent, + UserMenuComponent, + SidenavComponent +] as const; diff --git a/projects/aca-content/src/lib/components/sidenav/sidenav.component.spec.ts b/projects/aca-content/src/lib/components/sidenav/sidenav.component.spec.ts index 97769edebb..c0e02d15fe 100644 --- a/projects/aca-content/src/lib/components/sidenav/sidenav.component.spec.ts +++ b/projects/aca-content/src/lib/components/sidenav/sidenav.component.spec.ts @@ -36,8 +36,7 @@ describe('SidenavComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule], - declarations: [SidenavComponent], + imports: [AppTestingModule, SidenavComponent], providers: [ { provide: AppService, diff --git a/projects/aca-content/src/lib/components/sidenav/sidenav.component.ts b/projects/aca-content/src/lib/components/sidenav/sidenav.component.ts index ae1cfa44ec..57d6f61bd9 100755 --- a/projects/aca-content/src/lib/components/sidenav/sidenav.component.ts +++ b/projects/aca-content/src/lib/components/sidenav/sidenav.component.ts @@ -23,15 +23,21 @@ */ import { Component, Input, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core'; -import { NavBarGroupRef, NavBarLinkRef } from '@alfresco/adf-extensions'; +import { ExtensionsModule, NavBarGroupRef, NavBarLinkRef } from '@alfresco/adf-extensions'; import { Store } from '@ngrx/store'; import { AppStore, getSideNavState } from '@alfresco/aca-shared/store'; import { Subject } from 'rxjs'; import { takeUntil, distinctUntilChanged, debounceTime } from 'rxjs/operators'; import { AppExtensionService, AppService } from '@alfresco/aca-shared'; import { SidenavLayoutComponent } from '@alfresco/adf-core'; +import { CommonModule } from '@angular/common'; +import { SidenavHeaderComponent } from './components/sidenav-header.component'; +import { MatListModule } from '@angular/material/list'; +import { ExpandMenuComponent } from './components/expand-menu.component'; @Component({ + standalone: true, + imports: [CommonModule, SidenavHeaderComponent, MatListModule, ExpandMenuComponent, ExtensionsModule], selector: 'app-sidenav', templateUrl: './sidenav.component.html', styleUrls: ['./sidenav.component.scss'], diff --git a/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.spec.ts b/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.spec.ts index c80b104eb2..6a39d95bed 100644 --- a/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.spec.ts +++ b/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.spec.ts @@ -28,8 +28,6 @@ import { PeopleContentService } from '@alfresco/adf-content-services'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { UserMenuComponent } from './user-menu.component'; import { of } from 'rxjs'; -import { SharedToolbarModule } from '@alfresco/aca-shared'; -import { MatMenuModule } from '@angular/material/menu'; describe('UserMenuComponent', () => { let component: UserMenuComponent; @@ -108,8 +106,7 @@ describe('UserMenuComponent', () => { }; TestBed.configureTestingModule({ - imports: [AppTestingModule, SharedToolbarModule, MatMenuModule], - declarations: [UserMenuComponent], + imports: [AppTestingModule, UserMenuComponent], providers: [ { provide: AuthenticationService, useValue: authServiceStub }, { provide: PeopleContentService, useValue: peopleContentServiceStub }, diff --git a/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.ts b/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.ts index f4e6167c7d..d1b13a8d43 100644 --- a/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.ts +++ b/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.ts @@ -28,8 +28,15 @@ import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core'; import { Observable, of } from 'rxjs'; import { map } from 'rxjs/operators'; import { ContentActionRef } from '@alfresco/adf-extensions'; +import { CommonModule } from '@angular/common'; +import { MatButtonModule } from '@angular/material/button'; +import { TranslateModule } from '@ngx-translate/core'; +import { MatMenuModule } from '@angular/material/menu'; +import { ToolbarMenuItemComponent } from '@alfresco/aca-shared'; @Component({ + standalone: true, + imports: [CommonModule, TranslateModule, MatButtonModule, MatMenuModule, ToolbarMenuItemComponent], selector: 'aca-user-menu', templateUrl: './user-menu.component.html', styleUrls: ['./user-menu.component.scss'], diff --git a/projects/aca-content/src/lib/components/toolbar/toolbar.module.ts b/projects/aca-content/src/lib/components/toolbar/index.ts similarity index 64% rename from projects/aca-content/src/lib/components/toolbar/toolbar.module.ts rename to projects/aca-content/src/lib/components/toolbar/index.ts index 73df94e65e..60dccdd00d 100644 --- a/projects/aca-content/src/lib/components/toolbar/toolbar.module.ts +++ b/projects/aca-content/src/lib/components/toolbar/index.ts @@ -22,40 +22,20 @@ * from Hyland Software. If not, see . */ -import { NgModule } from '@angular/core'; import { ToggleFavoriteComponent } from './toggle-favorite/toggle-favorite.component'; import { ToggleInfoDrawerComponent } from './toggle-info-drawer/toggle-info-drawer.component'; -import { CommonModule } from '@angular/common'; -import { CoreModule } from '@alfresco/adf-core'; -import { ExtensionsModule } from '@alfresco/adf-extensions'; import { ToggleJoinLibraryButtonComponent } from './toggle-join-library/toggle-join-library-button.component'; import { ToggleJoinLibraryMenuComponent } from './toggle-join-library/toggle-join-library-menu.component'; -import { DirectivesModule } from '../../directives/directives.module'; import { ToggleFavoriteLibraryComponent } from './toggle-favorite-library/toggle-favorite-library.component'; import { ToggleEditOfflineComponent } from './toggle-edit-offline/toggle-edit-offline.component'; import { ViewNodeComponent } from './view-node/view-node.component'; -import { SharedToolbarModule } from '@alfresco/aca-shared'; -@NgModule({ - imports: [CommonModule, CoreModule.forChild(), ExtensionsModule, SharedToolbarModule, DirectivesModule], - declarations: [ - ToggleFavoriteComponent, - ToggleInfoDrawerComponent, - ToggleJoinLibraryButtonComponent, - ToggleJoinLibraryMenuComponent, - ToggleFavoriteLibraryComponent, - ToggleEditOfflineComponent, - ViewNodeComponent - ], - exports: [ - ToggleFavoriteComponent, - ToggleInfoDrawerComponent, - ToggleJoinLibraryButtonComponent, - ToggleJoinLibraryMenuComponent, - ToggleFavoriteLibraryComponent, - ToggleEditOfflineComponent, - ViewNodeComponent, - SharedToolbarModule - ] -}) -export class AppToolbarModule {} +export const APP_TOOLBAR_DIRECTIVES = [ + ToggleFavoriteComponent, + ToggleEditOfflineComponent, + ToggleInfoDrawerComponent, + ToggleJoinLibraryButtonComponent, + ToggleJoinLibraryMenuComponent, + ToggleFavoriteLibraryComponent, + ViewNodeComponent +] as const; diff --git a/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.spec.ts b/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.spec.ts index 6a2bb11d1c..e061c2a599 100644 --- a/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.spec.ts +++ b/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.spec.ts @@ -23,13 +23,12 @@ */ import { ToggleEditOfflineComponent } from './toggle-edit-offline.component'; -import { CoreModule } from '@alfresco/adf-core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; import { Store } from '@ngrx/store'; import { NodeEntry } from '@alfresco/js-api'; import { DownloadNodesAction, EditOfflineAction, SnackbarErrorAction } from '@alfresco/aca-shared/store'; -import { TranslateModule } from '@ngx-translate/core'; +import { AppTestingModule } from '../../../testing/app-testing.module'; describe('ToggleEditOfflineComponent', () => { let fixture: ComponentFixture; @@ -41,8 +40,7 @@ describe('ToggleEditOfflineComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CoreModule.forRoot()], - declarations: [ToggleEditOfflineComponent], + imports: [AppTestingModule, ToggleEditOfflineComponent], providers: [ { provide: Store, diff --git a/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts b/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts index 2539f92eb7..59f3ea696e 100644 --- a/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts +++ b/projects/aca-content/src/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.ts @@ -28,8 +28,14 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { Store } from '@ngrx/store'; import { isLocked } from '@alfresco/aca-shared'; import { AlfrescoApiService } from '@alfresco/adf-core'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatIconModule } from '@angular/material/icon'; @Component({ + standalone: true, + imports: [CommonModule, TranslateModule, MatMenuModule, MatIconModule], selector: 'app-toggle-edit-offline', template: `