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.`,
|
};
|