Improve agenda can go back from editing event to view event etc.

This commit is contained in:
Peter Maquiran
2021-04-01 11:28:39 +01:00
parent d892d84c4e
commit 3aca9f9cb9
4 changed files with 42 additions and 27 deletions
+2 -10
View File
@@ -348,10 +348,10 @@
[profile]="profile"
[selectedSegment]="segment"
[postEvent]="postEvent"
(cloneAllmobileComponent)="cloneAllmobileComponent()"
(clearContact)="clearContact()"
(openAttendeesComponent)="openAttendeesComponent($event)"
(setContact)="setContact($event)"
(closeComponent)="closeComponentEditEventOrAdd()"
></app-edit-event>
<!-- View -->
@@ -369,15 +369,7 @@
(cloneAllmobileComponent)="viewEventDetailDismiss($event)"
>
</app-event-list>
<!-- <app-events-to-approve
[profile]="profile"
*ngIf="mobileComponent.showEventList"
class="d-flex height-100 flex-column"
(approveEventDismiss) = "approveEventDismiss($event)"
(cloneAllmobileComponent)="viewEventDetailDismiss($event)"
>
</app-events-to-approve> -->
>
<app-approve-event class="d-flex flex-column" *ngIf="mobileComponent.showEventToApprove" [class.transparent]="mobileComponent.transparentEventToApprove"
[serialNumber] = "eventToaprove.serialNumber"
+26 -6
View File
@@ -109,7 +109,7 @@ export class AgendaPage implements OnInit {
showEventEditOrOpen: "edit" | "add" | "" = ""
prEventList: Event[];
mdEventList: Event[];
mdEventList: Event[]
showLoader: boolean;
@@ -134,6 +134,12 @@ export class AgendaPage implements OnInit {
saveData: {}
}
/**
* @description determinant if edit or add event component is open
*/
IsEvent: "edit" | "add" | "view";
viewingEventObject: { event: CalendarEvent };
constructor(
private alertCtrl: AlertController,
@Inject(LOCALE_ID) private locale: string,
@@ -196,11 +202,14 @@ export class AgendaPage implements OnInit {
this.viewTitle = title;
}
// Show information of the event for timeline
// show information about the clicked event in timeline
eventClicked({ event }: { event: CalendarEvent }): void {
console.log('Event clicked', event);
/* console.log('Event clicked', event); */
this.IsEvent= "view";
this.viewingEventObject = {event};
// this.selectedEvent = event;
this.eventSelectedDate = event.start;
this.selectedEventId = event.id;
@@ -223,7 +232,6 @@ export class AgendaPage implements OnInit {
}
//Show information of the event
async onEventSelected(ev: { event: Event}){
this.viewEventDetail(ev.event.EventId);
@@ -370,7 +378,7 @@ export class AgendaPage implements OnInit {
return `
<div class=" overflow-hidden timeline-box timeline-box-event-${eventIndex} timeline-${profile_}-box-${calendarName} calendar-top${top}">
<div>
<span class="timeline-start-time">${startTimeWisthS}</span><span class="timeline-location">${eventlocation}</span>
<span class="timeline-start-time">${startHours.toString().padStart(2, '0')}:${startMinutos.toString().padStart(2, '0')}</span><span class="timeline-location">${eventlocation}</span>
</div>
<div class="timeline-event-discription">
${subject}
@@ -823,6 +831,7 @@ export class AgendaPage implements OnInit {
await this.cloneAllmobileComponent();
this.showEventEditOrOpen = 'add';
this.IsEvent = 'add';
if( window.innerWidth <= 1024){
const modal = await this.modalCtrl.create({
@@ -1033,4 +1042,15 @@ export class AgendaPage implements OnInit {
}
//
async closeComponentEditEventOrAdd(){
if(this.IsEvent ='edit') {
this.eventClicked(this.viewingEventObject);
} else if (this.IsEvent = 'add') {
this.cloneAllmobileComponent();
}
}
}