mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'developer-c' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="middle">
|
||||
<ion-label class="title">Editar Evento</ion-label>
|
||||
<ion-label class="title">Editar Evento agenda</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -130,43 +130,43 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div d-flex">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class=" d-flex width-100">
|
||||
<div class="ion-item-class-2 width-100">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div (click)="openAttendees()" class="ion-input-class d-flex flex-grow-1 width-100 overflow-hidden ">
|
||||
<div class="list-people flex-grow-1">
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label class="list-people-title">Ver ou editar participantes</ion-label>
|
||||
<ion-label hidden >Text</ion-label>
|
||||
<ion-label *ngIf="taskParticipants.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
|
||||
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="d-flex justify-center align-center font-35">
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
<div class="add-people">
|
||||
<ion-icon (click)="addParticipants()" class="font-35" slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hidden class="container-div d-flex">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class=" d-flex width-100">
|
||||
<div class="ion-item-class-2 width-100">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class d-flex flex-grow-1 width-100 overflow-hidden">
|
||||
<div class="list-people flex-grow-1">
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label class="list-people-title">Com conhecimento</ion-label>
|
||||
<ion-label hidden >Text</ion-label>
|
||||
<ion-label *ngIf="taskParticipantsCc.length == 0" class="list-people-title">Como conhecido</ion-label>
|
||||
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="d-flex justify-center align-center font-35">
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
<div class="add-people">
|
||||
<ion-icon (click)="addParticipantsCc()" class="font-35" slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -22,25 +22,25 @@ export class EditEventComponent implements OnInit {
|
||||
eventAttendees: EventPerson[];
|
||||
minDate: string;
|
||||
|
||||
@Input() taskParticipants: EventPerson[];
|
||||
@Input() taskParticipantsCc: any = [];
|
||||
@Input() profile:string;
|
||||
@Input() selectedSegment: string;
|
||||
@Input() postEvent: any;
|
||||
@Output() clearContact = new EventEmitter<any>();
|
||||
|
||||
|
||||
@Output() openAttendeesComponent = new EventEmitter<any>();
|
||||
@Output() closeComponent = new EventEmitter<any>();
|
||||
|
||||
@Output() setIntervenient = new EventEmitter<any>();
|
||||
@Output() setIntervenientCC = new EventEmitter<any>();
|
||||
|
||||
@Output() clearPostEvent = new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private eventsService: EventsService,
|
||||
public alertController: AlertController,
|
||||
)
|
||||
{
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
@@ -48,8 +48,18 @@ export class EditEventComponent implements OnInit {
|
||||
if(this.postEvent){
|
||||
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
|
||||
}
|
||||
console.log(this.postEvent);
|
||||
|
||||
|
||||
// attendees list
|
||||
if(this.postEvent.Attendees != null) {
|
||||
this.postEvent.Attendees.forEach(e =>{
|
||||
if(e.IsRequired){
|
||||
this.taskParticipants.push(e);
|
||||
} else {
|
||||
this.taskParticipantsCc.push(e);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.isEventEdited = false;
|
||||
|
||||
if(this.postEvent.IsRecurring == false){
|
||||
@@ -61,32 +71,45 @@ export class EditEventComponent implements OnInit {
|
||||
}
|
||||
|
||||
close(){
|
||||
console.log('!!!!!!!!!!!!!!!!! close')
|
||||
this.closeComponent.emit();
|
||||
this.setIntervenient.emit([]);
|
||||
this.setIntervenientCC.emit([]);
|
||||
this.clearContact.emit();
|
||||
}
|
||||
save(){
|
||||
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
|
||||
|
||||
async save(){
|
||||
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
|
||||
|
||||
await this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento actualizado',
|
||||
buttons: ['OK']
|
||||
});
|
||||
await alert.present();
|
||||
|
||||
|
||||
});
|
||||
|
||||
this.clearPostEvent.emit();
|
||||
|
||||
this.closeComponent.emit();
|
||||
this.clearContact.emit();
|
||||
|
||||
this.setIntervenient.emit([]);
|
||||
this.setIntervenientCC.emit([]);
|
||||
this.close();
|
||||
}
|
||||
|
||||
async openAttendees() {
|
||||
async addParticipants() {
|
||||
this.openAttendeesComponent.emit({
|
||||
type: "intervenient"
|
||||
});
|
||||
|
||||
this.clearContact.emit();
|
||||
}
|
||||
|
||||
async addParticipantsCc() {
|
||||
this.openAttendeesComponent.emit({
|
||||
type: "CC"
|
||||
});
|
||||
|
||||
this.openAttendeesComponent.emit();
|
||||
|
||||
this.clearContact.emit();
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
<!-- Hide footer in gabinete-digital -->
|
||||
<ion-footer class="ion-no-border" *ngIf="currentPath != '/home/gabinete-digital' ">
|
||||
<ion-toolbar class="width-100 d-flex justify-space-between px-20">
|
||||
<ion-toolbar *ngIf="currentPath != '/home/events'" class="width-100 d-flex justify-space-between px-20">
|
||||
<ion-buttons slot="start">
|
||||
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
|
||||
@@ -13,13 +13,16 @@ export class AttendeeModalPage implements OnInit {
|
||||
// Defined by the API
|
||||
contacts: EventPerson[];
|
||||
showLoader: boolean = false;
|
||||
selectedContact: EventPerson[] =[];
|
||||
eventPersons: EventPerson[];
|
||||
|
||||
@Input() taskParticipants:EventPerson[] = [];
|
||||
@Input() taskParticipantsCc:EventPerson[] = [];
|
||||
|
||||
constructor(private modalCtrl: ModalController, private contactsService: ContactsService) { }
|
||||
constructor(
|
||||
private modalCtrl: ModalController,
|
||||
private contactsService: ContactsService ) {
|
||||
|
||||
}
|
||||
|
||||
@Output() closeComponent = new EventEmitter<any>();
|
||||
|
||||
@@ -46,7 +49,6 @@ export class AttendeeModalPage implements OnInit {
|
||||
ngOnChanges(event){}
|
||||
|
||||
save(){
|
||||
|
||||
this.setIntervenient.emit(this.taskParticipants);
|
||||
this.setIntervenientCC.emit(this.taskParticipantsCc);
|
||||
|
||||
@@ -61,8 +63,6 @@ export class AttendeeModalPage implements OnInit {
|
||||
}
|
||||
|
||||
close(){
|
||||
// this.modalCtrl.dismiss(null);
|
||||
this.selectedContact = [];
|
||||
this.closeComponent.emit();
|
||||
}
|
||||
|
||||
@@ -72,29 +72,36 @@ export class AttendeeModalPage implements OnInit {
|
||||
|
||||
filterSearchList(itm: EventPerson): boolean {
|
||||
|
||||
if(this.adding == "intervenient"){
|
||||
const result = this.taskParticipants.find((contact, index)=>{
|
||||
|
||||
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
});
|
||||
return undefined == result;
|
||||
|
||||
} else if (this.adding == "CC") {
|
||||
|
||||
const result = this.taskParticipantsCc.find((contact, index)=>{
|
||||
|
||||
const result1 = this.taskParticipants.find((contact, index)=>{
|
||||
|
||||
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
});
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
});
|
||||
|
||||
return undefined == result;
|
||||
// if to show
|
||||
if(undefined != result1){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const result2 = this.taskParticipantsCc.find((contact, index)=>{
|
||||
|
||||
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
});
|
||||
|
||||
// if to show
|
||||
if(undefined != result2){
|
||||
return false;
|
||||
}
|
||||
|
||||
// don't show
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
remove(itm: EventPerson){
|
||||
@@ -110,8 +117,6 @@ export class AttendeeModalPage implements OnInit {
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
} else if (this.adding == "CC") {
|
||||
|
||||
this.taskParticipantsCc = this.taskParticipantsCc.filter((contact, index) =>{
|
||||
@@ -138,10 +143,12 @@ export class AttendeeModalPage implements OnInit {
|
||||
|
||||
if(this.adding == "intervenient"){
|
||||
|
||||
itm.IsRequired = true;
|
||||
this.taskParticipants.push(itm);
|
||||
|
||||
} else if (this.adding == "CC") {
|
||||
|
||||
itm.IsRequired = false;
|
||||
this.taskParticipantsCc.push(itm);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user