mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
fix filter change
This commit is contained in:
@@ -281,22 +281,15 @@ export class GabineteDigitalPage implements OnInit {
|
||||
|
||||
|
||||
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') {
|
||||
if(this.router.url.includes('ForToDay')) {
|
||||
this.filterName = 'Para hoje'
|
||||
} else if (filter == 'OverdueTasks') {
|
||||
} else if (this.router.url.includes('OverdueTasks')) {
|
||||
this.filterName = 'OverdueTasks'
|
||||
} else if (filter == 'New') {
|
||||
} else if (this.router.url.includes('New')) {
|
||||
this.filterName = 'Novos'
|
||||
} else if (filter == 'unread') {
|
||||
} else if (this.router.url.includes('unread')) {
|
||||
this.filterName = 'Não lidos'
|
||||
} else {
|
||||
console.log('filter', filter)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -443,7 +436,7 @@ export class GabineteDigitalPage implements OnInit {
|
||||
|
||||
checkRoutes() {
|
||||
this.closeAllDesktopComponents();
|
||||
if (this.router.url == '/home/gabinete-digital?processes=true') {
|
||||
if (this.router.url == 'processes=true') {
|
||||
this.openAllProcessesPage();
|
||||
this.selectedElement = 'allProcessesTag';
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ export class TaskService {
|
||||
}
|
||||
|
||||
overdueTask(isoDateString:string) {
|
||||
return (new Date()).getTime() < (new Date(isoDateString)).getTime()
|
||||
return (new Date()).getTime() > (new Date(isoDateString)).getTime()
|
||||
}
|
||||
|
||||
lessThen24Hours(isoDateString:string) {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-refresher name="refresher" slot="fixed" >
|
||||
<ion-refresher-content
|
||||
pullingIcon="chevron-down-circle-outline"
|
||||
pullingText="deslize para actualizar"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavigationStart, Router } from '@angular/router';
|
||||
import { ActivatedRoute, NavigationEnd, NavigationStart, Router } from '@angular/router';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
@@ -39,7 +39,8 @@ export class AllProcessesPage implements OnInit {
|
||||
constructor(
|
||||
private router: Router,
|
||||
public ThemeService: ThemeService,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
private route: ActivatedRoute
|
||||
) {
|
||||
this.loggeduser = SessionStore.user;
|
||||
}
|
||||
@@ -49,36 +50,32 @@ export class AllProcessesPage implements OnInit {
|
||||
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();
|
||||
}
|
||||
if (event instanceof NavigationEnd && event.url.includes('/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') {
|
||||
console.log(this.router.url)
|
||||
if(this.router.url.includes('ForToDay')) {
|
||||
this.filterName = 'Para hoje'
|
||||
} else if (filter == 'OverdueTasks') {
|
||||
} else if (this.router.url.includes('OverdueTasks')) {
|
||||
this.filterName = 'OverdueTasks'
|
||||
} else if (filter == 'New') {
|
||||
} else if (this.router.url.includes('New')) {
|
||||
this.filterName = 'Novos'
|
||||
} else if (filter == 'unread') {
|
||||
} else if (this.router.url.includes('unread')) {
|
||||
this.filterName = 'Não lidos'
|
||||
} else {
|
||||
console.log('filter', filter)
|
||||
console.log('else uiuuiu')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
if (event) {
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user