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
@@ -41,12 +41,12 @@ export class EventListPage implements OnInit {
}
// this.LoadToApproveEvents();
this.LoadToApproveEvents();
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == this.router.url) {
// this.LoadToApproveEvents();
this.LoadToApproveEvents();
}
});
@@ -123,14 +123,14 @@
<!-- Aside right -->
<div class="aside-content d-none flex-column height-100">
<!--
<app-empty-container [texto]="emptyTextDescription" *ngIf="showEmptyContainer" class="d-flex height-100 flex-column"></app-empty-container>
<app-events-to-approve [profile]="'MDGPR'" *ngIf="showEventsToApprove" class="d-flex height-100 flex-column"></app-events-to-approve>
<app-expedients (openExpedientDetail)="openExpedientPage($event)" [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showExpedients"></app-expedients>
<app-expediente (openExpedientList)="openExpedientListPage()" [profile]="profile" [serialNumber]="serialNumber" class="d-flex height-100 flex-column" *ngIf="showExpedientDetail"></app-expediente>
-->
</div>
</div>
@@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { ProcessesService } from 'src/app/services/processes.service';
import { AlertService } from 'src/app/services/alert.service';
import { EventsService } from 'src/app/services/events.service';
import { ModalController } from '@ionic/angular';
import { EventListPage } from './event-list/event-list.page';
import { ExpedientePage } from './expediente/expediente.page';
@@ -60,15 +59,21 @@ export class GabineteDigitalPage implements OnInit {
this.activatedRoute.queryParams.subscribe(params => {
if(params["show"]) {
// this.openExpedientListPage();
this.openExpedientListPage();
this.selectedElement='Correspondence'
}
else if(params["events"]) {
// this.openEventsToApprovePage("MDGPR");
this.openEventsToApprovePage("MDGPR");
this.selectedElement='approval'
} else {
this.openEventsToApprovePage('MDGPR');
this.selectedElement='approval'
}
});
}
}
closeAllDesktopComponent(){
this.desktopComponent = {
@@ -83,11 +88,11 @@ export class GabineteDigitalPage implements OnInit {
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == this.router.url) {
//this.LoadCounts();
this.LoadCounts();
}
});
// this.LoadCounts();
this.LoadCounts();
/* this.eventService.getAllMdEvents.subscribe(res=>{
console.log(res);
@@ -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>();
@@ -49,6 +49,7 @@ 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,8 +154,6 @@ export class NewEventPage implements OnInit {
this.setIntervenientCC.emit([]);
}
async save(){
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
@@ -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){
@@ -30,10 +30,10 @@
</ion-list>
<hr/>
<ion-list lines="none" *ngIf="taskParticipants.length >= 1 && adding == 'intervenient' " class="flex-grow-1 overflow-y-auto height-100 pb-0" >
<div class="px-20 font-15 pt-20" style="border-top:1px solid #ebebeb;font-weight: 500;" *ngIf="taskParticipants.length >= 1 || taskParticipantsCc.length >= 1" > Destinatário</div>
<ion-list lines="none" *ngIf="LtaskParticipants.length >= 1 && adding == 'intervenient' " class="flex-grow-1 overflow-y-auto height-100 pb-0" >
<div class="px-20 font-15 pt-20" style="border-top:1px solid #ebebeb;font-weight: 500;" *ngIf="LtaskParticipants.length >= 1 || LtaskParticipantsCc.length >= 1" > Destinatário</div>
<ion-item-sliding class="px-20">
<ion-item *ngFor="let attendee of taskParticipants;" class="d-flex">
<ion-item *ngFor="let attendee of LtaskParticipants;" class="d-flex">
<div class="pr-10">
<ion-icon class="font-35" src="assets/images/icons-userprofile.svg"></ion-icon>
</div>
@@ -47,11 +47,11 @@
</ion-item>
</ion-item-sliding>
</ion-list>
<ion-list lines="none" *ngIf="taskParticipantsCc.length >= 1 && adding == 'CC' " class="flex-grow-1 overflow-y-auto height-100 pb-0" >
<div class="px-20 font-15 pt-20" style="border-top:1px solid #ebebeb;font-weight: 500;" *ngIf="taskParticipants.length >= 1 || taskParticipantsCc.length >= 1" > Destinatário</div>
<ion-list lines="none" *ngIf="LtaskParticipantsCc.length >= 1 && adding == 'CC' " class="flex-grow-1 overflow-y-auto height-100 pb-0" >
<div class="px-20 font-15 pt-20" style="border-top:1px solid #ebebeb;font-weight: 500;" *ngIf="LtaskParticipants.length >= 1 || LtaskParticipantsCc.length >= 1" > Destinatário</div>
<ion-item-sliding class="px-20">
<ion-item *ngFor="let attendee of taskParticipantsCc;" class="d-flex">
<ion-item *ngFor="let attendee of LtaskParticipantsCc;" class="d-flex">
<div class="pr-10">
<ion-icon class="font-35" src="assets/images/icons-userprofile.svg"></ion-icon>
</div>
@@ -15,14 +15,6 @@ export class AttendeeModalPage implements OnInit {
showLoader: boolean = false;
eventPersons: EventPerson[];
@Input() taskParticipants:EventPerson[] = [];
@Input() taskParticipantsCc:EventPerson[] = [];
constructor(
private modalCtrl: ModalController,
private contactsService: ContactsService ) {
}
@Output() closeComponent = new EventEmitter<any>();
@@ -30,6 +22,23 @@ export class AttendeeModalPage implements OnInit {
@Output() setIntervenientCC = new EventEmitter<any>();
@Output() dynamicSetIntervenient = new EventEmitter<any>();
@Input() taskParticipants:EventPerson[] = [];
@Input() taskParticipantsCc:EventPerson[] = [];
LtaskParticipants: EventPerson[] = [];
LtaskParticipantsCc: EventPerson[] = [];
constructor(
private modalCtrl: ModalController,
private contactsService: ContactsService ) {
this.LtaskParticipants = this.taskParticipants;
this.LtaskParticipantsCc = this.taskParticipantsCc;
}
currentPath = window.location.pathname;
@Input() adding: "intervenient" | "CC";
@@ -37,12 +46,12 @@ export class AttendeeModalPage implements OnInit {
this.fetchContacts("");
if(this.taskParticipants == null || this.taskParticipants == undefined) {
this.taskParticipants = [];
if(this.LtaskParticipants == null || this.LtaskParticipants == undefined) {
this.LtaskParticipants = [];
}
if(this.taskParticipantsCc == null || this.taskParticipantsCc == undefined) {
this.taskParticipantsCc = [];
if(this.LtaskParticipantsCc == null || this.LtaskParticipantsCc == undefined) {
this.LtaskParticipantsCc = [];
}
}
@@ -52,23 +61,26 @@ export class AttendeeModalPage implements OnInit {
}
save(){
this.setIntervenient.emit(this.taskParticipants);
this.setIntervenientCC.emit(this.taskParticipantsCc);
this.setIntervenient.emit(this.LtaskParticipants);
this.setIntervenientCC.emit(this.LtaskParticipantsCc);
this.closeComponent.emit();
}
setContactWithClose() {
if(this.currentPath == '/home/gabinete-digital') {
this.setIntervenient.emit(this.taskParticipants);
this.setIntervenientCC.emit(this.taskParticipantsCc);
console.log('set!!!!! ')
this.setIntervenient.emit(this.LtaskParticipants);
this.setIntervenientCC.emit(this.LtaskParticipantsCc);
}
console.log('data', this.taskParticipants, this.taskParticipantsCc );
/* console.log('data', this.LtaskParticipants, this.LtaskParticipantsCc ); */
this.dynamicSetIntervenient.emit({
taskParticipants: this.taskParticipants,
taskParticipantsCc: this.taskParticipantsCc
LtaskParticipants: this.LtaskParticipants,
LtaskParticipantsCc: this.LtaskParticipantsCc
})
}
async selectContact(itm: EventPerson){
@@ -76,12 +88,12 @@ export class AttendeeModalPage implements OnInit {
if(this.adding == "intervenient") {
itm.IsRequired = true;
this.taskParticipants.push(itm);
this.LtaskParticipants.push(itm);
} else if (this.adding == "CC") {
itm.IsRequired = false;
this.taskParticipantsCc.push(itm);
this.LtaskParticipantsCc.push(itm);
} else {
// alert('bug')
}
@@ -101,7 +113,7 @@ export class AttendeeModalPage implements OnInit {
filterSearchList(itm: EventPerson): boolean {
const result1 = this.taskParticipants.find((contact, index)=>{
const result1 = this.LtaskParticipants.find((contact, index)=>{
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
index = index;
@@ -115,7 +127,7 @@ export class AttendeeModalPage implements OnInit {
}
const result2 = this.taskParticipantsCc.find((contact, index)=>{
const result2 = this.LtaskParticipantsCc.find((contact, index)=>{
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
index = index;
@@ -137,7 +149,7 @@ export class AttendeeModalPage implements OnInit {
if(this.adding == "intervenient"){
this.taskParticipants = this.taskParticipants.filter((contact, index) =>{
this.LtaskParticipants = this.LtaskParticipants.filter((contact, index) =>{
if(contact.Name != itm.Name && contact.EmailAddress != itm.EmailAddress){
return contact;
@@ -148,7 +160,7 @@ export class AttendeeModalPage implements OnInit {
} else if (this.adding == "CC") {
this.taskParticipantsCc = this.taskParticipantsCc.filter((contact, index) =>{
this.LtaskParticipantsCc = this.LtaskParticipantsCc.filter((contact, index) =>{
if(contact.Name != itm.Name && contact.EmailAddress != itm.EmailAddress){
return contact;