| /** | 
|  * @file          Common Calendar Event List Panel | 
|  * @author        Wong Jia Hui (jiahui.wong@3ds.com) | 
|  */ | 
| import { ListSOP } from '../../../libappsop/listsop'; | 
| import { PanelSOP } from '../../../libappsop/panelsop'; | 
| import { DialogCalendarEvent } from '../../dialogs/calendarevent/dialog.calendarevent'; | 
| import { DialogDummy } from '../../dialogs/dialog.dummy'; | 
| import { FormCommonCalendar } from './form.commoncalendar'; | 
|   | 
| export class PanelCommonEventsList extends PanelSOP { | 
|   public static readonly title = 'Common Calendar Events (List)'; | 
|   public listCommonEvent = new ListCommonEvent(); | 
|   public listCommonEventOccurrence = new ListCommonEventOccurrence(); | 
|   | 
|   public constructor() { | 
|     super(`${FormCommonCalendar.componentName}.pnlCommonCalendar.tabEventsAndOccurrences`); | 
|   } | 
|   | 
|   /** | 
|    * @override Additionally wait for lists to be present (Events and Occurrences) | 
|    */ | 
|   public async clickTab(): Promise<void> { | 
|     await super.clickTab(); | 
|     await this.listCommonEvent.waitUntilPresent(); | 
|     await this.listCommonEventOccurrence.waitUntilPresent(); | 
|   } | 
| } | 
|   | 
| export class ListCommonEvent extends ListSOP<DialogCalendarEvent, ListCommonEventColumn> { | 
|   public static readonly title = 'Events'; | 
|   | 
|   public constructor() { | 
|     super(`${FormCommonCalendar.componentName}.pnlCommonCalendar.tabEventsAndOccurrences.lstParticipations`, new DialogCalendarEvent()); | 
|   } | 
| } | 
|   | 
| export class ListCommonEventOccurrence extends ListSOP<DialogDummy, ListCommonEventOccurrenceColumn> { | 
|   public static readonly title = 'Occurrence'; | 
|   | 
|   public constructor() { | 
|     super(`${FormCommonCalendar.componentName}.pnlCommonCalendar.tabEventsAndOccurrences.pnlEventsAndOccurrences.pnlOccurrences.lstOccurrences`, new DialogDummy()); | 
|   } | 
| } | 
|   | 
| export interface ListCommonEventColumn { | 
|   Category?: string; // Event category name (level 1 row) | 
|   Name?: string; // Event name (level 2 row) | 
|   NrOfOccurrences?: string; // Level 2 row | 
| } | 
|   | 
| export interface ListCommonEventOccurrenceColumn { | 
|   Start?: string; | 
|   End?: string; | 
| } | 
|   | 
| const listCommonEventContextMenuItem = { | 
|   CreateEvent: { ContextMenu: 'cmEventParticipationsWithoutSubscription', Name: 'mnuCreateEventWS', Label: 'Create event' }, | 
|   EditEvent: { ContextMenu: 'cmEventParticipationsWithoutSubscription', Name: 'mnuEditEventWS', Label: 'Edit event' }, | 
|   DeleteEvent: { ContextMenu: 'cmEventParticipationsWithoutSubscription', Name: 'mnuDeleteEventWS', Label: 'Delete event' }, | 
| }; | 
|   | 
| export { listCommonEventContextMenuItem as ListCommonEventContextMenuItem }; |