mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Merge branch 'feature/calendar' into developer
This commit is contained in:
@@ -380,22 +380,16 @@
|
||||
>
|
||||
|
||||
</app-approve-event>
|
||||
|
||||
|
||||
<app-attendees
|
||||
class="d-flex flex-column height-100"
|
||||
*ngIf="mobileComponent.showAttendees"
|
||||
(openAttendeeModal)="openAttendeeModal()"
|
||||
[eventAttendees]="contacts"
|
||||
(openAddEvent)="openAddEvent($event)"
|
||||
(GoBackEditOrAdd)="GoBackEditOrAdd()"
|
||||
>
|
||||
</app-attendees>
|
||||
|
||||
|
||||
<app-attendee-modal
|
||||
class="d-flex flex-column height-100"
|
||||
*ngIf="mobileComponent.showAttendeeModal"
|
||||
*ngIf="mobileComponent.showAttendees"
|
||||
[eventAttendees]="contacts"
|
||||
(openAttendeesComponent)="openAttendeesComponent($event)"
|
||||
(openAddEvent)="openAddEvent()"
|
||||
(GoBackEditOrAdd)="GoBackEditOrAdd()"
|
||||
(setContact)="setContact($event)"
|
||||
>
|
||||
</app-attendee-modal>
|
||||
|
||||
|
||||
@@ -958,7 +958,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
|
||||
if(Array.isArray(data)){
|
||||
if(data.length != 0){
|
||||
if(data.length >= 1){
|
||||
|
||||
console.log('save!!!',data.length);
|
||||
console.log(data);
|
||||
|
||||
@@ -1,26 +1,51 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<ion-title>Adicionar intervenientes</ion-title>
|
||||
<ion-header class="ion-no-border px-20">
|
||||
<ion-toolbar class="px-10">
|
||||
<ion-title class="pa-0">Adicionar intervenientes</ion-title>
|
||||
</ion-toolbar>
|
||||
<ion-searchbar (ionChange)="onChange($event)" placeholder="Pesquisar"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
|
||||
<ion-searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Pesquisar"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-item-group>
|
||||
<ion-list>
|
||||
<ion-item-sliding>
|
||||
<ion-item *ngFor="let attendee of contacts">
|
||||
<ion-checkbox slot="end" (ionChange)="selectContact(attendee)"></ion-checkbox><!-- [disabled]="isCheckboxDisabled" -->
|
||||
<ion-label>
|
||||
<h3>{{ attendee.Name }}</h3>
|
||||
<p>{{ attendee.EmailAddress }}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
</ion-item-group>
|
||||
<ion-content class="height-100 ">
|
||||
|
||||
<ion-item-group class="d-flex flex-column height-100">
|
||||
<ion-list class="flex-grow-1 overflow-y-auto height-100" >
|
||||
<ion-item-sliding class="px-20">
|
||||
<div *ngFor="let attendee of contacts;">
|
||||
<ion-item (click)="selectContact(attendee)" *ngIf="checkbox(attendee)" >
|
||||
<div class="pr-10">
|
||||
<ion-icon class="font-35" src="assets/images/icons-userprofile.svg"></ion-icon>
|
||||
</div>
|
||||
<ion-label>
|
||||
<h3>{{ attendee.Name }}</h3>
|
||||
<p>{{ attendee.EmailAddress }}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
<hr/>
|
||||
<ion-list lines="none" *ngIf="selectedContact.length >= 1" class="flex-grow-1 overflow-y-auto height-100" style="border-top:1px solid #ebebeb">
|
||||
<ion-item-sliding class="px-20">
|
||||
<ion-item *ngFor="let attendee of selectedContact;" class="d-flex">
|
||||
<div class="pr-10">
|
||||
<ion-icon class="font-35" src="assets/images/icons-userprofile.svg"></ion-icon>
|
||||
</div>
|
||||
<ion-label>
|
||||
<h3>{{ attendee.Name }}</h3>
|
||||
<p>{{ attendee.EmailAddress }}</p>
|
||||
</ion-label>
|
||||
<div style="color:red" (click)="remove(attendee)">
|
||||
X
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
</ion-item-group>
|
||||
|
||||
</ion-content>
|
||||
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="width-100 d-flex justify-space-between px-20">
|
||||
<ion-buttons slot="start">
|
||||
@@ -31,7 +56,7 @@
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<ion-button class="btn-ok" fill="clear" color="#fff" (click)="save()">
|
||||
<ion-label>Adicionar</ion-label>
|
||||
<ion-label>Gravar</ion-label>
|
||||
<ion-icon name="checkmark" slot="start"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
ion-item-group{
|
||||
margin: 15px;
|
||||
|
||||
}
|
||||
ion-searchbar{
|
||||
--border-radius: 20px;
|
||||
}
|
||||
}
|
||||
.item-inner{
|
||||
border-style: unset !important;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
@@ -12,35 +12,79 @@ export class AttendeeModalPage implements OnInit {
|
||||
|
||||
contacts: EventPerson[];
|
||||
showLoader: boolean = false;
|
||||
selectedContact: EventPerson[] =[];
|
||||
eventPersons: EventPerson[];
|
||||
|
||||
@Input() eventAttendees: EventPerson[];
|
||||
|
||||
constructor(private modalCtrl: ModalController, private contactsService: ContactsService) { }
|
||||
|
||||
@Output() openAttendeesComponent = new EventEmitter<any>();
|
||||
@Output() GoBackEditOrAdd = new EventEmitter<any>();
|
||||
@Output() setContact = new EventEmitter<any>();
|
||||
|
||||
ngOnInit() {
|
||||
this.fetchContacts("");
|
||||
this.selectedContact = this.eventAttendees;
|
||||
}
|
||||
|
||||
save(){
|
||||
|
||||
this.openAttendeesComponent.emit(this.contacts.filter(function(contact) {
|
||||
return contact.IsRequired == true;
|
||||
}));
|
||||
|
||||
// set data to agenda component
|
||||
this.setContact.emit(this.selectedContact);
|
||||
// got back
|
||||
this.GoBackEditOrAdd.emit();
|
||||
}
|
||||
|
||||
close(){
|
||||
// this.modalCtrl.dismiss(null);
|
||||
this.openAttendeesComponent.emit(false);
|
||||
this.selectedContact = [];
|
||||
this.GoBackEditOrAdd.emit();
|
||||
}
|
||||
|
||||
onChange(evt: any) {
|
||||
this.fetchContacts(evt.detail.value);
|
||||
}
|
||||
|
||||
selectContact(itm: EventPerson){
|
||||
itm.IsRequired = !itm.IsRequired;
|
||||
|
||||
checkbox(itm: EventPerson): boolean {
|
||||
const result = this.selectedContact.find((contact, index)=>{
|
||||
|
||||
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
});
|
||||
|
||||
return undefined == result;
|
||||
}
|
||||
|
||||
remove(itm: EventPerson){
|
||||
|
||||
this.selectedContact = this.selectedContact.filter((contact, index) =>{
|
||||
|
||||
if(contact.Name != itm.Name && contact.EmailAddress != itm.EmailAddress){
|
||||
return contact;
|
||||
}
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async selectContact(itm: EventPerson){
|
||||
|
||||
const index = 0;
|
||||
const findIndex = this.selectedContact.find((contact, index)=>{
|
||||
|
||||
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
});
|
||||
|
||||
this.selectedContact.push(itm);
|
||||
|
||||
}
|
||||
|
||||
async fetchContacts(filter: string) {
|
||||
|
||||
Reference in New Issue
Block a user