mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-19 19:48:45 +00:00
feat: rehauled console (#3525)
* new console * move npm ci to angular build * rel path for assets * local grpc copy * login policy, rm clear views, features rel path * lock Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
co-authored by
Livio Amstutz
parent
00f7dbe875
commit
08ae39ae19
@@ -0,0 +1,32 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class NavigationService {
|
||||
private history: string[] = [];
|
||||
|
||||
constructor(private router: Router, private location: Location) {
|
||||
this.router.events.subscribe((event) => {
|
||||
if (event instanceof NavigationEnd) {
|
||||
this.history.push(event.urlAfterRedirects);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public back(): void {
|
||||
if (this.isBackPossible) {
|
||||
this.location.back();
|
||||
this.history.pop();
|
||||
} else {
|
||||
this.router.navigateByUrl('/');
|
||||
this.history.pop();
|
||||
}
|
||||
}
|
||||
|
||||
public get isBackPossible(): boolean {
|
||||
return this.history.length > 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user