diff --git a/apps/red-ui/src/app/app-routing.module.ts b/apps/red-ui/src/app/app-routing.module.ts index ea41e5775..d856101fd 100644 --- a/apps/red-ui/src/app/app-routing.module.ts +++ b/apps/red-ui/src/app/app-routing.module.ts @@ -8,7 +8,7 @@ import { IqserAuthGuard, IqserPermissionsGuard, IqserRoutes, - TenantResolveComponent, + TenantSelectComponent, } from '@iqser/common-ui'; import { RedRoleGuard } from '@users/red-role.guard'; import { BaseScreenComponent } from '@components/base-screen/base-screen.component'; @@ -211,7 +211,7 @@ const routes: IqserRoutes = [ path: '', pathMatch: 'full', canActivate: [ifNotLoggedIn], - component: TenantResolveComponent, + component: TenantSelectComponent, }, { path: ':tenant', diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts index 5b96bb85e..06b06d7d0 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts @@ -126,7 +126,7 @@ export class BaseScreenComponent { #search(query: string, dossierIds: string[], onlyActive = false) { const queryParams = { query, dossierIds: dossierIds.join(','), onlyActive }; - this._router.navigate([`/${this._tenantsService.currentTenant}/main/search`], { queryParams }).then(); + this._router.navigate([`/${this._tenantsService.activeTenantId}/main/search`], { queryParams }).then(); } #searchThisDossier(query: string) { diff --git a/apps/red-ui/src/app/guards/dossier-files-guard.ts b/apps/red-ui/src/app/guards/dossier-files-guard.ts index 06acc0426..11c6914f4 100644 --- a/apps/red-ui/src/app/guards/dossier-files-guard.ts +++ b/apps/red-ui/src/app/guards/dossier-files-guard.ts @@ -34,7 +34,7 @@ export class DossierFilesGuard implements CanActivate { } if (!dossiersService.has(dossierId)) { - await this._router.navigate([`/${this._tenantsService.currentTenant}/main`, dossierTemplateId]); + await this._router.navigate([`/${this._tenantsService.activeTenantId}/main`, dossierTemplateId]); return false; } diff --git a/apps/red-ui/src/app/guards/dossier-template-exists.guard.ts b/apps/red-ui/src/app/guards/dossier-template-exists.guard.ts index bc4c3a684..ebd2b36f6 100644 --- a/apps/red-ui/src/app/guards/dossier-template-exists.guard.ts +++ b/apps/red-ui/src/app/guards/dossier-template-exists.guard.ts @@ -10,7 +10,7 @@ export function templateExistsWhenEnteringAdmin(): CanActivateFn { const dossierTemplate = inject(DashboardStatsService).find(dossierTemplateId); if (!dossierTemplate) { - await inject(Router).navigate([inject(TenantsService).currentTenant, 'main', 'admin', 'dossier-templates']); + await inject(Router).navigate([inject(TenantsService).activeTenantId, 'main', 'admin', 'dossier-templates']); return false; } return true; @@ -23,7 +23,7 @@ export function templateExistsWhenEnteringDossierList(): CanActivateFn { const dossierTemplateStats = inject(DashboardStatsService).find(dossierTemplateId); if (!dossierTemplateStats || dossierTemplateStats.isEmpty) { - await inject(Router).navigate([inject(TenantsService).currentTenant, 'main']); + await inject(Router).navigate([inject(TenantsService).activeTenantId, 'main']); return false; } return true; diff --git a/apps/red-ui/src/app/guards/dossiers.guard.ts b/apps/red-ui/src/app/guards/dossiers.guard.ts index ff8902584..880b45b02 100644 --- a/apps/red-ui/src/app/guards/dossiers.guard.ts +++ b/apps/red-ui/src/app/guards/dossiers.guard.ts @@ -35,7 +35,7 @@ export class DossiersGuard implements CanActivate { const dossierTemplateStats = this._dashboardStatsService.find(dossierTemplateId); if (isArchive && dossierTemplateStats?.numberOfArchivedDossiers === 0) { - await this._router.navigate([this._tenantsService.currentTenant, 'main', dossierTemplateId, 'dossiers']); + await this._router.navigate([this._tenantsService.activeTenantId, 'main', dossierTemplateId, 'dossiers']); return false; } diff --git a/apps/red-ui/src/app/guards/entity-exists-guard.service.ts b/apps/red-ui/src/app/guards/entity-exists-guard.service.ts index 4d1e6c9ca..285e1b806 100644 --- a/apps/red-ui/src/app/guards/entity-exists-guard.service.ts +++ b/apps/red-ui/src/app/guards/entity-exists-guard.service.ts @@ -12,7 +12,7 @@ export function entityExistsGuard(): CanActivateFn { if (!inject(DictionariesMapService).get(dossierTemplateId, type)) { const dossierTemplate = inject(DossierTemplatesService).find(dossierTemplateId); - await inject(Router).navigate([`/${inject(TenantsService).currentTenant}/${dossierTemplate.routerLink}/entities`]); + await inject(Router).navigate([`/${inject(TenantsService).activeTenantId}/${dossierTemplate.routerLink}/entities`]); return false; } diff --git a/apps/red-ui/src/app/guards/watermark-exists.guard.ts b/apps/red-ui/src/app/guards/watermark-exists.guard.ts index 2813d803c..02a3b19d9 100644 --- a/apps/red-ui/src/app/guards/watermark-exists.guard.ts +++ b/apps/red-ui/src/app/guards/watermark-exists.guard.ts @@ -14,7 +14,7 @@ export function watermarkExistsGuard(): CanActivateFn { } await inject(Router).navigate([ - inject(TenantsService).currentTenant, + inject(TenantsService).activeTenantId, 'main', 'admin', 'dossier-templates', diff --git a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts index c439a9c1f..5e7e951de 100644 --- a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts +++ b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts @@ -47,7 +47,7 @@ export class UserProfileScreenComponent extends BaseFormComponent implements OnI ) { super(); this._loadingService.start(); - const tenant = inject(TenantsService).currentTenant; + const tenant = inject(TenantsService).activeTenantId; const realmUrl = `${getConfig().OAUTH_URL}/realms/${tenant}`; this.changePasswordUrl = `${realmUrl}/account/password`; } diff --git a/apps/red-ui/src/app/modules/admin/base-entity-screen/base-entity-screen.component.ts b/apps/red-ui/src/app/modules/admin/base-entity-screen/base-entity-screen.component.ts index 429607f02..75a70446f 100644 --- a/apps/red-ui/src/app/modules/admin/base-entity-screen/base-entity-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/base-entity-screen/base-entity-screen.component.ts @@ -42,7 +42,7 @@ export class BaseEntityScreenComponent { this._loadingService.start(); const dossierTemplate = this._dossierTemplatesService.find(this.#dossierTemplateId); await firstValueFrom(this._dictionaryService.deleteDictionaries([this.#entityType], this.#dossierTemplateId)); - await this._router.navigate([`/${this._tenantsService.currentTenant}/${dossierTemplate.routerLink}/entities`]); + await this._router.navigate([`/${this._tenantsService.activeTenantId}/${dossierTemplate.routerLink}/entities`]); this._loadingService.stop(); }); } diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.ts index 410a97223..d31c83a07 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.ts @@ -151,7 +151,7 @@ export class WatermarkScreenComponent implements OnInit { ); if (!watermark.id) { await this._router.navigate([ - `/${this._tenantsService.currentTenant}/main/admin/dossier-templates/${this.#dossierTemplateId}/watermarks/${ + `/${this._tenantsService.activeTenantId}/main/admin/dossier-templates/${this.#dossierTemplateId}/watermarks/${ updatedWatermark.id }`, ]); diff --git a/apps/red-ui/src/app/modules/admin/shared/components/dossier-template-actions/dossier-template-actions.component.ts b/apps/red-ui/src/app/modules/admin/shared/components/dossier-template-actions/dossier-template-actions.component.ts index 9a4d4ffe9..021c15f89 100644 --- a/apps/red-ui/src/app/modules/admin/shared/components/dossier-template-actions/dossier-template-actions.component.ts +++ b/apps/red-ui/src/app/modules/admin/shared/components/dossier-template-actions/dossier-template-actions.component.ts @@ -51,7 +51,7 @@ export class DossierTemplateActionsComponent implements OnInit { const success = await firstValueFrom(this._dossierTemplatesService.delete([this.dossierTemplateId])); if (success) { - await this._router.navigate([this._tenantsService.currentTenant, 'main', 'admin']); + await this._router.navigate([this._tenantsService.activeTenantId, 'main', 'admin']); } this._loadingService.stop(); diff --git a/apps/red-ui/src/app/modules/dossier-overview/components/screen-header/dossier-overview-screen-header.component.html b/apps/red-ui/src/app/modules/dossier-overview/components/screen-header/dossier-overview-screen-header.component.html index 78037fd8b..8ff1d20b9 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/components/screen-header/dossier-overview-screen-header.component.html +++ b/apps/red-ui/src/app/modules/dossier-overview/components/screen-header/dossier-overview-screen-header.component.html @@ -1,5 +1,5 @@ this._toaster.info(_('download-status.queued'), { - params: { downloadHref: `/ui/${this._tenantsService.currentTenant}/main/downloads` }, + params: { downloadHref: `/ui/${this._tenantsService.activeTenantId}/main/downloads` }, }), ) .catch(() => this._toaster.error(_('download-status.error'))); diff --git a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts b/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts index c1221ef6c..f5e332a64 100644 --- a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts @@ -99,7 +99,7 @@ export class ExpandableFileActionsComponent implements OnChanges { ...result, }); this._toaster.info(_('download-status.queued'), { - params: { downloadHref: `/ui/${this._tenantsService.currentTenant}/main/downloads` }, + params: { downloadHref: `/ui/${this._tenantsService.activeTenantId}/main/downloads` }, }); } } diff --git a/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts b/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts index b608ad956..ca5ae6e26 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts +++ b/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts @@ -83,7 +83,7 @@ export class AddDossierDialogComponent extends BaseDialogComponent implements On this._loadingService.start(); const savedDossier = await firstValueFrom(this._activeDossiersService.createOrUpdate(this._formToObject())); if (savedDossier) { - await this._router.navigate([`/${this._tenantsService.currentTenant}${savedDossier.routerLink}`]); + await this._router.navigate([`/${this._tenantsService.activeTenantId}${savedDossier.routerLink}`]); if (options?.addMembers) { this._dialogService.openDialog('editDossier', { dossierId: savedDossier.id, diff --git a/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts b/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts index 39672a4af..8225fef33 100644 --- a/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts @@ -36,7 +36,7 @@ export class FileDownloadService extends EntitiesService d.dossierTemplateId === dossierTemplateId)) { route = route.replace(DOSSIERS_ROUTE, ARCHIVE_ROUTE); } - await this.#router.navigate([`/${this.#tenantsService.currentTenant}${route}`]); + await this.#router.navigate([`/${this.#tenantsService.activeTenantId}${route}`]); }), catchError(showArchiveFailedToast), ); diff --git a/apps/red-ui/src/app/services/notifications.service.ts b/apps/red-ui/src/app/services/notifications.service.ts index 3cdc513ad..a6c54e82b 100644 --- a/apps/red-ui/src/app/services/notifications.service.ts +++ b/apps/red-ui/src/app/services/notifications.service.ts @@ -78,7 +78,7 @@ export class NotificationsService extends EntitiesService if it's not user he must be an admin if (currentUser.isUserAdmin && !currentUser.isAdmin && state.url.includes('admin') && !state.url.includes('users')) { - await this._router.navigate([`/${this._tenantsService.currentTenant}/main/admin/users`]); + await this._router.navigate([`/${this._tenantsService.activeTenantId}/main/admin/users`]); return false; } @@ -29,7 +29,7 @@ export class RedRoleGuard extends IqserRoleGuard { !currentUser.isUser && !(state.url.includes('/main/admin/users') || state.url.includes('/main/account')) ) { - await this._router.navigate([`/${this._tenantsService.currentTenant}/main/admin/users`]); + await this._router.navigate([`/${this._tenantsService.activeTenantId}/main/admin/users`]); return false; } @@ -38,9 +38,9 @@ export class RedRoleGuard extends IqserRoleGuard { return true; } if (!currentUser.isUser) { - await this._router.navigate([`/${this._tenantsService.currentTenant}/main/admin`]); + await this._router.navigate([`/${this._tenantsService.activeTenantId}/main/admin`]); } else { - await this._router.navigate([`/${this._tenantsService.currentTenant}`]); + await this._router.navigate([`/${this._tenantsService.activeTenantId}`]); } return false; } diff --git a/apps/red-ui/src/app/utils/main.resolver.ts b/apps/red-ui/src/app/utils/main.resolver.ts index b016ecf0a..0f076fdf0 100644 --- a/apps/red-ui/src/app/utils/main.resolver.ts +++ b/apps/red-ui/src/app/utils/main.resolver.ts @@ -53,10 +53,11 @@ export const mainResolver: ResolveFn = async () => { const lastDossierTemplate = userPreferenceService.getLastDossierTemplate(); if (lastDossierTemplate) { - redirectToLastDossierTemplate(baseHref, tenantsService.currentTenant, lastDossierTemplate); + redirectToLastDossierTemplate(baseHref, tenantsService.activeTenantId, lastDossierTemplate); } loadingService.stop(); + tenantsService.storeTenant(userService.currentUser.email); logger.info('[ROUTES] Main resolver finished!'); }; diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index bb38c7531..b7b6b5df1 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -2065,13 +2065,13 @@ "title": "Authentifizierung aktivieren" }, "tenant-resolve": { - "actions": { - "save": "Proceed" + "contact-administrator": "", + "header": { + "first-time": "", + "join-another-domain": "", + "sign-in-previous-domain": "" }, - "form": { - "tenant-placeholder": "Select a tenant ..." - }, - "header": "Select your Tenant" + "input-placeholder": "" }, "time": { "days": "{days} {days, plural, one{Tag} other{Tage}}", diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index 4a3bf7b75..0efc2f074 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -2065,13 +2065,13 @@ "title": "Enable Authentication" }, "tenant-resolve": { - "actions": { - "save": "Proceed" + "contact-administrator": "Cannot remember the domain's name? Please contact your administrator.", + "header": { + "first-time": "Sign in for the first time to a domain", + "join-another-domain": "Or join another domain", + "sign-in-previous-domain": "Sign in to a previously used domain" }, - "form": { - "tenant-placeholder": "Select a tenant ..." - }, - "header": "Select your Tenant" + "input-placeholder": "your domain's name" }, "time": { "days": "{days} {days, plural, one{day} other{days}}", diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index 274648eb0..753de987d 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -2065,13 +2065,13 @@ "title": "Authentifizierung aktivieren" }, "tenant-resolve": { - "actions": { - "save": "Proceed" + "contact-administrator": "", + "header": { + "first-time": "", + "join-another-domain": "", + "sign-in-previous-domain": "" }, - "form": { - "tenant-placeholder": "Select a tenant ..." - }, - "header": "Select your Tenant" + "input-placeholder": "" }, "time": { "days": "{days} {days, plural, one{Tag} other{Tage}}", diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index 6bd005af1..c819222f4 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -2065,13 +2065,13 @@ "title": "Enable Authentication" }, "tenant-resolve": { - "actions": { - "save": "Proceed" + "contact-administrator": "Cannot remember the domain's name? Please contact your administrator.", + "header": { + "first-time": "Sign in for the first time to a domain", + "join-another-domain": "Or join another domain", + "sign-in-previous-domain": "Sign in to a previously used domain" }, - "form": { - "tenant-placeholder": "Select a tenant ..." - }, - "header": "Select your Tenant" + "input-placeholder": "your domain's name" }, "time": { "days": "{days} {days, plural, one{day} other{days}}", diff --git a/libs/common-ui b/libs/common-ui index 721d3e3b1..223fbe688 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 721d3e3b1a0e933afe76914b1f3b80097e40a6de +Subproject commit 223fbe688c512a5473a9e791acbcf694682f6ffa