Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer

This commit is contained in:
Peter Maquiran
2021-07-15 16:19:33 +01:00
4 changed files with 19 additions and 28 deletions
@@ -200,9 +200,11 @@ export class EditEventPage implements OnInit {
let body = {
"EventId": this.postEvent.EventId,
"CalendarDestinationName": this.postEvent.CalendarName,
}
console.log(body);
}
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (error) {}
}
this.toastService.successMessage();
@@ -173,7 +173,7 @@
<mat-form-field appearance="none" floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
<mat-select
placeholder="Selecione repetição*"
[(ngModel)]="selectedRecurringType"
[(ngModel)]="postEvent.EventRecurrence.Type"
(ngModelChange)="onSelectedRecurringChanged($event)">
<mat-option
*ngFor="let recurring of recurringTypes"
@@ -32,7 +32,6 @@ export class EditEventPage implements OnInit {
// minDate: string;
loadedEventAttachments: Attachment[]=[];
recurringTypes: any;
selectedRecurringType: any;
public dateControlOccurrence = new FormControl(moment("DD MM YYYY hh"));
public date: any;
@@ -106,7 +105,6 @@ export class EditEventPage implements OnInit {
}
ngOnInit() {
console.log(this.postEvent);
this.dateControlOccurrence = new FormControl(moment(this.postEvent.EventRecurrence.LastOccurrence));
if(!this.restoreTemporaryData()) {
@@ -151,11 +149,11 @@ export class EditEventPage implements OnInit {
this.restoreDatepickerData();
this.getRecurrenceTypes();
this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString();
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
setTimeout(() => {
this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString();
console.log(this.selectedRecurringType);
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
console.log( this.postEvent.EventRecurrence.Type);
}, 1000);
@@ -177,17 +175,6 @@ export class EditEventPage implements OnInit {
});
}
onSelectedRecurringChanged(ev:any){
console.log(ev);
if(ev.length > 1){
console.log(ev.filter(data => data != '-1'));
this.selectedRecurringType = ev.filter(data => data != '-1');
}
if(ev.length == 0){
this.selectedRecurringType = "-1";
}
}
runValidation() {
this.validateFrom = true
@@ -248,6 +235,17 @@ export class EditEventPage implements OnInit {
}
}
onSelectedRecurringChanged(ev:any){
console.log(ev);
if(ev.length > 1){
console.log(ev.filter(data => data != '-1'));
this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1');
}
if(ev.length == 0){
this.postEvent.EventRecurrence.Type = "-1";
}
}
async save() {
@@ -257,9 +255,6 @@ export class EditEventPage implements OnInit {
if(this.Form.invalid) {
return false
}
if(this.selectedRecurringType != '-1'){
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
}
this.getDatepickerData()
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
@@ -273,12 +268,9 @@ export class EditEventPage implements OnInit {
"CalendarDestinationName": this.postEvent.CalendarName,
}
console.log(body);
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (e) {}
}
this.showLoader = false;
this.toastService.successMessage()
@@ -92,9 +92,7 @@ export class ViewEventPage implements OnInit {
loadEvent(){
this.eventsService.getEvent(this.eventId).subscribe(res => {
this.loadedEvent = res;
console.log(res);
this.today = new Date(res.StartDate);
// console.log(new Date(this.today));
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
this.getAttachments(this.loadedEvent.EventId);
}, (errer)=> {
@@ -138,7 +136,6 @@ export class ViewEventPage implements OnInit {
}
async openExpedientActionsModal(taskAction: any, task: any) {
//this.modalController.dismiss();
let classs;
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'