Merge branch 'RED-8164' into 'master'

RED-8164

See merge request redactmanager/red-ui!241
This commit is contained in:
Dan Percic 2024-01-05 12:14:06 +01:00
commit 478353c8f8
2 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,7 @@ import { NGXLogger } from 'ngx-logger';
import { firstValueFrom } from 'rxjs';
import { tap } from 'rxjs/operators';
import { APP_BASE_HREF } from '@angular/common';
import { getCurrentUser } from '@users/user.service';
async function redirectToLastDossierTemplate(router: Router, state: RouterStateSnapshot, baseHref: string, lastDossierTemplate: string) {
const lastUrlSegment = window.location.pathname.split('/').filter(Boolean).pop();
@ -43,6 +44,8 @@ export function mainGuard(): AsyncGuard {
const generalConfig$ = inject(GeneralSettingsService).getGeneralConfigurations();
const updatedDisplayName$ = generalConfig$.pipe(tap(config => configService.updateDisplayName(config.displayName)));
const currentUser = getCurrentUser();
const isUsersAdminOnly = currentUser.isUserAdmin && currentUser.roles.length === 1;
await Promise.all([
systemPreferencesService.loadPreferencesIfNeeded(),
@ -52,7 +55,7 @@ export function mainGuard(): AsyncGuard {
const lastDossierTemplate = userPreferenceService.getLastDossierTemplate();
if (lastDossierTemplate) {
if (lastDossierTemplate && !isUsersAdminOnly) {
await redirectToLastDossierTemplate(router, state, baseHref, lastDossierTemplate);
}

@ -1 +1 @@
Subproject commit da086cdaa648d1d35a9eb16ee23cb223e1de2316
Subproject commit bd77067dc7a10bad1b21a3e0807f4ea6413da4ad