Skip to content

Commit

Permalink
fix(Designer): Secure string workflow parameters now pass validation (#…
Browse files Browse the repository at this point in the history
…4408)

* Fixed secure string wf parameters validation

* Slight rename

* PR comment fix
  • Loading branch information
rllyy97 committed Mar 21, 2024
1 parent 25cf75b commit ba6327a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libs/designer/src/lib/core/actions/bjsworkflow/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,19 @@ const getWorkflowParameters = (
delete parameterDefinition['name'];
delete parameterDefinition['isEditable'];

parameterDefinition.value = equals(parameterDefinition.type, UIConstants.WORKFLOW_PARAMETER_TYPE.STRING)
const isStringParameter =
equals(parameterDefinition.type, UIConstants.WORKFLOW_PARAMETER_TYPE.STRING) ||
equals(parameterDefinition.type, UIConstants.WORKFLOW_PARAMETER_TYPE.SECURE_STRING);

parameterDefinition.value = isStringParameter
? value
: value === ''
? undefined
: typeof value !== 'string'
? value
: JSON.parse(value);

parameterDefinition.defaultValue = equals(parameterDefinition.type, UIConstants.WORKFLOW_PARAMETER_TYPE.STRING)
parameterDefinition.defaultValue = isStringParameter
? defaultValue
: defaultValue === ''
? undefined
Expand Down

0 comments on commit ba6327a

Please sign in to comment.