limj
2023-10-24 93652435728de839582440eefd5122c281181d35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
 * @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 };