Added fake user information
This commit is contained in:
committed by
Erik Tiekstra
parent
bf66859f06
commit
ec6c7eb4a9
@@ -2,7 +2,7 @@
|
|||||||
<dafa-skip-to-content mainContentId="dafa-main-content"></dafa-skip-to-content>
|
<dafa-skip-to-content mainContentId="dafa-main-content"></dafa-skip-to-content>
|
||||||
|
|
||||||
<header class="dafa__header">
|
<header class="dafa__header">
|
||||||
<dafa-navigation></dafa-navigation>
|
<dafa-navigation [user]="user"></dafa-navigation>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main id="dafa-main-content" class="dafa__main">
|
<main id="dafa-main-content" class="dafa__main">
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ import { TestBed } from '@angular/core/testing';
|
|||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { NavigationModule } from './components/navigation/navigation.module';
|
import { NavigationModule } from './components/navigation/navigation.module';
|
||||||
|
import { SidebarModule } from './components/sidebar/sidebar.module';
|
||||||
import { SkipToContentModule } from './components/skip-to-content/skip-to-content.module';
|
import { SkipToContentModule } from './components/skip-to-content/skip-to-content.module';
|
||||||
|
|
||||||
describe('AppComponent', () => {
|
describe('AppComponent', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [AppComponent],
|
declarations: [AppComponent],
|
||||||
imports: [RouterTestingModule, SkipToContentModule, NavigationModule],
|
imports: [RouterTestingModule, SkipToContentModule, NavigationModule, SidebarModule],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||||
import { NavigationEnd, Router } from '@angular/router';
|
import { NavigationEnd, Router } from '@angular/router';
|
||||||
|
import { User } from '@dafa-models/user.model';
|
||||||
import { filter } from 'rxjs/operators';
|
import { filter } from 'rxjs/operators';
|
||||||
import { UnsubscribeDirective } from './directives/unsubscribe.directive';
|
import { UnsubscribeDirective } from './directives/unsubscribe.directive';
|
||||||
|
|
||||||
@@ -11,6 +12,9 @@ import { UnsubscribeDirective } from './directives/unsubscribe.directive';
|
|||||||
})
|
})
|
||||||
export class AppComponent extends UnsubscribeDirective {
|
export class AppComponent extends UnsubscribeDirective {
|
||||||
path = '';
|
path = '';
|
||||||
|
user: User = {
|
||||||
|
id: 'Fake user',
|
||||||
|
};
|
||||||
|
|
||||||
constructor(private router: Router) {
|
constructor(private router: Router) {
|
||||||
super();
|
super();
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
<img src="assets/logo/fa-mina-sidor-light.svg" class="navigation__logo" alt="" />
|
<img src="assets/logo/fa-mina-sidor-light.svg" class="navigation__logo" alt="" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- <ul class="navigation__list dafa__hide-on-print">
|
<ul class="navigation__list dafa__hide-on-print">
|
||||||
<li class="navigation__item">
|
<!-- <li class="navigation__item">
|
||||||
<a
|
<a
|
||||||
class="navigation__link"
|
class="navigation__link"
|
||||||
[routerLink]="['/']"
|
[routerLink]="['/']"
|
||||||
@@ -15,6 +15,12 @@
|
|||||||
<dafa-icon [icon]="iconType.HOME" size="l"></dafa-icon>
|
<dafa-icon [icon]="iconType.HOME" size="l"></dafa-icon>
|
||||||
<span class="navigation__text">Startsida</span>
|
<span class="navigation__text">Startsida</span>
|
||||||
</a>
|
</a>
|
||||||
|
</li> -->
|
||||||
|
<li class="navigation__item" *ngIf="user">
|
||||||
|
<div class="navigation__no-link">
|
||||||
|
<dafa-icon [icon]="iconType.USER" size="l"></dafa-icon>
|
||||||
|
<span class="navigation__text">{{ user.id }}</span>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul> -->
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -93,6 +93,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__text {
|
&__text {
|
||||||
margin-top: $af__gutter-xxs;
|
margin-top: $af__gutter-xs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||||
import { IconType } from '@dafa-enums/icon-type.enum';
|
import { IconType } from '@dafa-enums/icon-type.enum';
|
||||||
|
import { User } from '@dafa-models/user.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'dafa-navigation',
|
selector: 'dafa-navigation',
|
||||||
@@ -8,5 +9,6 @@ import { IconType } from '@dafa-enums/icon-type.enum';
|
|||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class NavigationComponent {
|
export class NavigationComponent {
|
||||||
|
@Input() user: User;
|
||||||
iconType = IconType;
|
iconType = IconType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
|
import { IconModule } from '@dafa-shared/components/icon/icon.module';
|
||||||
import { SidebarComponent } from './sidebar.component';
|
import { SidebarComponent } from './sidebar.component';
|
||||||
|
|
||||||
describe('SidebarComponent', () => {
|
describe('SidebarComponent', () => {
|
||||||
@@ -9,7 +10,7 @@ describe('SidebarComponent', () => {
|
|||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [SidebarComponent],
|
declarations: [SidebarComponent],
|
||||||
imports: [RouterTestingModule],
|
imports: [RouterTestingModule, IconModule],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
3
apps/dafa-web/src/app/data/models/user.model.ts
Normal file
3
apps/dafa-web/src/app/data/models/user.model.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export interface User {
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
@@ -12,9 +12,9 @@
|
|||||||
@include dafa__digi-ng-icon(1em);
|
@include dafa__digi-ng-icon(1em);
|
||||||
}
|
}
|
||||||
&--l {
|
&--l {
|
||||||
@include dafa__digi-ng-icon(1.5em);
|
@include dafa__digi-ng-icon(1.25em);
|
||||||
}
|
}
|
||||||
&--xl {
|
&--xl {
|
||||||
@include dafa__digi-ng-icon(2em);
|
@include dafa__digi-ng-icon(1.5em);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user