| /** | 
|  * @file          Campaign Types Dialog | 
|  * @author        Mehrab Kamrani (mehrab.hassan@3ds.com) | 
|  */ | 
| import { DialogSOP } from '../../libappsop/dialogsop'; | 
| import { DropDownListSOP } from '../../libappsop/dropdownlistsop'; | 
| import { EditFieldSOP } from '../../libappsop/editfieldsop'; | 
| import { RadioButtonSOP } from '../../libappsop/radiobuttonsop'; | 
| import { DurationSelectorSOP } from '../../libappsop/durationselectorsop'; | 
|   | 
| export class DialogCampaignType extends DialogSOP<DialogCampaignTypeFields> { | 
|   public readonly name = 'Campaign Type'; | 
|   | 
|   // Campaign type unit and name | 
|   private readonly _ddlUnit = new DropDownListSOP('DropDownListUnit'); | 
|   private readonly _efName = new EditFieldSOP('EditFieldName'); | 
|   | 
|   // Radio button selection for quantity/duration | 
|   private readonly _rbgQuantityOrDuration = new RadioButtonSOP('RadioButtonGroupQuantityDuration'); | 
|   | 
|   // Fields for quantity | 
|   private readonly _efDefaultMinQty = new EditFieldSOP('EditFieldDefaultMinQty'); | 
|   private readonly _efDefaultMaxQty = new EditFieldSOP('EditFieldDefaultMaxQty'); | 
|   | 
|   // Fields for duration | 
|   private readonly _dsDefaultMinimumDuration = new DurationSelectorSOP('DurationSelectorMinDuration', {Days: 0, Hours: 0, Minutes: 0}); | 
|   private readonly _dsDefaultMaximumDuration = new DurationSelectorSOP('DurationSelectorMaxDuration', {Days: 0, Hours: 0, Minutes: 0}); | 
|   | 
|   public constructor() { | 
|     super('DialogCreateEditCampaignType'); | 
|   | 
|     // 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('Unit', this._ddlUnit); | 
|     this._uiMap.set('QuantityOrDuration', this._rbgQuantityOrDuration); | 
|     this._uiMap.set('MinQuantity', this._efDefaultMinQty); | 
|     this._uiMap.set('MaxQuantity', this._efDefaultMaxQty); | 
|     this._uiMap.set('MinDuration', this._dsDefaultMinimumDuration); | 
|     this._uiMap.set('MaxDuration', this._dsDefaultMaximumDuration); | 
|   } | 
| } | 
|   | 
| export interface DialogCampaignTypeFields { | 
|   Name?: string; | 
|   Unit?: string; | 
|   QuantityOrDuration?: string; | 
|   MinQuantity?: string; | 
|   MaxQuantity?: string; | 
|   MinDuration?: string; | 
|   MaxDuration?: string; | 
| } |