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 @@