change text, fixe create and edit event

This commit is contained in:
Peter Maquiran
2023-09-20 20:25:48 +01:00
parent be3f1e8f15
commit c674ec0bca
11 changed files with 149 additions and 128 deletions
@@ -117,7 +117,7 @@ export class EditEventPage implements OnInit {
}
for(const index in this._postEvent.Attendees) {
const user = this._postEvent.Attendees[index]
@@ -127,7 +127,7 @@ export class EditEventPage implements OnInit {
} else {
console.log('user not set')
}
}
if (this._postEvent.Attendees != null) {
@@ -149,7 +149,7 @@ export class EditEventPage implements OnInit {
setTimeout(() => {
this._postEvent.EventRecurrence.Type = this._postEvent.EventRecurrence.Type.toString();
}, 500);
@@ -188,7 +188,7 @@ export class EditEventPage implements OnInit {
getRecurrenceTypes() {
this.eventsService.getRecurrenceTypes().subscribe(res=>{
this.recurringTypes = res;
});
}
@@ -234,7 +234,7 @@ export class EditEventPage implements OnInit {
openInicio() {
let input: any = document.querySelector('#new-inicio')
if(input) {
input.click()
}
}
@@ -259,7 +259,7 @@ export class EditEventPage implements OnInit {
date.setSeconds(0);
if(minutes % 15 != 0) {
if (minutes > 45) {
date.setMinutes(60)
} else if (minutes > 30) {
@@ -270,7 +270,7 @@ export class EditEventPage implements OnInit {
date.setMinutes(15)
}
}
}
return date
}
@@ -279,15 +279,15 @@ export class EditEventPage implements OnInit {
const _date = new Date(date);
const minutes = _date .getMinutes();
_date .setMinutes(minutes + 15)
return _date
return _date
}
onSelectedRecurringChanged(ev:any){
this.calculetedLastOccurrence(ev);
if(ev.length > 1){
this._postEvent.EventRecurrence.Type = ev.filter(data => data != '-1');
}
if(ev.length == 0){
@@ -296,7 +296,7 @@ export class EditEventPage implements OnInit {
}
calculetedLastOccurrence(type:number){
var valor;
var valor;
var opcao: boolean;
if (type == 0) {
valor = 7;
@@ -322,15 +322,15 @@ export class EditEventPage implements OnInit {
this._postEvent.EventRecurrence.LastOccurrence = time;
} else {
time = new Date(
time.getFullYear() + valor,
time.getMonth(),
time.getDate(),
time.getHours(),
time.getFullYear() + valor,
time.getMonth(),
time.getDate(),
time.getHours(),
time.getMinutes()
);
this._postEvent.EventRecurrence.LastOccurrence = time;
}
}
@@ -358,14 +358,14 @@ export class EditEventPage implements OnInit {
this.showLoader = true;
try {
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
await this.eventsService.editEvent(this._postEvent, 2, 3).toPromise()
if(this.initCalendarName != this._postEvent.CalendarName) {
let body = {
"EventId": this._postEvent.EventId,
"CalendarDestinationName": this._postEvent.CalendarName,
}
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (e) {}
@@ -379,7 +379,7 @@ export class EditEventPage implements OnInit {
"EventId": this._postEvent.EventId,
"CalendarDestinationName": this._postEvent.CalendarName,
}
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (e) {}
@@ -397,7 +397,7 @@ export class EditEventPage implements OnInit {
this.clearPostEvent.emit();
this.deleteTemporaryData();
/* await this.saveDocument() */
await this.saveDocument()
this.close();
}
@@ -407,7 +407,7 @@ export class EditEventPage implements OnInit {
try {
for( let e of this.loadedEventAttachments) {
const id: any = e.Id
const remove = e['remove']
@@ -425,7 +425,7 @@ export class EditEventPage implements OnInit {
SerialNumber: '',
};
await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise();
// await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise();
} else if(remove) {
await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise()
@@ -527,7 +527,7 @@ export class EditEventPage implements OnInit {
}
});
modal.onDidDismiss().then( async (res) => {
modal.onDidDismiss().then( async (res) => {
if(res) {
const data = res.data;
@@ -559,17 +559,17 @@ export class EditEventPage implements OnInit {
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']
}