This commit is contained in:
Peter Maquiran
2023-07-20 16:54:58 +01:00
parent 880f154ea2
commit 4d7c80a739
49 changed files with 1114 additions and 432 deletions
@@ -16,7 +16,7 @@ import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
import { environment } from 'src/environments/environment';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -57,6 +57,9 @@ export class EditEventPage implements OnInit {
recurringTypes: any;
selectedRecurringType: any;
CalendarNameOwnerName = ''
CalendarNamesOptions = []
public date: any;
public disabled = false;
public showSpinners = true;
@@ -82,11 +85,12 @@ export class EditEventPage implements OnInit {
public stepSeconds = [1, 5, 10, 15, 20, 25];
sesseionStora = SessionStore
environment = environment
constructor(
private modalController: ModalController,
private navParams: NavParams,
private eventsService: EventsService,
public eventsService: EventsService,
public alertController: AlertController,
private attachmentsService: AttachmentsService,
private toastService: ToastService,
@@ -134,6 +138,9 @@ export class EditEventPage implements OnInit {
this.getAttachments(this.postEvent.EventId);
this.CalendarNameOwnerName = this.eventsService.detectCalendarNameByCalendarId(this.postEvent.CalendarId)
this.changeAgenda()
}
ngOnInit() {
@@ -559,4 +566,27 @@ export class EditEventPage implements OnInit {
await modal.present();
}
changeAgenda() {
setTimeout(() => {
if(this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Oficial'] && this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Pessoal']) {
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
} else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Oficial']) {
this.CalendarNamesOptions = ['Oficial']
this.postEvent.CalendarName = 'Oficial'
} else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Pessoal']) {
this.CalendarNamesOptions = ['Pessoal']
this.postEvent.CalendarName = 'Pessoal'
} else {
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
}
}, 50)
}
}