Newer
Older
/**
* This file is part of Anis Client.
*
* @copyright Laboratoire d'Astrophysique de Marseille / CNRS
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
import { Instance } from 'src/app/metamodel/models';
/**
* @class
* @classdesc Navbar component.
*/
selector: 'app-navbar',
templateUrl: 'navbar.component.html',
styleUrls: [ 'navbar.component.scss' ],
export class NavbarComponent {
@Input() links: {label: string, icon: string, routerLink: string}[];
@Input() isAuthenticated: boolean;
@Input() userProfile: UserProfile = null;
@Input() baseHref: string;
@Input() authenticationEnabled: boolean;
@Output() login: EventEmitter<any> = new EventEmitter();
@Output() logout: EventEmitter<any> = new EventEmitter();
@Output() openEditProfile: EventEmitter<any> = new EventEmitter();
/**
* Returns logo href.
*
* @return string
*/
getLogoHref(): string {
if (this.instance.config.design.design_logo) {
return `${this.apiUrl}/download-instance-file/${this.instance.name}/${this.instance.config.design.design_logo}`;