Uncomment all method that use k2 service

This commit is contained in:
Peter Maquiran
2021-04-21 14:27:55 +01:00
parent 7d882d3a11
commit ef1c260f77
9 changed files with 98 additions and 63 deletions
@@ -54,6 +54,7 @@ export class EditEventComponent implements OnInit {
ngOnInit() {
if(!this.restoreTemporaryData()){
// clear
if(this.postEvent){
if( this.postEvent.Body){
@@ -118,7 +119,11 @@ export class EditEventComponent implements OnInit {
header: 'Evento actualizado',
buttons: ['OK']
});
await alert.present();
setTimeout(()=>{
alert.dismiss();
}, 1500);
});
@@ -44,11 +44,11 @@ export class EventListComponent implements OnInit {
this.profile = 'PR'
}
// this.LoadToApproveEvents();
this.LoadToApproveEvents();
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == this.router.url) {
// this.LoadToApproveEvents();
this.LoadToApproveEvents();
}
});
}
@@ -29,7 +29,7 @@ export class NewEventPage implements OnInit {
@Output() setIntervenient = new EventEmitter<any>();
@Output() setIntervenientCC = new EventEmitter<any>();
@Input() postEvent: Event;
postEvent: Event;
@Output() onAddEvent = new EventEmitter<any>();
@Output() openAttendeesComponent = new EventEmitter<any>();
@Output() clearContact = new EventEmitter<any>();
@@ -47,8 +47,9 @@ export class NewEventPage implements OnInit {
) {}
ngOnInit() {
if(!this.restoreTemporaryData()){
// clear
this.postEvent = new Event();
this.eventBody = { BodyType : "1", Text : ""};
@@ -124,7 +125,6 @@ export class NewEventPage implements OnInit {
this.setIntervenientCC.emit(this.taskParticipantsCc);
}
}
async getDoc(){
@@ -154,14 +154,12 @@ export class NewEventPage implements OnInit {
this.setIntervenientCC.emit([]);
}
async save(){
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
if(this.documents.length >= 0){
if(this.documents.length >= 0) {
this.postEvent.HasAttachments = true;
}
@@ -184,8 +182,14 @@ export class NewEventPage implements OnInit {
};
});
DocumentToSave.forEach((attachments) => {
this.attachmentsService.setEventAttachmentById(attachments).subscribe();
DocumentToSave.forEach((attachments, i) => {
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
if(DocumentToSave.length == (i+1)){
this.close();
}
});
});
});
@@ -196,7 +200,7 @@ export class NewEventPage implements OnInit {
const eventId: string = id;
const toDocumentTosSave: EventAttachment[] = this.documents.map((e) => {
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
return {
SourceTitle: e.Assunto,
ParentId: eventId,
@@ -209,12 +213,21 @@ export class NewEventPage implements OnInit {
};
});
toDocumentTosSave.forEach((attachments) => {
this.attachmentsService.setEventAttachmentById(attachments);
DocumentToSave.forEach((attachments, i) => {
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
if(DocumentToSave.length == (i+1)){
this.close();
}
});
});
});
}
this.close();
}
removeAttachment(index: number){