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()
})
}
}
+6 -1
View File
@@ -16,6 +16,8 @@ import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
import { ChangeProfileService } from 'src/app/services/change-profile.service';
import { SessionStore } from 'src/app/store/session.service';
import { TaskService } from 'src/app/services/task.service';
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
@Component({
selector: 'app-events',
templateUrl: './events.page.html',
@@ -90,7 +92,8 @@ export class EventsPage implements OnInit {
private storage: Storage,
public p: PermissionService,
private changeProfileService: ChangeProfileService,
public TaskService: TaskService
public TaskService: TaskService,
public AgendaDataRepositoryService: AgendaDataRepositoryService
) {
window['zipPhoneCallback'] = function (zipphone) {
@@ -225,8 +228,10 @@ export class EventsPage implements OnInit {
let date = new Date();
let month = date.getMonth() + 1;
let start = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
let end = date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59";
if(SessionStore.user) {
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => {
this.showLoader = false;