Skip to content
Snippets Groups Projects
Commit 868ce3f9 authored by Etienne LOUPIAS's avatar Etienne LOUPIAS
Browse files

Merge branch 'dev' into 'master'

V3.1.0 (fix)

See merge request !853
parents ad187e0a bf123d74
Branches
Tags
2 merge requests!979feat(dashboard): new access interface,!853V3.1.0 (fix)
<header class="hide-on-print"> <header class="hide-on-print">
<div class="containerIconMenu"> <div class="containerIconMenu">
<app-svg-icon <app-svg-icon
aria-label="Ouvrir le menu"
[asButton]="true" [asButton]="true"
[ariaLabel]="'Ouvrir le menu'"
[folder]="'ico'" [folder]="'ico'"
[icon]="'menu'" [icon]="'menu'"
[iconClass]="'icon-32'" [iconClass]="'icon-32'"
(action)="openMenu()" (action)="toggleMenu()"
/> />
</div> </div>
<div <div
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
<div class="containerIconMenu profile"> <div class="containerIconMenu profile">
<app-svg-icon <app-svg-icon
[asButton]="true" [asButton]="true"
[attr.aria-label]="isLoggedIn ? 'Ouvrir le menu Mon compte' : 'Se connecter'" [ariaLabel]="isLoggedIn ? 'Ouvrir le menu Mon compte' : 'Se connecter'"
[folder]="'ico'" [folder]="'ico'"
[icon]="'profile'" [icon]="'profile'"
[iconClass]="'icon-32'" [iconClass]="'icon-32'"
(action)="isLoggedIn ? openProfileMenu() : goToLoginPage()" (action)="clickProfileButton()"
/> />
</div> </div>
<div class="rightHeader"> <div class="rightHeader">
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
[variant]="'primary'" [variant]="'primary'"
[label]="displayName" [label]="displayName"
[size]="'small'" [size]="'small'"
(action)="openProfileMenu()" (action)="clickProfileButton()"
/> />
<app-button <app-button
*ngIf="!isLoggedIn" *ngIf="!isLoggedIn"
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
[variant]="'primaryBlack'" [variant]="'primaryBlack'"
[label]="'Se connecter'" [label]="'Se connecter'"
[size]="'small'" [size]="'small'"
(action)="goToLoginPage()" (action)="clickProfileButton()"
/> />
</div> </div>
</header> </header>
......
...@@ -55,6 +55,7 @@ export class HeaderComponent { ...@@ -55,6 +55,7 @@ export class HeaderComponent {
return this.router.url === route ? 'page' : ''; return this.router.url === route ? 'page' : '';
} }
public goToHome(): void { public goToHome(): void {
this.closeMenu();
this.router.navigateByUrl('/home'); this.router.navigateByUrl('/home');
} }
public goToProfile(): void { public goToProfile(): void {
...@@ -62,8 +63,8 @@ export class HeaderComponent { ...@@ -62,8 +63,8 @@ export class HeaderComponent {
this.router.navigateByUrl('/profil'); this.router.navigateByUrl('/profil');
} }
public openMenu(): void { public toggleMenu(): void {
this.showMenu = true; this.showMenu = !this.showMenu;
} }
public closeMenu(): void { public closeMenu(): void {
this.showMenu = false; this.showMenu = false;
...@@ -75,6 +76,14 @@ export class HeaderComponent { ...@@ -75,6 +76,14 @@ export class HeaderComponent {
public closeProfileMenu(): void { public closeProfileMenu(): void {
this.showProfileMenu = false; this.showProfileMenu = false;
} }
public clickProfileButton(): void {
this.closeMenu();
if (this.isLoggedIn) {
this.openProfileMenu();
} else {
this.goToLoginPage();
}
}
public get isLoggedIn(): boolean { public get isLoggedIn(): boolean {
return this.authService.isLoggedIn(); return this.authService.isLoggedIn();
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<div class="headerModal"> <div class="headerModal">
<h3>{{ title }}</h3> <h3>{{ title }}</h3>
<app-svg-icon <app-svg-icon
aria-label="Fermer la fenêtre"
[asButton]="true" [asButton]="true"
[ariaLabel]="'Fermer la fenêtre'"
[folder]="'ico'" [folder]="'ico'"
[icon]="'cross'" [icon]="'cross'"
[iconClass]="'icon-24'" [iconClass]="'icon-24'"
......
<button *ngIf="asButton; else svgIcon" type="button" class="asButton" (click)="action.emit()"> <button
*ngIf="asButton; else svgIcon"
type="button"
class="asButton"
[attr.aria-label]="ariaLabel"
(click)="action.emit()"
>
<ng-container *ngTemplateOutlet="svgIcon" /> <ng-container *ngTemplateOutlet="svgIcon" />
</button> </button>
......
...@@ -18,5 +18,6 @@ export class SvgIconComponent { ...@@ -18,5 +18,6 @@ export class SvgIconComponent {
/** If should be interactive */ /** If should be interactive */
@Input() asButton = false; @Input() asButton = false;
@Input() ariaLabel?: string = null;
@Output() action = new EventEmitter<void>(); @Output() action = new EventEmitter<void>();
} }
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<div *ngIf="getModalType() === 'moreFilters'" class="moreFiltersHeader"> <div *ngIf="getModalType() === 'moreFilters'" class="moreFiltersHeader">
<h3>Plus de filtres</h3> <h3>Plus de filtres</h3>
<app-svg-icon <app-svg-icon
aria-label="Fermer la fenêtre"
[asButton]="true" [asButton]="true"
[ariaLabel]="'Fermer la fenêtre'"
[iconClass]="'icon-24'" [iconClass]="'icon-24'"
[iconColor]="'grey-1'" [iconColor]="'grey-1'"
[icon]="'cross'" [icon]="'cross'"
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
<app-svg-icon <app-svg-icon
#closeButton #closeButton
cdkFocusInitial cdkFocusInitial
aria-label="Fermer"
[asButton]="true" [asButton]="true"
[ariaLabel]="'Fermer'"
[folder]="'ico'" [folder]="'ico'"
[icon]="'cross'" [icon]="'cross'"
[iconColor]="'grey-1'" [iconColor]="'grey-1'"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment