fix loader

This commit is contained in:
Peter Maquiran
2023-06-09 12:02:11 +01:00
parent 91588ebb24
commit 7f3cfdc55e
10 changed files with 58 additions and 41 deletions
@@ -1,16 +1,16 @@
<!-- {{ NotificationsService.active }} --> <!-- {{ NotificationsService.active }} -->
<ion-content class="height-100 container-wrapper"> <ion-content class="height-100 container-wrapper">
<!-- <ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)"> <ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)" *ngIf="refresh">
<ion-refresher-content> <ion-refresher-content>
</ion-refresher-content> </ion-refresher-content>
</ion-refresher> --> </ion-refresher>
<div class="main-content d-flex height-100 border-t-radius"> <div class="main-content d-flex height-100 border-t-radius">
<!-- Aside left --> <!-- Aside left -->
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1"> <div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
<ion-progress-bar type="indeterminate" *ngIf="TaskService.showLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="TaskService.showLoader"></ion-progress-bar>
<div class="title-container"> <div class="title-container" >
<div class="title d-flex justify-center"> <div class="title d-flex justify-center">
<ion-label *ngIf="hideRefreshBtn">Gabinete Digital</ion-label> <ion-label *ngIf="hideRefreshBtn">Gabinete Digital</ion-label>
<div class="d-flex align-center cursor" *ngIf="!hideRefreshBtn && segmentVista == 'listview' "> <div class="d-flex align-center cursor" *ngIf="!hideRefreshBtn && segmentVista == 'listview' ">
@@ -147,7 +147,7 @@
</div> </div>
<div [ngSwitch]="segmentVista" class="overflow-y-auto"> <div #scroll [ngSwitch]="segmentVista" class="overflow-y-auto">
<!-- This is the list view --> <!-- This is the list view -->
<div *ngSwitchCase="'listview'"> <div *ngSwitchCase="'listview'">
@@ -258,7 +258,7 @@
</div> </div>
<!-- This is the box view --> <!-- This is the box view -->
<div *ngSwitchCase="'boxview'" class="aside overflow-y-auto d-flex flex-wrap width-100 height-100"> <div *ngSwitchCase="'boxview'" class="aside d-flex flex-wrap width-100 height-100">
<div *ngIf="TaskService.loadCount" class="center-box"> <div *ngIf="TaskService.loadCount" class="center-box">
<!-- List --> <!-- List -->
@@ -1,4 +1,4 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import {NavigationEnd, NavigationExtras, Router } from '@angular/router'; import {NavigationEnd, NavigationExtras, Router } from '@angular/router';
@@ -102,6 +102,11 @@ export class GabineteDigitalPage implements OnInit {
AllProcess = [] AllProcess = []
ordinance: string = 'old' ordinance: string = 'old'
refresh = true
@ViewChild('scroll') scroll: ElementRef;
constructor( constructor(
private processesbackend: ProcessesService, private processesbackend: ProcessesService,
private modalController: ModalController, private modalController: ModalController,
@@ -191,7 +196,7 @@ export class GabineteDigitalPage implements OnInit {
reorderList(orderBy: string) { reorderList(orderBy: string) {
this.changeTab()
this.ordinance = orderBy; this.ordinance = orderBy;
this.dynamicSearch(); this.dynamicSearch();
@@ -256,9 +261,31 @@ export class GabineteDigitalPage implements OnInit {
}); });
this.hideRefreshButton(); this.hideRefreshButton();
// console.log(' this.scroll', this.scroll)
// this.scroll.nativeElement.addEventListener("scroll", ()=> {
// console.log('123')
// });
} }
ngAfterViewInit(): void {
// We can access the TestComponent now that this portion of the view tree has been initiated.
const element = this.scroll.nativeElement
this.scroll.nativeElement.addEventListener("scroll", (e)=> {
this.changeTab()
});
}
changeTab() {
const element = this.scroll.nativeElement
if(element.scrollTop == 0 ) {
this.refresh = true
} else {
this.refresh = false
}
}
checkFilter() { checkFilter() {
+4 -9
View File
@@ -239,9 +239,7 @@ export class TaskService {
this.pedidosstore.resetdeferimento(deferimentos.filter(data => data.workflowInstanceDataFields.Status == "Active").map((element) => { this.pedidosstore.resetdeferimento(deferimentos.filter(data => data.workflowInstanceDataFields.Status == "Active").map((element) => {
return this.customTaskPipe.transform(element) return this.customTaskPipe.transform(element)
})); }));
} catch (error) { } catch (error) {}
}
} }
@@ -274,7 +272,7 @@ export class TaskService {
let genericEvents = await this.processesbackend.GetTasksList('Agendar Evento', false).toPromise(); let genericEvents = await this.processesbackend.GetTasksList('Agendar Evento', false).toPromise();
let eventsList let eventsList
try { try {
eventsList = this.sortService.sortArrayByDate(genericEvents).reverse(); eventsList = genericEvents
} catch (error) { } catch (error) {
eventsList = []; eventsList = [];
} }
@@ -285,7 +283,7 @@ export class TaskService {
let allEvents = await this.processesbackend.eventsToApprove(calendar.OwnerUserId, 'againete page').toPromise() let allEvents = await this.processesbackend.eventsToApprove(calendar.OwnerUserId, 'againete page').toPromise()
let eventsList let eventsList
try { try {
eventsList = this.sortService.sortArrayByDate(allEvents).reverse(); eventsList = allEvents
} catch(error) { } catch(error) {
eventsList = [] eventsList = []
} }
@@ -335,7 +333,7 @@ export class TaskService {
diplomasList.push(task); diplomasList.push(task);
}); });
diplomasList = this.sortService.sortDate(diplomasList, 'CreateDate').reverse() diplomasList = diplomasList
this.deplomasStore.resetDiplomaGerar(diplomasList); this.deplomasStore.resetDiplomaGerar(diplomasList);
@@ -356,13 +354,10 @@ export class TaskService {
let diplomasAssinar: any = depachoAPI.filter(data => data.activityInstanceName == "Assinar Diploma"); let diplomasAssinar: any = depachoAPI.filter(data => data.activityInstanceName == "Assinar Diploma");
diplomasAssinar = diplomasAssinar.map((element) => this.expedienteTaskPipe.transform(element)) diplomasAssinar = diplomasAssinar.map((element) => this.expedienteTaskPipe.transform(element))
this.sortService.sortDate(diplomasAssinar, 'CreateDate')
diplomasAssinar = this.sortService.sortArrayISODate(diplomasAssinar)
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar) this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
let diplomasAssinados: any = depachoAPI.filter(data => data.activityInstanceName == "Diploma Assinado"); let diplomasAssinados: any = depachoAPI.filter(data => data.activityInstanceName == "Diploma Assinado");
diplomasAssinados = diplomasAssinados.map((element) => this.expedienteTaskPipe.transform(element)) diplomasAssinados = diplomasAssinados.map((element) => this.expedienteTaskPipe.transform(element))
diplomasAssinados = this.sortService.sortArrayISODate(diplomasAssinados)
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados) this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados)
} catch (error) { } catch (error) {
@@ -33,11 +33,7 @@ export class DespachosPage implements OnInit {
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital?despachos=true')) { if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital?despachos=true')) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { this.LoadList()
this.LoadList()
} else {
this.LoadList()
}
} }
}); });
@@ -43,11 +43,7 @@ export class DiplomasAssinarPage implements OnInit {
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && '/home/gabinete-digital?diplomasassinar=true'.startsWith(event.url)) { if (event instanceof NavigationStart && '/home/gabinete-digital?diplomasassinar=true'.startsWith(event.url)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { this.LoadList()
this.LoadList()
} else {
this.LoadList()
}
} }
}); });
@@ -118,6 +114,7 @@ export class DiplomasAssinarPage implements OnInit {
this.skeletonLoader = true this.skeletonLoader = true
await this.TaskService.loadDiplomas() await this.TaskService.loadDiplomas()
this.dynamicSearch()
this.skeletonLoader = false this.skeletonLoader = false
} }
@@ -77,7 +77,8 @@ export class DiplomasGerarPage implements OnInit {
this.skeletonLoader = true this.skeletonLoader = true
this.TaskService.loadDiplomas() await this.TaskService.loadDiplomas()
this.dynamicSearch()
this.skeletonLoader = false; this.skeletonLoader = false;
} }
@@ -54,7 +54,9 @@ export class ExpedientesPrPage implements OnInit {
if (event instanceof NavigationStart && if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientespr=true') || event.url.startsWith('/home/gabinete-digital?expedientespr=true') ||
event instanceof NavigationStart && event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientes-pr=true')) { event.url.startsWith('/home/gabinete-digital?expedientes-pr=true' ) ||
event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientes=true' )) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing() this.refreshing()
@@ -58,11 +58,7 @@ export class ExpedientsPage implements OnInit {
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientes=true')) { event.url.startsWith('/home/gabinete-digital?expedientes=true')) {
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { this.LoadList()
this.LoadList()
} else {
this.LoadList()
}
} }
}); });
@@ -139,7 +139,7 @@ export class PedidosPage implements OnInit {
async LoadList() { async LoadList() {
this.skeletonLoader = true;
if(this.segment == 'parecer') { if(this.segment == 'parecer') {
this.taskType = "Pedido de Parecer"; this.taskType = "Pedido de Parecer";
@@ -147,6 +147,8 @@ export class PedidosPage implements OnInit {
let parecer = []; let parecer = [];
let parecerPr = []; let parecerPr = [];
this.skeletonLoader = true;
try { try {
parecer = await this.processes.GetTasksList("Pedido de Parecer", false).toPromise(); parecer = await this.processes.GetTasksList("Pedido de Parecer", false).toPromise();
parecerPr = await this.processes.GetTasksList("Pedido de Parecer do Presidente", false).toPromise(); parecerPr = await this.processes.GetTasksList("Pedido de Parecer do Presidente", false).toPromise();
@@ -174,6 +176,7 @@ export class PedidosPage implements OnInit {
} }
else if(this.segment == 'deferimento') { else if(this.segment == 'deferimento') {
this.taskType = "Pedido de Deferimento"; this.taskType = "Pedido de Deferimento";
this.skeletonLoader = true;
this.processes.GetTasksList("Pedido de Deferimento", false).subscribe(result => { this.processes.GetTasksList("Pedido de Deferimento", false).subscribe(result => {
this.skeletonLoader = false this.skeletonLoader = false
@@ -194,7 +197,7 @@ export class PedidosPage implements OnInit {
this.skeletonLoader = false this.skeletonLoader = false
}); });
} }
this.skeletonLoader = false
} }
doRefresh(event) { doRefresh(event) {
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = { export let versionData = {
"shortSHA": "3bf5bfa75", "shortSHA": "91588ebb2",
"SHA": "3bf5bfa75bdd0153b2e52d20af670ecb7592c621", "SHA": "91588ebb24dc5cd0e6ff09806faca06fd01aa5d1",
"branch": "feature/gabinete-search", "branch": "feature/gabinete-search",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Thu Jun 8 16:01:56 2023 +0100'", "lastCommitTime": "'Fri Jun 9 09:22:46 2023 +0100'",
"lastCommitMessage": "fix", "lastCommitMessage": "fix event to approve",
"lastCommitNumber": "4955", "lastCommitNumber": "4956",
"change": "", "change": "",
"changeStatus": "On branch feature/gabinete-search\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.ts\n\tmodified: version/git-version.ts", "changeStatus": "On branch feature/gabinete-search\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/shared/gabinete-digital/despachos/despachos.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.ts\n\tmodified: src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts\n\tmodified: src/app/shared/gabinete-digital/expedients/expedients.page.ts\n\tmodified: src/app/shared/gabinete-digital/pedidos/pedidos.page.ts",
"changeAuthor": "peter.maquiran" "changeAuthor": "peter.maquiran"
} }