This commit is contained in:
tiago.kayaya
2021-07-14 16:49:56 +01:00
parent 29d8894c7b
commit ef05948e6c
16 changed files with 231 additions and 224 deletions
@@ -210,7 +210,7 @@ export class EditEventToApprovePage implements OnInit {
Validators.required,
]),
//CalendarName: new FormControl(this.postEvent.CalendarName),
// Categories: new FormControl(this.postEvent.Categories[0], [
// Categories: new FormControl(this.postEvent.Categories, [
// Validators.required
// ]),
dateStart: new FormControl(this.dateStart, [
@@ -253,26 +253,25 @@ export class EditEventToApprovePage implements OnInit {
})
const event: any = {
Agenda: this.eventProcess.workflowInstanceDataFields.Agenda,
SerialNumber: this.eventProcess.serialNumber,
Body: this.eventProcess.workflowInstanceDataFields.Body,
EndDate: this.eventProcess.workflowInstanceDataFields.EndDate,
EventType: this.eventProcess.workflowInstanceDataFields.EventType,
IsAllDayEvent: this.eventProcess.workflowInstanceDataFields.IsAllDayEvent,
IsRecurring: this.eventProcess.workflowInstanceDataFields.IsRecurring,
Location: this.eventProcess.workflowInstanceDataFields.Location,
Subject: this.eventProcess.workflowInstanceDataFields.Subject,
serialNumber: this.eventProcess.serialNumber,
StartDate: this.eventProcess.workflowInstanceDataFields.StartDate,
MDEmail: this.eventProcess.workflowInstanceDataFields.MDEmail,
EndDate: this.eventProcess.workflowInstanceDataFields.EndDate,
ReviewUserComment: '',
MDName: this.eventProcess.workflowInstanceDataFields.MDName,
MDEmail: this.eventProcess.workflowInstanceDataFields.MDEmail,
IsAllDayEvent: this.eventProcess.workflowInstanceDataFields.IsAllDayEvent,
Status: null,
EventType: this.eventProcess.workflowInstanceDataFields.EventType,
IsRecurring: this.eventProcess.workflowInstanceDataFields.IsRecurring,
Message: this.eventProcess.workflowInstanceDataFields.Message,
EventRecurrence: {
Type: this.eventProcess.workflowInstanceDataFields.OccurrenceType,
LastOccurrence: this.eventProcess.workflowInstanceDataFields.LastOccurrence,
},
ParticipantsList: this.eventProcess.workflowInstanceDataFields.ParticipantsList,
Private: false,
ReviewUserComment: ''
}
@@ -87,7 +87,7 @@
<mat-form-field appearance="none" floatLabel="never" class="width-100" required>
<!-- <input matInput type="text" > -->
<mat-select placeholder="Selecione o tipo de evento*" matInput [(ngModel)]="postEvent.Categories[0]" >
<mat-select placeholder="Selecione o tipo de evento*" matInput [(ngModel)]="postEvent.Categories" >
<mat-option value="Reunião">
Reunião
</mat-option>
@@ -204,7 +204,7 @@ export class EditEventPage implements OnInit {
Validators.required,
]),
CalendarName: new FormControl(this.postEvent.CalendarName),
Categories: new FormControl(this.postEvent.Categories[0], [
Categories: new FormControl(this.postEvent.Categories, [
Validators.required
]),
dateStart: new FormControl(this.dateStart, [
@@ -268,13 +268,13 @@ export class EditEventPage implements OnInit {
"EventId": this.postEvent.EventId,
"CalendarDestinationName": this.postEvent.CalendarName,
}
console.log(body);
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (e) {}
}
this.showLoader = false;
this.toastService.successMessage()
@@ -74,7 +74,7 @@
<mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > -->
<mat-select [(value)]="postEvent.Categories[0]" >
<mat-select [(value)]="postEvent.Categories" >
<mat-option value="Reunião">
Reunião
</mat-option>
@@ -140,7 +140,7 @@ export class NewEventPage implements OnInit {
if(!this.restoreTemporaryData()){
// clear
this.eventBody = { BodyType : "1", Text : ""};
this.postEvent.Body = this.eventBody;
@@ -169,7 +169,7 @@ export class NewEventPage implements OnInit {
AppointmentState: 0,
TimeZone: '',
Organizer: '',
Categories: ['Reunião'],
Categories: 'Reunião',
HasAttachments: false,
EventRecurrence: {Type:'-1'},
};
@@ -191,7 +191,7 @@ export class NewEventPage implements OnInit {
AppointmentState: 0,
TimeZone: '',
Organizer: '',
Categories: ['Reunião'],
Categories: 'Reunião',
HasAttachments: false,
EventRecurrence: {Type:'-1'},
};
@@ -238,7 +238,7 @@ export class NewEventPage implements OnInit {
Validators.required,
]),
CalendarName: new FormControl(this.postEvent.CalendarName),
Categories: new FormControl(this.postEvent.Categories[0], [
Categories: new FormControl(this.postEvent.Categories, [
Validators.required
]),
dateStart: new FormControl(this.postEvent.StartDate, [
@@ -423,7 +423,7 @@ export class NewEventPage implements OnInit {
loader.remove()
this.showLoader = false
this.toastService.badRequest('Evento não criado')
});
}
@@ -77,7 +77,7 @@
<ion-datetime
class="d-block d-md-none"
placeholder="Início"
[(ngModel)]="eventProcess.workflowInstanceDataFields.StartDate"
[(ngModel)]="startDate"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,15,30,45"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
@@ -90,7 +90,7 @@
class="width-100 date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date"
[(ngModel)]="eventProcess.workflowInstanceDataFields.StartDate"
[(ngModel)]="startDate"
[min]="minDate" [max]="maxDate"
[disabled]="disabled"
>
@@ -116,7 +116,7 @@
<ion-datetime
class="d-block d-md-none"
placeholder="Fim"
[(ngModel)]="eventProcess.workflowInstanceDataFields.EndDate"
[(ngModel)]="endDate"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,15,30,45"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
@@ -129,7 +129,7 @@
class="width-100 date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Choose a date"
[(ngModel)]="eventProcess.workflowInstanceDataFields.EndDate"
[(ngModel)]="endDate"
[min]="minDate" [max]="maxDate"
[disabled]="disabled"
>
@@ -232,7 +232,7 @@
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
</div>
<div class="ion-input-class-no-height d-flex">
<div (click)="addParticipants()" class="ion-input-class-no-height d-flex">
<div class="list-people flex-grow-1">
<ion-item lines="none">
<ion-list>
@@ -241,7 +241,7 @@
</ion-list>
</ion-item>
</div>
<div class="add-people cursor-pointer" (click)="addParticipants()">
<div class="add-people cursor-pointer">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
@@ -13,6 +13,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service';
import { Event } from '../../../models/event.model';
import { NgxMatDateFormats, NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { NavigationExtras, Router } from '@angular/router';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -94,7 +95,8 @@ export class EditEventToApproveComponent implements OnInit {
segment:string = "true";
profile:string;
eventAttendees: EventPerson[];
startDate: Date;
endDate: Date;
loadedEventAttachments: Attachment[];
taskParticipants: any = [];
taskParticipantsCc: any = [];
@@ -115,31 +117,18 @@ export class EditEventToApproveComponent implements OnInit {
private processes:ProcessesService,
private animationController: AnimationController,
private toastService: ToastService,
private router:Router,
) {
// Edit event to approve
this.serialNumber = this.navParams.get('serialNumber');
this.isEventEdited = false;
}
ngOnInit() {
this.getTask()
console.log('HERE');
this.getRecurrenceTypes();
this.selectedRecurringType = this.eventProcess.workflowInstanceDataFields.OccurrenceType;
setTimeout(() => {
this.selectedRecurringType = this.eventProcess.workflowInstanceDataFields.OccurrenceType;
console.log(this.selectedRecurringType);
}, 1000);
}
async getTask() {
@@ -149,6 +138,9 @@ export class EditEventToApproveComponent implements OnInit {
this.eventProcess = result
this.startDate = new Date(this.eventProcess.workflowInstanceDataFields.StartDate);
this.endDate = new Date(this.eventProcess.workflowInstanceDataFields.EndDate);
// description
let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body
@@ -205,10 +197,26 @@ export class EditEventToApproveComponent implements OnInit {
}
}
goBack() {
let navigationExtras: NavigationExtras = {
queryParams: {
"eventos": true,
}
};
if( window.innerWidth < 801) {
this.router.navigate(['/home/gabinete-digital/event-list']);
} else {
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
close() {
this.modalController.dismiss();
console.log('CLOSE');
}
save() {
@@ -232,8 +240,8 @@ export class EditEventToApproveComponent implements OnInit {
Body: this.eventProcess.workflowInstanceDataFields.Body,
Location: this.eventProcess.workflowInstanceDataFields.Location,
Subject: this.eventProcess.workflowInstanceDataFields.Subject,
StartDate: this.eventProcess.workflowInstanceDataFields.StartDate,
EndDate: this.eventProcess.workflowInstanceDataFields.EndDate,
StartDate: this.startDate,
EndDate: this.endDate,
ReviewUserComment: '',
MDName: this.eventProcess.workflowInstanceDataFields.MDName,
MDEmail: this.eventProcess.workflowInstanceDataFields.MDEmail,
@@ -277,8 +285,8 @@ export class EditEventToApproveComponent implements OnInit {
})
//this.modalController.dismiss();
this.modalController.dismiss();
this.goBack();
}
@@ -326,8 +334,9 @@ export class EditEventToApproveComponent implements OnInit {
addParticipants(){
this.adding = 'intervenient'
this.openAttendees();
console.log('LOGS');
}
addParticipantsCC(){