From c984912a87ab3dc9debf86ef493baffcc8daa0c2 Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Thu, 9 Sep 2021 06:13:17 +0200 Subject: [PATCH] feat(authorization): Implemented guards to avoid unauthorized access. (TV-515) Squashed commit of the following: commit 86aa3af3f54be4ef5bfb99baece6654a7fba204f Merge: f3258e8 1e45fb5 Author: Erik Tiekstra Date: Thu Sep 9 05:42:46 2021 +0200 Merge branch 'develop' into feature/TV-515-authorization-flow commit f3258e8c6e3d51f21ec619e09c82b2d0f581bde9 Author: Erik Tiekstra Date: Wed Sep 8 16:43:44 2021 +0200 Fixed tests commit 91bfea1baa297f34769a33972fd61481dfa31197 Author: Erik Tiekstra Date: Wed Sep 8 15:55:13 2021 +0200 Removed unused pages commit d4a92fbde9d6255d8406abc23fe1479658035787 Author: Erik Tiekstra Date: Wed Sep 8 15:51:25 2021 +0200 Updated some styling commit dc75656ff96ff0358a2dd0a8b090b4b4938b8323 Author: Erik Tiekstra Date: Wed Sep 8 15:35:04 2021 +0200 Refactured guards by separating organizations into its own guard commit 24f3a0a2d821930bd682b854f98e1c9816ece08c Author: Erik Tiekstra Date: Wed Sep 8 15:33:53 2021 +0200 Readded search on employees commit f1890b104c48d6dd6e263b730dbdafbc2a6fbf0f Author: Erik Tiekstra Date: Wed Sep 8 14:59:24 2021 +0200 Added RoleGuard to pages needing a guard commit ef4b37e3dcc8fe26eef1bb813cfb35727ba691be Merge: 07bca2a b06436a Author: Erik Tiekstra Date: Wed Sep 8 14:06:34 2021 +0200 Merge branch 'develop' into feature/TV-515-authorization-flow commit 07bca2a84d0ec970188c284ba4b950312cec57cb Author: Erik Tiekstra Date: Wed Sep 8 13:26:50 2021 +0200 Added check for navigation --- .../src/app/app-routing.module.ts | 40 ++++++------------- .../employee-card.component.scss | 2 +- .../edit-employee-form.component.html | 2 +- .../edit-employee-form.component.scss | 2 +- .../pages/employees/employees.component.html | 8 ++-- .../pages/employees/employees.component.scss | 1 + .../pages/messages/messages.component.html | 3 -- .../pages/messages/messages.component.scss | 0 .../pages/messages/messages.component.spec.ts | 29 -------------- .../app/pages/messages/messages.component.ts | 9 ----- .../src/app/pages/messages/messages.module.ts | 11 ----- .../my-account/my-account.component.html | 24 ++++++++++- .../my-account/my-account.component.scss | 32 +++++++++++++++ .../my-account/my-account.component.spec.ts | 7 +++- .../pages/my-account/my-account.component.ts | 11 ++++- .../app/pages/my-account/my-account.module.ts | 6 ++- .../organization-picker.component.ts | 7 ++-- .../pages/settings/settings.component.html | 3 -- .../pages/settings/settings.component.scss | 0 .../pages/settings/settings.component.spec.ts | 29 -------------- .../app/pages/settings/settings.component.ts | 9 ----- .../src/app/pages/settings/settings.module.ts | 11 ----- .../statistics/statistics.component.html | 3 -- .../statistics/statistics.component.scss | 0 .../statistics/statistics.component.spec.ts | 29 -------------- .../pages/statistics/statistics.component.ts | 9 ----- .../app/pages/statistics/statistics.module.ts | 11 ----- .../back-link/back-link.component.scss | 2 +- .../components/icon/icon.component.html | 20 ++++++++++ .../shared/components/icon/icon.component.ts | 9 ++++- .../navigation/navigation.component.html | 10 +++-- .../navigation/navigation.component.scss | 9 +++-- .../navigation/navigation.component.ts | 2 + .../components/sidebar/sidebar.component.html | 6 +-- .../components/sidebar/sidebar.component.ts | 15 ++++++- .../components/layout/layout.component.html | 4 +- .../components/layout/layout.component.ts | 18 +++++---- .../src/app/shared/enums/icon-type.enum.ts | 2 + .../src/app/shared/guards/auth.guard.ts | 16 +------- .../app/shared/guards/organization.guard.ts | 23 +++++++++++ .../src/app/shared/guards/role.guard.ts | 30 ++++++++++++++ .../models/api/user-info.response.model.ts | 4 +- .../src/app/shared/models/user-info.model.ts | 5 ++- .../src/app/shared/models/user.model.ts | 3 +- .../app/shared/services/api/user.service.ts | 29 +++++++++----- .../src/styles/mixins/_buttons.scss | 10 +++-- .../src/styles/mixins/_link.scss | 2 +- apps/mina-sidor-fa/src/styles/styles.scss | 4 +- .../src/styles/variables/_colors.scss | 8 ---- 49 files changed, 266 insertions(+), 263 deletions(-) delete mode 100644 apps/mina-sidor-fa/src/app/pages/messages/messages.component.html delete mode 100644 apps/mina-sidor-fa/src/app/pages/messages/messages.component.scss delete mode 100644 apps/mina-sidor-fa/src/app/pages/messages/messages.component.spec.ts delete mode 100644 apps/mina-sidor-fa/src/app/pages/messages/messages.component.ts delete mode 100644 apps/mina-sidor-fa/src/app/pages/messages/messages.module.ts delete mode 100644 apps/mina-sidor-fa/src/app/pages/settings/settings.component.html delete mode 100644 apps/mina-sidor-fa/src/app/pages/settings/settings.component.scss delete mode 100644 apps/mina-sidor-fa/src/app/pages/settings/settings.component.spec.ts delete mode 100644 apps/mina-sidor-fa/src/app/pages/settings/settings.component.ts delete mode 100644 apps/mina-sidor-fa/src/app/pages/settings/settings.module.ts delete mode 100644 apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.html delete mode 100644 apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.scss delete mode 100644 apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.spec.ts delete mode 100644 apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.ts delete mode 100644 apps/mina-sidor-fa/src/app/pages/statistics/statistics.module.ts create mode 100644 apps/mina-sidor-fa/src/app/shared/guards/organization.guard.ts create mode 100644 apps/mina-sidor-fa/src/app/shared/guards/role.guard.ts diff --git a/apps/mina-sidor-fa/src/app/app-routing.module.ts b/apps/mina-sidor-fa/src/app/app-routing.module.ts index 7a7e5a2..287d162 100644 --- a/apps/mina-sidor-fa/src/app/app-routing.module.ts +++ b/apps/mina-sidor-fa/src/app/app-routing.module.ts @@ -1,50 +1,35 @@ import { NgModule } from '@angular/core'; import { ExtraOptions, RouterModule, Routes } from '@angular/router'; +import { RoleEnum } from '@msfa-enums/role.enum'; import { environment } from '@msfa-environment'; import { AuthGuard } from '@msfa-guards/auth.guard'; +import { OrganizationGuard } from '@msfa-guards/organization.guard'; +import { RoleGuard } from '@msfa-guards/role.guard'; const routes: Routes = [ { path: '', data: { title: '' }, loadChildren: () => import('./pages/start/start.module').then(m => m.StartModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, OrganizationGuard], }, { path: 'administration', - data: { title: 'Administration' }, + data: { title: 'Administration', expectedRole: RoleEnum.MSFA_AuthAdmin }, loadChildren: () => import('./pages/administration/administration.module').then(m => m.AdministrationModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, OrganizationGuard, RoleGuard], }, { path: 'deltagare', - data: { title: 'Deltagare' }, + data: { title: 'Deltagare', expectedRole: RoleEnum.MSFA_ReportAndPlanning }, loadChildren: () => import('./pages/deltagare/deltagare.module').then(m => m.DeltagareModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, OrganizationGuard, RoleGuard], }, { path: 'nya-deltagare', - data: { title: 'Nya deltagare' }, + data: { title: 'Nya deltagare', expectedRole: RoleEnum.MSFA_ReceiveDeltagare }, loadChildren: () => import('./pages/avrop/avrop.module').then(m => m.AvropModule), - canActivate: [AuthGuard], - }, - { - path: 'meddelanden', - data: { title: 'Meddelanden' }, - loadChildren: () => import('./pages/messages/messages.module').then(m => m.MessagesModule), - canActivate: [AuthGuard], - }, - { - path: 'statistik', - data: { title: 'Statistik' }, - loadChildren: () => import('./pages/statistics/statistics.module').then(m => m.StatisticsModule), - canActivate: [AuthGuard], - }, - { - path: 'installningar', - data: { title: 'Inställningar' }, - loadChildren: () => import('./pages/settings/settings.module').then(m => m.SettingsModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, OrganizationGuard, RoleGuard], }, { path: 'logga-ut', @@ -57,18 +42,19 @@ const routes: Routes = [ data: { title: 'Välj organisation' }, loadChildren: () => import('./pages/organization-picker/organization-picker.module').then(m => m.OrganizationPickerModule), + canActivate: [AuthGuard], }, { path: 'mitt-konto', data: { title: 'Mitt konto' }, loadChildren: () => import('./pages/my-account/my-account.module').then(m => m.MyAccountModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, OrganizationGuard], }, { path: 'obehorig', data: { title: 'Saknar behörighet' }, loadChildren: () => import('./pages/unauthorized/unauthorized.module').then(m => m.UnauthorizedModule), - canActivate: [], + canActivate: [AuthGuard], }, ]; diff --git a/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-card/employee-card.component.scss b/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-card/employee-card.component.scss index fbaa19b..f92e2b0 100644 --- a/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-card/employee-card.component.scss +++ b/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-card/employee-card.component.scss @@ -71,7 +71,7 @@ } &__edit-button { - @include msfa-button('secondary'); + @include msfa__button('secondary'); } &__authorization-icon { diff --git a/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/edit-employee-form/edit-employee-form.component.html b/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/edit-employee-form/edit-employee-form.component.html index 515a166..47428ae 100644 --- a/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/edit-employee-form/edit-employee-form.component.html +++ b/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/edit-employee-form/edit-employee-form.component.html @@ -140,7 +140,7 @@ (afOnPrimaryClick)="onFormSubmitted(true)" (afOnSecondaryClick)="abortFormSubmit()" (afOnInactive)="abortFormSubmit()" - afHeading="Är du säker" + afHeading="Är du säker?" afHeadingLevel="h2" afPrimaryButtonText="Ja, spara ändå" afSecondaryButtonText="Nej, gå tillbaka" diff --git a/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/edit-employee-form/edit-employee-form.component.scss b/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/edit-employee-form/edit-employee-form.component.scss index 540edf9..e6ad658 100644 --- a/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/edit-employee-form/edit-employee-form.component.scss +++ b/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/edit-employee-form/edit-employee-form.component.scss @@ -47,7 +47,7 @@ } &__link-btn { - @include msfa-button('secondary'); + @include msfa__button('secondary'); } &__choose-all-utforande-verksamheter { diff --git a/apps/mina-sidor-fa/src/app/pages/administration/pages/employees/employees.component.html b/apps/mina-sidor-fa/src/app/pages/administration/pages/employees/employees.component.html index 72aa113..44a1bcd 100644 --- a/apps/mina-sidor-fa/src/app/pages/administration/pages/employees/employees.component.html +++ b/apps/mina-sidor-fa/src/app/pages/administration/pages/employees/employees.component.html @@ -20,11 +20,11 @@

Personallista

- + > + -
Meddelanden funkar!
- diff --git a/apps/mina-sidor-fa/src/app/pages/messages/messages.component.scss b/apps/mina-sidor-fa/src/app/pages/messages/messages.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/apps/mina-sidor-fa/src/app/pages/messages/messages.component.spec.ts b/apps/mina-sidor-fa/src/app/pages/messages/messages.component.spec.ts deleted file mode 100644 index 19dba45..0000000 --- a/apps/mina-sidor-fa/src/app/pages/messages/messages.component.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { LayoutComponent } from '@msfa-shared/components/layout/layout.component'; -import { MessagesComponent } from './messages.component'; - -describe('MessagesComponent', () => { - let component: MessagesComponent; - let fixture: ComponentFixture; - - beforeEach( - waitForAsync(() => { - void TestBed.configureTestingModule({ - declarations: [MessagesComponent, LayoutComponent], - imports: [RouterTestingModule, HttpClientTestingModule], - }).compileComponents(); - }) - ); - - beforeEach(() => { - fixture = TestBed.createComponent(MessagesComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/apps/mina-sidor-fa/src/app/pages/messages/messages.component.ts b/apps/mina-sidor-fa/src/app/pages/messages/messages.component.ts deleted file mode 100644 index 4c02bc3..0000000 --- a/apps/mina-sidor-fa/src/app/pages/messages/messages.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; - -@Component({ - selector: 'msfa-messages', - templateUrl: './messages.component.html', - styleUrls: ['./messages.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class MessagesComponent {} diff --git a/apps/mina-sidor-fa/src/app/pages/messages/messages.module.ts b/apps/mina-sidor-fa/src/app/pages/messages/messages.module.ts deleted file mode 100644 index bac60e0..0000000 --- a/apps/mina-sidor-fa/src/app/pages/messages/messages.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import { LayoutModule } from '@msfa-shared/components/layout/layout.module'; -import { MessagesComponent } from './messages.component'; - -@NgModule({ - declarations: [MessagesComponent], - imports: [CommonModule, RouterModule.forChild([{ path: '', component: MessagesComponent }]), LayoutModule], -}) -export class MessagesModule {} diff --git a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.html b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.html index f6ba78c..d381966 100644 --- a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.html +++ b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.html @@ -1,9 +1,29 @@ + + + + diff --git a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.scss b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.scss index e69de29..d6f9321 100644 --- a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.scss +++ b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.scss @@ -0,0 +1,32 @@ +@import 'mixins/buttons'; +@import 'mixins/list'; +@import 'variables/gutters'; + +.my-account { + &__header { + display: flex; + justify-content: space-between; + align-items: center; + } + + &__logout { + @include msfa__button('secondary'); + } + + &__roles { + @include msfa__reset-list; + display: flex; + flex-direction: column; + gap: $digi--layout--gutter--s; + } + + &__role { + display: flex; + align-items: center; + gap: $digi--layout--gutter--s; + } + + &__authorization-icon { + color: var(--digi--ui--color--border--success); + } +} diff --git a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.spec.ts b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.spec.ts index 888b027..02c7c85 100644 --- a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.spec.ts +++ b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.spec.ts @@ -1,5 +1,7 @@ -import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; import { MyAccountComponent } from './my-account.component'; describe('MyAccountComponent', () => { @@ -9,8 +11,9 @@ describe('MyAccountComponent', () => { beforeEach( waitForAsync(() => { void TestBed.configureTestingModule({ - schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], + schemas: [CUSTOM_ELEMENTS_SCHEMA], declarations: [MyAccountComponent], + imports: [HttpClientTestingModule, RouterTestingModule], }).compileComponents(); }) ); diff --git a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.ts b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.ts index bfd88e3..c7d59b0 100644 --- a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.ts +++ b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.component.ts @@ -1,4 +1,8 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { IconType } from '@msfa-enums/icon-type.enum'; +import { User } from '@msfa-models/user.model'; +import { UserService } from '@msfa-services/api/user.service'; +import { Observable } from 'rxjs'; @Component({ selector: 'msfa-my-account', @@ -6,4 +10,9 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; styleUrls: ['./my-account.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class MyAccountComponent {} +export class MyAccountComponent { + user$: Observable = this.userService.user$; + readonly IconType = IconType; + + constructor(private userService: UserService) {} +} diff --git a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.module.ts b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.module.ts index 36a2357..f7525f6 100644 --- a/apps/mina-sidor-fa/src/app/pages/my-account/my-account.module.ts +++ b/apps/mina-sidor-fa/src/app/pages/my-account/my-account.module.ts @@ -1,7 +1,8 @@ -import { DigiNgLinkInternalModule } from '@af/digi-ng/_link/link-internal'; +import { DigiNgSkeletonBaseModule } from '@af/digi-ng/_skeleton/skeleton-base'; import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; +import { IconModule } from '@msfa-shared/components/icon/icon.module'; import { LayoutModule } from '@msfa-shared/components/layout/layout.module'; import { MyAccountComponent } from './my-account.component'; @@ -12,7 +13,8 @@ import { MyAccountComponent } from './my-account.component'; CommonModule, RouterModule.forChild([{ path: '', component: MyAccountComponent }]), LayoutModule, - DigiNgLinkInternalModule, + IconModule, + DigiNgSkeletonBaseModule, ], }) export class MyAccountModule {} diff --git a/apps/mina-sidor-fa/src/app/pages/organization-picker/organization-picker.component.ts b/apps/mina-sidor-fa/src/app/pages/organization-picker/organization-picker.component.ts index 3a744fc..1710a17 100644 --- a/apps/mina-sidor-fa/src/app/pages/organization-picker/organization-picker.component.ts +++ b/apps/mina-sidor-fa/src/app/pages/organization-picker/organization-picker.component.ts @@ -5,7 +5,7 @@ import { UnsubscribeDirective } from '@msfa-directives/unsubscribe.directive'; import { Organization } from '@msfa-models/organization.model'; import { UserService } from '@msfa-services/api/user.service'; import { Observable } from 'rxjs'; -import { filter, map } from 'rxjs/operators'; +import { filter } from 'rxjs/operators'; @Component({ selector: 'msfa-organization-picker', @@ -14,9 +14,8 @@ import { filter, map } from 'rxjs/operators'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class OrganizationPickerComponent extends UnsubscribeDirective { - organizations$: Observable = this.userService.user$.pipe( - filter(user => !!(user && user.organizations?.length)), - map(({ organizations }) => organizations) + organizations$: Observable = this.userService.organizations$.pipe( + filter(organizations => !!organizations?.length) ); constructor( diff --git a/apps/mina-sidor-fa/src/app/pages/settings/settings.component.html b/apps/mina-sidor-fa/src/app/pages/settings/settings.component.html deleted file mode 100644 index 4588aeb..0000000 --- a/apps/mina-sidor-fa/src/app/pages/settings/settings.component.html +++ /dev/null @@ -1,3 +0,0 @@ - -
Inställningar funkar!
-
diff --git a/apps/mina-sidor-fa/src/app/pages/settings/settings.component.scss b/apps/mina-sidor-fa/src/app/pages/settings/settings.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/apps/mina-sidor-fa/src/app/pages/settings/settings.component.spec.ts b/apps/mina-sidor-fa/src/app/pages/settings/settings.component.spec.ts deleted file mode 100644 index effd860..0000000 --- a/apps/mina-sidor-fa/src/app/pages/settings/settings.component.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { LayoutComponent } from '@msfa-shared/components/layout/layout.component'; -import { SettingsComponent } from './settings.component'; - -describe('SettingsComponent', () => { - let component: SettingsComponent; - let fixture: ComponentFixture; - - beforeEach( - waitForAsync(() => { - void TestBed.configureTestingModule({ - declarations: [SettingsComponent, LayoutComponent], - imports: [RouterTestingModule, HttpClientTestingModule], - }).compileComponents(); - }) - ); - - beforeEach(() => { - fixture = TestBed.createComponent(SettingsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/apps/mina-sidor-fa/src/app/pages/settings/settings.component.ts b/apps/mina-sidor-fa/src/app/pages/settings/settings.component.ts deleted file mode 100644 index cd395c6..0000000 --- a/apps/mina-sidor-fa/src/app/pages/settings/settings.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; - -@Component({ - selector: 'msfa-settings', - templateUrl: './settings.component.html', - styleUrls: ['./settings.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class SettingsComponent {} diff --git a/apps/mina-sidor-fa/src/app/pages/settings/settings.module.ts b/apps/mina-sidor-fa/src/app/pages/settings/settings.module.ts deleted file mode 100644 index 4d15766..0000000 --- a/apps/mina-sidor-fa/src/app/pages/settings/settings.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import { LayoutModule } from '@msfa-shared/components/layout/layout.module'; -import { SettingsComponent } from './settings.component'; - -@NgModule({ - declarations: [SettingsComponent], - imports: [CommonModule, RouterModule.forChild([{ path: '', component: SettingsComponent }]), LayoutModule], -}) -export class SettingsModule {} diff --git a/apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.html b/apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.html deleted file mode 100644 index 3ed6879..0000000 --- a/apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.html +++ /dev/null @@ -1,3 +0,0 @@ - -
Statistik funkar!
-
diff --git a/apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.scss b/apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.spec.ts b/apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.spec.ts deleted file mode 100644 index 8b1a62a..0000000 --- a/apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { LayoutComponent } from '@msfa-shared/components/layout/layout.component'; -import { StatisticsComponent } from './statistics.component'; - -describe('StatisticsComponent', () => { - let component: StatisticsComponent; - let fixture: ComponentFixture; - - beforeEach( - waitForAsync(() => { - void TestBed.configureTestingModule({ - declarations: [StatisticsComponent, LayoutComponent], - imports: [RouterTestingModule, HttpClientTestingModule], - }).compileComponents(); - }) - ); - - beforeEach(() => { - fixture = TestBed.createComponent(StatisticsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.ts b/apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.ts deleted file mode 100644 index c3ae0b6..0000000 --- a/apps/mina-sidor-fa/src/app/pages/statistics/statistics.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; - -@Component({ - selector: 'msfa-statistics', - templateUrl: './statistics.component.html', - styleUrls: ['./statistics.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class StatisticsComponent {} diff --git a/apps/mina-sidor-fa/src/app/pages/statistics/statistics.module.ts b/apps/mina-sidor-fa/src/app/pages/statistics/statistics.module.ts deleted file mode 100644 index 1bca8a8..0000000 --- a/apps/mina-sidor-fa/src/app/pages/statistics/statistics.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import { LayoutModule } from '@msfa-shared/components/layout/layout.module'; -import { StatisticsComponent } from './statistics.component'; - -@NgModule({ - declarations: [StatisticsComponent], - imports: [CommonModule, RouterModule.forChild([{ path: '', component: StatisticsComponent }]), LayoutModule], -}) -export class StatisticsModule {} diff --git a/apps/mina-sidor-fa/src/app/shared/components/back-link/back-link.component.scss b/apps/mina-sidor-fa/src/app/shared/components/back-link/back-link.component.scss index bd35a07..de25bd1 100644 --- a/apps/mina-sidor-fa/src/app/shared/components/back-link/back-link.component.scss +++ b/apps/mina-sidor-fa/src/app/shared/components/back-link/back-link.component.scss @@ -1,5 +1,5 @@ @import 'mixins/link'; .back-link { - @include msfa-link(true); + @include msfa__link(true); } diff --git a/apps/mina-sidor-fa/src/app/shared/components/icon/icon.component.html b/apps/mina-sidor-fa/src/app/shared/components/icon/icon.component.html index ce3824e..a4117ae 100644 --- a/apps/mina-sidor-fa/src/app/shared/components/icon/icon.component.html +++ b/apps/mina-sidor-fa/src/app/shared/components/icon/icon.component.html @@ -25,6 +25,26 @@ > + + + + + + + + -