Lai,Risheng
2023-11-02 30c02e0c981b16be0918483543f4b812956c45d4
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
import { DialogSOP } from '../../libappsop/dialogsop';
import { DurationSelectorSOP } from '../../libappsop/durationselectorsop';
import { EditFieldSOP } from '../../libappsop/editfieldsop';
 
export interface DialogShiftPatternFields {
  Name?: string;
  MinimumDuration?: string;
}
 
export class DialogShiftPattern extends DialogSOP<DialogShiftPatternFields> {
  public static readonly title = 'Shift pattern';
  public efName = new EditFieldSOP('EditFieldName');
  public dsMinimumDuration = new DurationSelectorSOP('MinimumDurationSelector', { Days: 0, Hours: 0, Minutes: 0 });
 
  public constructor() {
    super('DialogCreateEditShiftPattern');
 
    // Set UI element mapping to pair the UI name to the UI element for use in DialogSOP to find the UI object to set value or verify value
    // This prevents each new Dialog to duplicate code just to set/verify UI element value
    this._uiMap.set('Name', this.efName);
    this._uiMap.set('MinimumDuration', this.dsMinimumDuration);
  }
}
 
/**
 * Tooltips
 */
export const btnOkTooltip = {
  missingName: (): string => 'Shift pattern [Missing name]: Shift pattern must have a name of at most 500 characters.',
  uniqueName: (name: string): string => `Shift pattern [${name}]: Shift pattern must be unique by name.`,
};