[ACS-9510] Tasks and processes are not displayed when About page is refreshed (#4510)

* [ACS-9510] Tasks and processes are not displayed when About page is refreshed

* [ACS-9510] Tasks and processes are not displayed when About page is refreshed
This commit is contained in:
dominikiwanekhyland 2025-04-14 12:32:47 +02:00 committed by GitHub
parent 215881b0cd
commit 0118c21bb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 7 deletions

View File

@ -41,6 +41,7 @@ describe('RouterExtensionService', () => {
let guard1; let guard1;
let guard2; let guard2;
let guard3; let guard3;
let guard4;
beforeEach(() => { beforeEach(() => {
component1 = { name: 'component-1' }; component1 = { name: 'component-1' };
@ -50,6 +51,7 @@ describe('RouterExtensionService', () => {
guard1 = { name: 'guard1' }; guard1 = { name: 'guard1' };
guard2 = { name: 'guard2' }; guard2 = { name: 'guard2' };
guard3 = { name: 'guard3' }; guard3 = { name: 'guard3' };
guard4 = { name: 'guard4' };
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [LibTestingModule], imports: [LibTestingModule],
@ -62,6 +64,7 @@ describe('RouterExtensionService', () => {
getAuthGuards: (authKeys) => { getAuthGuards: (authKeys) => {
const authMapping = { const authMapping = {
'app.auth': guard1, 'app.auth': guard1,
'app.extensions.dataLoaderGuard': guard4,
'ext.auth1': guard2, 'ext.auth1': guard2,
'ext.auth2': guard3 'ext.auth2': guard3
}; };
@ -135,18 +138,18 @@ describe('RouterExtensionService', () => {
expect(service.getApplicationRoutes()[0].component).toBe(component1); expect(service.getApplicationRoutes()[0].component).toBe(component1);
}); });
it('should calculate the "canActivateChild" and "canActivate" to default auth guard, if no "auth" defined for the route', () => { it('should calculate the "canActivateChild" and "canActivate" to default guards, if no "auth" defined for the route', () => {
extensionService.routes = [getDummyRoute({ auth: undefined })]; extensionService.routes = [getDummyRoute({ auth: undefined })];
expect(service.getApplicationRoutes()[0].canActivateChild).toEqual([guard1]); expect(service.getApplicationRoutes()[0].canActivateChild).toEqual([guard1, guard4]);
expect(service.getApplicationRoutes()[0].canActivate).toEqual([guard1]); expect(service.getApplicationRoutes()[0].canActivate).toEqual([guard1, guard4]);
}); });
it('should calculate the "canActivateChild" and "canActivate" to default auth guard, if "auth" is defined as [] for the route', () => { it('should calculate the "canActivateChild" and "canActivate" to default guards, if "auth" is defined as [] for the route', () => {
extensionService.routes = [getDummyRoute({ auth: [] })]; extensionService.routes = [getDummyRoute({ auth: [] })];
expect(service.getApplicationRoutes()[0].canActivateChild).toEqual([guard1]); expect(service.getApplicationRoutes()[0].canActivateChild).toEqual([guard1, guard4]);
expect(service.getApplicationRoutes()[0].canActivate).toEqual([guard1]); expect(service.getApplicationRoutes()[0].canActivate).toEqual([guard1, guard4]);
}); });
it('should calculate the "canActivateChild" and "canActivate" to the registered guard(s) matching the "auth" value of the route', () => { it('should calculate the "canActivateChild" and "canActivate" to the registered guard(s) matching the "auth" value of the route', () => {

View File

@ -33,7 +33,7 @@ import { Router } from '@angular/router';
export class RouterExtensionService { export class RouterExtensionService {
defaults = { defaults = {
layout: 'app.layout.main', layout: 'app.layout.main',
auth: ['app.auth'] auth: ['app.auth', 'app.extensions.dataLoaderGuard']
}; };
constructor(private router: Router, protected extensions: ExtensionService) {} constructor(private router: Router, protected extensions: ExtensionService) {}