RED-7874 - added back auth-error component
This commit is contained in:
parent
3512e51341
commit
562ae83f73
@ -22,6 +22,7 @@ import { Roles } from '@users/roles';
|
|||||||
import { mainGuard } from '@utils/main.guard';
|
import { mainGuard } from '@utils/main.guard';
|
||||||
import { webViewerLoadedGuard } from './modules/pdf-viewer/services/webviewer-loaded.guard';
|
import { webViewerLoadedGuard } from './modules/pdf-viewer/services/webviewer-loaded.guard';
|
||||||
import { ACTIVE_DOSSIERS_SERVICE } from './tokens';
|
import { ACTIVE_DOSSIERS_SERVICE } from './tokens';
|
||||||
|
import { AuthErrorComponent } from '@components/auth-error/auth-error.component';
|
||||||
|
|
||||||
const dossierTemplateIdRoutes: IqserRoutes = [
|
const dossierTemplateIdRoutes: IqserRoutes = [
|
||||||
{
|
{
|
||||||
@ -209,6 +210,11 @@ const routes: IqserRoutes = [
|
|||||||
component: BaseScreenComponent,
|
component: BaseScreenComponent,
|
||||||
children: mainRoutes,
|
children: mainRoutes,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'auth-error',
|
||||||
|
component: AuthErrorComponent,
|
||||||
|
canActivate: [doesNotHaveAnyRole()],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '**',
|
path: '**',
|
||||||
redirectTo: 'main',
|
redirectTo: 'main',
|
||||||
|
|||||||
@ -68,11 +68,13 @@ import { AppRoutingModule } from './app-routing.module';
|
|||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { PdfViewerModule } from './modules/pdf-viewer/pdf-viewer.module';
|
import { PdfViewerModule } from './modules/pdf-viewer/pdf-viewer.module';
|
||||||
import { ACTIVE_DOSSIERS_SERVICE, ARCHIVED_DOSSIERS_SERVICE } from './tokens';
|
import { ACTIVE_DOSSIERS_SERVICE, ARCHIVED_DOSSIERS_SERVICE } from './tokens';
|
||||||
|
import { AuthErrorComponent } from '@components/auth-error/auth-error.component';
|
||||||
|
|
||||||
export const appModuleFactory = (config: AppConfig) => {
|
export const appModuleFactory = (config: AppConfig) => {
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
|
AuthErrorComponent,
|
||||||
NotificationsComponent,
|
NotificationsComponent,
|
||||||
SpotlightSearchComponent,
|
SpotlightSearchComponent,
|
||||||
BreadcrumbsComponent,
|
BreadcrumbsComponent,
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
<section>
|
||||||
|
<p *ngIf="!adminName && !adminUrl" class="heading-xl" translate="auth-error.heading"></p>
|
||||||
|
<p
|
||||||
|
*ngIf="adminName && adminUrl"
|
||||||
|
[innerHTML]="'auth-error.heading-with-name-and-link' | translate: { adminName: adminName, adminUrl: adminUrl }"
|
||||||
|
class="heading-xl"
|
||||||
|
></p>
|
||||||
|
<p
|
||||||
|
*ngIf="adminName && !adminUrl"
|
||||||
|
[innerHTML]="'auth-error.heading-with-name' | translate: { adminName: adminName }"
|
||||||
|
class="heading-xl"
|
||||||
|
></p>
|
||||||
|
<p
|
||||||
|
*ngIf="!adminName && adminUrl"
|
||||||
|
[innerHTML]="'auth-error.heading-with-link' | translate: { adminName: adminName }"
|
||||||
|
class="heading-xl"
|
||||||
|
></p>
|
||||||
|
<a (click)="userService.logout()" translate="auth-error.logout"></a>
|
||||||
|
</section>
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
section {
|
||||||
|
padding: 24px;
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { UserService } from '@users/user.service';
|
||||||
|
import { getConfig } from '@iqser/common-ui';
|
||||||
|
import { AppConfig } from '@red/domain';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'redaction-auth-error',
|
||||||
|
templateUrl: './auth-error.component.html',
|
||||||
|
styleUrls: ['./auth-error.component.scss'],
|
||||||
|
})
|
||||||
|
export class AuthErrorComponent {
|
||||||
|
readonly #config = getConfig<AppConfig>();
|
||||||
|
readonly adminName = this.#config.ADMIN_CONTACT_NAME;
|
||||||
|
readonly adminUrl = this.#config.ADMIN_CONTACT_URL;
|
||||||
|
|
||||||
|
constructor(readonly userService: UserService) {}
|
||||||
|
}
|
||||||
@ -458,6 +458,13 @@
|
|||||||
},
|
},
|
||||||
"to": "bis"
|
"to": "bis"
|
||||||
},
|
},
|
||||||
|
"auth-error": {
|
||||||
|
"heading": "Ihr Benutzer verfügt nicht über die erforderlichen RED-*-Rollen, um auf diese Applikation zugreifen zu können. Bitte kontaktieren Sie Ihren Admin, um den Zugang anzufordern!",
|
||||||
|
"heading-with-link": "Ihr Benutzer verfügt nicht über die erforderlichen RED-*-Rollen, um auf diese Applikation zugreifen zu können. Bitte kontaktieren Sie <a href={adminUrl} target=_blank >Ihren Admin</a>, um den Zugang anzufordern!",
|
||||||
|
"heading-with-name": "Ihr Benutzer verfügt nicht über die erforderlichen RED-*-Rollen, um auf diese Applikation zugreifen zu können. Bitte kontaktieren Sie {adminName}, um den Zugang anzufordern!",
|
||||||
|
"heading-with-name-and-link": "Ihr Benutzer verfügt nicht über die erforderlichen RED-*-Rollen, um auf diese Applikation zugreifen zu können. Bitte kontaktieren Sie <a href={adminUrl} target=_blank >{adminName}</a>, um den Zugang anzufordern!",
|
||||||
|
"logout": "Ausloggen"
|
||||||
|
},
|
||||||
"change-legal-basis-dialog": {
|
"change-legal-basis-dialog": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"cancel": "Abbrechen",
|
"cancel": "Abbrechen",
|
||||||
|
|||||||
@ -458,6 +458,13 @@
|
|||||||
},
|
},
|
||||||
"to": "to"
|
"to": "to"
|
||||||
},
|
},
|
||||||
|
"auth-error": {
|
||||||
|
"heading": "Your user is successfully logged in but has no role assigned yet. Please contact your RedactManager administrator to assign appropriate roles.",
|
||||||
|
"heading-with-link": "Your user is successfully logged in but has no role assigned yet. Please contact <a href={adminUrl} target=_blank >your RedactManager administrator</a> to assign appropriate roles!",
|
||||||
|
"heading-with-name": "Your user is successfully logged in but has no role assigned yet. Please contact {adminName} to assign appropriate roles.",
|
||||||
|
"heading-with-name-and-link": "Your user is successfully logged in but has no role assigned yet. Please contact <a href={adminUrl} target=_blank >{adminName}</a> to assign appropriate roles.",
|
||||||
|
"logout": "Logout"
|
||||||
|
},
|
||||||
"change-legal-basis-dialog": {
|
"change-legal-basis-dialog": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
|
|||||||
@ -458,6 +458,13 @@
|
|||||||
},
|
},
|
||||||
"to": "bis"
|
"to": "bis"
|
||||||
},
|
},
|
||||||
|
"auth-error": {
|
||||||
|
"heading": "Ihr Benutzer verfügt nicht über die erforderlichen RED-*-Rollen, um auf diese Applikation zugreifen zu können. Bitte kontaktieren Sie Ihren Admin, um den Zugang anzufordern!",
|
||||||
|
"heading-with-link": "Ihr Benutzer verfügt nicht über die erforderlichen RED-*-Rollen, um auf diese Applikation zugreifen zu können. Bitte kontaktieren Sie <a href={adminUrl} target=_blank >Ihren Admin</a>, um den Zugang anzufordern!",
|
||||||
|
"heading-with-name": "Ihr Benutzer verfügt nicht über die erforderlichen RED-*-Rollen, um auf diese Applikation zugreifen zu können. Bitte kontaktieren Sie {adminName}, um den Zugang anzufordern!",
|
||||||
|
"heading-with-name-and-link": "Ihr Benutzer verfügt nicht über die erforderlichen RED-*-Rollen, um auf diese Applikation zugreifen zu können. Bitte kontaktieren Sie <a href={adminUrl} target=_blank >{adminName}</a>, um den Zugang anzufordern!",
|
||||||
|
"logout": "Ausloggen"
|
||||||
|
},
|
||||||
"change-legal-basis-dialog": {
|
"change-legal-basis-dialog": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"cancel": "Abbrechen",
|
"cancel": "Abbrechen",
|
||||||
|
|||||||
@ -458,6 +458,13 @@
|
|||||||
},
|
},
|
||||||
"to": "to"
|
"to": "to"
|
||||||
},
|
},
|
||||||
|
"auth-error": {
|
||||||
|
"heading": "Your user is successfully logged in but has no role assigned yet. Please contact your RedactManager administrator to assign appropriate roles.",
|
||||||
|
"heading-with-link": "Your user is successfully logged in but has no role assigned yet. Please contact <a href={adminUrl} target=_blank >your RedactManager administrator</a> to assign appropriate roles!",
|
||||||
|
"heading-with-name": "Your user is successfully logged in but has no role assigned yet. Please contact {adminName} to assign appropriate roles.",
|
||||||
|
"heading-with-name-and-link": "Your user is successfully logged in but has no role assigned yet. Please contact <a href={adminUrl} target=_blank >{adminName}</a> to assign appropriate roles.",
|
||||||
|
"logout": "Logout"
|
||||||
|
},
|
||||||
"change-legal-basis-dialog": {
|
"change-legal-basis-dialog": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user