improve links

This commit is contained in:
Peter Maquiran
2023-04-17 14:57:08 +01:00
parent d4538fa54a
commit f8f5a0074f
27 changed files with 94 additions and 36 deletions
@@ -35,7 +35,7 @@ export class AllProcessesPage implements OnInit {
deplomasStore = DeplomasStore
AllProcess = []
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'Todos' = 'Todos'
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
constructor(
private router: Router,
@@ -53,16 +53,39 @@ export class AllProcessesPage implements OnInit {
ngOnInit() {
this.updateAllProcess()
this.checkFilter();
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital')) {
if (window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing();
this.checkFilter();
}
}
});
}
checkFilter() {
const params: any = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams: any, prop: any) => searchParams.get(prop),
});
const filter = params.filter
if(filter == 'ForToDay') {
this.filterName = 'Para hoje'
} else if (filter == 'OverdueTasks') {
this.filterName = 'OverdueTasks'
} else if (filter == 'New') {
this.filterName = 'Novos'
} else if (filter == 'unread') {
this.filterName = 'Não lidos'
} else {
console.log('filter', filter)
}
}
doRefresh(event) {
if (event) {
setTimeout(() => {