Fix loader

This commit is contained in:
Peter Maquiran
2021-07-17 10:49:52 +01:00
parent 6719dbdce4
commit 6ef4dd6ab4
5 changed files with 48 additions and 37 deletions
@@ -66,9 +66,11 @@ export class DespachosPrPage implements OnInit {
//Inicializar segment //Inicializar segment
this.segment = "despachos"; this.segment = "despachos";
const location = window.location
const pathname = location.pathname + location.search
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
event.url.startsWith('/home/gabinete-digital?despachospr=true')) {
this.LoadList(); this.LoadList();
} }
}); });
@@ -104,7 +106,8 @@ export class DespachosPrPage implements OnInit {
this.skeletonLoader = true this.skeletonLoader = true
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise(); let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.despachoList = new Array(); this.despachoList = [];
this.skeletonLoader = false
let despachosPr; let despachosPr;
switch (this.loggeduser.Profile) { switch (this.loggeduser.Profile) {
@@ -116,7 +119,7 @@ export class DespachosPrPage implements OnInit {
break; break;
} }
this.skeletonLoader = false
despachosPr = despachosPr.filter(data => data.workflowInstanceDataFields.Status == "Active"); despachosPr = despachosPr.filter(data => data.workflowInstanceDataFields.Status == "Active");
@@ -70,7 +70,7 @@ export class DiplomasAssinarPage implements OnInit {
this.skeletonLoader = true this.skeletonLoader = true
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise(); let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.diplomasList = new Array(); this.diplomasList = [];
let diplomasAssinar = diplomas.reverse().filter(data => data.activityInstanceName == "Assinar Diploma"); let diplomasAssinar = diplomas.reverse().filter(data => data.activityInstanceName == "Assinar Diploma");
console.log(diplomasAssinar); console.log(diplomasAssinar);
@@ -112,6 +112,9 @@ export class DiplomasAssinarPage implements OnInit {
this.diplomasList.push(task); this.diplomasList.push(task);
}); });
}); });
this.skeletonLoader = false
this.showLoader = false; this.showLoader = false;
} }
@@ -44,7 +44,7 @@ export class ExpedientesPrPage implements OnInit {
const pathname = location.pathname + location.search const pathname = location.pathname + location.search
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.startsWith('/home/gabinete-digital?expedientes-pr=true')) { if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
this.LoadList(); this.LoadList();
} }
}); });
@@ -58,6 +58,8 @@ export class ExpedientesPrPage implements OnInit {
case 'MDGPR': case 'MDGPR':
this.processes.GetTasksList("Expediente do Presidente", false).subscribe(result => { this.processes.GetTasksList("Expediente do Presidente", false).subscribe(result => {
console.log(result); console.log(result);
this.skeletonLoader = false
this.showLoader =false
this.taskslist = new Array(); this.taskslist = new Array();
let res = result.reverse().filter(data => data.workflowInstanceDataFields.Status == "Active"); let res = result.reverse().filter(data => data.workflowInstanceDataFields.Status == "Active");
res.forEach(element => { res.forEach(element => {
@@ -87,6 +89,9 @@ export class ExpedientesPrPage implements OnInit {
this.processes.GetTasksList("Expediente do Presidente", false).subscribe(result => { this.processes.GetTasksList("Expediente do Presidente", false).subscribe(result => {
console.log(result); console.log(result);
this.taskslist = new Array(); this.taskslist = new Array();
this.skeletonLoader = false
this.showLoader =false
let res = result.reverse().filter(data => data.workflowInstanceDataFields.Status == "Active"); let res = result.reverse().filter(data => data.workflowInstanceDataFields.Status == "Active");
res.forEach(element => { res.forEach(element => {
let date = new Date(element.taskStartDate); let date = new Date(element.taskStartDate);
@@ -26,7 +26,7 @@
<div class="main-container height-100 overflow-y-auto d-flex flex-column "> <div class="main-container height-100 overflow-y-auto d-flex flex-column ">
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<div class=" height-100"> <div *ngIf="despachoList.length >= 1" class=" height-100">
<ion-list> <ion-list>
<ion-item <ion-item