LocationBasedServices/maptology/pipeline/head This commit looks good
Upgrade gralde to latest version recommended by android studio. Remove outdated android options in gradle properties. Upgrade outdated gradle plugins to support npm downloads. Upgrade android app dependencies to latest versions. Make logger service constants static final. Replace angular client generator with swagger codegen. Adapt angular code to new client. Integrate proxy config and basehref into angular cli configuration. Change jenkinsfile to only deploy releases. Change jenkinsfile to use gradle wrapper instead of fixed version. Remove dots from user emails to not confuse simple email clients.
79 lines
1.9 KiB
TypeScript
79 lines
1.9 KiB
TypeScript
import { Component, Input, OnInit, OnDestroy } from '@angular/core';
|
|
import { Router, NavigationEnd } from '@angular/router';
|
|
import { Subscription } from 'rxjs';
|
|
|
|
/**
|
|
* Implements a responsive button for the toolbar
|
|
* that consists of an icon, text and a link.
|
|
* Optionally, it can be disabled and it is possible
|
|
* to set a color. If a color is used, the button
|
|
* will raise as well. If no color is provided, the
|
|
* button will be flat.
|
|
*/
|
|
@Component({
|
|
selector: 'app-toolbar-button',
|
|
templateUrl: './toolbar-button.component.html'
|
|
})
|
|
export class ToolbarButtonComponent implements OnInit, OnDestroy {
|
|
|
|
/**
|
|
* The title of the button.
|
|
*/
|
|
@Input() title: string;
|
|
/**
|
|
* The icon of the button which should
|
|
* be a character or ligature of the material
|
|
* icon font.
|
|
*/
|
|
@Input() icon: string;
|
|
/**
|
|
* The router link that is activated by the
|
|
* button.
|
|
*/
|
|
@Input() link: string;
|
|
/**
|
|
* Enables or disables the button.
|
|
*/
|
|
@Input() disabled: boolean;
|
|
/**
|
|
* The color (e.g. "accent") which will also
|
|
* raise the button, if set.
|
|
*/
|
|
@Input() color: string;
|
|
|
|
/**
|
|
* Determines whether the button is shown.
|
|
*/
|
|
visible: boolean;
|
|
|
|
/**
|
|
* The subscription to the router.
|
|
*/
|
|
private routerSubscription: Subscription;
|
|
|
|
/**
|
|
* Creates a new button.
|
|
*
|
|
* @param router The router.
|
|
*/
|
|
constructor(private router: Router) { }
|
|
|
|
ngOnInit() {
|
|
this.routerSubscription = this.router.events.subscribe((event) => {
|
|
if (event instanceof NavigationEnd) {
|
|
this.updateVisibility();
|
|
}
|
|
});
|
|
this.updateVisibility();
|
|
}
|
|
|
|
private updateVisibility(): void {
|
|
this.visible = (this.router.url !== this.link);
|
|
}
|
|
|
|
ngOnDestroy() {
|
|
this.routerSubscription.unsubscribe();
|
|
}
|
|
|
|
}
|