From 0f6a2b25810c5e4ce09f820f4695b30a99188263 Mon Sep 17 00:00:00 2001 From: Tyler Ohlsen Date: Wed, 20 Nov 2024 14:17:45 -0800 Subject: [PATCH] Fix bug of model interface not autopopulating in map Signed-off-by: Tyler Ohlsen --- .../ml_processor_inputs/ml_processor_inputs.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/public/pages/workflow_detail/workflow_inputs/processor_inputs/ml_processor_inputs/ml_processor_inputs.tsx b/public/pages/workflow_detail/workflow_inputs/processor_inputs/ml_processor_inputs/ml_processor_inputs.tsx index a9bec8a8..5d24c2ce 100644 --- a/public/pages/workflow_detail/workflow_inputs/processor_inputs/ml_processor_inputs/ml_processor_inputs.tsx +++ b/public/pages/workflow_detail/workflow_inputs/processor_inputs/ml_processor_inputs/ml_processor_inputs.tsx @@ -33,6 +33,8 @@ import { MapEntry, MapFormValue, EMPTY_INPUT_MAP_ENTRY, + REQUEST_PREFIX, + REQUEST_PREFIX_WITH_JSONPATH_ROOT_SELECTOR, } from '../../../../../../common'; import { ModelField } from '../../input_fields'; import { @@ -142,9 +144,12 @@ export function MLProcessorInputs(props: MLProcessorInputsProps) { const newModelInterface = models[modelId]?.interface; setModelInterface(newModelInterface); const modelInputsAsForm = [ - parseModelInputs(newModelInterface).map( - (modelInput) => EMPTY_INPUT_MAP_ENTRY - ) as InputMapFormValue, + parseModelInputs(newModelInterface).map((modelInput) => { + return { + ...EMPTY_INPUT_MAP_ENTRY, + key: modelInput.label, + }; + }) as InputMapFormValue, ] as InputMapArrayFormValue; const modelOutputsAsForm = [ parseModelOutputs(newModelInterface).map((modelOutput) => {