Right sidebar login option appears only when not on login page
This commit is contained in:
parent
648fe1c139
commit
e344f7ce6e
|
@ -98,11 +98,10 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
top: -40px;
|
top: -40px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 13vh;
|
min-height: 134px;
|
||||||
padding: 25px;
|
padding: 25px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
background: rgb(0, 112, 192);
|
background: rgb(0, 112, 192);
|
||||||
// box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(233, 30, 99, 0.4);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
<div mat-dialog-title>
|
<div mat-dialog-title>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<img mat-card-avatar class="my-mat-card-avatar" *ngIf="this.principalHasAvatar()" [src]="this.getPrincipalAvatar()">
|
<img mat-card-avatar class="my-mat-card-avatar" *ngIf="this.principalHasAvatar()"
|
||||||
|
[src]="this.getPrincipalAvatar()">
|
||||||
</div>
|
</div>
|
||||||
<span class="user-label col">{{this.getPrincipalName()}}</span>
|
<span class="user-label col">{{this.getPrincipalName()}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,7 +16,7 @@
|
||||||
</a>
|
</a>
|
||||||
<mat-divider class="col-12"></mat-divider>
|
<mat-divider class="col-12"></mat-divider>
|
||||||
<a mat-button (click)="logout()" class="col-12">
|
<a mat-button (click)="logout()" class="col-12">
|
||||||
{{'USER-DIALOG.EXIT' | translate}} <mat-icon>exit_to_app</mat-icon>
|
{{ 'USER-DIALOG.LOG-OUT' | translate }} <mat-icon>exit_to_app</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<ng-template #loginoption>
|
<ng-template #loginoption>
|
||||||
<a class="nav-link login" [routerLink]=" ['/login'] ">
|
<a class="nav-link login" *ngIf="!isLoginRouteActivated()" [routerLink]=" ['/login'] ">
|
||||||
<i class="material-icons">vpn_key</i>
|
<i class="material-icons">vpn_key</i>
|
||||||
<p class="login-label">{{ 'GENERAL.ACTIONS.LOG-IN' | translate }}</p>
|
<p class="login-label">{{ 'GENERAL.ACTIONS.LOG-IN' | translate }}</p>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit} from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material';
|
import { MatDialog } from '@angular/material';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { AuthService } from '../../core/services/auth/auth.service';
|
import { AuthService } from '../../core/services/auth/auth.service';
|
||||||
import { UserDialogComponent } from '../misc/navigation/user-dialog/user-dialog.component';
|
import { UserDialogComponent } from '../misc/navigation/user-dialog/user-dialog.component';
|
||||||
import { Principal } from '../../core/model/auth/Principal';
|
import { Principal } from '../../core/model/auth/Principal';
|
||||||
import { AppRole } from '../../core/common/enum/app-role';
|
import { AppRole } from '../../core/common/enum/app-role';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { Location } from '@angular/common';
|
||||||
|
|
||||||
declare interface RouteInfo {
|
declare interface RouteInfo {
|
||||||
path: string;
|
path: string;
|
||||||
|
@ -52,11 +54,14 @@ export class SidebarComponent implements OnInit {
|
||||||
// historyItems: GroupMenuItem;
|
// historyItems: GroupMenuItem;
|
||||||
publicItems: GroupMenuItem;
|
publicItems: GroupMenuItem;
|
||||||
groupMenuItems: GroupMenuItem[] = [];
|
groupMenuItems: GroupMenuItem[] = [];
|
||||||
|
private toggleButton: any;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public translate: TranslateService,
|
public translate: TranslateService,
|
||||||
private authentication: AuthService,
|
private authentication: AuthService,
|
||||||
private dialog: MatDialog) {
|
private dialog: MatDialog,
|
||||||
|
public router: Router,
|
||||||
|
private location: Location) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +132,10 @@ export class SidebarComponent implements OnInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isLoginRouteActivated(): boolean {
|
||||||
|
return this.location.path().indexOf('/login') > -1;
|
||||||
|
}
|
||||||
|
|
||||||
public logout(): void {
|
public logout(): void {
|
||||||
this.authentication.logout();
|
this.authentication.logout();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue