-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from GemeenteUtrecht/feature/fe-nav-bar
ZAC navigation
- Loading branch information
Showing
51 changed files
with
492 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
<!--<gu-home></gu-home>--> | ||
<router-outlet></router-outlet> | ||
<div class="gu-dashboard"> | ||
<gu-sidenav [menuItems]="menuItems" | ||
[bottomMenuItems]="bottomMenuItems" | ||
[selectedParentMenu]="selectedMenu" | ||
[logoUrl]="logoUrl" | ||
[mobileLogoUrl]="mobileLogoUrl" | ||
[currentUser]="currentUser"></gu-sidenav> | ||
<div class="main-content-outer-wrapper"> | ||
<router-outlet></router-outlet> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@import 'base/grid/mixins'; | ||
|
||
.gu-dashboard { | ||
height: 100vh; | ||
flex-direction: row; | ||
background-color: white; | ||
display: flex; | ||
@include media-breakpoint-down(md) { | ||
flex-direction: column; | ||
|
||
} | ||
gu-sidenav { | ||
display: block; | ||
position: static; | ||
z-index: 1; | ||
align-self: stretch; | ||
@include media-breakpoint-down(md) { | ||
position: sticky; | ||
top: 0; | ||
} | ||
} | ||
.main-content-outer-wrapper { | ||
width: 100%; | ||
z-index: 0; | ||
overflow: auto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,49 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { menuItems, bottomMenuItems, MenuItem } from './constants/menu'; | ||
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; | ||
import { filter, first, share } from 'rxjs/operators'; | ||
import { Observable } from 'rxjs'; | ||
import { User } from '@gu/models'; | ||
import { ApplicationHttpClient } from '@gu/services'; | ||
|
||
@Component({ | ||
selector: 'zac-ui-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'], | ||
}) | ||
export class AppComponent { | ||
export class AppComponent implements OnInit { | ||
title = 'zac-ui'; | ||
logoUrl = 'assets/gemeente-utrecht-logo.svg'; | ||
mobileLogoUrl = 'assets/schild.png'; | ||
currentUser: string; | ||
|
||
menuItems: MenuItem[] = menuItems; | ||
bottomMenuItems: MenuItem[] = bottomMenuItems; | ||
selectedMenu: string; | ||
|
||
constructor( | ||
private router: Router, | ||
private http: ApplicationHttpClient | ||
) { | ||
} | ||
|
||
ngOnInit() { | ||
this.router.events | ||
.pipe(filter((event) => event instanceof NavigationEnd)) | ||
.subscribe((event: NavigationEnd) => { | ||
const parentRoute = event.url.split('/')[1].split('?')[0] | ||
this.selectedMenu = `${parentRoute}`; | ||
window.scrollTo(0, 0); | ||
}); | ||
this.getCurrentUser() | ||
.pipe(first()) | ||
.subscribe(res => { | ||
this.currentUser = `${res.firstName} ${res.lastName}`; | ||
}); | ||
} | ||
|
||
getCurrentUser(): Observable<User> { | ||
const endpoint = encodeURI("/api/accounts/users/me"); | ||
return this.http.Get<User>(endpoint); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
frontend/zac-ui/apps/zac-ui/src/app/components/home/home.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="feature-container"> | ||
<div class="content-background"> | ||
<div class="content content--wide"> | ||
<h1>Overzicht</h1> | ||
</div> | ||
</div> | ||
</div> | ||
<!--<router-outlet></router-outlet>--> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
frontend/zac-ui/apps/zac-ui/src/app/components/kownsl/kownsl.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<router-outlet></router-outlet> | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
frontend/zac-ui/apps/zac-ui/src/app/components/search/search.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<gu-features-search></gu-features-search> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
frontend/zac-ui/apps/zac-ui/src/app/components/zaak-detail/zaak-detail.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!--<div class="layout"> | ||
<div class="container container--max"> | ||
<gu-features-zaak-detail></gu-features-zaak-detail> | ||
</div> | ||
</div>--> | ||
<gu-features-zaak-detail *ngIf="bronorganisatie && identificatie"></gu-features-zaak-detail> |
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
frontend/zac-ui/apps/zac-ui/src/app/components/zaak-detail/zaak-detail.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
|
||
@Component({ | ||
selector: 'gu-zaak-detail', | ||
templateUrl: './zaak-detail.component.html', | ||
styleUrls: ['./zaak-detail.component.scss'] | ||
}) | ||
export class ZaakDetailComponent implements OnInit { | ||
bronorganisatie: string; | ||
identificatie: string; | ||
|
||
constructor( private route: ActivatedRoute ) {} | ||
|
||
ngOnInit(): void { | ||
this.route.params.subscribe(params => { | ||
this.bronorganisatie = params['bronorganisatie']; | ||
this.identificatie = params['identificatie']; | ||
}); | ||
} | ||
|
||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { MenuItem } from '@gu/models'; | ||
|
||
const menuItems: MenuItem[] = [ | ||
{ | ||
icon: 'search', | ||
label: 'Zoeken', | ||
to: '/zoeken', | ||
marginBottom: true, | ||
}, | ||
{ | ||
icon: 'article', | ||
label: 'Werkvoorraad', | ||
to: '/kownsl', | ||
}, | ||
{ | ||
icon: 'list', | ||
label: 'Alle zaken', | ||
to: '/zaken/002220647/ZAAK-2020-0000004839', | ||
}, | ||
]; | ||
|
||
const bottomMenuItems: MenuItem[] = [ | ||
{ | ||
icon: 'login', | ||
label: 'Inloggen', | ||
to: '/accounts/login/?next=/ui/', | ||
external: true | ||
}, | ||
{ | ||
icon: 'admin_panel_settings', | ||
label: 'Autorisatieprofielen', | ||
to: '/accounts/auth-profiles/', | ||
external: true, | ||
// roles: [UserRole.Admin], | ||
}, | ||
{ | ||
icon: 'admin', | ||
label: 'Admin', | ||
to: '/admin', | ||
external: true | ||
// roles: [UserRole.Admin], | ||
}, | ||
]; | ||
export { MenuItem, menuItems, bottomMenuItems }; |
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
frontend/zac-ui/apps/zac-ui/src/app/kownsl/kownsl.component.html
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
frontend/zac-ui/apps/zac-ui/src/app/search/search.component.html
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
frontend/zac-ui/apps/zac-ui/src/app/zaak-detail/zaak-detail.component.html
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
frontend/zac-ui/apps/zac-ui/src/app/zaak-detail/zaak-detail.component.ts
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
frontend/zac-ui/apps/zac-ui/src/assets/gemeente-utrecht-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
frontend/zac-ui/libs/features/search/src/lib/search-form/search-form.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export interface MenuItem { | ||
id?: string; | ||
icon?: string; | ||
label: string; | ||
to: string; | ||
external?: boolean; | ||
subs?: MenuItem[]; | ||
marginBottom?: boolean; | ||
} |
71 changes: 71 additions & 0 deletions
71
frontend/zac-ui/libs/shared/ui/components/src/lib/components/sidenav/sidenav.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<div class="gu-sidenav"> | ||
<div class="backdrop" | ||
[ngClass]="{ | ||
'expanded': expanded === true | ||
}" | ||
(click)="expanded = !expanded" | ||
></div> | ||
<header class="navigation-header d-lg-none"> | ||
<div class="navbar-left"> | ||
<button class="hamburger" aria-label="Menuknop" (click)="expanded = !expanded"> | ||
<gu-icon>menu</gu-icon> | ||
</button> | ||
</div> | ||
<div class="navbar-logo"> | ||
<span class="logo" [ngStyle]="{'background-image': 'url(' + mobileLogoUrl + ')'}"></span> | ||
</div> | ||
<div class="navbar-right"> | ||
<p class="p--nomargin d-none d-sm-block">{{currentUser}}</p> | ||
</div> | ||
</header> | ||
<nav class="vertical-nav" | ||
[ngClass]="{ | ||
'expanded': expanded === true | ||
}"> | ||
<a class="mobile-menu-back menu-item menu-link d-lg-none" aria-label="Menuknop" (click)="expanded = !expanded"> | ||
<gu-icon fontSize="50">arrow_back</gu-icon> | ||
Ga terug | ||
</a> | ||
<div class="logo"> | ||
<img [src]="logoUrl"/> | ||
</div> | ||
<div class="menu-container" *ngIf="menuItems"> | ||
<a *ngFor="let item of menuItems" | ||
(click)="toggle()" | ||
[routerLink]="!item.external ? [item.to] : null" | ||
[href]="item.external ? item.to : null" | ||
class="menu-item menu-link" | ||
[ngClass]="{ | ||
'selected': selectedParentMenu === subtractParentRoute(item.to), | ||
'mb-3': item.marginBottom === true | ||
}"> | ||
<gu-icon>{{item.icon}}</gu-icon>{{item.label}}</a> | ||
<div class="bottom-navigation"> | ||
<ng-container *ngFor="let bottomItem of bottomMenuItems"> | ||
<a *ngIf="bottomItem.external" | ||
(click)="toggle()" | ||
href="{{bottomItem.to}}" | ||
class="menu-item menu-link" | ||
[ngClass]="{ | ||
'selected': selectedParentMenu === subtractParentRoute(bottomItem.to), | ||
'mb-3': bottomItem.marginBottom === true | ||
}" | ||
> | ||
<gu-icon>{{bottomItem.icon}}</gu-icon>{{bottomItem.label}} | ||
</a> | ||
<a *ngIf="!bottomItem.external" | ||
(click)="toggle()" | ||
[routerLink]="!bottomItem.external ? [bottomItem.to] : null" | ||
class="menu-item menu-link" | ||
[ngClass]="{ | ||
'selected': selectedParentMenu === subtractParentRoute(bottomItem.to), | ||
'mb-3': bottomItem.marginBottom === true | ||
}" | ||
> | ||
<gu-icon>{{bottomItem.icon}}</gu-icon>{{bottomItem.label}} | ||
</a> | ||
</ng-container> | ||
</div> | ||
</div> | ||
</nav> | ||
</div> |
Oops, something went wrong.