feat(authorization): Added unauthorized page. (TV-531)

Squashed commit of the following:

commit 67b70e2e2ece4df73be91dc7f3234543c933d12a
Merge: aabf1cc 26a56fd
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Wed Sep 8 14:01:09 2021 +0200

    Merge branch 'develop' into feature/TV-531

commit aabf1cc4050b45ef055780dece9462ca121d343a
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Wed Sep 8 14:00:15 2021 +0200

    Added unauthorized page
This commit is contained in:
Erik Tiekstra
2021-09-08 14:06:07 +02:00
parent 26a56fdf1f
commit b06436adee
14 changed files with 127 additions and 44 deletions

View File

@@ -1,12 +1,9 @@
<msfa-layout>
<msfa-layout [showBreadCrumbs]="false">
<digi-typography>
<section class="page-not-found">
<h1>Oj då! Vi kan inte hitta sidan.</h1>
<p>Det kan bero på att länken du använder är felaktig eller att sidan inte längre finns.</p>
<a class="msfa__link msfa__link--with-icon msfa__link--ignore-visited" routerLink="/">
<digi-icon-arrow-left class="msfa__digi-icon"></digi-icon-arrow-left>
Gå tillbaka till startsidan
</a>
<msfa-back-link route="/">Tillbaka till startsidan</msfa-back-link>
</section>
</digi-typography>
</msfa-layout>

View File

@@ -1,12 +1,18 @@
import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { BackLinkModule } from '@msfa-shared/components/back-link/back-link.module';
import { LayoutModule } from '@msfa-shared/components/layout/layout.module';
import { PageNotFoundComponent } from './page-not-found.component';
@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [PageNotFoundComponent],
imports: [CommonModule, RouterModule.forChild([{ path: '', component: PageNotFoundComponent }]), LayoutModule],
imports: [
CommonModule,
RouterModule.forChild([{ path: '', component: PageNotFoundComponent }]),
LayoutModule,
BackLinkModule,
],
})
export class PageNotFoundModule {}

View File

@@ -0,0 +1,12 @@
<msfa-layout>
<digi-typography>
<section class="unauthorized">
<h1>Du saknar behörigheter!</h1>
<p>
Det verkar som att du saknar behörigheter att komma in på sidan. Kontakta verksamhetens
behörighetsadministratör.
</p>
<msfa-back-link route="/">Tillbaka till startsidan</msfa-back-link>
</section>
</digi-typography>
</msfa-layout>

View File

@@ -0,0 +1,29 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { UnauthorizedComponent } from './unauthorized.component';
describe('UnauthorizedComponent', () => {
let component: UnauthorizedComponent;
let fixture: ComponentFixture<UnauthorizedComponent>;
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [UnauthorizedComponent],
imports: [RouterTestingModule],
}).compileComponents();
})
);
beforeEach(() => {
fixture = TestBed.createComponent(UnauthorizedComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,9 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
@Component({
selector: 'msfa-unauthorized',
templateUrl: './unauthorized.component.html',
styleUrls: ['./unauthorized.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class UnauthorizedComponent {}

View File

@@ -0,0 +1,18 @@
import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { BackLinkModule } from '@msfa-shared/components/back-link/back-link.module';
import { LayoutModule } from '@msfa-shared/components/layout/layout.module';
import { UnauthorizedComponent } from './unauthorized.component';
@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [UnauthorizedComponent],
imports: [
CommonModule,
RouterModule.forChild([{ path: '', component: UnauthorizedComponent }]),
LayoutModule,
BackLinkModule,
],
})
export class UnauthorizedModule {}