fix agenda calendar names

This commit is contained in:
Peter Maquiran
2022-07-04 18:15:55 +01:00
parent d8d1fc7b0c
commit e625fbfeb2
2 changed files with 32 additions and 32 deletions
+28 -28
View File
@@ -225,7 +225,6 @@ export class EventsService {
} }
}); });
for (let sharedCalendar of this.loggeduser.SharedCalendars) { for (let sharedCalendar of this.loggeduser.SharedCalendars) {
@@ -252,38 +251,39 @@ export class EventsService {
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId); this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName); this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
} }
}
for (let sharedCalendar of this.loggeduser.SharedCalendars) {
if(sharedCalendar?.OwnerUserId) {
this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> {
this.calendarNames[sharedCalendar.CalendarId] = e.FullName
this.myCalendarNames[sharedCalendar.CalendarId] = e.FullName
if(!this.calendarNamesAry.includes(e.FullName)) { for (let sharedCalendar of this.loggeduser.SharedCalendars) {
this.calendarNamesAry.push(e.FullName) if(sharedCalendar?.OwnerUserId) {
this.calendarNamesType[e.FullName] = {} this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> {
} this.calendarNames[sharedCalendar.CalendarId] = e.FullName
this.myCalendarNames[sharedCalendar.CalendarId] = e.FullName
this.calendarNamesType[e.FullName][sharedCalendar.CalendarName] = true if(!this.calendarNamesAry.includes(e.FullName)) {
this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId this.calendarNamesAry.push(e.FullName)
this.calendarNamesType[e.FullName] = {}
}) }
}
this.calendarNamesType[e.FullName][sharedCalendar.CalendarName] = true
this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId
})
}
}
for (let sharedCalendar of this.loggeduser.OwnerCalendars) {
this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario'
if(!this.calendarNamesAry.includes('Meu calendario')) {
this.calendarNamesAry.push('Meu calendario')
this.calendarNamesType['Meu calendario'] = {}
} }
for (let sharedCalendar of this.loggeduser.OwnerCalendars) { this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName] = true
this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId
this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario'
if(!this.calendarNamesAry.includes('Meu calendario')) {
this.calendarNamesAry.push('Meu calendario')
this.calendarNamesType['Meu calendario'] = {}
}
this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName] = true
this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId
}
} }
} }
} }
@@ -165,7 +165,7 @@ export class NewEventPage implements OnInit {
this.eventBody = { BodyType : "1", Text : ""}; this.eventBody = { BodyType : "1", Text : ""};
this.postEvent.Body = this.eventBody; this.postEvent.Body = this.eventBody;
if(this.selectedSegment != "Combinada"){ if(this.selectedSegment != "Combinada") {
this.postEvent ={ this.postEvent ={
EventId: '', EventId: '',
Subject: '', Subject: '',
@@ -188,7 +188,7 @@ export class NewEventPage implements OnInit {
}; };
} }
else{ else{
this.postEvent ={ this.postEvent = {
EventId: '', EventId: '',
Subject: '', Subject: '',
Body: this.eventBody, Body: this.eventBody,
@@ -207,11 +207,11 @@ export class NewEventPage implements OnInit {
Category: 'Reunião', Category: 'Reunião',
HasAttachments: false, HasAttachments: false,
EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime}, EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime},
}; }
} }
if(this.postEvent.Attendees != null) { if(this.postEvent.Attendees != null) {
this.postEvent.Attendees.forEach(e =>{ this.postEvent.Attendees.forEach(e => {
if(e.IsRequired) { if(e.IsRequired) {
this.taskParticipants.push(e); this.taskParticipants.push(e);
} else { } else {