mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
Ng16 migration (#4104)
* Updated ACA to Angular 16 * Updated Subject types to void in cases where no values was being emitted * [ACS-8375] [ACA] [General] Selecting a checkbox gives a light green color on focus (#3937) * [ACS-8376] [ACA] [[Manage Rules] Multiple UI issues in create rule dialog (#3943) * [ACS-8378] Fixed inputs having fill styling throughout ACA (#3944) * [ACS-8378] Mat form fields now have white background instead of grey * [ACS-8378] Fixed issue where the background of the boolean mode control dropdown was appearing as white when in condition groups. Labels in create rules window are now black * [ACS-8415] Sidenav labels are now grey (#3946) * [ACS-8379] Fixed issue where icons in menus were coming as black after ng16 upgrade (#3935) * refactor DI into inject() methods (#3954) * Cleanup and remove unneeded commits and changes * Fix eslint (#4032) * [REVERTABLE] - this is a quick temp fix to be able to release ACA with NG16 * [MIGRATION] - added some fix after rebase * Refactor AppEffects (#4079) * Refactor effects to use inject() (#4080) * Refactor effects to use inject() (#4081) * Rebase fixes * [ACS-8739] Fix e2e tests (#4106) * Updated ADF deps * Fixed unit passing mandatory value * Updated ADF version * Updated ADF version * [ACS-8743] [ADW] click on search button open a blank page (#4125) * Updating ADF dep * Updating ADF * Refactor injections in effects (#4137) * Upstream dependencies * Refactor SearchAiEffects * Updating ADF and rebased * Rebased and updated * Rebased and updated * Updating deps * Updating deps * Updating deps * Rebased and updated deps * Pushing package-lock.json * Moved the JWT storage injection token at app level * Updated dependencies * Fixed unit test * Improved solutio for token with no need to set it explicitly * Updating dependencies * Updated package version * Updated ADF deps * Use latest ADF --------- Co-authored-by: swapnil.verma <swapnil.verma@globallogic.com> Co-authored-by: swapnil-verma-gl <92505353+swapnil-verma-gl@users.noreply.github.com> Co-authored-by: VitoAlbano <vito.albano.123@gmail.com> Co-authored-by: Ehsan Rezaei <ehsan.rezaei@hyland.com> Co-authored-by: MichalKinas <michal.kinas@hyland.com>
This commit is contained in:
committed by
GitHub
parent
e97fd97e7c
commit
3fbdc93c51
@@ -84,8 +84,8 @@ describe('ExtensionsDataLoaderGuard', () => {
|
||||
const guard = setupTest([() => subject1.asObservable(), () => subject2.asObservable()]);
|
||||
|
||||
guard.subscribe(emittedSpy, erroredSpy, completedSpy);
|
||||
subject1.next();
|
||||
subject2.next();
|
||||
subject1.next(true);
|
||||
subject2.next(true);
|
||||
subject1.complete();
|
||||
|
||||
expect(emittedSpy).not.toHaveBeenCalled();
|
||||
@@ -99,8 +99,8 @@ describe('ExtensionsDataLoaderGuard', () => {
|
||||
const guard = setupTest([() => subject1.asObservable(), () => subject2.asObservable()]);
|
||||
|
||||
guard.subscribe(emittedSpy, erroredSpy, completedSpy);
|
||||
subject1.next();
|
||||
subject2.next();
|
||||
subject1.next(true);
|
||||
subject2.next(true);
|
||||
subject1.complete();
|
||||
subject2.complete();
|
||||
|
||||
@@ -114,7 +114,7 @@ describe('ExtensionsDataLoaderGuard', () => {
|
||||
const guard = setupTest([() => subject1.asObservable(), () => throwError(new Error())]);
|
||||
|
||||
guard.subscribe(emittedSpy, erroredSpy, completedSpy);
|
||||
subject1.next();
|
||||
subject1.next(true);
|
||||
|
||||
expect(emittedSpy).toHaveBeenCalledWith(true);
|
||||
expect(erroredSpy).not.toHaveBeenCalled();
|
||||
|
@@ -58,7 +58,7 @@ import { NavigationHistoryService } from '../../services/navigation-history.serv
|
||||
/* eslint-disable @angular-eslint/directive-class-suffix */
|
||||
@Directive()
|
||||
export abstract class PageComponent implements OnInit, OnDestroy, OnChanges {
|
||||
onDestroy$: Subject<boolean> = new Subject<boolean>();
|
||||
onDestroy$: Subject<void> = new Subject<void>();
|
||||
|
||||
@ViewChild(DocumentListComponent)
|
||||
documentList: DocumentListComponent;
|
||||
@@ -173,7 +173,7 @@ export abstract class PageComponent implements OnInit, OnDestroy, OnChanges {
|
||||
this.subscriptions.forEach((subscription) => subscription.unsubscribe());
|
||||
this.subscriptions = [];
|
||||
|
||||
this.onDestroy$.next(true);
|
||||
this.onDestroy$.next();
|
||||
this.onDestroy$.complete();
|
||||
this.store.dispatch(new SetSelectedNodesAction([]));
|
||||
}
|
||||
|
@@ -178,7 +178,7 @@ describe('InfoDrawerComponent', () => {
|
||||
|
||||
it('should show the icons from extension', () => {
|
||||
fixture.detectChanges();
|
||||
mockStream.next();
|
||||
mockStream.next({});
|
||||
expect(component.actions).toEqual([
|
||||
{
|
||||
id: 'app.sidebar.close',
|
||||
|
@@ -33,7 +33,7 @@ export class AppHookService {
|
||||
/**
|
||||
* Gets emitted when user delete the node
|
||||
*/
|
||||
nodesDeleted = new Subject<any>();
|
||||
nodesDeleted = new Subject<void>();
|
||||
|
||||
/**
|
||||
* Gets emitted when user delete the library
|
||||
@@ -53,7 +53,7 @@ export class AppHookService {
|
||||
/**
|
||||
* Gets emitted when user join the library
|
||||
*/
|
||||
libraryJoined = new Subject<string>();
|
||||
libraryJoined = new Subject<void>();
|
||||
|
||||
/**
|
||||
* Gets emitted when user left the library
|
||||
@@ -63,20 +63,20 @@ export class AppHookService {
|
||||
/**
|
||||
* Gets emitted when library throws 400 error code
|
||||
*/
|
||||
library400Error = new Subject<any>();
|
||||
library400Error = new Subject<void>();
|
||||
|
||||
/**
|
||||
* Gets emitted when user join the library
|
||||
*/
|
||||
joinLibraryToggle = new Subject<string>();
|
||||
joinLibraryToggle = new Subject<void>();
|
||||
|
||||
/**
|
||||
* Gets emitted when user unlink the node
|
||||
*/
|
||||
linksUnshared = new Subject<any>();
|
||||
linksUnshared = new Subject<void>();
|
||||
|
||||
/**
|
||||
* Gets emitted when user mark the favorite library
|
||||
*/
|
||||
favoriteLibraryToggle = new Subject<any>();
|
||||
favoriteLibraryToggle = new Subject<void>();
|
||||
}
|
||||
|
@@ -137,14 +137,14 @@ describe('AppService', () => {
|
||||
service.ready$.subscribe((value) => {
|
||||
isReady = value;
|
||||
});
|
||||
auth.onLogin.next();
|
||||
auth.onLogin.next({});
|
||||
await expect(isReady).toEqual(true);
|
||||
});
|
||||
|
||||
it('should set local storage prefix after login', () => {
|
||||
spyOn(preferencesService, 'setStoragePrefix');
|
||||
spyOn(auth, 'getUsername').and.returnValue('test-username');
|
||||
auth.onLogin.next();
|
||||
auth.onLogin.next({});
|
||||
|
||||
expect(preferencesService.setStoragePrefix).toHaveBeenCalledWith('test-username');
|
||||
});
|
||||
|
@@ -62,7 +62,7 @@ export class AppService implements ShellAppService, OnDestroy {
|
||||
pageHeading$ = this.pageHeading.asObservable();
|
||||
|
||||
appNavNarMode$: Subject<'collapsed' | 'expanded'> = new BehaviorSubject('expanded');
|
||||
toggleAppNavBar$ = new Subject();
|
||||
toggleAppNavBar$ = new Subject<void>();
|
||||
|
||||
hideSidenavConditions = ['/preview/'];
|
||||
minimizeSidenavConditions = ['search'];
|
||||
|
@@ -24,19 +24,20 @@
|
||||
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Actions, ofType, createEffect } from '@ngrx/effects';
|
||||
import { Actions, createEffect, ofType } from '@ngrx/effects';
|
||||
import { Node, PathInfo } from '@alfresco/js-api';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Location } from '@angular/common';
|
||||
import { NavigateUrlAction, NavigateRouteAction, NavigateToFolder, NavigateToParentFolder, NavigateToPreviousPage } from '../actions/router.actions';
|
||||
import { NavigateRouteAction, NavigateToFolder, NavigateToParentFolder, NavigateToPreviousPage, NavigateUrlAction } from '../actions/router.actions';
|
||||
import { RouterActionTypes } from '../actions/router-action-types';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
|
||||
@Injectable()
|
||||
export class RouterEffects {
|
||||
private notificationService = inject(NotificationService);
|
||||
|
||||
constructor(private actions$: Actions, private router: Router, private location: Location) {}
|
||||
private actions$ = inject(Actions);
|
||||
private router = inject(Router);
|
||||
private location = inject(Location);
|
||||
|
||||
navigateUrl$ = createEffect(
|
||||
() =>
|
||||
|
@@ -23,22 +23,20 @@
|
||||
*/
|
||||
|
||||
import { SnackbarContentComponent, SnackBarData, TranslationService } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Actions, ofType, createEffect } from '@ngrx/effects';
|
||||
import { Actions, createEffect, ofType } from '@ngrx/effects';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { AppStore } from '../states/app.state';
|
||||
import { SnackbarInfoAction, SnackbarActionTypes, SnackbarWarningAction, SnackbarErrorAction, SnackbarAction } from '../actions/snackbar.actions';
|
||||
import { SnackbarAction, SnackbarActionTypes, SnackbarErrorAction, SnackbarInfoAction, SnackbarWarningAction } from '../actions/snackbar.actions';
|
||||
|
||||
@Injectable()
|
||||
export class SnackbarEffects {
|
||||
constructor(
|
||||
private store: Store<AppStore>,
|
||||
private actions$: Actions,
|
||||
private snackBar: MatSnackBar,
|
||||
private translationService: TranslationService
|
||||
) {}
|
||||
private store = inject(Store<AppStore>);
|
||||
private actions$ = inject(Actions);
|
||||
private snackBar = inject(MatSnackBar);
|
||||
private translationService = inject(TranslationService);
|
||||
|
||||
infoEffect = createEffect(
|
||||
() =>
|
||||
|
Reference in New Issue
Block a user