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

This commit is contained in:
Peter Maquiran
2021-07-14 15:45:02 +01:00
18 changed files with 196 additions and 146 deletions
+1 -1
View File
@@ -134,7 +134,7 @@
</mfp:windows10>
<mfp:appChecksum>0</mfp:appChecksum>
</mfp:windows>
<mfp:platformVersion>8.0.0.00-20210308-063916</mfp:platformVersion>
<mfp:platformVersion>8.0.0.00-20210214-154410</mfp:platformVersion>
<mfp:clientCustomInit enabled="false" />
<mfp:server runtime="mfp" url="http://gpr-dev-10.gabinetedigital.local:9080" />
<mfp:serverUri url="" />
+4 -2
View File
@@ -20,7 +20,7 @@ export class Event{
TimeZone: string;
Organizer: string;
Categories: string[];
HasAttachments: boolean;
HasAttachments: boolean;
EventRecurrence?: EventRecurrence;
/* public Event(){
@@ -38,6 +38,8 @@ export class EventToApproveEdit {
"Private": false
"ReviewUserComment": ""
"MDName": "Paulo Pinto"
"OccurrenceType": "-1"
"LastOccurrence": "2021-07-14"
"MDEmail": "paulo.pinto@gabinetedigital.local"
"Agenda": "Oficial" | "Pessoal"
"EventType": "Reunião"
@@ -49,4 +51,4 @@ export class EventToApproveEdit {
"IsRequired": true
}[]
"Message": "Recebeu um novo"
}
}
@@ -141,18 +141,6 @@ export class DespachosPrPage implements OnInit {
});
console.log(this.despachoList);
this.despachoList = this.sortArrayISODate(this.despachoList).reverse()
this.despachoList.forEach( (element, index) => {
// let aplicationId = element.workflowInstanceDataFields.SourceSecFsID;
let FolderID = element['FolderID'];
this.processes.GetDocumentDetails(FolderID, '361').subscribe(res=>{
element.DocumentsQty = res.DocumentsTotal
})
});
this.loading = false;
}
@@ -100,7 +100,7 @@ export class DespachosPage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DispatchDocId,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
@@ -108,16 +108,6 @@ export class DespachosPage implements OnInit {
this.despachoList.push(task)
});
this.despachoList = this.sortArrayISODate(this.despachoList).reverse()
this.despachoList.forEach( (element, index) => {
// let aplicationId = element.workflowInstanceDataFields.SourceSecFsID;
let FolderID = element['FolderID'];
this.processes.GetDocumentDetails(FolderID, '361').subscribe(res=>{
element.DocumentsQty = res.DocumentsTotal
})
});
}
sortArrayISODate(myArray: any) {
@@ -80,7 +80,7 @@ export class DiplomasAssinarPage implements OnInit {
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": this.totalDocs,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
@@ -96,7 +96,7 @@ export class DiplomasAssinarPage implements OnInit {
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
@@ -168,7 +168,7 @@ constructor(
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": this.totalDocs,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
@@ -200,7 +200,7 @@ constructor(
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": this.totalDocs,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
@@ -293,6 +293,7 @@ export class ApproveEventPage implements OnInit {
modal.onDidDismiss().then(res => {
this.getTask();
this.goBack();
});
}
@@ -33,11 +33,10 @@ export class EventListPage implements OnInit {
ngOnInit() {
this.segment = 'MDGPR';
this.LoadToApproveEvents();
this.refreshing();
const pathname = window.location.pathname
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == pathname) {
this.LoadToApproveEvents();
@@ -55,7 +54,7 @@ export class EventListPage implements OnInit {
LoadToApproveEvents(){
this.showLoader = true;
this.processes.GetToApprovedEvents('PR','false').subscribe(res=>{
this.showLoader = false;
this.eventsPRList = res;
@@ -80,7 +79,7 @@ export class EventListPage implements OnInit {
goToEventToApproveDetail(serialNumber:string){
console.log(serialNumber);
/* let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
@@ -97,6 +96,12 @@ export class EventListPage implements OnInit {
//this.router.navigate(['/home/gabinete-digital/event-list/approve-event'], navigationExtras)
}
refreshing() {
setTimeout(() => {
this.LoadToApproveEvents();
}, 1500);
}
doRefresh(event) {
this.LoadToApproveEvents();
setTimeout(() => {
@@ -314,7 +314,9 @@ export class ExpedienteDetailPage implements OnInit {
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
modal.onDidDismiss().then(res=>{
this.goBack();
});
}
goToEvent(eventId:any){
@@ -53,7 +53,7 @@ export class ExpedientePage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
"Status": element.workflowInstanceDataFields.Status,
@@ -96,7 +96,7 @@ export class ExpedientesPrPage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
"Status": element.workflowInstanceDataFields.Status,
@@ -117,7 +117,7 @@ export class PedidosPage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
@@ -147,7 +147,7 @@ export class PedidosPage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
@@ -68,6 +68,8 @@ export class EditEventToApprovePage implements OnInit {
taskStartDate: "",
workflowInstanceDataFields:{
Body: "",
OccurrenceType: '',
LastOccurrence: '',
IsRecurring: false,
ParticipantsList: [],
Agenda: '',
@@ -125,7 +127,7 @@ export class EditEventToApprovePage implements OnInit {
ngOnInit() {
if(this.restoreTemporaryData()){
if(this.restoreTemporaryData()){
this.setOtherData()
} else {
this.getTask();
@@ -138,22 +140,22 @@ export class EditEventToApprovePage implements OnInit {
this.processes.GetTask(this.serialNumber).subscribe( result =>{
this.eventProcess = result
this.restoreDatepickerData()
// description
let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
this.getAttachments()
this.setOtherData()
this.saveTemporaryData()
})
}
setOtherData() {
if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) {
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
@@ -167,7 +169,7 @@ export class EditEventToApprovePage implements OnInit {
this.taskParticipants = removeDuplicate(this.taskParticipants)
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc)
if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) {
this.isRecurring = "Não se repete";
}
@@ -183,7 +185,7 @@ export class EditEventToApprovePage implements OnInit {
close() {
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {}
this.closeComponent.emit();
/* this.setIntervenient.emit([]);
this.setIntervenientCC.emit([]);
@@ -233,18 +235,18 @@ export class EditEventToApprovePage implements OnInit {
this.runValidation()
if(this.Form.invalid) return false
// set dates to eventProcess object
this.getDatepickerData()
this.taskParticipantsCc.forEach( e => {
e.IsRequired = false
})
this.eventProcess.workflowInstanceDataFields.ParticipantsList = this.taskParticipants.concat(this.taskParticipantsCc)
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e=>{
if(e.hasOwnProperty('$type')) {
delete e.$type
}
@@ -264,12 +266,16 @@ export class EditEventToApprovePage implements OnInit {
MDEmail: this.eventProcess.workflowInstanceDataFields.MDEmail,
MDName: this.eventProcess.workflowInstanceDataFields.MDName,
Message: this.eventProcess.workflowInstanceDataFields.Message,
EventRecurrence: {
Type: this.eventProcess.workflowInstanceDataFields.OccurrenceType,
LastOccurrence: this.eventProcess.workflowInstanceDataFields.LastOccurrence,
},
ParticipantsList: this.eventProcess.workflowInstanceDataFields.ParticipantsList,
Private: false,
ReviewUserComment: ''
}
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
this.toastService.successMessage('Evento editado');
}, error =>{
@@ -303,7 +309,7 @@ export class EditEventToApprovePage implements OnInit {
// this.taskParticipants = data;
// this.postEvent.Attendees = data;
// }
// setIntervenientCC(data) {
// this.taskParticipantsCc = data;
// }
@@ -315,7 +321,7 @@ export class EditEventToApprovePage implements OnInit {
// }
// addParticipantsCC(){
// this.adding = 'CC'
// this.openAttendees();
// }
@@ -348,7 +354,7 @@ export class EditEventToApprovePage implements OnInit {
}
saveTemporaryData() {
this.getDatepickerData()
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {
@@ -372,7 +378,7 @@ export class EditEventToApprovePage implements OnInit {
return false;
}
}
async getAttachments() {
@@ -405,7 +411,7 @@ export class EditEventToApprovePage implements OnInit {
await modal.present();
modal.onDidDismiss().then( async (res)=>{
if(res){
const data: SearchDocument = res.data.selected;
const DocumentToSave: any = {
@@ -440,14 +446,14 @@ export class EditEventToApprovePage implements OnInit {
this.dateControlStart = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.StartDate)));
this.dateControlEnd = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.EndDate)));
}
getDatepickerData() {
this.eventProcess.workflowInstanceDataFields.StartDate = this.dateStart
this.eventProcess.workflowInstanceDataFields.EndDate = this.dateEnd
}
}
}
@@ -110,7 +110,7 @@ export class DespachosPage implements OnInit {
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DispatchDocId,
"FolderID": element.workflowInstanceDataFields.FolderID,
"WorkflowName": element.workflowDisplayName,
@@ -122,18 +122,7 @@ export class DespachosPage implements OnInit {
});
this.despachoList = this.sortArrayISODate(this.despachoList).reverse()
this.despachoList.forEach( (element, index) => {
// let aplicationId = element.workflowInstanceDataFields.SourceSecFsID;
let FolderID = element['FolderID'];
this.processes.GetDocumentDetails(FolderID, '361').subscribe(res=>{
element.DocumentsQty = res.DocumentsTotal
})
});
this.despachoList = this.sortArrayISODate(this.despachoList).reverse();
}
@@ -82,7 +82,7 @@ serialNumber:string;
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DispatchDocID,
"FolderID": element.workflowInstanceDataFields.FolderID,
"WorkflowName": element.workflowDisplayName,
@@ -103,7 +103,7 @@ serialNumber:string;
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Sender,
"DocumentsQty": 0,
"DocumentsQty": element.totalDocuments,
"DocId": element.workflowInstanceDataFields.DispatchDocID,
"FolderID": element.workflowInstanceDataFields.FolderID,
"WorkflowName": element.workflowDisplayName,
@@ -22,6 +22,7 @@ import { NgxMatMomentModule } from '@angular-material-components/moment-adapter'
import { MAT_DATE_LOCALE } from '@angular/material/core';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatInputModule } from '@angular/material/input';
import { MatDialogModule } from '@angular/material/dialog';
@NgModule({
imports: [
@@ -40,7 +41,8 @@ import { MatInputModule } from '@angular/material/input';
NgxMatMomentModule,
MatSelectModule,
MatButtonModule,
ReactiveFormsModule
ReactiveFormsModule,
MatDialogModule,
],
declarations: [
EditEventToApproveComponent
@@ -8,7 +8,7 @@
<ion-header>
<div class="title-content">
<div class="middle">
<ion-label class="title">Editar evento por aprovar MOB</ion-label>
<ion-label class="title">Editar evento por aprovar</ion-label>
</div>
</div>
</ion-header>
@@ -77,7 +77,7 @@
<ion-datetime
class="d-block d-md-none"
placeholder="Início"
[(ngModel)]="dateControlEnd"
[(ngModel)]="eventProcess.workflowInstanceDataFields.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"
@@ -86,10 +86,11 @@
>
</ion-datetime>
<mat-form-field appearance="none" class="width-100 date-hour-picker d-none d-md-block">
<mat-form-field appearance="none"
class="width-100 date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date"
[formControl]="dateControlStart"
[(ngModel)]="eventProcess.workflowInstanceDataFields.StartDate"
[min]="minDate" [max]="maxDate"
[disabled]="disabled"
>
@@ -111,9 +112,9 @@
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class">
<div class="ion-input-class width-100">
<ion-datetime
class="d-none d-md-none"
class="d-block d-md-none"
placeholder="Fim"
[(ngModel)]="eventProcess.workflowInstanceDataFields.EndDate"
displayFormat="D MMM YYYY H:mm"
@@ -124,10 +125,11 @@
>
</ion-datetime>
<mat-form-field class="width-100 date-hour-picker d-none d-md-block">
<mat-form-field appearance="none"
class="width-100 date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Choose a date"
[formControl]="dateControlEnd"
[(ngModel)]="eventProcess.workflowInstanceDataFields.EndDate"
[min]="minDate" [max]="maxDate"
[disabled]="disabled"
>
@@ -154,12 +156,11 @@
<ion-select
placeholder="Selecione repetição"
class="d-block d-md-none"
[(ngModel)]="eventProcess.workflowInstanceDataFields.IsRecurring"
selectedText="{{isRecurring}}"
[(ngModel)]="eventProcess.workflowInstanceDataFields.OccurrenceType"
(ngModelChange)="onSelectedRecurringChanged($event)"
interface="action-sheet"
Cancel-text="Cancelar" required>
<ion-select-option value="false">Não se repete</ion-select-option>
<ion-select-option value="true">Repete</ion-select-option>
<ion-select-option *ngFor="let recurring of recurringTypes" value="{{recurring.Code}}">{{recurring.Description}}</ion-select-option>
</ion-select>
<mat-form-field
@@ -170,12 +171,13 @@
required
appearance="none"
>
<mat-select [(value)]="eventProcess.workflowInstanceDataFields.IsRecurring">
<mat-option value="false">
Não se repete
</mat-option>
<mat-option value="true">
Repete
<mat-select [(ngModel)]="eventProcess.workflowInstanceDataFields.OccurrenceType"
(ngModelChange)="onSelectedRecurringChanged($event)"
>
<mat-option
*ngFor="let recurring of recurringTypes" value="{{recurring.Code}}"
>
{{recurring.Description}}
</mat-option>
</mat-select>
</mat-form-field>
@@ -184,7 +186,46 @@
</div>
</div>
<div *ngIf="eventProcess.workflowInstanceDataFields.OccurrenceType != '-1'"
class="container-div width-100">
<div class="ion-item-class-2 d-flex">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1">
<ion-datetime
class="d-block d-md-none"
placeholder="Última ocorrência"
[(ngModel)]="eventProcess.workflowInstanceDataFields.LastOccurrence"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,15,30,45"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
min="2021"
max="2025"
>
</ion-datetime>
<mat-form-field class="date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="occurrrence"
placeholder="Choose a date"
[(ngModel)]="eventProcess.workflowInstanceDataFields.LastOccurrence"
[disabled]="disabled"
>
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #occurrrence
[showSpinners]="showSpinners"
[showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute"
[stepSecond]="stepSecond"
[touchUi]="touchUi"
>
</ngx-mat-datetime-picker>
</mat-form-field>
</div>
</div>
</div>
<div class="container-div width-100">
<div class="ion-item-class-2">
@@ -50,25 +50,16 @@ export class EditEventToApproveComponent implements OnInit {
public stepHour = 1;
public stepMinute = 5;
public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
recurringTypes: any;
selectedRecurringType: any;
showLoader = false
get dateStart () {
return this.dateControlStart.value
}
get dateEnd () {
return this.dateControlEnd.value
}
@ViewChild('picker') picker: any;
@ViewChild('fim') fim: any;
@ViewChild('inicio') inicio: any;
@ViewChild('picker1') picker1: any;
serialNumber: string
loadedAttachments: Attachment[]= []
@@ -77,6 +68,8 @@ export class EditEventToApproveComponent implements OnInit {
taskStartDate: "",
workflowInstanceDataFields:{
Body: "",
OccurrenceType: '',
LastOccurrence: '',
IsRecurring: false,
ParticipantsList: [],
Agenda: '',
@@ -128,41 +121,55 @@ export class EditEventToApproveComponent implements OnInit {
this.isEventEdited = false;
this.dateControlStart = new FormControl(moment(new Date()));
this.dateControlEnd = new FormControl(moment(new Date()));
}
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() {
const result = await this.processes.GetTask(this.serialNumber).subscribe( result =>{
const result = await this.processes.GetTask(this.serialNumber).toPromise();
console.log(result);
this.eventProcess = result
this.restoreDatepickerData()
// description
let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body
this.Location = this.eventProcess.workflowInstanceDataFields.Location
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
this.getAttachments()
try {
this.getAttachments()
} catch (error) {
}
if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) {
this.isRecurring = "Não se repete";
}
else {
this.isRecurring = "Repete";
}
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
if(e.IsRequired) {
this.taskParticipants.push(e);
@@ -170,27 +177,51 @@ export class EditEventToApproveComponent implements OnInit {
this.taskParticipantsCc.push(e);
}
})
})
/* }) */
}
getRecurrenceTypes() {
this.eventsService.getRecurrenceTypes().subscribe(res=>{
console.log(res);
this.recurringTypes = res;
});
}
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";
} */
}
openLastOccurrence() {
let input: any = document.querySelector('#last-occurrence')
if(input) {
input.click()
}
}
close() {
this.modalController.dismiss();
}
save() {
save() {
// set dates to eventProcess object
this.getDatepickerData()
this.taskParticipantsCc.forEach(e=>{
e.IsRequired = false
})
this.eventProcess.workflowInstanceDataFields.ParticipantsList = this.taskParticipants.concat(this.taskParticipantsCc)
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e=>{
if(e.hasOwnProperty('$type')) {
delete e.$type
}
@@ -205,18 +236,22 @@ export class EditEventToApproveComponent implements OnInit {
IsRecurring: this.eventProcess.workflowInstanceDataFields.IsRecurring,
Location: this.eventProcess.workflowInstanceDataFields.Location,
Subject: this.eventProcess.workflowInstanceDataFields.Subject,
serialNumber: this.eventProcess.serialNumber,
SerialNumber: this.eventProcess.serialNumber,
StartDate: this.eventProcess.workflowInstanceDataFields.StartDate,
MDEmail: this.eventProcess.workflowInstanceDataFields.MDEmail,
MDName: this.eventProcess.workflowInstanceDataFields.MDName,
Message: this.eventProcess.workflowInstanceDataFields.Message,
EventRecurrence: {
Type: this.eventProcess.workflowInstanceDataFields.OccurrenceType,
LastOccurrence: this.eventProcess.workflowInstanceDataFields.LastOccurrence,
},
ParticipantsList: this.eventProcess.workflowInstanceDataFields.ParticipantsList,
Private: false,
ReviewUserComment: ''
}
console.log(event);
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
this.toastService.successMessage('Evento editado');
}, error =>{
@@ -244,7 +279,7 @@ export class EditEventToApproveComponent implements OnInit {
})
this.modalController.dismiss();
//this.modalController.dismiss();
}
@@ -261,11 +296,11 @@ export class EditEventToApproveComponent implements OnInit {
cssClass: 'attendee modal modal-desktop',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((data) => {
if(data){
data = data['data'];
@@ -285,7 +320,7 @@ export class EditEventToApproveComponent implements OnInit {
this.taskParticipants = data;
this.postEvent.Attendees = data;
}
setIntervenientCC(data) {
this.taskParticipantsCc = data;
}
@@ -297,7 +332,7 @@ export class EditEventToApproveComponent implements OnInit {
}
addParticipantsCC(){
this.adding = 'CC'
this.openAttendees();
}
@@ -339,7 +374,7 @@ export class EditEventToApproveComponent implements OnInit {
await modal.present();
modal.onDidDismiss().then( async (res)=>{
if(res){
const data: SearchDocument = res.data.selected;
const DocumentToSave: any = {
@@ -370,18 +405,7 @@ export class EditEventToApproveComponent implements OnInit {
});
}
restoreDatepickerData() {
this.dateControlStart = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.StartDate)));
this.dateControlEnd = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.EndDate)));
}
getDatepickerData() {
this.eventProcess.workflowInstanceDataFields.StartDate = this.dateStart
this.eventProcess.workflowInstanceDataFields.EndDate = this.dateEnd
}
}
}