mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Merge branch 'feature/calendar' into developer
This commit is contained in:
+29
-32
@@ -1,33 +1,30 @@
|
||||
<ion-tabs class="tab">
|
||||
<ion-tab-bar class="bottoms" slot="bottom">
|
||||
<ion-tab-button tab="events">
|
||||
<!-- <ion-icon name="home"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
|
||||
<ion-badge color="danger">{{totalEvent}}</ion-badge>
|
||||
<ion-label>Iníci1o</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
|
||||
<ion-tabs class="tab" >
|
||||
<ion-tab-bar class="bottoms" slot="bottom">
|
||||
<ion-tab-button tab="events">
|
||||
<!-- <ion-icon name="home"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
|
||||
<ion-badge color="danger">{{totalEvent}}</ion-badge>
|
||||
<ion-label>Iníci1o</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
<ion-tab-button tab="agenda">
|
||||
<!-- <ion-icon name="calendar"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-calendar.svg"></ion-icon>
|
||||
<ion-label>Agenda</ion-label>
|
||||
</ion-tab-button>
|
||||
<ion-tab-button tab="gabinete-digital">
|
||||
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
|
||||
<ion-badge color="danger">{{totalExpediente}}</ion-badge>
|
||||
<ion-label>Gabinete</ion-label>
|
||||
</ion-tab-button>
|
||||
<ion-tab-button tab="publications">
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
|
||||
<ion-label>Acções</ion-label>
|
||||
</ion-tab-button>
|
||||
<ion-tab-button tab="chat">
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
|
||||
<ion-label>Chat</ion-label>
|
||||
</ion-tab-button>
|
||||
</ion-tab-bar>
|
||||
|
||||
</ion-tabs>
|
||||
<ion-tab-button tab="agenda">
|
||||
<!-- <ion-icon name="calendar"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-calendar.svg"></ion-icon>
|
||||
<ion-label>Agenda</ion-label>
|
||||
</ion-tab-button>
|
||||
<ion-tab-button tab="gabinete-digital">
|
||||
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
|
||||
<ion-badge color="danger">{{totalExpediente}}</ion-badge>
|
||||
<ion-label>Gabinete</ion-label>
|
||||
</ion-tab-button>
|
||||
<ion-tab-button tab="publications">
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
|
||||
<ion-label>Ações</ion-label>
|
||||
</ion-tab-button>
|
||||
<ion-tab-button tab="chat">
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
|
||||
<ion-label>Chat</ion-label>
|
||||
</ion-tab-button>
|
||||
</ion-tab-bar>
|
||||
</ion-tabs>
|
||||
|
||||
@@ -18,6 +18,8 @@ import { EditEventComponent } from 'src/app/shared/agenda/edit-event/edit-event.
|
||||
import { ViewEventPage } from 'src/app/shared/agenda/view-event/view-event.page';
|
||||
import { EventListComponent } from "src/app/shared/agenda/event-list/event-list.component";
|
||||
import { ApproveEventComponent } from "src/app/shared/agenda/approve-event/approve-event.component";
|
||||
import { AttendeesPage } from 'src/app/shared/event/attendees/attendees.page';
|
||||
import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page';
|
||||
|
||||
|
||||
registerLocaleData(localeDe);
|
||||
@@ -45,7 +47,9 @@ import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
|
||||
EditEventComponent,
|
||||
ViewEventPage,
|
||||
EventListComponent,
|
||||
ApproveEventComponent
|
||||
ApproveEventComponent,
|
||||
AttendeesPage,
|
||||
AttendeeModalPage
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
providers: [
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<ion-icon *ngIf="profile == 'mdgpr' " (click)="changeProfile()" class="right-icons d-md-none" src="assets/images/icons-profile-calendar-md.svg"></ion-icon>
|
||||
<ion-icon *ngIf="profile == 'pr' " (click)="changeProfile()" class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg"></ion-icon>
|
||||
<ion-icon (click)="viewEventsToApprove()" class="right-icons" src="assets/images/icons-received-event.svg"></ion-icon>
|
||||
<ion-icon (click)="openAddEvent()" class="right-icons" src="assets/images/icons-add-new-event.svg" ></ion-icon>
|
||||
<ion-icon (click)="clearContact();openAddEvent()" class="right-icons" src="assets/images/icons-add-new-event.svg" ></ion-icon>
|
||||
</ion-row>
|
||||
</ion-row>
|
||||
|
||||
@@ -283,29 +283,27 @@
|
||||
*ngSwitchCase="'day'"
|
||||
[viewDate]="viewDate"
|
||||
[events]="events"
|
||||
(eventClicked)="eventClicked($event)"
|
||||
(eventClicked)="clearContact();eventClicked($event)"
|
||||
>
|
||||
</mwl-calendar-day-view>
|
||||
</div>
|
||||
|
||||
<div [ngSwitch]="view" class="fs-timeline flex-grow-1 d-none d-md-block"
|
||||
*ngIf="showTimelineMD">
|
||||
<div [ngSwitch]="view" class="fs-timeline flex-grow-1 d-none d-md-block" *ngIf="showTimelineMD">
|
||||
<mwl-calendar-day-view
|
||||
*ngSwitchCase="'day'"
|
||||
[viewDate]="viewDate"
|
||||
[events]="TimelineMD"
|
||||
(eventClicked)="eventClicked($event)"
|
||||
(eventClicked)="clearContact();eventClicked($event)"
|
||||
>
|
||||
</mwl-calendar-day-view>
|
||||
</div>
|
||||
|
||||
<div [ngSwitch]="view" class="sd-timeline flex-grow-1 d-none d-md-block timeline-md"
|
||||
*ngIf="showTimelinePR">
|
||||
<div [ngSwitch]="view" class="sd-timeline flex-grow-1 d-none d-md-block timeline-md" *ngIf="showTimelinePR">
|
||||
<mwl-calendar-day-view
|
||||
*ngSwitchCase="'day'"
|
||||
[viewDate]="viewDate"
|
||||
[events]="TimelinePR"
|
||||
(eventClicked)="eventClicked($event)"
|
||||
(eventClicked)="clearContact();eventClicked($event)"
|
||||
>
|
||||
</mwl-calendar-day-view>
|
||||
</div>
|
||||
@@ -321,12 +319,14 @@
|
||||
<div *ngIf="(
|
||||
mobileComponent.showAddNewEvent == false &&
|
||||
mobileComponent.showEditEvent == false &&
|
||||
mobileComponent.showEventDitails == false &&
|
||||
mobileComponent.showEventDetails == false &&
|
||||
mobileComponent.showEventList == false &&
|
||||
mobileComponent.showEventToApprove == false
|
||||
mobileComponent.showEventToApprove == false &&
|
||||
mobileComponent.showAttendees == false &&
|
||||
mobileComponent.showAttendeeModal == false
|
||||
)
|
||||
"
|
||||
class="text-black nothing-to-show">
|
||||
class="text-black nothing-to-show">
|
||||
Nenhum evento selecionado
|
||||
</div>
|
||||
|
||||
@@ -336,6 +336,11 @@
|
||||
[selectedSegment]=segment
|
||||
[selectedDate]="eventSelectedDate"
|
||||
(onAddEvent)="openAddEventDismiss($event)"
|
||||
(openAttendeesComponent)="openAttendeesComponent($event)"
|
||||
(cloneAllmobileComponent)="cloneAllmobileComponent()"
|
||||
[eventAttendees]="contacts"
|
||||
(clearContact)="clearContact()"
|
||||
(setContact)="setContact()"
|
||||
|
||||
></app-new-event>
|
||||
<!-- Edit -->
|
||||
@@ -343,15 +348,18 @@
|
||||
[profile]="profile"
|
||||
[selectedSegment]="segment"
|
||||
[postEvent]="postEvent"
|
||||
(cloneAllmobileComponent)="cloneAllmobileComponent($event)"
|
||||
|
||||
(cloneAllmobileComponent)="cloneAllmobileComponent()"
|
||||
(clearContact)="clearContact()"
|
||||
(openAttendeesComponent)="openAttendeesComponent($event)"
|
||||
(setContact)="setContact()"
|
||||
></app-edit-event>
|
||||
|
||||
<!-- View -->
|
||||
<app-view-event *ngIf="mobileComponent.showEventDitails"
|
||||
<app-view-event *ngIf="mobileComponent.showEventDetails"
|
||||
[profile]="profile"
|
||||
[eventId]="selectedEventId"
|
||||
(viewEventDetailDismiss)="viewEventDetailDismiss($event)"
|
||||
[eventAttendees]="contacts"
|
||||
></app-view-event>
|
||||
|
||||
|
||||
@@ -366,13 +374,30 @@
|
||||
<app-approve-event class="d-flex flex-column" *ngIf="mobileComponent.showEventToApprove" [class.transparent]="mobileComponent.transparentEventToApprove"
|
||||
[serialNumber] = "eventToaprove.serialNumber"
|
||||
(cloneAllmobileComponent)="viewEventDetailDismiss($event)"
|
||||
(closeEventToApprove)="closeEventToApprove($event)"
|
||||
(closeEventToApprove)="closeEventToApprove()"
|
||||
(AproveEventEditEvent)="AproveEventEditEvent($event)"
|
||||
[eventAttendees]="contacts"
|
||||
>
|
||||
|
||||
</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"
|
||||
(openAttendeesComponent)="openAttendeesComponent($event)"
|
||||
>
|
||||
</app-attendee-modal>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import { Router, NavigationEnd } from '@angular/router';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { momentG } from 'src/plugin/momentG';
|
||||
import { DomSanitizer } from "@angular/platform-browser";
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
|
||||
|
||||
// showTimeline
|
||||
import { setHours, setMinutes } from 'date-fns';
|
||||
@@ -48,6 +50,8 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
timelineDate: string;
|
||||
|
||||
contacts: EventPerson[]
|
||||
|
||||
setView(view: CalendarView) {
|
||||
this.view = view;
|
||||
}
|
||||
@@ -99,6 +103,9 @@ export class AgendaPage implements OnInit {
|
||||
eventsListPessoal: Event[];
|
||||
eventsListOficial: Event[];
|
||||
|
||||
// this will make toggle add event and.
|
||||
showEventEditOrOpen: "edit" | "add" | "" = ""
|
||||
|
||||
prEventList: Event[];
|
||||
mdEventList: Event[];
|
||||
|
||||
@@ -107,14 +114,16 @@ export class AgendaPage implements OnInit {
|
||||
startTime: Date;
|
||||
endTime: Date;
|
||||
|
||||
mobileComponent: any = {
|
||||
mobileComponent = {
|
||||
showAddNewEvent: false,
|
||||
showEditEvent: false,
|
||||
showEventDitails: false,
|
||||
showEventDetails: false,
|
||||
showEventList: false,
|
||||
transparentEventList: false,
|
||||
transparentEventToApprove: false,
|
||||
showEventToApprove: false
|
||||
showEventToApprove: false,
|
||||
showAttendees: false,
|
||||
showAttendeeModal: false
|
||||
}
|
||||
|
||||
eventToaprove: any = {
|
||||
@@ -129,7 +138,7 @@ export class AgendaPage implements OnInit {
|
||||
private modalCtrl: ModalController,
|
||||
private eventService: EventsService,
|
||||
private router: Router,
|
||||
private alertCrontroller: AlertService,
|
||||
private alertController: AlertService,
|
||||
private sanitizer: DomSanitizer
|
||||
) {
|
||||
|
||||
@@ -198,17 +207,24 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
// this.viewEventDetail(event.id);
|
||||
|
||||
this.cloneAllmobileComponent()
|
||||
this.cloneAllmobileComponent();
|
||||
|
||||
|
||||
this.showEventEditOrOpen = 'edit';
|
||||
|
||||
if( window.innerWidth <= 1024){
|
||||
this.router.navigate(["/home/agenda", event.id, 'agenda']);
|
||||
this.viewEventDetail(event.id)
|
||||
//this.router.navigate(["/home/agenda", event.id, 'agenda']);
|
||||
} else {
|
||||
this.cloneAllmobileComponent();
|
||||
this.mobileComponent.showEventDitails = true;
|
||||
|
||||
this.mobileComponent.showEventDetails = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Show information of the event
|
||||
async onEventSelected(ev: { event: Event}){
|
||||
this.viewEventDetail(ev.event.EventId);
|
||||
@@ -369,7 +385,7 @@ export class AgendaPage implements OnInit {
|
||||
timelineBoxCorrectHeight(timeout){
|
||||
|
||||
setTimeout(()=>{
|
||||
this.eventSource.forEach((el, eventIndex)=>{
|
||||
this.eventSource.forEach((el:any, eventIndex)=>{
|
||||
|
||||
const startEvent = new Date(el.startTime);
|
||||
const endEvent = new Date(el.endTime);
|
||||
@@ -380,15 +396,23 @@ export class AgendaPage implements OnInit {
|
||||
document.querySelectorAll('.fs-timeline .timeline-box').forEach(ele => {
|
||||
|
||||
if(ele.className.indexOf(`timeline-box-event-${eventIndex}`)>=0){
|
||||
ele.setAttribute('style',`height:${minutes}px`);
|
||||
|
||||
if(ele['offsetHeight'] <= minutes){
|
||||
ele.setAttribute('style',`height:${minutes}px`);
|
||||
}
|
||||
|
||||
}
|
||||
// this event has an contraction time
|
||||
// if(`timeline-box-event-${eventIndex}` == `timeline-box-event-3`){
|
||||
// alert(startEvent.toString()+' '+ endEvent.toString());
|
||||
// }
|
||||
});
|
||||
|
||||
});
|
||||
},timeout)
|
||||
|
||||
setTimeout(()=>{
|
||||
this.TimelinePR.forEach((el, eventIndex)=>{
|
||||
this.eventSource.forEach((el, eventIndex)=>{
|
||||
|
||||
const startEvent = new Date(el['startTime']);
|
||||
const endEvent = new Date(el['endTime']);
|
||||
@@ -629,11 +653,14 @@ export class AgendaPage implements OnInit {
|
||||
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
|
||||
response => {
|
||||
|
||||
this.TimelineMD = [];
|
||||
|
||||
this.eventsList = response;
|
||||
// loop
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
|
||||
this.eventSource.push({
|
||||
index: eventIndex,
|
||||
title: element.Subject,
|
||||
startTime: new Date(element.StartDate),
|
||||
endTime: new Date(element.EndDate),
|
||||
@@ -643,10 +670,11 @@ export class AgendaPage implements OnInit {
|
||||
profile: 'md'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
this.events = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md');
|
||||
|
||||
this.TimelineMD = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md');
|
||||
this.events = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md');
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
@@ -660,10 +688,14 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(
|
||||
response => {
|
||||
|
||||
|
||||
this.TimelinePR = [];
|
||||
|
||||
this.eventsList = response;
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
|
||||
this.eventSource.push({
|
||||
index: eventIndex,
|
||||
title: element.Subject,
|
||||
startTime: new Date(element.StartDate),
|
||||
endTime: new Date(element.EndDate),
|
||||
@@ -705,7 +737,7 @@ export class AgendaPage implements OnInit {
|
||||
}, 250)
|
||||
}
|
||||
showAlert(){
|
||||
this.alertCrontroller.presentAlert("Funcionalidade em desenvolvimento.");
|
||||
this.alertController.presentAlert("Funcionalidade em desenvolvimento.");
|
||||
}
|
||||
changeProfile(){
|
||||
|
||||
@@ -727,7 +759,9 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
async openAddEvent() {
|
||||
|
||||
await this.cloneAllmobileComponent()
|
||||
await this.cloneAllmobileComponent();
|
||||
|
||||
this.showEventEditOrOpen = 'add';
|
||||
|
||||
if( window.innerWidth <= 1024){
|
||||
const modal = await this.modalCtrl.create({
|
||||
@@ -752,6 +786,12 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
openEditEvent(){
|
||||
this.showEventEditOrOpen = 'edit';
|
||||
|
||||
}
|
||||
|
||||
openAddEventDismiss(data){
|
||||
|
||||
let postEvent: Event = data;
|
||||
@@ -772,6 +812,7 @@ export class AgendaPage implements OnInit {
|
||||
this.cloneAllmobileComponent();
|
||||
}
|
||||
|
||||
// open component
|
||||
async viewEventDetail(eventId:any) {
|
||||
console.log(this.profile);
|
||||
|
||||
@@ -791,6 +832,7 @@ export class AgendaPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
// open component
|
||||
async viewEventDetailDismiss(data){
|
||||
|
||||
await this.cloneAllmobileComponent()
|
||||
@@ -830,7 +872,7 @@ export class AgendaPage implements OnInit {
|
||||
this.mobileComponent.showEventList = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
approveEventDismiss({saveData, serialNumber, action}){
|
||||
|
||||
@@ -862,17 +904,16 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
async cloneAllmobileComponent(){
|
||||
|
||||
this.mobileComponent = {
|
||||
showAddNewEvent: false,
|
||||
showEditEvent: false,
|
||||
showEventDitails: false,
|
||||
showEventList: false,
|
||||
showEventToApprove: false
|
||||
}
|
||||
|
||||
this.mobileComponent.showAddNewEvent = false;
|
||||
this.mobileComponent.showEditEvent = false;
|
||||
this.mobileComponent.showEventDetails = false;
|
||||
this.mobileComponent.showEventList = false;
|
||||
this.mobileComponent.showEventToApprove = false;
|
||||
this.mobileComponent.showAttendees = false;
|
||||
this.mobileComponent.showAttendeeModal = false;
|
||||
|
||||
this.closeEventToApprove();
|
||||
|
||||
}
|
||||
|
||||
async AproveEventEditEvent(data){
|
||||
@@ -882,4 +923,53 @@ export class AgendaPage implements OnInit {
|
||||
this.mobileComponent.showAddNewEvent = true;
|
||||
}
|
||||
|
||||
// open component
|
||||
async openAttendeesComponent(data){
|
||||
|
||||
|
||||
if(Array.isArray(data)){
|
||||
if(data.length != 0){
|
||||
|
||||
console.log('save!!!',data.length);
|
||||
console.log(data);
|
||||
this.contacts = data ;
|
||||
}
|
||||
}
|
||||
|
||||
this.cloneAllmobileComponent();
|
||||
this.mobileComponent.showAttendees = true;
|
||||
|
||||
}
|
||||
|
||||
async clearContact(){
|
||||
this.contacts = [];
|
||||
}
|
||||
|
||||
async setContact(data:EventPerson[]){
|
||||
this.contacts = data;
|
||||
}
|
||||
|
||||
async openAttendeeModal(){
|
||||
this.cloneAllmobileComponent();
|
||||
this.mobileComponent.showAttendeeModal = true;
|
||||
}
|
||||
|
||||
|
||||
async GoBackEditOrAdd(){
|
||||
|
||||
|
||||
if(this.showEventEditOrOpen == "edit"){
|
||||
this.cloneAllmobileComponent();
|
||||
|
||||
this.mobileComponent.showEditEvent = true;
|
||||
} else if(this.showEventEditOrOpen == "add") {
|
||||
this.cloneAllmobileComponent();
|
||||
|
||||
this.mobileComponent.showAddNewEvent = true;
|
||||
} else {
|
||||
// do Nothings
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,10 +18,9 @@ ion-content{
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.title-content{
|
||||
width: 360px;
|
||||
padding: 0px 20px;
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #fff;
|
||||
.middle{
|
||||
padding: 0!important;
|
||||
|
||||
@@ -25,10 +25,9 @@ ion-menu{
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.title-content{
|
||||
width: 360px;
|
||||
padding: 0px 20px;
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #fff;
|
||||
|
||||
.left{
|
||||
|
||||
@@ -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