Updated some pages

This commit is contained in:
Erik Tiekstra
2021-04-07 14:04:58 +02:00
committed by Erik Tiekstra
parent 5448643d8e
commit cee9168c3c
16 changed files with 349 additions and 955 deletions

View File

@@ -1,6 +1,7 @@
export enum IconType { export enum IconType {
HOME = 'home', // Custom HOME = 'home', // Custom
SETTINGS = 'settings', // Custom SETTINGS = 'settings', // Custom
PLUS = 'plus', // Custom
USER = 'user', USER = 'user',
USERS = 'users', USERS = 'users',
BELL = 'bell', BELL = 'bell',

View File

@@ -13,6 +13,10 @@ const routes: Routes = [
path: 'personal', path: 'personal',
loadChildren: () => import('./pages/staff-list/staff-list.module').then(m => m.StaffListModule), loadChildren: () => import('./pages/staff-list/staff-list.module').then(m => m.StaffListModule),
}, },
{
path: 'skapa-konto',
loadChildren: () => import('./pages/create-account/create-account.module').then(m => m.CreateAccountModule),
},
]; ];
@NgModule({ @NgModule({

View File

@@ -0,0 +1,10 @@
<section class="create-account">
<digi-typography>
<h1>Skapa nytt konto</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam magna neque, interdum vel massa eget, condimentum
rutrum velit. Sed vitae ullamcorper sem. Aliquam malesuada nunc sed purus mollis scelerisque. Curabitur bibendum
leo quis ante porttitor tincidunt. Nam tincidunt imperdiet tortor eu suscipit. Maecenas ut dui est.
</p>
</digi-typography>
</section>

View File

@@ -0,0 +1,27 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { CreateAccountComponent } from './create-account.component';
describe('CreateAccountComponent', () => {
let component: CreateAccountComponent;
let fixture: ComponentFixture<CreateAccountComponent>;
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [CreateAccountComponent],
imports: [RouterTestingModule],
}).compileComponents();
})
);
beforeEach(() => {
fixture = TestBed.createComponent(CreateAccountComponent);
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: 'dafa-create-account',
templateUrl: './create-account.component.html',
styleUrls: ['./create-account.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CreateAccountComponent {}

View File

@@ -0,0 +1,11 @@
import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CreateAccountComponent } from './create-account.component';
@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [CreateAccountComponent],
imports: [CommonModule, RouterModule.forChild([{ path: '', component: CreateAccountComponent }])],
})
export class CreateAccountModule {}

View File

@@ -6,5 +6,9 @@
rutrum velit. Sed vitae ullamcorper sem. Aliquam malesuada nunc sed purus mollis scelerisque. Curabitur bibendum rutrum velit. Sed vitae ullamcorper sem. Aliquam malesuada nunc sed purus mollis scelerisque. Curabitur bibendum
leo quis ante porttitor tincidunt. Nam tincidunt imperdiet tortor eu suscipit. Maecenas ut dui est. leo quis ante porttitor tincidunt. Nam tincidunt imperdiet tortor eu suscipit. Maecenas ut dui est.
</p> </p>
<digi-button>
Skapa nytt konto
<dafa-icon [icon]="iconType.PLUS"></dafa-icon>
</digi-button>
</digi-typography> </digi-typography>
</section> </section>

View File

@@ -1,4 +1,5 @@
import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ChangeDetectionStrategy, Component } from '@angular/core';
import { IconType } from '@dafa-enums/icon-type.enum';
@Component({ @Component({
selector: 'dafa-staff-list', selector: 'dafa-staff-list',
@@ -6,4 +7,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
styleUrls: ['./staff-list.component.scss'], styleUrls: ['./staff-list.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
}) })
export class StaffListComponent {} export class StaffListComponent {
iconType = IconType;
}

View File

@@ -1,11 +1,12 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { IconModule } from '@dafa-shared/components/icon/icon.module';
import { StaffListComponent } from './staff-list.component'; import { StaffListComponent } from './staff-list.component';
@NgModule({ @NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA], schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [StaffListComponent], declarations: [StaffListComponent],
imports: [CommonModule, RouterModule.forChild([{ path: '', component: StaffListComponent }])], imports: [CommonModule, RouterModule.forChild([{ path: '', component: StaffListComponent }]), IconModule],
}) })
export class StaffListModule {} export class StaffListModule {}

View File

@@ -17,6 +17,7 @@ describe('ParticipantsListComponent', () => {
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(ParticipantsListComponent); fixture = TestBed.createComponent(ParticipantsListComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
component.participants = [];
fixture.detectChanges(); fixture.detectChanges();
}); });

View File

@@ -1,4 +1,5 @@
import { DigiNgSkeletonBaseModule } from '@af/digi-ng/_skeleton/skeleton-base'; import { DigiNgSkeletonBaseModule } from '@af/digi-ng/_skeleton/skeleton-base';
import { HttpClientModule } from '@angular/common/http';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { ParticipantsListModule } from './components/participants-list/participants-list.module'; import { ParticipantsListModule } from './components/participants-list/participants-list.module';
@@ -12,7 +13,7 @@ describe('ParticipantsComponent', () => {
waitForAsync(() => { waitForAsync(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [ParticipantsComponent], declarations: [ParticipantsComponent],
imports: [RouterTestingModule, DigiNgSkeletonBaseModule, ParticipantsListModule], imports: [RouterTestingModule, HttpClientModule, DigiNgSkeletonBaseModule, ParticipantsListModule],
}).compileComponents(); }).compileComponents();
}) })
); );

View File

@@ -17,6 +17,13 @@
fill="currentColor" fill="currentColor"
></path> ></path>
</svg> </svg>
<svg *ngIf="icon === iconType.PLUS" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="25" height="25">
<path
fill="currentColor"
d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"
></path>
</svg>
</digi-ng-icon-custom> </digi-ng-icon-custom>
<ng-template #DigiNgIcon> <ng-template #DigiNgIcon>

View File

@@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/c
import { IconSize } from '@dafa-enums/icon-size.enum'; import { IconSize } from '@dafa-enums/icon-size.enum';
import { IconType } from '@dafa-enums/icon-type.enum'; import { IconType } from '@dafa-enums/icon-type.enum';
const CUSTOM_ICONS: IconType[] = [IconType.HOME, IconType.SETTINGS]; const CUSTOM_ICONS: IconType[] = [IconType.HOME, IconType.SETTINGS, IconType.PLUS];
@Component({ @Component({
selector: 'dafa-icon', selector: 'dafa-icon',

1216
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -18,6 +18,7 @@
"test:dafa": "ng test dafa-web", "test:dafa": "ng test dafa-web",
"lint": "nx workspace-lint && ng lint", "lint": "nx workspace-lint && ng lint",
"e2e": "ng e2e", "e2e": "ng e2e",
"e2e:dafa": "ng e2e dafa-web",
"affected:apps": "nx affected:apps", "affected:apps": "nx affected:apps",
"affected:libs": "nx affected:libs", "affected:libs": "nx affected:libs",
"affected:build": "nx affected:build", "affected:build": "nx affected:build",