Improve agenda add-event-component by saving data on leave

This commit is contained in:
Peter Maquiran
2021-03-31 14:42:00 +01:00
parent dec8338009
commit a266908b55
6 changed files with 156 additions and 74 deletions
+1 -3
View File
@@ -15,7 +15,7 @@
<div>
<!-- Calendar is here -->
<div [ngSwitch]="segment">
<div class="calendar-container" *ngSwitchCase="'Combinada'" [style.height]="calendarHeight">
<div class="calendar-container" *ngSwitchCase="'Combinado'" [style.height]="calendarHeight">
<ion-row class="ion-justify-content-between calendar-tool-tip">
<ion-row class="ion-align-items-center">
@@ -386,10 +386,8 @@
(AproveEventEditEvent)="AproveEventEditEvent($event)"
[eventAttendees]="contacts"
>
</app-approve-event>
<app-attendee-modal
class="d-flex flex-column height-100"
*ngIf="mobileComponent.showAttendees"
+42 -12
View File
@@ -96,7 +96,8 @@ export class AgendaPage implements OnInit {
@ViewChild(CalendarComponent) myCal: CalendarComponent;
segment:string;
segment: "Combinado" | "Pessoal" | "Oficial";
timelineSedment : "Combinado" | "Pessoal" | "Oficial";
profile:'mdgpr' | 'pr';
@@ -160,12 +161,10 @@ export class AgendaPage implements OnInit {
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == "/home/agenda") {
if (this.segment == null)
{
this.segment = "Combinada";
if (this.segment == null){
this.segment = "Combinado";
}
else
{
else{
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
}
}
@@ -506,7 +505,7 @@ export class AgendaPage implements OnInit {
this.showTimeline = false;
switch (this.segment) {
case "Combinada":
case "Combinado":
//Inicializa o array eventSource
this.eventSource=[];
@@ -531,8 +530,11 @@ export class AgendaPage implements OnInit {
profile: 'md'
});
});
this.events = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md');
const list = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md');
this.events = list;
this.TimelineMD = list;
this.myCal.update();
this.myCal.loadEvents();
@@ -569,8 +571,13 @@ export class AgendaPage implements OnInit {
});
this.events = this.timelineFilter(this.timelineFilterState, this.eventsList, 'pr');
const list = this.timelineFilter(this.timelineFilterState, this.eventsList, 'pr');
this.events = list;
this.TimelinePR = list;
this.myCal.update();
this.myCal.loadEvents();
this.showLoader = false;
@@ -602,9 +609,20 @@ export class AgendaPage implements OnInit {
profile: 'md'
});
});
const list = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md');
this.events = list;
this.TimelineMD = list;
this.myCal.update();
this.myCal.loadEvents();
this.showLoader = false;
this.showTimeline = true;
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
});
}
@@ -644,12 +662,23 @@ export class AgendaPage implements OnInit {
endTime: new Date(element.EndDate),
allDay: false,
event: element,
profile: 'md'
profile: 'pr'
});
});
const list = this.timelineFilter(this.timelineFilterState, this.eventsList, 'pr');
this.events = list;
this.TimelinePR = list;
this.myCal.update();
this.myCal.loadEvents();
this.showLoader = false;
this.showTimeline = true;
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
});
}else{
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
@@ -770,6 +799,7 @@ export class AgendaPage implements OnInit {
showAlert(){
this.alertController.presentAlert("Funcionalidade em desenvolvimento.");
}
changeProfile(){
if(this.profile == "mdgpr"){
@@ -171,8 +171,10 @@
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-input-class">
<ion-input placeholder="Detalhes" [(ngModel)]="postEvent.Body.Text"></ion-input>
<div class="ion-input-class-no-height flex-grow-1">
<ion-textarea [(ngModel)]="postEvent.Body.Text" placeholder="Detalhes" ></ion-textarea>
</div>
</div>
</div>