mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
save
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment">
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button value="MDGPR">
|
||||
Seu calendário
|
||||
</ion-segment-button>
|
||||
|
||||
@@ -37,36 +37,42 @@ export class EventsToApprovePage implements OnInit {
|
||||
ngOnInit() {
|
||||
this.segment = this.loggeduser.Profile;
|
||||
this.LoadToApproveEvents();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.doRefresh();
|
||||
this.LoadToApproveEvents();
|
||||
}
|
||||
});
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
if( window.innerWidth <= 1024){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
LoadToApproveEvents() {
|
||||
segmentChanged(ev: any) {
|
||||
this.LoadToApproveEvents();
|
||||
}
|
||||
|
||||
async LoadToApproveEvents() {
|
||||
this.showLoader = true;
|
||||
|
||||
let prEvents = await this.processes.GetToApprovedEvents('PR','false').toPromise();
|
||||
this.eventsPRList = prEvents;
|
||||
console.log(this.eventsPRList);
|
||||
|
||||
this.processes.GetToApprovedEvents('PR','false').subscribe(res=>{
|
||||
/* this.processes.GetToApprovedEvents('PR','false').subscribe(res=>{
|
||||
this.showLoader = false;
|
||||
this.eventsPRList = res;
|
||||
|
||||
console.log('this.eventsPRList', this.eventsPRList)
|
||||
});
|
||||
this.processes.GetToApprovedEvents('MDGPR','false').subscribe(res=>{
|
||||
}); */
|
||||
let mdEvents = await this.processes.GetToApprovedEvents('MDGPR','false').toPromise();
|
||||
this.eventsMDGPRList = mdEvents;
|
||||
console.log(this.eventsMDGPRList);
|
||||
/* this.processes.GetToApprovedEvents('MDGPR','false').subscribe(res=>{
|
||||
this.showLoader = false;
|
||||
this.eventsMDGPRList = res;
|
||||
|
||||
console.log('this.eventsMDGPRList', this.eventsMDGPRList)
|
||||
});
|
||||
}); */
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
goToEventDetail(eventToAprove){
|
||||
@@ -121,11 +127,7 @@ export class EventsToApprovePage implements OnInit {
|
||||
|
||||
doRefresh() {
|
||||
console.log('Refresh Events');
|
||||
|
||||
this.LoadToApproveEvents();
|
||||
console.log('refresh');
|
||||
setTimeout(() => {
|
||||
}, 2000);
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss(null);
|
||||
|
||||
Reference in New Issue
Block a user