add either pattern

This commit is contained in:
Peter Maquiran
2024-05-30 12:03:30 +01:00
parent 3c4ec1a432
commit 746db6f583
9 changed files with 410 additions and 85 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()
})
}
}
+4 -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) {