mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Add new component in agenda
This commit is contained in:
@@ -336,6 +336,8 @@
|
||||
[selectedDate]="eventSelectedDate"
|
||||
(onAddEvent)="openAddEventDismiss($event)"
|
||||
(openAttendeesComponent)="openAttendeesComponent($event)"
|
||||
[eventAttendees]="contacts"
|
||||
(clearContact)="clearContact()"
|
||||
|
||||
></app-new-event>
|
||||
<!-- Edit -->
|
||||
@@ -343,7 +345,7 @@
|
||||
[profile]="profile"
|
||||
[selectedSegment]="segment"
|
||||
[postEvent]="postEvent"
|
||||
(cloneAllmobileComponent)="cloneAllmobileComponent($event)"
|
||||
(cloneAllmobileComponent)="cloneAllmobileComponent()"
|
||||
></app-edit-event>
|
||||
|
||||
<!-- View -->
|
||||
@@ -365,7 +367,7 @@
|
||||
<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)"
|
||||
>
|
||||
|
||||
@@ -375,6 +377,8 @@
|
||||
class="d-flex flex-column height-100"
|
||||
*ngIf="mobileComponent.showAttendees"
|
||||
(openAttendeeModal)="openAttendeeModal()"
|
||||
[eventAttendees]="contacts"
|
||||
(openAddEvent)="openAddEvent($event)"
|
||||
>
|
||||
</app-attendees>
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -382,7 +386,11 @@ 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`){
|
||||
@@ -900,13 +908,26 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
// open component
|
||||
async openAttendeesComponent(data){
|
||||
console.log('open attendees component');
|
||||
|
||||
|
||||
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 openAttendeeModal(){
|
||||
this.cloneAllmobileComponent();
|
||||
this.mobileComponent.showAttendeeModal = true;
|
||||
|
||||
@@ -70,11 +70,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"
|
||||
@@ -111,7 +111,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="container-div d-flex">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
|
||||
@@ -129,7 +129,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="container-div d-flex">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
@@ -150,7 +150,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hidden class="container-div">
|
||||
<div hidden class="container-div d-flex">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
@@ -171,12 +171,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="container-div d-flex">
|
||||
<div class="ion-item-class-2">
|
||||
<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 +209,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">
|
||||
<ion-buttons slot="start">
|
||||
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
|
||||
@@ -46,7 +46,7 @@ ion-content{
|
||||
padding: 15px 20px 0 20px;
|
||||
|
||||
.ion-item-container{
|
||||
width: 360px;
|
||||
|
||||
margin: 15px auto;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
@@ -63,7 +63,7 @@ ion-content{
|
||||
overflow: auto;
|
||||
}
|
||||
.ion-item-class-2{
|
||||
width: 360px;
|
||||
|
||||
margin: 0px auto;
|
||||
}
|
||||
.ion-icon-class{
|
||||
@@ -78,7 +78,7 @@ ion-content{
|
||||
margin-left: 0;
|
||||
}
|
||||
.ion-input-class{
|
||||
width: 315px;
|
||||
|
||||
height: 45px;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
@@ -92,7 +92,7 @@ ion-content{
|
||||
overflow: auto;
|
||||
}
|
||||
.list-people{
|
||||
width: 256px;
|
||||
|
||||
float: left;
|
||||
|
||||
}
|
||||
|
||||
@@ -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,14 +15,15 @@ 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>();
|
||||
|
||||
minDate: string;
|
||||
|
||||
@@ -91,6 +91,7 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
close(){
|
||||
this.onAddEvent.emit(false);
|
||||
this.clearContact.emit();
|
||||
}
|
||||
save(){
|
||||
|
||||
@@ -102,6 +103,8 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
this.onAddEvent.emit(this.postEvent);
|
||||
|
||||
this.clearContact.emit();
|
||||
}
|
||||
|
||||
async openAttendees(data: any)
|
||||
|
||||
@@ -2,7 +2,6 @@ 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';
|
||||
import { ThrowStmt, removeSummaryDuplicates } from '@angular/compiler';
|
||||
|
||||
@Component({
|
||||
selector: 'app-attendee-modal',
|
||||
@@ -19,22 +18,21 @@ export class AttendeeModalPage implements OnInit {
|
||||
|
||||
@Output() openAttendeesComponent = new EventEmitter<any>();
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.fetchContacts("");
|
||||
}
|
||||
|
||||
save(){
|
||||
this.modalCtrl.dismiss(
|
||||
this.contacts.filter(function(contact) {
|
||||
|
||||
this.openAttendeesComponent.emit(this.contacts.filter(function(contact) {
|
||||
return contact.IsRequired == true;
|
||||
})
|
||||
);
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
close(){
|
||||
// this.modalCtrl.dismiss(null);
|
||||
this.openAttendeesComponent.emit();
|
||||
this.openAttendeesComponent.emit(false);
|
||||
}
|
||||
|
||||
onChange(evt: any) {
|
||||
@@ -67,4 +65,4 @@ export class AttendeeModalPage implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
||||
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';
|
||||
@@ -11,13 +11,15 @@ import { ModalController, NavController } from '@ionic/angular';
|
||||
})
|
||||
export class AttendeesPage implements OnInit {
|
||||
|
||||
eventAttendees: EventPerson[];
|
||||
|
||||
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[];
|
||||
|
||||
|
||||
constructor(private eventService: EventsService, private modalCtrl: ModalController,
|
||||
@@ -29,11 +31,13 @@ export class AttendeesPage implements OnInit {
|
||||
}
|
||||
|
||||
save(){
|
||||
this.openAddEvent.emit();
|
||||
// this.modalCtrl.dismiss(this.eventAttendees);
|
||||
}
|
||||
|
||||
close(){
|
||||
// this.modalCtrl.dismiss(null);
|
||||
this.openAddEvent.emit();
|
||||
}
|
||||
|
||||
removeAttendee(attendee: EventPerson)
|
||||
|
||||
Reference in New Issue
Block a user