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 61a3c94..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,56 +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], - }, - { - path: 'releases', - data: { title: 'Releaser' }, - loadChildren: () => import('./pages/releases/releases.module').then(m => m.ReleasesModule), - canActivate: [AuthGuard], + canActivate: [AuthGuard, OrganizationGuard, RoleGuard], }, { path: 'logga-ut', @@ -63,21 +42,36 @@ 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, OrganizationGuard], + }, + { + path: 'obehorig', + data: { title: 'Saknar behörighet' }, + loadChildren: () => import('./pages/unauthorized/unauthorized.module').then(m => m.UnauthorizedModule), canActivate: [AuthGuard], }, ]; if (!environment.production) { - routes.push({ - path: 'mock-login', - data: { title: 'Mock login' }, - loadChildren: () => import('./pages/mock-login/mock-login.module').then(m => m.MockLoginModule), - }); + routes.push( + { + path: 'mock-login', + data: { title: 'Mock login' }, + loadChildren: () => import('./pages/mock-login/mock-login.module').then(m => m.MockLoginModule), + }, + { + path: 'releases', + data: { title: 'Releaser' }, + loadChildren: () => import('./pages/releases/releases.module').then(m => m.ReleasesModule), + canActivate: [AuthGuard], + } + ); } routes.push({ diff --git a/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-card/employee-card.component.html b/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-card/employee-card.component.html index 005a3ff..cffe79b 100644 --- a/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-card/employee-card.component.html +++ b/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-card/employee-card.component.html @@ -17,11 +17,11 @@ Redigera -

{{ employee.fullName }}

+

Personalkonto

-

Här kan du se och ändra personalkontots behörigheter. Ändra behörighet genom att klicka på redigera.

+

Här ser ni personalkontot. Ändra behörighet genom att klicka på redigera.

-
+

Personuppgifter

Förnamn
@@ -42,58 +42,73 @@
-
-

Tjänst

+
+

Behörigheter

+

Här kan du se personalkontots behörigheter.

+
+
+

Tjänst

    -
  • {{ tjanst.name }}
  • +
  • + + {{ tjanst.name }} +

Kontot har inga registrerade tjänster ännu.

-
-

Utförande verksamheter och utförande adresser

+
+

Utförande verksamheter och utförande adresser

Kontot har behörighet till alla utförande verksamheter och utförande adresser inom organisationen.

-

- OBS: BEHÖVER FIXAS, ÄVEN OM MAN HAR UTFÖRANDE VERKSAMHETER SÅ SYNS DOM INTE DÅ VI BARA FÅR UT ID -

-
- - - - - {{utforandeverksamhet.adresser.length === 1 ? 'adress' : 'adresser'}} - -
    -
  • - {{address.adressrad}} - {{address.postnummer}} - {{address.postort}} -
  • -
-
-
-
+
  • + +

    Alla adresser inom utförande verksamheten valda.

    + + + + {{ isAccordionExpanded(utforandeVerksamhet.id) ? 'Dölj' : 'Visa' }} + {{utforandeVerksamhet.adresser.length}} {{utforandeVerksamhet.adresser.length === 1 ? 'adress' : + 'adresser'}} + +
      +
    • + {{address.name}}{{last ? '' : ','}} +
    • +
    +
    +
    +
  • +

    Kontot har inga registrerade utförande verksamheter eller utförande adresser ännu.

    -
    -

    Behörigheter

    +
    +

    Roller

    +

    + Här ser du användarens specifika roller i systemet. Tänk på att rollen i systemet är begränsad till de + utförande verksamheter och adresser som användaren hör till. Användaren kan därför endast utföra uppgifter + och se information inom den/de utförande adresser som tilldelats användaren. + . +

    = this.tjanstService.tjanster$; availableUtforandeVerksamheter$: Observable = this._selectedTjanstIds$.pipe( filter(selectedTjanstIds => !!selectedTjanstIds?.length), - switchMap(selectedTjanstIds => this.utforandeVerksamheterService.getUtforandeVerksamheter(selectedTjanstIds)) + switchMap(selectedTjanstIds => this.utforandeVerksamheterService.fetchUtforandeVerksamheter$(selectedTjanstIds)) ); availableRoles: Role[] = this.employeeService.allRoles; diff --git a/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/employee-form.module.ts b/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/employee-form.module.ts index 78aec54..9bd66a1 100644 --- a/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/employee-form.module.ts +++ b/apps/mina-sidor-fa/src/app/pages/administration/pages/employee-form/employee-form.module.ts @@ -12,6 +12,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; import { HideTextModule } from '@msfa-shared/components/hide-text/hide-text.module'; import { LayoutModule } from '@msfa-shared/components/layout/layout.module'; +import { RolesDialogModule } from '@msfa-shared/components/roles-dialog/roles-dialog.module'; import { TreeNodesSelectorModule } from '@msfa-shared/components/tree-nodes-selector/tree-nodes-selector.module'; import { LocalDatePipeModule } from '@msfa-shared/pipes/local-date/local-date.module'; import { EmployeeDeleteModule } from '../../components/employee-delete/employee-delete.module'; @@ -38,6 +39,7 @@ import { EmployeeFormComponent } from './employee-form.component'; DigiNgDialogModule, HideTextModule, TreeNodesSelectorModule, + RolesDialogModule, ], }) export class EmployeeFormModule {} diff --git a/apps/mina-sidor-fa/src/app/pages/administration/pages/employees/components/employees-list/employees-list.component.spec.ts b/apps/mina-sidor-fa/src/app/pages/administration/pages/employees/components/employees-list/employees-list.component.spec.ts index 20e2e48..31efe2e 100644 --- a/apps/mina-sidor-fa/src/app/pages/administration/pages/employees/components/employees-list/employees-list.component.spec.ts +++ b/apps/mina-sidor-fa/src/app/pages/administration/pages/employees/components/employees-list/employees-list.component.spec.ts @@ -2,7 +2,6 @@ import { DigiNgSkeletonBaseModule } from '@af/digi-ng/_skeleton/skeleton-base'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { SortOrder } from '@msfa-enums/sort-order.enum'; import { EmployeeCompactResponse } from '@msfa-models/api/employee.response.model'; @@ -13,7 +12,6 @@ import { employeesMock } from './employees-list.mock'; describe('EmployeesListComponent', () => { let component: EmployeesListComponent; let fixture: ComponentFixture; - const getEmployeeRows = () => fixture.debugElement.queryAll(By.css('.employees-list__row')); beforeEach(async () => { await TestBed.configureTestingModule({ 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.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/page-not-found/page-not-found.component.html b/apps/mina-sidor-fa/src/app/pages/page-not-found/page-not-found.component.html index 0b8e649..bc928cf 100644 --- a/apps/mina-sidor-fa/src/app/pages/page-not-found/page-not-found.component.html +++ b/apps/mina-sidor-fa/src/app/pages/page-not-found/page-not-found.component.html @@ -1,12 +1,9 @@ - +

    Oj då! Vi kan inte hitta sidan.

    Det kan bero på att länken du använder är felaktig eller att sidan inte längre finns.

    - - - Gå tillbaka till startsidan - + Tillbaka till startsidan
    diff --git a/apps/mina-sidor-fa/src/app/pages/page-not-found/page-not-found.module.ts b/apps/mina-sidor-fa/src/app/pages/page-not-found/page-not-found.module.ts index 45652be..7a3abb3 100644 --- a/apps/mina-sidor-fa/src/app/pages/page-not-found/page-not-found.module.ts +++ b/apps/mina-sidor-fa/src/app/pages/page-not-found/page-not-found.module.ts @@ -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 {} 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/pages/unauthorized/unauthorized.component.html b/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.component.html new file mode 100644 index 0000000..d01376c --- /dev/null +++ b/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.component.html @@ -0,0 +1,12 @@ + + +
    +

    Du saknar behörigheter!

    +

    + Det verkar som att du saknar behörigheter att komma in på sidan. Kontakta verksamhetens + behörighetsadministratör. +

    + Tillbaka till startsidan +
    +
    +
    diff --git a/apps/mina-sidor-fa/src/app/pages/messages/messages.component.scss b/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.component.scss similarity index 100% rename from apps/mina-sidor-fa/src/app/pages/messages/messages.component.scss rename to apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.component.scss diff --git a/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.component.spec.ts b/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.component.spec.ts new file mode 100644 index 0000000..429b36f --- /dev/null +++ b/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.component.spec.ts @@ -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; + + 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(); + }); +}); diff --git a/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.component.ts b/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.component.ts new file mode 100644 index 0000000..ae81811 --- /dev/null +++ b/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.component.ts @@ -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 {} diff --git a/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.module.ts b/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.module.ts new file mode 100644 index 0000000..99428e6 --- /dev/null +++ b/apps/mina-sidor-fa/src/app/pages/unauthorized/unauthorized.module.ts @@ -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 {} 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 224c563..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,11 +1,5 @@ -.back-link { - display: inline-flex; - align-items: center; - text-decoration: none; - font-weight: var(--digi--typography--font-weight--semibold); - gap: var(--digi--layout--gutter--xs); +@import 'mixins/link'; - &:hover { - text-decoration: underline; - } +.back-link { + @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 @@ > + + + + + + + + diff --git a/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.component.scss b/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.component.scss index 4d3f086..bac8da7 100644 --- a/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.component.scss +++ b/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.component.scss @@ -1,15 +1,12 @@ +@import 'variables/gutters'; + .footer { background-color: var(--digi--ui--color--background--profile); - padding: var(--digi--layout--gutter); + padding: $digi--layout--gutter--l $digi--layout--gutter; &__logo-wrapper { - height: 100%; - display: flex; - align-items: center; - } - - &__logo { - height: 2rem; - vertical-align: middle; + ::ng-deep .digi-logo { + --digi-logo--padding: 0; + } } } diff --git a/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.module.ts b/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.module.ts index dc8c438..555cb70 100644 --- a/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.module.ts +++ b/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.module.ts @@ -1,9 +1,10 @@ import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { FooterComponent } from './footer.component'; @NgModule({ + schemas: [CUSTOM_ELEMENTS_SCHEMA], declarations: [FooterComponent], imports: [CommonModule, RouterModule], exports: [FooterComponent], diff --git a/apps/mina-sidor-fa/src/app/shared/components/layout/components/navigation/navigation.component.html b/apps/mina-sidor-fa/src/app/shared/components/layout/components/navigation/navigation.component.html index ab10a65..30f85fb 100644 --- a/apps/mina-sidor-fa/src/app/shared/components/layout/components/navigation/navigation.component.html +++ b/apps/mina-sidor-fa/src/app/shared/components/layout/components/navigation/navigation.component.html @@ -1,16 +1,20 @@