Improve Attendees component for agenda

This commit is contained in:
Peter Maquiran
2021-03-29 13:12:35 +01:00
parent 2606235a09
commit 28dc0f3e22
6 changed files with 126 additions and 36 deletions
+4 -11
View File
@@ -381,21 +381,14 @@
</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()"
>
</app-attendee-modal>
@@ -6,21 +6,46 @@
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
</ion-header>
<ion-content>
<ion-item-group>
<ion-list>
<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>
<ion-item *ngFor="let attendee of contacts">
<ion-checkbox slot="end" (ionChange)="selectContact(attendee)"></ion-checkbox><!-- [disabled]="isCheckboxDisabled" -->
<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>
</ion-item-group>
<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>
<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">
@@ -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,22 +12,27 @@ 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>();
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.openAttendeesComponent.emit(this.selectedContact);
// got back
this.GoBackEditOrAdd.emit();
}
close(){
@@ -39,8 +44,45 @@ export class AttendeeModalPage implements OnInit {
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) {
+27
View File
@@ -0,0 +1,27 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="35" height="35" viewBox="0 0 35 35">
<defs>
<circle id="nbs0qtv3ga" cx="17.5" cy="17.5" r="17.5"/>
</defs>
<g fill="none" fill-rule="evenodd">
<g>
<g>
<g>
<g>
<g transform="translate(-20 -466) translate(0 99) translate(20 327) translate(0 35) translate(0 5)">
<rect width="35" height="35" fill="#FFF" fill-opacity=".6" rx="17.5"/>
<g>
<mask id="413y7q8i5b" fill="#fff">
<use xlink:href="#nbs0qtv3ga"/>
</mask>
<path fill="#42B9FE" fill-opacity=".7" d="M17.5 8.167c4.51 0 8.167 3.917 8.167 8.75 0 3.035-1.443 5.71-3.634 7.279 4.85 1.914 8.3 6.813 8.3 12.554 0 7.41-5.745 13.417-12.833 13.417S4.667 44.16 4.667 36.75c0-5.741 3.45-10.64 8.3-12.556-2.191-1.567-3.634-4.242-3.634-7.277 0-4.833 3.657-8.75 8.167-8.75z" mask="url(#413y7q8i5b)"/>
</g>
<text fill="#FFF" fill-opacity=".7" font-family="Roboto-Light, Roboto" font-size="20" font-weight="300">
<tspan x="5.889" y="21.778">SE</tspan>
</text>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

+1 -1
View File
@@ -487,7 +487,7 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent-
.timeline-box{
left: -13%;
position: relative;
width: 115%;
width: 113%;
}
}