edit event to aprove done

This commit is contained in:
Eudes Inácio
2024-05-31 12:50:25 +01:00
19 changed files with 652 additions and 144 deletions
+42 -35
View File
@@ -637,48 +637,55 @@ export class AgendaPage implements OnInit {
let load = 0;
for (const selectedCalendar of selectedCalendarIds) {
this.AgendaDataRepositoryService.EventList({userId: selectedCalendar.OwnerUserId, calendarOwnerName: selectedCalendar['FullName'] }).subscribe( response => {
(async () => {
let label;
if (SessionStore.user.Profile == 'PR') {
label = "pr"
} else if (SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) {
label = 'md'
const response = await this.AgendaDataRepositoryService.EventList({userId: selectedCalendar.OwnerUserId, calendarOwnerName: selectedCalendar['FullName'] })
if(response.isOk()) {
let label;
if (SessionStore.user.Profile == 'PR') {
label = "pr"
} else if (SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) {
label = 'md'
} else {
label = "pr"
}
let eventsList = response.value;
this.CalendarStore.pushEvent(eventsList, label);
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
this.showTimelinePR = true;
load++
if (load == selectedCalendarIds.length) {
this.showLoader = false;
}
this.myCal.update();
this.myCal.loadEvents();
this.updateEventListBox()
} else {
label = "pr"
load++
if (load == selectedCalendarIds.length) {
this.showLoader = false;
}
this.myCal.update();
this.myCal.loadEvents();
console.log('111b')
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
this.updateEventListBox()
}
let eventsList = response;
this.CalendarStore.pushEvent(eventsList, label);
})()
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
this.updateEventListBox()
this.showTimelinePR = true;
load++
if (load == selectedCalendarIds.length) {
this.showLoader = false;
}
this.myCal.update();
this.myCal.loadEvents();
this.updateEventListBox()
}, () => {
load++
if (load == selectedCalendarIds.length) {
this.showLoader = false;
}
this.myCal.update();
this.myCal.loadEvents();
console.log('111b')
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
this.updateEventListBox()
})
}
}