/**
|
* @file Campaign Dialog
|
* @author Mehrab Kamrani (mehrab.hassan@3ds.com)
|
*/
|
import { DialogSOP } from '../../libappsop/dialogsop';
|
import { DropDownListSOP } from '../../libappsop/dropdownlistsop';
|
import { DurationSelectorSOP } from '../../libappsop/durationselectorsop';
|
import { DateTimeSelectorSOP } from '../../libappsop/datetimeselectorsop';
|
import { RadioButtonSOP } from '../../libappsop/radiobuttonsop';
|
import { EditFieldSOP } from '../../libappsop/editfieldsop';
|
import { LabelSOP } from '../../libappsop/labelsop';
|
|
export class DialogCampaign extends DialogSOP<DialogCampaignFields> {
|
public static readonly title = 'Campaign';
|
public readonly name = 'Campaign';
|
private readonly _ddlCampaignType = new DropDownListSOP('selCampaignType_MP');
|
private readonly _dsEarliestStart = new DateTimeSelectorSOP('dsEarliestStart');
|
|
private readonly _rbgInputType = new RadioButtonSOP('RadioButtonGroupQuantityDuration');
|
private readonly _efMinQuantity = new EditFieldSOP('EditorCampaignMinQuantity');
|
private readonly _efMaxQuantity = new EditFieldSOP('EditorCampaignMaxQuantity');
|
private readonly _efMinDuration = new DurationSelectorSOP('DurationSelectorMinDuration', { Days: 0, Hours: 0, Minutes: 0 });
|
private readonly _efMaxDuration = new DurationSelectorSOP('DurationSelectorMaxDuration', { Days: 0, Hours: 0, Minutes: 0 });
|
private readonly _efComment = new EditFieldSOP('edtComment');
|
|
// Labels for indicative values
|
private readonly _lblIndicatedDurationBasedOnMinQuantity = new LabelSOP('LabelIndicatedDurationBasedOnMinQty');
|
private readonly _lblIndicatedDurationBasedOnMaxQuantity = new LabelSOP('LabelIndicatedDurationBasedOnMaxQty');
|
private readonly _lblIndicatedQuantityBasedOnMinDuration = new LabelSOP('LabelIndicatedQuantityBasedOnMinDuration');
|
private readonly _lblIndicatedQuantityBasedOnMaxDuration = new LabelSOP('LabelIndicatedQuantityBasedOnMaxDuration');
|
|
public constructor() {
|
super('DialogCreateEditCampaign', 'btnOK', 'btnCancel');
|
|
// 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('Campaign type', this._ddlCampaignType);
|
this._uiMap.set('Earliest start', this._dsEarliestStart);
|
this._uiMap.set('Input type', this._rbgInputType);
|
this._uiMap.set('Minimum quantity', this._efMinQuantity);
|
this._uiMap.set('Maximum quantity', this._efMaxQuantity);
|
this._uiMap.set('Minimum duration', this._efMinDuration);
|
this._uiMap.set('Maximum duration', this._efMaxDuration);
|
this._uiMap.set('Indicated Duration BasedOn MinQty', this._lblIndicatedDurationBasedOnMinQuantity);
|
this._uiMap.set('Indicated Duration BasedOn MaxQty', this._lblIndicatedDurationBasedOnMaxQuantity);
|
this._uiMap.set('Indicated Quantity BasedOn MinDuration', this._lblIndicatedQuantityBasedOnMinDuration);
|
this._uiMap.set('Indicated Quantity BasedOn MaxDuration', this._lblIndicatedQuantityBasedOnMaxDuration);
|
this._uiMap.set('Comment', this._efComment);
|
}
|
}
|
|
export interface DialogCampaignFields {
|
'Campaign type'?: string;
|
'Earliest start'?: string;
|
'Input type'?: string;
|
'Minimum quantity'?: string;
|
'Maximum quantity'?: string;
|
'Minimum duration'?: string;
|
'Maximum duration'?: string;
|
'Indicated Duration BasedOn MinQty'?: string;
|
'Indicated Duration BasedOn MaxQty'?: string;
|
'Indicated Quantity BasedOn MinDuration'?: string;
|
'Indicated Quantity BasedOn MaxDuration'?: string;
|
Comment?: string;
|
}
|