Bug fix na agenda presenting events

This commit is contained in:
Eudes Inácio
2021-11-23 13:56:41 +01:00
parent 4f3ba91eb4
commit 3512e44a97
+30 -9
View File
@@ -161,6 +161,7 @@ export class AgendaPage implements OnInit {
dropdownScrollWeal = false
CalendarStore = CalendarStore
listToPresent
array = []
constructor(
private alertCtrl: AlertController,
@@ -232,6 +233,8 @@ export class AgendaPage implements OnInit {
ngOnInit() {
this.getFromDB();
const pathname = window.location.pathname
let realoadCounter = 0
this.router.events.forEach((event) => {
@@ -240,14 +243,14 @@ export class AgendaPage implements OnInit {
this.segment = "Combinado";
}
if (realoadCounter != 0) {
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
//this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
}
realoadCounter++;
}
});
this.backgroundservice.registerBackService('Online', () => {
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
//this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
});
window.onresize = (event) => {
@@ -514,6 +517,7 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
console.log('check list to present data', this.listToPresent);
this.myCal.update();
this.myCal.loadEvents();
@@ -540,13 +544,17 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
console.log('check list to present data', this.listToPresent);
this.myCal.update();
this.myCal.loadEvents();
this.showLoader = false;
this.showTimeline = true;
}).finally(() => {
}).catch((error) => {
this.getFromDB()
})
.finally(() => {
this.showLoader = false;
})
@@ -567,6 +575,7 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
console.log('check list to present data', this.listToPresent);
this.myCal.update();
this.myCal.loadEvents();
@@ -603,6 +612,7 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
console.log('check list to present data', this.listToPresent);
this.myCal.update();
this.myCal.loadEvents();
@@ -614,7 +624,10 @@ export class AgendaPage implements OnInit {
}
}).finally(() => {
}).catch((error) => {
this.getFromDB()
})
.finally(() => {
counter++;
if (counter == 2) {
this.showLoader = false;
@@ -633,6 +646,8 @@ export class AgendaPage implements OnInit {
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
console.log('check list to present data', this.listToPresent);
this.myCal.update();
this.myCal.loadEvents();
@@ -644,7 +659,10 @@ export class AgendaPage implements OnInit {
this.showLoader = false;
}
}).finally(() => {
}).catch((error) => {
this.getFromDB()
})
.finally(() => {
counter++;
if (counter == 2) {
this.showLoader = false;
@@ -674,6 +692,7 @@ export class AgendaPage implements OnInit {
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
console.log('check list to present data', this.listToPresent);
this.myCal.update();
this.myCal.loadEvents();
@@ -685,7 +704,10 @@ export class AgendaPage implements OnInit {
this.showLoader = false;
}
}).finally(() => {
}).catch((error) => {
this.getFromDB()
})
.finally(() => {
if (counter == 1 || this.loggeduser.Profile == 'PR') {
this.showLoader = false;
}
@@ -697,7 +719,6 @@ export class AgendaPage implements OnInit {
}
trasnformData(response,profile) {
let array = []
response.forEach(element => {
let event = {
startTime: new Date(element.StartDate),
@@ -708,10 +729,10 @@ export class AgendaPage implements OnInit {
profile: profile,
id: element.EventId,
}
array.push(event)
this.array.push(event)
});
this.listToPresent = array;
this.listToPresent = this.array;
console.log('LIST TO PRESET', this.listToPresent)
}