mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'feature/calendar' into developer
This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
<ion-input placeholder="Assunto" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||
</div>
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<ion-input placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,14 +29,15 @@
|
||||
Campo obrigatório
|
||||
</span> -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<ion-select disabled placeholder="Selecione agenda"
|
||||
selectedText="{{postEvent.CalendarName}}"
|
||||
[(ngModel)]="postEvent.CalendarName"
|
||||
@@ -50,11 +51,11 @@
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<ion-select placeholder="Selecione tipo"
|
||||
[(ngModel)]="postEvent.Categories[0]"
|
||||
selectedText="{{postEvent.Categories[0]}}"
|
||||
@@ -70,11 +71,11 @@
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<ion-datetime
|
||||
placeholder="Início"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
@@ -91,11 +92,11 @@
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<ion-datetime
|
||||
placeholder="Fim"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
@@ -111,12 +112,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="container-div d-flex">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<ion-select placeholder="Selecione repetição"
|
||||
[(ngModel)]="postEvent.IsRecurring"
|
||||
selectedText="{{isRecurring}}"
|
||||
@@ -129,13 +130,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="container-div d-flex">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<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-no-height">
|
||||
<div class="list-people">
|
||||
<div (click)="openAttendees()" class="ion-input-class d-flex flex-grow-1 width-100 overflow-hidden ">
|
||||
<div class="list-people flex-grow-1">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label class="list-people-title">Ver ou editar participantes</ion-label>
|
||||
@@ -143,20 +144,20 @@
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people">
|
||||
<div class="d-flex justify-center align-center font-35">
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hidden class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div hidden class="container-div d-flex">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="list-people">
|
||||
<div class="ion-input-class d-flex flex-grow-1 width-100 overflow-hidden">
|
||||
<div class="list-people flex-grow-1">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label class="list-people-title">Com conhecimento</ion-label>
|
||||
@@ -164,19 +165,19 @@
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people">
|
||||
<div class="d-flex justify-center align-center font-35">
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="container-div d-flex">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<ion-input placeholder="Detalhes" [(ngModel)]="postEvent.Body.Text"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
@@ -209,7 +210,7 @@
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="btn-div">
|
||||
<ion-toolbar 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>
|
||||
|
||||
@@ -18,15 +18,12 @@ ion-content{
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.title-content{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #fff;
|
||||
.middle{
|
||||
padding: 0!important;
|
||||
float: left;
|
||||
width: 221px;
|
||||
margin: 2.5px 0 0 5px;
|
||||
}
|
||||
}
|
||||
@@ -42,11 +39,10 @@ ion-content{
|
||||
font-family: Roboto;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
overflow:auto;
|
||||
padding: 15px 20px 0 20px;
|
||||
|
||||
.ion-item-container{
|
||||
width: 360px;
|
||||
|
||||
margin: 15px auto;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
@@ -56,14 +52,12 @@ ion-content{
|
||||
width: 100%;
|
||||
margin: 0px auto;
|
||||
padding: 0 !important;
|
||||
overflow: auto;
|
||||
}
|
||||
.container-div{
|
||||
margin-bottom: 15px;
|
||||
overflow: auto;
|
||||
}
|
||||
.ion-item-class-2{
|
||||
width: 360px;
|
||||
|
||||
margin: 0px auto;
|
||||
}
|
||||
.ion-icon-class{
|
||||
@@ -78,7 +72,7 @@ ion-content{
|
||||
margin-left: 0;
|
||||
}
|
||||
.ion-input-class{
|
||||
width: 315px;
|
||||
|
||||
height: 45px;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
@@ -89,17 +83,15 @@ ion-content{
|
||||
.ion-input-class-no-height{
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
.list-people{
|
||||
width: 256px;
|
||||
|
||||
float: left;
|
||||
|
||||
}
|
||||
.add-people{
|
||||
width: 45px;
|
||||
float: right;
|
||||
overflow: auto;
|
||||
font-size: 25px;
|
||||
padding: 10px;
|
||||
}
|
||||
@@ -136,7 +128,6 @@ ion-content{
|
||||
}
|
||||
.container-footer{
|
||||
margin:0 auto;
|
||||
overflow: auto;
|
||||
}
|
||||
.button-cancel {
|
||||
width: 170px;
|
||||
|
||||
@@ -28,10 +28,11 @@ export class EditEventComponent implements OnInit {
|
||||
@Input() profile:string;
|
||||
@Input() selectedSegment: string;
|
||||
@Input() postEvent: any;
|
||||
@Output() clearContact = new EventEmitter<any>();
|
||||
|
||||
|
||||
@Output() cloneAllmobileComponent = new EventEmitter<any>();
|
||||
|
||||
@Output() openAttendeesComponent = new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -54,6 +55,7 @@ export class EditEventComponent implements OnInit {
|
||||
close(){
|
||||
// this.modalController.dismiss();
|
||||
this.cloneAllmobileComponent.emit();
|
||||
this.clearContact.emit();
|
||||
}
|
||||
save(){
|
||||
|
||||
@@ -68,28 +70,16 @@ export class EditEventComponent implements OnInit {
|
||||
this.isEventEdited = true;
|
||||
// this.modalController.dismiss(this.isEventEdited);
|
||||
this.cloneAllmobileComponent.emit(this.isEventEdited);
|
||||
|
||||
this.clearContact.emit();
|
||||
}
|
||||
|
||||
async openAttendees()
|
||||
{
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
componentProps: {
|
||||
eventAttendees: this.postEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.postEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
this.openAttendeesComponent.emit();
|
||||
|
||||
this.clearContact.emit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import { Event } from 'src/app/models/event.model';
|
||||
import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-event',
|
||||
templateUrl: './new-event.component.html',
|
||||
@@ -16,19 +15,22 @@ export class NewEventPage implements OnInit {
|
||||
postEvent: Event;
|
||||
eventBody: EventBody;
|
||||
segment:string = "true";
|
||||
eventAttendees: EventPerson[];
|
||||
|
||||
@Input() profile:string;
|
||||
@Input() selectedSegment: string;
|
||||
@Input() selectedDate: Date;
|
||||
@Input() eventAttendees: EventPerson[];
|
||||
|
||||
@Output() onAddEvent = new EventEmitter<any>();
|
||||
@Output() openAttendeesComponent = new EventEmitter<any>();
|
||||
@Output() clearContact = new EventEmitter<any>();
|
||||
@Output() GoBackEditOrAdd = new EventEmitter<any>();
|
||||
@Output() cloneAllmobileComponent = new EventEmitter<any>();
|
||||
|
||||
minDate: string;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
//private navParams: NavParams,
|
||||
private eventService: EventsService,
|
||||
) {
|
||||
this.postEvent = new Event();
|
||||
@@ -90,7 +92,8 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
close(){
|
||||
this.onAddEvent.emit(false);
|
||||
this.cloneAllmobileComponent.emit();
|
||||
this.clearContact.emit();
|
||||
}
|
||||
save(){
|
||||
|
||||
@@ -102,28 +105,14 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
this.onAddEvent.emit(this.postEvent);
|
||||
|
||||
this.GoBackEditOrAdd.emit();
|
||||
}
|
||||
|
||||
async openAttendees()
|
||||
async openAttendees(data: any)
|
||||
{
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
componentProps: {
|
||||
eventAttendees: this.postEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.postEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.openAttendeesComponent.emit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
@Output() viewEventDetailDismiss = new EventEmitter<any>();
|
||||
|
||||
|
||||
constructor(
|
||||
private eventsService: EventsService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { AttendeeModalPage } from './attendee-modal.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: AttendeeModalPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AttendeeModalPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AttendeeModalPageRoutingModule } from './attendee-modal-routing.module';
|
||||
|
||||
import { AttendeeModalPage } from './attendee-modal.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
AttendeeModalPageRoutingModule
|
||||
],
|
||||
declarations: [AttendeeModalPage]
|
||||
})
|
||||
export class AttendeeModalPageModule {}
|
||||
@@ -0,0 +1,39 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<ion-title>Adicionar intervenientes</ion-title>
|
||||
</ion-toolbar>
|
||||
<ion-searchbar (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>
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar 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>
|
||||
<ion-icon name="close" slot="start"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<ion-button class="btn-ok" fill="clear" color="#fff" (click)="save()">
|
||||
<ion-label>Adicionar</ion-label>
|
||||
<ion-icon name="checkmark" slot="start"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -0,0 +1,6 @@
|
||||
ion-item-group{
|
||||
margin: 15px;
|
||||
}
|
||||
ion-searchbar{
|
||||
--border-radius: 20px;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AttendeeModalPage } from './attendee-modal.page';
|
||||
|
||||
describe('AttendeeModalPage', () => {
|
||||
let component: AttendeeModalPage;
|
||||
let fixture: ComponentFixture<AttendeeModalPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AttendeeModalPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AttendeeModalPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,68 @@
|
||||
import { Component, EventEmitter, 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';
|
||||
|
||||
@Component({
|
||||
selector: 'app-attendee-modal',
|
||||
templateUrl: './attendee-modal.page.html',
|
||||
styleUrls: ['./attendee-modal.page.scss'],
|
||||
})
|
||||
export class AttendeeModalPage implements OnInit {
|
||||
|
||||
contacts: EventPerson[];
|
||||
showLoader: boolean = false;
|
||||
eventPersons: EventPerson[];
|
||||
|
||||
constructor(private modalCtrl: ModalController, private contactsService: ContactsService) { }
|
||||
|
||||
@Output() openAttendeesComponent = new EventEmitter<any>();
|
||||
|
||||
ngOnInit() {
|
||||
this.fetchContacts("");
|
||||
}
|
||||
|
||||
save(){
|
||||
|
||||
this.openAttendeesComponent.emit(this.contacts.filter(function(contact) {
|
||||
return contact.IsRequired == true;
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
close(){
|
||||
// this.modalCtrl.dismiss(null);
|
||||
this.openAttendeesComponent.emit(false);
|
||||
}
|
||||
|
||||
onChange(evt: any) {
|
||||
this.fetchContacts(evt.detail.value);
|
||||
}
|
||||
|
||||
selectContact(itm: EventPerson){
|
||||
itm.IsRequired = !itm.IsRequired;
|
||||
}
|
||||
|
||||
async fetchContacts(filter: string) {
|
||||
this.showLoader = true;
|
||||
|
||||
this.contactsService.getContacts(filter).subscribe(result =>
|
||||
{
|
||||
if (this.eventPersons != null)
|
||||
{
|
||||
this.eventPersons.forEach(attendee => {
|
||||
const index: number = result.findIndex((cont) => {
|
||||
return cont.EmailAddress == attendee.EmailAddress
|
||||
});
|
||||
|
||||
result.splice(index, 1);
|
||||
});
|
||||
}
|
||||
|
||||
this.contacts = result;
|
||||
this.showLoader = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { AttendeesPage } from './attendees.page';
|
||||
|
||||
const routes: Routes = [];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AttendeesPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AttendeesPageRoutingModule } from './attendees-routing.module';
|
||||
|
||||
import { AttendeesPage } from './attendees.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
AttendeesPageRoutingModule
|
||||
],
|
||||
declarations: [AttendeesPage]
|
||||
})
|
||||
export class AttendeesPageModule {}
|
||||
@@ -0,0 +1,57 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<ion-title>Participantes</ion-title>
|
||||
</ion-toolbar>
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment">
|
||||
<ion-segment-button value="true">
|
||||
Intervenientes
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="false">
|
||||
Com Conhecimento
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-item-group>
|
||||
<ion-button class="btn-ok-no-width" fill="clear" color="#fff" shape="round" (click)="addAttendees()" expand="block">
|
||||
<ion-label>Adicionar participantes</ion-label>
|
||||
</ion-button>
|
||||
</ion-item-group>
|
||||
<ion-item-group [ngSwitch]="segment" *ngFor="let attendee of eventAttendees">
|
||||
<ion-list *ngSwitchCase="attendee.IsRequired.toString()">
|
||||
<ion-item-sliding>
|
||||
<ion-item-options side="end">
|
||||
<ion-item-option color="danger" (click)="removeAttendee(attendee)">Apagar</ion-item-option>
|
||||
</ion-item-options>
|
||||
<ion-item lines="none">
|
||||
<ion-icon slot="start" name="person"></ion-icon>
|
||||
<ion-label>
|
||||
<h3>{{ attendee.Name }}</h3>
|
||||
<p>{{ attendee.EmailAddress }}</p>
|
||||
</ion-label>
|
||||
</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">
|
||||
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
<ion-icon name="close" slot="start"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<ion-title></ion-title>
|
||||
<ion-buttons slot="end">
|
||||
<ion-button class="btn-ok" fill="clear" color="#fff" (click)="save()">
|
||||
<ion-label>OK</ion-label>
|
||||
<ion-icon name="checkmark" slot="start"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -0,0 +1,6 @@
|
||||
ion-item-group{
|
||||
margin: 15px;
|
||||
}
|
||||
ion-item{
|
||||
border-bottom:1px solid #ccc;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AttendeesPage } from './attendees.page';
|
||||
|
||||
describe('AttendeesPage', () => {
|
||||
let component: AttendeesPage;
|
||||
let fixture: ComponentFixture<AttendeesPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AttendeesPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AttendeesPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,93 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ModalController, NavController } from '@ionic/angular';
|
||||
// import { AttendeeModalPage } from '../attendee-modal/attendee-modal.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-attendees',
|
||||
templateUrl: './attendees.page.html',
|
||||
styleUrls: ['./attendees.page.scss'],
|
||||
})
|
||||
export class AttendeesPage implements OnInit {
|
||||
|
||||
|
||||
segment:string = "true";
|
||||
shouldShowCancel:boolean = true;
|
||||
|
||||
searchCountryString = ''; // initialize your searchCountryString string empty
|
||||
|
||||
@Output() openAttendeeModal = new EventEmitter<any>();
|
||||
@Output() openAddEvent = new EventEmitter<any>();
|
||||
@Input() eventAttendees: EventPerson[];
|
||||
@Output() GoBackEditOrAdd = new EventEmitter<any>();
|
||||
|
||||
|
||||
constructor(private eventService: EventsService, private modalCtrl: ModalController,
|
||||
private navCtrl: NavController) {
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
save(){
|
||||
this.GoBackEditOrAdd.emit();
|
||||
//this.openAddEvent.emit();
|
||||
// this.modalCtrl.dismiss(this.eventAttendees);
|
||||
}
|
||||
|
||||
close(){
|
||||
this.GoBackEditOrAdd.emit();
|
||||
// this.modalCtrl.dismiss(null);
|
||||
//this.openAddEvent.emit();
|
||||
}
|
||||
|
||||
removeAttendee(attendee: EventPerson)
|
||||
{
|
||||
let index: number = this.eventAttendees.findIndex((att) => {
|
||||
return att.EmailAddress == attendee.EmailAddress
|
||||
});
|
||||
|
||||
this.eventAttendees.splice(index, 1);
|
||||
}
|
||||
|
||||
async addAttendees() {
|
||||
|
||||
console.log('Event Intervenient');
|
||||
this.openAttendeeModal.emit();
|
||||
|
||||
/* const modal = await this.modalCtrl.create({
|
||||
component: AttendeeModalPage,
|
||||
componentProps: {
|
||||
eventPersons: this.eventAttendees
|
||||
},
|
||||
cssClass: 'attendee-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
|
||||
if (newattendees != null)
|
||||
{
|
||||
newattendees.forEach(newattendee => {
|
||||
let att = {
|
||||
"EmailAddress": newattendee.EmailAddress,
|
||||
"Name": newattendee.Name,
|
||||
"IsRequired": (this.segment == "true")
|
||||
};
|
||||
if (this.eventAttendees == null)
|
||||
{
|
||||
this.eventAttendees = new Array();
|
||||
}
|
||||
this.eventAttendees.push(att);
|
||||
});
|
||||
}
|
||||
}); */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user