From 3c1246227fba949045d5faa9cc4192e5e022c75b Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 2 Jun 2023 12:24:14 +0100 Subject: [PATCH 01/10] crate-form-template dialog --- projects/aca-content/src/lib/aca-content.module.ts | 4 ++-- .../node-template/create-from-template.dialog.spec.ts | 8 ++++---- .../node-template/create-from-template.dialog.ts | 11 +++++++++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/projects/aca-content/src/lib/aca-content.module.ts b/projects/aca-content/src/lib/aca-content.module.ts index 3da5bb1d59..b7bfadf7fb 100644 --- a/projects/aca-content/src/lib/aca-content.module.ts +++ b/projects/aca-content/src/lib/aca-content.module.ts @@ -123,7 +123,8 @@ import { ContextMenuComponent } from './components/context-menu/context-menu.com AppSharedLinkViewModule, AcaFolderRulesModule, GenericErrorComponent, - DetailsComponent + DetailsComponent, + CreateFromTemplateDialogComponent ], declarations: [ FilesComponent, @@ -132,7 +133,6 @@ import { ContextMenuComponent } from './components/context-menu/context-menu.com FavoritesComponent, RecentFilesComponent, SharedFilesComponent, - CreateFromTemplateDialogComponent, HomeComponent, UploadFilesDialogComponent ], diff --git a/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.spec.ts b/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.spec.ts index 619ca3370c..302c05f4c0 100644 --- a/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.spec.ts +++ b/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.spec.ts @@ -25,8 +25,8 @@ import { CreateFromTemplateDialogComponent } from './create-from-template.dialog'; import { TestBed, ComponentFixture } from '@angular/core/testing'; import { AppTestingModule } from '../../testing/app-testing.module'; -import { CoreModule, TranslationMock } from '@alfresco/adf-core'; -import { MatDialogModule, MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { TranslationMock } from '@alfresco/adf-core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Store } from '@ngrx/store'; import { CreateFromTemplate } from '@alfresco/aca-shared/store'; import { Node } from '@alfresco/js-api'; @@ -51,8 +51,8 @@ describe('CreateFileFromTemplateDialogComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [CoreModule.forRoot(), AppTestingModule, MatDialogModule], - declarations: [CreateFromTemplateDialogComponent], + imports: [AppTestingModule, CreateFromTemplateDialogComponent], + declarations: [], providers: [ { provide: MatDialogRef, diff --git a/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.ts b/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.ts index f04fcc8698..a273b86270 100644 --- a/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.ts +++ b/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.ts @@ -23,14 +23,21 @@ */ import { Component, ViewEncapsulation, Inject, OnInit } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; import { Node } from '@alfresco/js-api'; -import { UntypedFormBuilder, UntypedFormGroup, Validators, UntypedFormControl, ValidationErrors } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup, Validators, UntypedFormControl, ValidationErrors, ReactiveFormsModule } from '@angular/forms'; import { Store } from '@ngrx/store'; import { AppStore, CreateFromTemplate } from '@alfresco/aca-shared/store'; import { TranslationService } from '@alfresco/adf-core'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatButtonModule } from '@angular/material/button'; @Component({ + standalone: true, + imports: [CommonModule, TranslateModule, MatDialogModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, MatButtonModule], templateUrl: './create-from-template.dialog.html', styleUrls: ['./create-from-template.dialog.scss'], encapsulation: ViewEncapsulation.None From b0c39a98de808bdec141db72fb3f488b93513a36 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 2 Jun 2023 12:30:54 +0100 Subject: [PATCH 02/10] remove unused module --- .../src/lib/components/common/common.module.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/projects/aca-content/src/lib/components/common/common.module.ts b/projects/aca-content/src/lib/components/common/common.module.ts index 5d3ccb6d56..dbf7f3eeeb 100644 --- a/projects/aca-content/src/lib/components/common/common.module.ts +++ b/projects/aca-content/src/lib/components/common/common.module.ts @@ -22,21 +22,12 @@ * from Hyland Software. If not, see . */ -import { NgModule } from '@angular/core'; import { LocationLinkComponent } from './location-link/location-link.component'; import { ToggleSharedComponent } from './toggle-shared/toggle-shared.component'; import { LanguagePickerComponent } from './language-picker/language-picker.component'; import { LogoutComponent } from './logout/logout.component'; import { UserInfoComponent } from './user-info/user-info.component'; -/** - * @deprecated Use `APP_COMMON_DIRECTIVES` instead - */ -@NgModule({ - imports: [LanguagePickerComponent, LocationLinkComponent, LogoutComponent, ToggleSharedComponent, UserInfoComponent] -}) -export class AppCommonModule {} - export const APP_COMMON_DIRECTIVES = [ LanguagePickerComponent, LocationLinkComponent, From 76b03ba65466f877c228aa970a722272196790f7 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 2 Jun 2023 14:45:43 +0100 Subject: [PATCH 03/10] viewer profile component --- .../aca-content/src/lib/aca-content.module.ts | 4 +-- .../view-profile.component.spec.ts | 6 +--- .../view-profile/view-profile.component.ts | 10 +++++- .../view-profile/view-profile.module.ts | 34 ------------------- 4 files changed, 12 insertions(+), 42 deletions(-) delete mode 100644 projects/aca-content/src/lib/components/view-profile/view-profile.module.ts diff --git a/projects/aca-content/src/lib/aca-content.module.ts b/projects/aca-content/src/lib/aca-content.module.ts index b7bfadf7fb..e84861d362 100644 --- a/projects/aca-content/src/lib/aca-content.module.ts +++ b/projects/aca-content/src/lib/aca-content.module.ts @@ -40,7 +40,6 @@ 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'; @@ -93,6 +92,7 @@ import { ContentManagementService } from './services/content-management.service' import { ShellLayoutComponent, SHELL_NAVBAR_MIN_WIDTH } from '@alfresco/adf-core/shell'; import { UserMenuComponent } from './components/sidenav/user-menu/user-menu.component'; import { ContextMenuComponent } from './components/context-menu/context-menu.component'; +import { ViewProfileComponent } from './components/view-profile/view-profile.component'; @NgModule({ imports: [ @@ -118,7 +118,7 @@ import { ContextMenuComponent } from './components/context-menu/context-menu.com AppSearchInputModule, AppSearchResultsModule, HammerModule, - ViewProfileModule, + ViewProfileComponent, AppTrashcanModule, AppSharedLinkViewModule, AcaFolderRulesModule, diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts b/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts index 2e7cd95ed2..c216278727 100644 --- a/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts +++ b/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts @@ -23,13 +23,10 @@ */ import { TestBed, ComponentFixture } from '@angular/core/testing'; -import { AppConfigModule } from '@alfresco/adf-core'; import { ViewProfileComponent } from './view-profile.component'; import { AppTestingModule } from '../../testing/app-testing.module'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; -import { MatDividerModule } from '@angular/material/divider'; import { BehaviorSubject, Subject } from 'rxjs'; import { AppService } from '@alfresco/aca-shared'; @@ -44,8 +41,7 @@ describe('ViewProfileComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, AppConfigModule, FormsModule, ReactiveFormsModule, MatDividerModule], - declarations: [ViewProfileComponent], + imports: [AppTestingModule, ViewProfileComponent], providers: [ { provide: AppService, diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.component.ts b/projects/aca-content/src/lib/components/view-profile/view-profile.component.ts index 39305256bd..5890d48191 100644 --- a/projects/aca-content/src/lib/components/view-profile/view-profile.component.ts +++ b/projects/aca-content/src/lib/components/view-profile/view-profile.component.ts @@ -25,13 +25,21 @@ import { AlfrescoApiService } from '@alfresco/adf-core'; import { PeopleApi, Person } from '@alfresco/js-api'; import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { Router } from '@angular/router'; import { Observable, Subject, throwError } from 'rxjs'; import { AppService } from '@alfresco/aca-shared'; import { takeUntil } from 'rxjs/operators'; +import { CommonModule } from '@angular/common'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { TranslateModule } from '@ngx-translate/core'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatFormFieldModule } from '@angular/material/form-field'; @Component({ + standalone: true, + imports: [CommonModule, TranslateModule, ReactiveFormsModule, MatButtonModule, MatIconModule, MatDividerModule, MatFormFieldModule], selector: 'app-view-profile', templateUrl: './view-profile.component.html', styleUrls: ['./view-profile.component.scss'], diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.module.ts b/projects/aca-content/src/lib/components/view-profile/view-profile.module.ts deleted file mode 100644 index b96898268a..0000000000 --- a/projects/aca-content/src/lib/components/view-profile/view-profile.module.ts +++ /dev/null @@ -1,34 +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 { ViewProfileComponent } from './view-profile.component'; -import { CommonModule } from '@angular/common'; -import { CoreModule } from '@alfresco/adf-core'; - -@NgModule({ - imports: [CommonModule, CoreModule.forChild()], - declarations: [ViewProfileComponent] -}) -export class ViewProfileModule {} From 05a2a4313e6a3642445f3bd1cdced43fddc7b46d Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 2 Jun 2023 15:31:51 +0100 Subject: [PATCH 04/10] trashcan component --- .../aca-content/src/lib/aca-content.module.ts | 4 +- .../trashcan/trashcan.component.spec.ts | 9 ++-- .../components/trashcan/trashcan.component.ts | 24 ++++++++- .../components/trashcan/trashcan.module.ts | 52 ------------------- .../src/lib/testing/app-testing.module.ts | 22 ++++++-- 5 files changed, 45 insertions(+), 66 deletions(-) delete mode 100644 projects/aca-content/src/lib/components/trashcan/trashcan.module.ts diff --git a/projects/aca-content/src/lib/aca-content.module.ts b/projects/aca-content/src/lib/aca-content.module.ts index e84861d362..33017eb876 100644 --- a/projects/aca-content/src/lib/aca-content.module.ts +++ b/projects/aca-content/src/lib/aca-content.module.ts @@ -82,7 +82,6 @@ import { ViewNodeComponent } from './components/toolbar/view-node/view-node.comp import { CONTENT_ROUTES } from './aca-content.routes'; import { RouterModule } from '@angular/router'; import { UploadFilesDialogComponent } from './components/upload-files-dialog/upload-files-dialog.component'; -import { AppTrashcanModule } from './components/trashcan/trashcan.module'; import { AppSharedLinkViewModule } from './components/shared-link-view/shared-link-view.module'; import { AcaFolderRulesModule } from '@alfresco/aca-folder-rules'; import { TagsColumnComponent } from './components/dl-custom-components/tags-column/tags-column.component'; @@ -93,6 +92,7 @@ import { ShellLayoutComponent, SHELL_NAVBAR_MIN_WIDTH } from '@alfresco/adf-core import { UserMenuComponent } from './components/sidenav/user-menu/user-menu.component'; import { ContextMenuComponent } from './components/context-menu/context-menu.component'; import { ViewProfileComponent } from './components/view-profile/view-profile.component'; +import { TrashcanComponent } from './components/trashcan/trashcan.component'; @NgModule({ imports: [ @@ -119,7 +119,7 @@ import { ViewProfileComponent } from './components/view-profile/view-profile.com AppSearchResultsModule, HammerModule, ViewProfileComponent, - AppTrashcanModule, + TrashcanComponent, AppSharedLinkViewModule, AcaFolderRulesModule, GenericErrorComponent, diff --git a/projects/aca-content/src/lib/components/trashcan/trashcan.component.spec.ts b/projects/aca-content/src/lib/components/trashcan/trashcan.component.spec.ts index 2d6cee5cfb..ef8f22a3cf 100644 --- a/projects/aca-content/src/lib/components/trashcan/trashcan.component.spec.ts +++ b/projects/aca-content/src/lib/components/trashcan/trashcan.component.spec.ts @@ -22,10 +22,8 @@ * from Hyland Software. If not, see . */ -import { NO_ERRORS_SCHEMA } from '@angular/core'; import { TestBed, ComponentFixture } from '@angular/core/testing'; -import { AlfrescoApiService, DataTableComponent, AppConfigModule } from '@alfresco/adf-core'; -import { DocumentListComponent, NodeFavoriteDirective } from '@alfresco/adf-content-services'; +import { AlfrescoApiService } from '@alfresco/adf-core'; import { TrashcanComponent } from './trashcan.component'; import { AppTestingModule } from '../../testing/app-testing.module'; @@ -36,9 +34,8 @@ describe('TrashcanComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, AppConfigModule], - declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, TrashcanComponent], - schemas: [NO_ERRORS_SCHEMA] + imports: [AppTestingModule, TrashcanComponent] + // schemas: [NO_ERRORS_SCHEMA] }); fixture = TestBed.createComponent(TrashcanComponent); diff --git a/projects/aca-content/src/lib/components/trashcan/trashcan.component.ts b/projects/aca-content/src/lib/components/trashcan/trashcan.component.ts index 1230f86e5f..d7828dcdf9 100644 --- a/projects/aca-content/src/lib/components/trashcan/trashcan.component.ts +++ b/projects/aca-content/src/lib/components/trashcan/trashcan.component.ts @@ -23,11 +23,31 @@ */ import { getUserProfile } from '@alfresco/aca-shared/store'; -import { DocumentListPresetRef } from '@alfresco/adf-extensions'; +import { DocumentListPresetRef, ExtensionsModule } from '@alfresco/adf-extensions'; import { Component, OnInit } from '@angular/core'; -import { PageComponent } from '@alfresco/aca-shared'; +import { PageComponent, PageLayoutModule, SharedToolbarModule } from '@alfresco/aca-shared'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +import { BreadcrumbModule, DocumentListModule } from '@alfresco/adf-content-services'; +import { DataTableModule, PaginationModule, TemplateModule, ToolbarModule } from '@alfresco/adf-core'; +import { DirectivesModule } from '../../directives/directives.module'; @Component({ + standalone: true, + imports: [ + CommonModule, + TranslateModule, + PageLayoutModule, + BreadcrumbModule, + ToolbarModule, + SharedToolbarModule, + DocumentListModule, + TemplateModule, + DirectivesModule, + PaginationModule, + DataTableModule, + ExtensionsModule + ], templateUrl: './trashcan.component.html' }) export class TrashcanComponent extends PageComponent implements OnInit { diff --git a/projects/aca-content/src/lib/components/trashcan/trashcan.module.ts b/projects/aca-content/src/lib/components/trashcan/trashcan.module.ts deleted file mode 100644 index 9d00bcc189..0000000000 --- a/projects/aca-content/src/lib/components/trashcan/trashcan.module.ts +++ /dev/null @@ -1,52 +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 { TrashcanComponent } from './trashcan.component'; -import { ContentModule } from '@alfresco/adf-content-services'; -import { AppToolbarModule } from '../toolbar/toolbar.module'; -import { DirectivesModule } from '../../directives/directives.module'; -import { AppSearchInputModule } from '../search/search-input.module'; -import { PageLayoutModule } from '@alfresco/aca-shared'; -import { ExtensionsModule } from '@alfresco/adf-extensions'; -import { ContextMenuComponent } from '../context-menu/context-menu.component'; - -@NgModule({ - imports: [ - CommonModule, - CoreModule.forChild(), - ContentModule.forChild(), - DirectivesModule, - AppToolbarModule, - ContextMenuComponent, - PageLayoutModule, - AppSearchInputModule, - ExtensionsModule - ], - declarations: [TrashcanComponent], - exports: [TrashcanComponent] -}) -export class AppTrashcanModule {} diff --git a/projects/aca-content/src/lib/testing/app-testing.module.ts b/projects/aca-content/src/lib/testing/app-testing.module.ts index f85f4dba14..0b5892cb9f 100644 --- a/projects/aca-content/src/lib/testing/app-testing.module.ts +++ b/projects/aca-content/src/lib/testing/app-testing.module.ts @@ -31,9 +31,10 @@ import { AuthenticationService, AlfrescoApiService, PipeModule, - AlfrescoApiServiceMock + AlfrescoApiServiceMock, + PageTitleService } from '@alfresco/adf-core'; -import { DiscoveryApiService } from '@alfresco/adf-content-services'; +import { DiscoveryApiService, SearchQueryBuilderService } from '@alfresco/adf-content-services'; import { RepositoryInfo } from '@alfresco/js-api'; import { HttpClientModule } from '@angular/common/http'; import { StoreModule } from '@ngrx/store'; @@ -42,9 +43,10 @@ import { RouterTestingModule } from '@angular/router/testing'; import { EffectsModule } from '@ngrx/effects'; import { MaterialModule } from '../material.module'; import { INITIAL_STATE } from '../store/initial-state'; -import { BehaviorSubject, Observable, of } from 'rxjs'; +import { BehaviorSubject, Observable, Subject, of } from 'rxjs'; import { ContentManagementService } from '../services/content-management.service'; import { DocumentBasePageService } from '@alfresco/aca-shared'; +import { STORE_INITIAL_APP_DATA } from '@alfresco/aca-shared/store'; @NgModule({ imports: [ @@ -68,6 +70,7 @@ import { DocumentBasePageService } from '@alfresco/aca-shared'; ], exports: [RouterTestingModule, MaterialModule, PipeModule, TranslateModule], providers: [ + SearchQueryBuilderService, { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }, { provide: TranslationService, useClass: TranslationMock }, { provide: DocumentBasePageService, useExisting: ContentManagementService }, @@ -85,8 +88,19 @@ import { DocumentBasePageService } from '@alfresco/aca-shared'; getRedirect: (): string | null => null, setRedirect() {}, isOauth: (): boolean => false, - isOAuthWithoutSilentLogin: (): boolean => false + isOAuthWithoutSilentLogin: (): boolean => false, + onLogin: new Subject(), + onLogout: new Subject(), + isLoggedIn: () => true } + }, + { + provide: PageTitleService, + useValue: {} + }, + { + provide: STORE_INITIAL_APP_DATA, + useValue: {} } ] }) From 4b9daef582ea809b9ab8cdf7d1de568184b40056 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 2 Jun 2023 16:13:00 +0100 Subject: [PATCH 05/10] remove test dependency on global material module --- .../favorite-libraries/favorite-libraries.component.spec.ts | 4 +++- .../lib/components/favorites/favorites.component.spec.ts | 4 +++- .../lib/components/libraries/libraries.component.spec.ts | 4 +++- .../components/recent-files/recent-files.component.spec.ts | 4 +++- .../search-action-menu/search-action-menu.component.spec.ts | 3 ++- .../search/search-input/search-input.component.spec.ts | 4 +++- .../search-libraries-results.component.spec.ts | 4 +++- .../components/shared-files/shared-files.component.spec.ts | 4 +++- .../sidenav/user-menu/user-menu.component.spec.ts | 3 ++- .../src/lib/components/trashcan/trashcan.component.spec.ts | 1 - .../src/lib/services/content-management.service.spec.ts | 6 +++--- .../src/lib/services/node-actions.service.spec.ts | 4 ++-- .../src/lib/services/node-template.service.spec.ts | 4 ++-- .../src/lib/store/effects/contextmenu.effects.spec.ts | 4 ++-- .../src/lib/store/effects/download.effects.spec.ts | 4 ++-- .../aca-content/src/lib/store/effects/node.effects.spec.ts | 4 +++- .../src/lib/store/effects/upload.effects.spec.ts | 4 +++- .../src/lib/store/effects/viewer.effects.spec.ts | 3 ++- projects/aca-content/src/lib/testing/app-testing.module.ts | 4 +--- 19 files changed, 45 insertions(+), 27 deletions(-) diff --git a/projects/aca-content/src/lib/components/favorite-libraries/favorite-libraries.component.spec.ts b/projects/aca-content/src/lib/components/favorite-libraries/favorite-libraries.component.spec.ts index 5dd5dfc8fa..a3697281ab 100644 --- a/projects/aca-content/src/lib/components/favorite-libraries/favorite-libraries.component.spec.ts +++ b/projects/aca-content/src/lib/components/favorite-libraries/favorite-libraries.component.spec.ts @@ -35,6 +35,8 @@ import { RouterEffects } from '@alfresco/aca-shared/store'; import { of, throwError } from 'rxjs'; import { LibraryEffects } from '../../store/effects'; import { NodeEntry } from '@alfresco/js-api'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; describe('FavoriteLibrariesComponent', () => { let fixture: ComponentFixture; @@ -57,7 +59,7 @@ describe('FavoriteLibrariesComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, EffectsModule.forRoot([RouterEffects, LibraryEffects]), AppConfigModule], + imports: [AppTestingModule, EffectsModule.forRoot([RouterEffects, LibraryEffects]), AppConfigModule, MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, FavoriteLibrariesComponent], schemas: [NO_ERRORS_SCHEMA] }); diff --git a/projects/aca-content/src/lib/components/favorites/favorites.component.spec.ts b/projects/aca-content/src/lib/components/favorites/favorites.component.spec.ts index e767e62196..2b42e4d8b9 100644 --- a/projects/aca-content/src/lib/components/favorites/favorites.component.spec.ts +++ b/projects/aca-content/src/lib/components/favorites/favorites.component.spec.ts @@ -31,6 +31,8 @@ import { of } from 'rxjs'; import { FavoritesComponent } from './favorites.component'; import { AppTestingModule } from '../../testing/app-testing.module'; import { ContentApiService } from '@alfresco/aca-shared'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; describe('FavoritesComponent', () => { let fixture: ComponentFixture; @@ -41,7 +43,7 @@ describe('FavoritesComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, AppConfigModule], + imports: [AppTestingModule, AppConfigModule, MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, FavoritesComponent], providers: [ { diff --git a/projects/aca-content/src/lib/components/libraries/libraries.component.spec.ts b/projects/aca-content/src/lib/components/libraries/libraries.component.spec.ts index def1d76a67..28327ed022 100644 --- a/projects/aca-content/src/lib/components/libraries/libraries.component.spec.ts +++ b/projects/aca-content/src/lib/components/libraries/libraries.component.spec.ts @@ -32,6 +32,8 @@ import { AppTestingModule } from '../../testing/app-testing.module'; import { EffectsModule } from '@ngrx/effects'; import { LibraryEffects } from '../../store/effects'; import { ContentApiService } from '@alfresco/aca-shared'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; describe('LibrariesComponent', () => { let fixture: ComponentFixture; @@ -52,7 +54,7 @@ describe('LibrariesComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, EffectsModule.forRoot([LibraryEffects]), AppConfigModule], + imports: [AppTestingModule, EffectsModule.forRoot([LibraryEffects]), AppConfigModule, MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, LibrariesComponent], schemas: [NO_ERRORS_SCHEMA] }); diff --git a/projects/aca-content/src/lib/components/recent-files/recent-files.component.spec.ts b/projects/aca-content/src/lib/components/recent-files/recent-files.component.spec.ts index 8bb5a47ffb..4c391767e1 100644 --- a/projects/aca-content/src/lib/components/recent-files/recent-files.component.spec.ts +++ b/projects/aca-content/src/lib/components/recent-files/recent-files.component.spec.ts @@ -31,6 +31,8 @@ import { AppTestingModule } from '../../testing/app-testing.module'; import { Router } from '@angular/router'; import { NodePaging, SearchApi } from '@alfresco/js-api'; import { of } from 'rxjs'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; describe('RecentFilesComponent', () => { let fixture: ComponentFixture; @@ -40,7 +42,7 @@ describe('RecentFilesComponent', () => { const searchApi = jasmine.createSpyObj('SearchApi', ['search']); const testBed = TestBed.configureTestingModule({ - imports: [AppTestingModule, AppConfigModule], + imports: [AppTestingModule, AppConfigModule, MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, RecentFilesComponent], providers: [ { provide: SearchApi, useValue: searchApi }, diff --git a/projects/aca-content/src/lib/components/search/search-action-menu/search-action-menu.component.spec.ts b/projects/aca-content/src/lib/components/search/search-action-menu/search-action-menu.component.spec.ts index c1bc49d476..dbf30fe5ee 100644 --- a/projects/aca-content/src/lib/components/search/search-action-menu/search-action-menu.component.spec.ts +++ b/projects/aca-content/src/lib/components/search/search-action-menu/search-action-menu.component.spec.ts @@ -27,6 +27,7 @@ import { SearchSortingDefinition } from '@alfresco/adf-content-services/lib/sear import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { SearchActionMenuComponent } from './search-action-menu.component'; +import { MatMenuModule } from '@angular/material/menu'; const mockSortingData: SearchSortingDefinition[] = [ { @@ -52,7 +53,7 @@ describe('SearchActionMenuComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule], + imports: [AppTestingModule, MatMenuModule], declarations: [SearchActionMenuComponent], providers: [SearchQueryBuilderService] }); diff --git a/projects/aca-content/src/lib/components/search/search-input/search-input.component.spec.ts b/projects/aca-content/src/lib/components/search/search-input/search-input.component.spec.ts index d63e3608c5..af728669cc 100644 --- a/projects/aca-content/src/lib/components/search/search-input/search-input.component.spec.ts +++ b/projects/aca-content/src/lib/components/search/search-input/search-input.component.spec.ts @@ -33,6 +33,8 @@ import { map } from 'rxjs/operators'; import { SearchQueryBuilderService } from '@alfresco/adf-content-services'; import { SearchNavigationService } from '../search-navigation.service'; import { BehaviorSubject, Subject } from 'rxjs'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { MatMenuModule } from '@angular/material/menu'; describe('SearchInputComponent', () => { let fixture: ComponentFixture; @@ -47,7 +49,7 @@ describe('SearchInputComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule], + imports: [AppTestingModule, MatSnackBarModule, MatMenuModule], declarations: [SearchInputComponent], providers: [ { 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 6465a86642..a6ef36577b 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 @@ -31,6 +31,8 @@ import { SearchLibrariesQueryBuilderService } from './search-libraries-query-bui 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; @@ -44,7 +46,7 @@ describe('SearchLibrariesResultsComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, AppConfigModule], + imports: [AppTestingModule, AppConfigModule, MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, DocumentListComponent, SearchLibrariesResultsComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ 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 1ec80c1711..47da7c373d 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 @@ -32,6 +32,8 @@ import { Router } from '@angular/router'; import { of } 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'; describe('SharedFilesComponent', () => { let fixture: ComponentFixture; @@ -39,7 +41,7 @@ describe('SharedFilesComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, AppConfigModule], + imports: [AppTestingModule, AppConfigModule, MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, SharedFilesComponent], providers: [ { 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 e16d82f9f8..c80b104eb2 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 @@ -29,6 +29,7 @@ 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; @@ -107,7 +108,7 @@ describe('UserMenuComponent', () => { }; TestBed.configureTestingModule({ - imports: [AppTestingModule, SharedToolbarModule], + imports: [AppTestingModule, SharedToolbarModule, MatMenuModule], declarations: [UserMenuComponent], providers: [ { provide: AuthenticationService, useValue: authServiceStub }, diff --git a/projects/aca-content/src/lib/components/trashcan/trashcan.component.spec.ts b/projects/aca-content/src/lib/components/trashcan/trashcan.component.spec.ts index ef8f22a3cf..4efd975cb3 100644 --- a/projects/aca-content/src/lib/components/trashcan/trashcan.component.spec.ts +++ b/projects/aca-content/src/lib/components/trashcan/trashcan.component.spec.ts @@ -35,7 +35,6 @@ describe('TrashcanComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [AppTestingModule, TrashcanComponent] - // schemas: [NO_ERRORS_SCHEMA] }); fixture = TestBed.createComponent(TrashcanComponent); diff --git a/projects/aca-content/src/lib/services/content-management.service.spec.ts b/projects/aca-content/src/lib/services/content-management.service.spec.ts index c72279d4f5..49e29d7d5b 100644 --- a/projects/aca-content/src/lib/services/content-management.service.spec.ts +++ b/projects/aca-content/src/lib/services/content-management.service.spec.ts @@ -53,8 +53,8 @@ import { Store } from '@ngrx/store'; import { ContentManagementService } from './content-management.service'; import { NodeActionsService } from './node-actions.service'; import { TranslationService, NotificationService } from '@alfresco/adf-core'; -import { MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar'; +import { MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; +import { MatSnackBarModule, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar'; import { NodeEntry, Node, VersionPaging, MinimalNodeEntity } from '@alfresco/js-api'; import { NewVersionUploaderDataAction, @@ -81,7 +81,7 @@ describe('ContentManagementService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, EffectsModule.forRoot([NodeEffects])] + imports: [AppTestingModule, EffectsModule.forRoot([NodeEffects]), MatDialogModule, MatSnackBarModule] }); contentApi = TestBed.inject(ContentApiService); diff --git a/projects/aca-content/src/lib/services/node-actions.service.spec.ts b/projects/aca-content/src/lib/services/node-actions.service.spec.ts index b5e349d1ab..f2c7d70261 100644 --- a/projects/aca-content/src/lib/services/node-actions.service.spec.ts +++ b/projects/aca-content/src/lib/services/node-actions.service.spec.ts @@ -23,7 +23,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { MatDialog, MatDialogRef } from '@angular/material/dialog'; +import { MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { of, throwError, Subject, Observable } from 'rxjs'; import { AlfrescoApiService, TranslationService } from '@alfresco/adf-core'; import { DocumentListService, NodeAction } from '@alfresco/adf-content-services'; @@ -96,7 +96,7 @@ describe('NodeActionsService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule] + imports: [AppTestingModule, MatDialogModule] }); spyOnSuccess = jasmine.createSpy('spyOnSuccess'); diff --git a/projects/aca-content/src/lib/services/node-template.service.spec.ts b/projects/aca-content/src/lib/services/node-template.service.spec.ts index 6257903bb7..19fb9bd050 100644 --- a/projects/aca-content/src/lib/services/node-template.service.spec.ts +++ b/projects/aca-content/src/lib/services/node-template.service.spec.ts @@ -28,7 +28,7 @@ import { AppStore, SnackbarErrorAction } from '@alfresco/aca-shared/store'; import { TemplateEffects } from '../store/effects/template.effects'; import { AppTestingModule } from '../testing/app-testing.module'; import { Store } from '@ngrx/store'; -import { MatDialog } from '@angular/material/dialog'; +import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { NodeTemplateService } from './node-template.service'; import { ResultSetPaging } from '@alfresco/js-api'; @@ -47,7 +47,7 @@ describe('NodeTemplateService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, EffectsModule.forRoot([TemplateEffects])], + imports: [AppTestingModule, EffectsModule.forRoot([TemplateEffects]), MatDialogModule], providers: [NodeTemplateService] }); diff --git a/projects/aca-content/src/lib/store/effects/contextmenu.effects.spec.ts b/projects/aca-content/src/lib/store/effects/contextmenu.effects.spec.ts index 9536231842..ca1e79aacd 100644 --- a/projects/aca-content/src/lib/store/effects/contextmenu.effects.spec.ts +++ b/projects/aca-content/src/lib/store/effects/contextmenu.effects.spec.ts @@ -29,7 +29,7 @@ import { EffectsModule } from '@ngrx/effects'; import { Store } from '@ngrx/store'; import { ContextMenu } from '@alfresco/aca-shared/store'; import { ContextMenuService } from '../../components/context-menu/context-menu.service'; -import { OverlayRef } from '@angular/cdk/overlay'; +import { OverlayModule, OverlayRef } from '@angular/cdk/overlay'; import { ContextMenuOverlayRef } from '../../components/context-menu/context-menu-overlay'; describe('ContextMenuEffects', () => { @@ -39,7 +39,7 @@ describe('ContextMenuEffects', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, EffectsModule.forRoot([ContextMenuEffects])], + imports: [AppTestingModule, EffectsModule.forRoot([ContextMenuEffects]), OverlayModule], providers: [ContextMenuService] }); diff --git a/projects/aca-content/src/lib/store/effects/download.effects.spec.ts b/projects/aca-content/src/lib/store/effects/download.effects.spec.ts index c66be428ad..29606debb2 100644 --- a/projects/aca-content/src/lib/store/effects/download.effects.spec.ts +++ b/projects/aca-content/src/lib/store/effects/download.effects.spec.ts @@ -27,7 +27,7 @@ import { AppTestingModule } from '../../testing/app-testing.module'; import { EffectsModule } from '@ngrx/effects'; import { Store } from '@ngrx/store'; import { BehaviorSubject, Subject } from 'rxjs'; -import { MatDialog, MatDialogRef } from '@angular/material/dialog'; +import { MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { DownloadNodesAction } from '@alfresco/aca-shared/store'; import { SelectionState } from '@alfresco/adf-extensions'; import { VersionEntry } from '@alfresco/js-api'; @@ -38,7 +38,7 @@ describe('DownloadEffects', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, EffectsModule.forRoot([DownloadEffects])] + imports: [AppTestingModule, EffectsModule.forRoot([DownloadEffects]), MatDialogModule] }); store = TestBed.inject(Store); }); diff --git a/projects/aca-content/src/lib/store/effects/node.effects.spec.ts b/projects/aca-content/src/lib/store/effects/node.effects.spec.ts index 7def4b57cb..e019b1ecfe 100644 --- a/projects/aca-content/src/lib/store/effects/node.effects.spec.ts +++ b/projects/aca-content/src/lib/store/effects/node.effects.spec.ts @@ -53,6 +53,8 @@ import { RenditionService } from '@alfresco/adf-content-services'; import { ViewerEffects } from './viewer.effects'; import { Router } from '@angular/router'; import { of } from 'rxjs'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; describe('NodeEffects', () => { let store: Store; @@ -63,7 +65,7 @@ describe('NodeEffects', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, SharedStoreModule, EffectsModule.forRoot([NodeEffects, ViewerEffects])], + imports: [AppTestingModule, SharedStoreModule, EffectsModule.forRoot([NodeEffects, ViewerEffects]), MatDialogModule, MatSnackBarModule], providers: [RenditionService] }); diff --git a/projects/aca-content/src/lib/store/effects/upload.effects.spec.ts b/projects/aca-content/src/lib/store/effects/upload.effects.spec.ts index 922b789a64..df84247054 100644 --- a/projects/aca-content/src/lib/store/effects/upload.effects.spec.ts +++ b/projects/aca-content/src/lib/store/effects/upload.effects.spec.ts @@ -31,6 +31,8 @@ import { NgZone } from '@angular/core'; import { UploadService, FileUploadCompleteEvent, FileModel } from '@alfresco/adf-content-services'; import { UnlockWriteAction, UploadFilesAction, UploadFileVersionAction, UploadFolderAction } from '@alfresco/aca-shared/store'; import { ContentManagementService } from '../../services/content-management.service'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; describe('UploadEffects', () => { let store: Store; @@ -41,7 +43,7 @@ describe('UploadEffects', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, EffectsModule.forRoot([UploadEffects])] + imports: [AppTestingModule, EffectsModule.forRoot([UploadEffects]), MatDialogModule, MatSnackBarModule] }); zone = TestBed.inject(NgZone); diff --git a/projects/aca-content/src/lib/store/effects/viewer.effects.spec.ts b/projects/aca-content/src/lib/store/effects/viewer.effects.spec.ts index 981eda8174..cc2997f0f0 100644 --- a/projects/aca-content/src/lib/store/effects/viewer.effects.spec.ts +++ b/projects/aca-content/src/lib/store/effects/viewer.effects.spec.ts @@ -29,6 +29,7 @@ import { EffectsModule } from '@ngrx/effects'; import { Store } from '@ngrx/store'; import { Router } from '@angular/router'; import { ViewFileAction, ViewNodeAction, SetSelectedNodesAction, SetCurrentFolderAction } from '@alfresco/aca-shared/store'; +import { MatDialogModule } from '@angular/material/dialog'; describe('ViewerEffects', () => { let store: Store; @@ -36,7 +37,7 @@ describe('ViewerEffects', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, EffectsModule.forRoot([ViewerEffects])] + imports: [AppTestingModule, EffectsModule.forRoot([ViewerEffects]), MatDialogModule] }); store = TestBed.inject(Store); diff --git a/projects/aca-content/src/lib/testing/app-testing.module.ts b/projects/aca-content/src/lib/testing/app-testing.module.ts index 0b5892cb9f..3f3c6e8b36 100644 --- a/projects/aca-content/src/lib/testing/app-testing.module.ts +++ b/projects/aca-content/src/lib/testing/app-testing.module.ts @@ -41,7 +41,6 @@ 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 { INITIAL_STATE } from '../store/initial-state'; import { BehaviorSubject, Observable, Subject, of } from 'rxjs'; import { ContentManagementService } from '../services/content-management.service'; @@ -53,7 +52,6 @@ import { STORE_INITIAL_APP_DATA } from '@alfresco/aca-shared/store'; NoopAnimationsModule, HttpClientModule, RouterTestingModule, - MaterialModule, TranslateModule.forRoot(), StoreModule.forRoot( { app: appReducer }, @@ -68,7 +66,7 @@ import { STORE_INITIAL_APP_DATA } from '@alfresco/aca-shared/store'; EffectsModule.forRoot([]), PipeModule ], - exports: [RouterTestingModule, MaterialModule, PipeModule, TranslateModule], + exports: [RouterTestingModule, PipeModule, TranslateModule], providers: [ SearchQueryBuilderService, { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }, From 38e8cd68e0e4d53244258c0777c1963c2c915b0a Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 2 Jun 2023 16:16:52 +0100 Subject: [PATCH 06/10] remove unused test imports --- .../favorite-libraries/favorite-libraries.component.spec.ts | 4 ++-- .../src/lib/components/favorites/favorites.component.spec.ts | 4 ++-- .../src/lib/components/files/files.component.spec.ts | 4 ++-- .../src/lib/components/libraries/libraries.component.spec.ts | 4 ++-- .../components/recent-files/recent-files.component.spec.ts | 4 ++-- .../search-libraries-results.component.spec.ts | 4 ++-- .../components/shared-files/shared-files.component.spec.ts | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/projects/aca-content/src/lib/components/favorite-libraries/favorite-libraries.component.spec.ts b/projects/aca-content/src/lib/components/favorite-libraries/favorite-libraries.component.spec.ts index a3697281ab..632d105891 100644 --- a/projects/aca-content/src/lib/components/favorite-libraries/favorite-libraries.component.spec.ts +++ b/projects/aca-content/src/lib/components/favorite-libraries/favorite-libraries.component.spec.ts @@ -25,7 +25,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { Router } from '@angular/router'; -import { AlfrescoApiService, AppConfigModule, DataTableComponent, UserPreferencesService } from '@alfresco/adf-core'; +import { AlfrescoApiService, DataTableComponent, UserPreferencesService } from '@alfresco/adf-core'; import { DocumentListComponent, NodeFavoriteDirective } from '@alfresco/adf-content-services'; import { FavoriteLibrariesComponent } from './favorite-libraries.component'; import { AppTestingModule } from '../../testing/app-testing.module'; @@ -59,7 +59,7 @@ describe('FavoriteLibrariesComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, EffectsModule.forRoot([RouterEffects, LibraryEffects]), AppConfigModule, MatDialogModule, MatSnackBarModule], + imports: [AppTestingModule, EffectsModule.forRoot([RouterEffects, LibraryEffects]), MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, FavoriteLibrariesComponent], schemas: [NO_ERRORS_SCHEMA] }); diff --git a/projects/aca-content/src/lib/components/favorites/favorites.component.spec.ts b/projects/aca-content/src/lib/components/favorites/favorites.component.spec.ts index 2b42e4d8b9..ea806c9963 100644 --- a/projects/aca-content/src/lib/components/favorites/favorites.component.spec.ts +++ b/projects/aca-content/src/lib/components/favorites/favorites.component.spec.ts @@ -25,7 +25,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { Router } from '@angular/router'; import { TestBed, ComponentFixture } from '@angular/core/testing'; -import { DataTableComponent, AppConfigModule } from '@alfresco/adf-core'; +import { DataTableComponent } from '@alfresco/adf-core'; import { CustomResourcesService, DocumentListComponent, NodeFavoriteDirective } from '@alfresco/adf-content-services'; import { of } from 'rxjs'; import { FavoritesComponent } from './favorites.component'; @@ -43,7 +43,7 @@ describe('FavoritesComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, AppConfigModule, MatDialogModule, MatSnackBarModule], + imports: [AppTestingModule, MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, FavoritesComponent], providers: [ { diff --git a/projects/aca-content/src/lib/components/files/files.component.spec.ts b/projects/aca-content/src/lib/components/files/files.component.spec.ts index 5aae075756..8fa4f518c3 100644 --- a/projects/aca-content/src/lib/components/files/files.component.spec.ts +++ b/projects/aca-content/src/lib/components/files/files.component.spec.ts @@ -25,7 +25,7 @@ import { TestBed, fakeAsync, tick, ComponentFixture } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA, SimpleChange, SimpleChanges } from '@angular/core'; import { Router, ActivatedRoute, convertToParamMap } from '@angular/router'; -import { DataTableComponent, AppConfigModule, DataTableModule, PaginationModule } from '@alfresco/adf-core'; +import { DataTableComponent, DataTableModule, PaginationModule } from '@alfresco/adf-core'; import { DocumentListComponent, DocumentListService, @@ -72,7 +72,7 @@ describe('FilesComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, DataTableModule, PaginationModule, SharedDirectivesModule, DirectivesModule, AppConfigModule], + imports: [AppTestingModule, DataTableModule, PaginationModule, SharedDirectivesModule, DirectivesModule], declarations: [FilesComponent, DataTableComponent, NodeFavoriteDirective, DocumentListComponent], providers: [ { diff --git a/projects/aca-content/src/lib/components/libraries/libraries.component.spec.ts b/projects/aca-content/src/lib/components/libraries/libraries.component.spec.ts index 28327ed022..fd26f655a9 100644 --- a/projects/aca-content/src/lib/components/libraries/libraries.component.spec.ts +++ b/projects/aca-content/src/lib/components/libraries/libraries.component.spec.ts @@ -25,7 +25,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { Router } from '@angular/router'; -import { AlfrescoApiService, DataTableComponent, AppConfigModule } from '@alfresco/adf-core'; +import { AlfrescoApiService, DataTableComponent } from '@alfresco/adf-core'; import { DocumentListComponent, NodeFavoriteDirective } from '@alfresco/adf-content-services'; import { LibrariesComponent } from './libraries.component'; import { AppTestingModule } from '../../testing/app-testing.module'; @@ -54,7 +54,7 @@ describe('LibrariesComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, EffectsModule.forRoot([LibraryEffects]), AppConfigModule, MatDialogModule, MatSnackBarModule], + imports: [AppTestingModule, EffectsModule.forRoot([LibraryEffects]), MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, LibrariesComponent], schemas: [NO_ERRORS_SCHEMA] }); diff --git a/projects/aca-content/src/lib/components/recent-files/recent-files.component.spec.ts b/projects/aca-content/src/lib/components/recent-files/recent-files.component.spec.ts index 4c391767e1..640940605e 100644 --- a/projects/aca-content/src/lib/components/recent-files/recent-files.component.spec.ts +++ b/projects/aca-content/src/lib/components/recent-files/recent-files.component.spec.ts @@ -24,7 +24,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { DataTableComponent, AppConfigModule } from '@alfresco/adf-core'; +import { DataTableComponent } from '@alfresco/adf-core'; import { CustomResourcesService, DocumentListComponent, NodeFavoriteDirective } from '@alfresco/adf-content-services'; import { RecentFilesComponent } from './recent-files.component'; import { AppTestingModule } from '../../testing/app-testing.module'; @@ -42,7 +42,7 @@ describe('RecentFilesComponent', () => { const searchApi = jasmine.createSpyObj('SearchApi', ['search']); const testBed = TestBed.configureTestingModule({ - imports: [AppTestingModule, AppConfigModule, MatDialogModule, MatSnackBarModule], + imports: [AppTestingModule, MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, RecentFilesComponent], providers: [ { provide: SearchApi, useValue: searchApi }, 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 a6ef36577b..7df48ca7dd 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,7 +24,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AppTestingModule } from '../../../testing/app-testing.module'; -import { AppConfigModule, DataTableComponent } from '@alfresco/adf-core'; +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'; @@ -46,7 +46,7 @@ describe('SearchLibrariesResultsComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, AppConfigModule, MatDialogModule, MatSnackBarModule], + imports: [AppTestingModule, MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, DocumentListComponent, SearchLibrariesResultsComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ 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 47da7c373d..abc34ca44a 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 @@ -24,7 +24,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { DataTableComponent, AppConfigModule } from '@alfresco/adf-core'; +import { DataTableComponent } from '@alfresco/adf-core'; import { CustomResourcesService, DocumentListComponent, NodeFavoriteDirective } from '@alfresco/adf-content-services'; import { SharedFilesComponent } from './shared-files.component'; import { AppTestingModule } from '../../testing/app-testing.module'; @@ -41,7 +41,7 @@ describe('SharedFilesComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, AppConfigModule, MatDialogModule, MatSnackBarModule], + imports: [AppTestingModule, MatDialogModule, MatSnackBarModule], declarations: [DataTableComponent, NodeFavoriteDirective, DocumentListComponent, SharedFilesComponent], providers: [ { From ae9abcdcdc3515a2dde15bcb384b23ac2a724271 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 2 Jun 2023 16:27:33 +0100 Subject: [PATCH 07/10] break CoreModule dependency --- .../name-column/name-column.component.spec.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/projects/aca-content/src/lib/components/dl-custom-components/name-column/name-column.component.spec.ts b/projects/aca-content/src/lib/components/dl-custom-components/name-column/name-column.component.spec.ts index a2ae25ee63..5daf9ddacf 100644 --- a/projects/aca-content/src/lib/components/dl-custom-components/name-column/name-column.component.spec.ts +++ b/projects/aca-content/src/lib/components/dl-custom-components/name-column/name-column.component.spec.ts @@ -26,7 +26,7 @@ import { CustomNameColumnComponent } from './name-column.component'; import { Actions } from '@ngrx/effects'; import { StoreModule } from '@ngrx/store'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CoreModule } from '@alfresco/adf-core'; +import { HttpClientModule } from '@angular/common/http'; import { TranslateModule } from '@ngx-translate/core'; describe('CustomNameColumnComponent', () => { @@ -35,12 +35,7 @@ describe('CustomNameColumnComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - CoreModule.forRoot(), - CustomNameColumnComponent, - StoreModule.forRoot({ app: () => {} }, { initialState: {} }) - ], + imports: [HttpClientModule, TranslateModule.forRoot(), CustomNameColumnComponent, StoreModule.forRoot({ app: () => {} }, { initialState: {} })], providers: [Actions] }); From e35322ec7d4f871023f31c1ded8a9ba31e4b3d83 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 2 Jun 2023 16:37:21 +0100 Subject: [PATCH 08/10] login component --- app/src/app/app.module.ts | 4 +-- .../app/components/login/login.component.ts | 4 +++ app/src/app/components/login/login.module.ts | 36 ------------------- 3 files changed, 6 insertions(+), 38 deletions(-) delete mode 100644 app/src/app/components/login/login.module.ts diff --git a/app/src/app/app.module.ts b/app/src/app/app.module.ts index 1253e42c9c..bd3da6d899 100644 --- a/app/src/app/app.module.ts +++ b/app/src/app/app.module.ts @@ -64,7 +64,7 @@ import { STORE_INITIAL_APP_DATA } from '@alfresco/aca-shared/store'; import { ShellModule, SHELL_APP_SERVICE, SHELL_AUTH_TOKEN } from '@alfresco/adf-core/shell'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import { APP_ROUTES } from './app.routes'; -import { AppLoginModule } from './components/login/login.module'; +import { LoginComponent } from './components/login/login.component'; registerLocaleData(localeFr); registerLocaleData(localeDe); @@ -90,7 +90,7 @@ registerLocaleData(localeSv); CoreModule.forRoot(), SharedModule, CoreExtensionsModule.forRoot(), - AppLoginModule, + LoginComponent, environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule, !environment.production ? StoreDevtoolsModule.instrument({ maxAge: 25 }) : [], RouterModule.forRoot(APP_ROUTES, { diff --git a/app/src/app/components/login/login.component.ts b/app/src/app/components/login/login.component.ts index 5af69b21db..1914ba7bd1 100644 --- a/app/src/app/components/login/login.component.ts +++ b/app/src/app/components/login/login.component.ts @@ -22,9 +22,13 @@ * from Hyland Software. If not, see . */ +import { AppConfigModule, LoginModule } from '@alfresco/adf-core'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ + standalone: true, + imports: [LoginModule, AppConfigModule, TranslateModule], templateUrl: './login.component.html' }) export class LoginComponent {} diff --git a/app/src/app/components/login/login.module.ts b/app/src/app/components/login/login.module.ts deleted file mode 100644 index 46ecdf3349..0000000000 --- a/app/src/app/components/login/login.module.ts +++ /dev/null @@ -1,36 +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 { LoginComponent } from './login.component'; -import { TranslateModule } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, CoreModule.forChild(), TranslateModule.forChild()], - exports: [LoginComponent], - declarations: [LoginComponent] -}) -export class AppLoginModule {} From 8a6b12da70106d40e9b335e54248e6da4d66a74a Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 2 Jun 2023 16:39:42 +0100 Subject: [PATCH 09/10] remove app material module --- app/src/app/material.module.ts | 45 ---------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 app/src/app/material.module.ts diff --git a/app/src/app/material.module.ts b/app/src/app/material.module.ts deleted file mode 100644 index be78663687..0000000000 --- a/app/src/app/material.module.ts +++ /dev/null @@ -1,45 +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 { MatMenuModule } from '@angular/material/menu'; -import { MatIconModule } from '@angular/material/icon'; -import { MatButtonModule } from '@angular/material/button'; -import { MatDialogModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog'; -import { MatInputModule } from '@angular/material/input'; -import { MatSnackBarModule } from '@angular/material/snack-bar'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatCardModule } from '@angular/material/card'; - -@NgModule({ - imports: [MatMenuModule, MatIconModule, MatButtonModule, MatDialogModule, MatInputModule, MatSnackBarModule, MatProgressBarModule, MatCardModule], - exports: [MatMenuModule, MatIconModule, MatButtonModule, MatDialogModule, MatInputModule, MatSnackBarModule, MatProgressBarModule, MatCardModule], - providers: [ - { - provide: MAT_DIALOG_DEFAULT_OPTIONS, - useValue: { closeOnNavigation: true, hasBackdrop: true, autoFocus: true } - } - ] -}) -export class MaterialModule {} From c8a88b649e1640161f659dc9c796dcad620bbb13 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Sat, 3 Jun 2023 09:57:00 +0100 Subject: [PATCH 10/10] remove languages from the config as not needed --- app/src/app.config.json.tpl | 71 ------------------------------------- 1 file changed, 71 deletions(-) diff --git a/app/src/app.config.json.tpl b/app/src/app.config.json.tpl index 527e3714d4..97adb099ad 100644 --- a/app/src/app.config.json.tpl +++ b/app/src/app.config.json.tpl @@ -65,77 +65,6 @@ "preserveState": true, "expandedSidenav": true }, - "languages": [ - { - "key": "de", - "label": "Deutsch" - }, - { - "key": "en", - "label": "English" - }, - { - "key": "es", - "label": "Español" - }, - { - "key": "fr", - "label": "Français" - }, - { - "key": "it", - "label": "Italiano" - }, - { - "key": "ja", - "label": "日本語" - }, - { - "key": "nb", - "label": "Bokmål" - }, - { - "key": "nl", - "label": "Nederlands" - }, - { - "key": "pt-BR", - "label": "Português (Brasil)" - }, - { - "key": "ru", - "label": "Русский" - }, - { - "key": "zh-CN", - "label": "中文简体" - }, - { - "key": "cs", - "label": "Čeština" - }, - { - "key": "da", - "label": "Dansk" - }, - { - "key": "fi", - "label": "Suomi" - }, - { - "key": "pl", - "label": "Polski" - }, - { - "key": "sv", - "label": "Svenska" - }, - { - "key": "ar", - "label": "العربية", - "direction": "rtl" - } - ], "mimeTypes": [ { "value": "video/3gpp",