feat(console): refresh roles, user-grants and project-members based on previous navigation (#728)

* feat: refresh roles, user-grants, project-members

* refresh keys

* user grants on granted projects

* refresh on member changes

* membership refresh

* lint
This commit is contained in:
Max Peintner
2020-09-11 14:24:41 +02:00
committed by GitHub
parent 15c977dab4
commit 4926509de0
24 changed files with 134 additions and 13 deletions
@@ -0,0 +1,27 @@
import { Injectable } from '@angular/core';
import { Event, NavigationEnd, Router } from '@angular/router';
import { filter } from 'rxjs/operators';
@Injectable({
providedIn: 'root',
})
export class RefreshService {
private fifo: Array<string> = ['', ''];
constructor(router: Router) {
router.events
.pipe(filter(event => event instanceof NavigationEnd))
.subscribe((event: Event | any) => {
console.log('prev:', event.url);
this.moveInto(event.url);
});
}
public get previousUrls(): Array<string> {
return this.fifo;
}
private moveInto(value: string): void {
this.fifo[1] = this.fifo[0];
this.fifo[0] = value;
}
}