[ACA-4382 ] About Page refactoring to use it across all the platform (#7365)

* about page refactor for global usage

* Development About

* add storybook

* fix build

* fix

* fix

* fix imports

* fix

* fix lint

* fix

* fix

* fix

* fix
This commit is contained in:
Eugenio Romano
2021-11-23 10:30:10 +00:00
committed by GitHub
parent dcb966f391
commit c8688bf0bf
56 changed files with 1079 additions and 777 deletions

View File

@@ -18,22 +18,29 @@
import { Observable, of, throwError } from 'rxjs';
import { RedirectionModel } from '../models/redirection.model';
// TODO: should be extending AuthenticationService
export class AuthenticationMock /*extends AuthenticationService*/ {
export class AuthenticationMock {
private redirectUrl: RedirectionModel = null;
setRedirectUrl(url: RedirectionModel) {
this.redirectUrl = url;
}
getRedirectUrl(): string|null {
isEcmLoggedIn(): boolean {
return true;
}
isBpmLoggedIn(): boolean {
return true;
}
getRedirectUrl(): string | null {
return this.redirectUrl ? this.redirectUrl.url : null;
}
// TODO: real auth service returns Observable<string>
login(username: string, password: string): Observable<{ type: string, ticket: any }> {
if (username === 'fake-username' && password === 'fake-password') {
return of({ type: 'type', ticket: 'ticket'});
return of({ type: 'type', ticket: 'ticket' });
}
if (username === 'fake-username-CORS-error' && password === 'fake-password') {
@@ -46,11 +53,14 @@ export class AuthenticationMock /*extends AuthenticationService*/ {
}
if (username === 'fake-username-CSRF-error' && password === 'fake-password') {
return throwError({message: 'ERROR: Invalid CSRF-token', status: 403});
return throwError({ message: 'ERROR: Invalid CSRF-token', status: 403 });
}
if (username === 'fake-username-ECM-access-error' && password === 'fake-password') {
return throwError({message: 'ERROR: 00170728 Access Denied. The system is currently in read-only mode', status: 403});
return throwError({
message: 'ERROR: 00170728 Access Denied. The system is currently in read-only mode',
status: 403
});
}
return throwError('Fake server error');