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>
|
||||
|
||||
<header class="dafa__header">
|
||||
<dafa-navigation></dafa-navigation>
|
||||
<dafa-navigation [user]="user"></dafa-navigation>
|
||||
</header>
|
||||
|
||||
<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 { AppComponent } from './app.component';
|
||||
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';
|
||||
|
||||
describe('AppComponent', () => {
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [AppComponent],
|
||||
imports: [RouterTestingModule, SkipToContentModule, NavigationModule],
|
||||
imports: [RouterTestingModule, SkipToContentModule, NavigationModule, SidebarModule],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { User } from '@dafa-models/user.model';
|
||||
import { filter } from 'rxjs/operators';
|
||||
import { UnsubscribeDirective } from './directives/unsubscribe.directive';
|
||||
|
||||
@@ -11,6 +12,9 @@ import { UnsubscribeDirective } from './directives/unsubscribe.directive';
|
||||
})
|
||||
export class AppComponent extends UnsubscribeDirective {
|
||||
path = '';
|
||||
user: User = {
|
||||
id: 'Fake user',
|
||||
};
|
||||
|
||||
constructor(private router: Router) {
|
||||
super();
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<img src="assets/logo/fa-mina-sidor-light.svg" class="navigation__logo" alt="" />
|
||||
</a>
|
||||
</div>
|
||||
<!-- <ul class="navigation__list dafa__hide-on-print">
|
||||
<li class="navigation__item">
|
||||
<ul class="navigation__list dafa__hide-on-print">
|
||||
<!-- <li class="navigation__item">
|
||||
<a
|
||||
class="navigation__link"
|
||||
[routerLink]="['/']"
|
||||
@@ -15,6 +15,12 @@
|
||||
<dafa-icon [icon]="iconType.HOME" size="l"></dafa-icon>
|
||||
<span class="navigation__text">Startsida</span>
|
||||
</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>
|
||||
</ul> -->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -93,6 +93,6 @@
|
||||
}
|
||||
|
||||
&__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 { User } from '@dafa-models/user.model';
|
||||
|
||||
@Component({
|
||||
selector: 'dafa-navigation',
|
||||
@@ -8,5 +9,6 @@ import { IconType } from '@dafa-enums/icon-type.enum';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class NavigationComponent {
|
||||
@Input() user: User;
|
||||
iconType = IconType;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { IconModule } from '@dafa-shared/components/icon/icon.module';
|
||||
import { SidebarComponent } from './sidebar.component';
|
||||
|
||||
describe('SidebarComponent', () => {
|
||||
@@ -9,7 +10,7 @@ describe('SidebarComponent', () => {
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [SidebarComponent],
|
||||
imports: [RouterTestingModule],
|
||||
imports: [RouterTestingModule, IconModule],
|
||||
}).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);
|
||||
}
|
||||
&--l {
|
||||
@include dafa__digi-ng-icon(1.5em);
|
||||
@include dafa__digi-ng-icon(1.25em);
|
||||
}
|
||||
&--xl {
|
||||
@include dafa__digi-ng-icon(2em);
|
||||
@include dafa__digi-ng-icon(1.5em);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user