| import { AppMP } from '../appmp'; | 
| import { CheckboxSOP } from '../../libappsop/checkboxsop'; | 
| import { DateTimeSelectorSOP } from '../../libappsop/datetimeselectorsop'; | 
| import { DialogSOP } from '../../libappsop/dialogsop'; | 
| import { LabelSOP } from '../../libappsop/labelsop'; | 
|   | 
| export interface FormWorkflowParametersFields { | 
|   AutomaticBasedOnCurentDate?: string; | 
|   CurrentDate?: string; | 
|   SpecificDate?: string; | 
|   EnableIntegration?: string; | 
| } | 
|   | 
| export class FormWorkflowParameters extends DialogSOP<FormWorkflowParametersFields> { | 
|   public static title = 'S&OP Workflow Parameters'; | 
|   public static readonly formPath = 'Workflow > Workflow Parameters'; | 
|   | 
|   public cbAutomaticCurrentDate = new CheckboxSOP('CheckboxCurrentDateAutomatic'); | 
|   public lblCurrentDate = new LabelSOP('LabelCurrentDate'); | 
|   public dsSpecificDate = new DateTimeSelectorSOP('DateSelectorCurrentDate'); | 
|   public cbEnableIntegration = new CheckboxSOP('CheckboxIntegration'); | 
|   | 
|   public constructor() { | 
|     super('SWF_DialogWorkflowParameter'); | 
|   | 
|     // 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('AutomaticBasedOnCurentDate', this.cbAutomaticCurrentDate); | 
|     this._uiMap.set('CurrentDate', this.lblCurrentDate); | 
|     this._uiMap.set('SpecificDate', this.dsSpecificDate); | 
|     this._uiMap.set('EnableIntegration', this.cbEnableIntegration); | 
|   | 
|   } | 
|   | 
|   /** | 
|    * Toggle open/close Workflow Parameters right docked form | 
|    * | 
|    * @param show True = workflow parameter form should be open, False = workflow parameter form should be close | 
|    */ | 
|   public async toggleFormWorkflowParameters(show: Boolean): Promise<void> { | 
|     if (await this.isOpen() !== show) { | 
|       const appDP = AppMP.getInstance(); | 
|       await appDP.abpWorkflow.click(); | 
|       await appDP.abpWorkflow.btnWorkflowParameters.click(); | 
|    } | 
|   } | 
| } | 
|   | 
| // Enable integration checkbox field need DP-MP integration configured, check toast message instead | 
| export const toastFormWorkflowParameters = { | 
|   enableIntegration: (): string => "Execute External Action: SOAP Client Method 'SOPDSSCClientInterface.HandleRegistration': SOAPClientParser found unexpected (end) element title in state Initial, ErrorCode 28737", | 
| }; | 
|   | 
| // Step description to re-use in spec file to prevent scriptor re-write each time | 
| const stepWorkflowParametersDocked = { | 
|   closeWorkflowParameterRightDockedPanel: (): string => `Click action bar button ${FormWorkflowParameters.formPath} to close ${FormWorkflowParameters.title} right docked panel.`, | 
|   openWorkflowParameterRightDockedPanel: (): string => `Click action bar button ${FormWorkflowParameters.formPath} to open ${FormWorkflowParameters.title} right docked panel.`, | 
| }; | 
|   | 
| export { stepWorkflowParametersDocked as StepWorkflowParametersDocked }; |