From 339080d9466093e94f0fe18e98a85a3a0ea54e5c Mon Sep 17 00:00:00 2001 From: ilan7empest Date: Mon, 8 Jan 2024 16:25:57 +0200 Subject: [PATCH] fix by code review --- src/components/JobWizard/JobWizard.util.js | 1 + src/utils/parseJob.js | 13 ++++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/components/JobWizard/JobWizard.util.js b/src/components/JobWizard/JobWizard.util.js index cf5a2c467..d0c7f9a8d 100644 --- a/src/components/JobWizard/JobWizard.util.js +++ b/src/components/JobWizard/JobWizard.util.js @@ -866,6 +866,7 @@ const generateParameters = parametersTableData => { ?.filter(parameter => !parameter.data.isHyper && parameter.data.isChecked) .forEach(parameter => { if (parameter.data.name === 'context' && !parameter.data.value) return false + parameters[parameter.data.name] = convertParameterValue( parameter.data.value, parameter.data.type diff --git a/src/utils/parseJob.js b/src/utils/parseJob.js index 783e06c42..34af6b481 100644 --- a/src/utils/parseJob.js +++ b/src/utils/parseJob.js @@ -51,13 +51,8 @@ export const parseJob = (job, tab) => { } } } else { - const filteredContextParameter = job.spec?.parameters - ? Object.fromEntries( - Object.entries(job.spec.parameters).filter(([key, value]) => - key !== 'context' ? key : value - ) - ) - : {} + let jobParameters = { ...job.spec?.parameters } || {} + if ('context' in jobParameters && !jobParameters.context) delete jobParameters.context jobItem = { artifacts: job.status.artifacts || [], @@ -75,9 +70,9 @@ export const parseJob = (job, tab) => { name: job.metadata.name, outputPath: job.spec?.output_path, owner: job.metadata.labels?.owner, - parameters: filteredContextParameter, + parameters: jobParameters, parametersChips: [ - ...parseKeyValues(filteredContextParameter || {}), + ...parseKeyValues(jobParameters), ...parseKeyValues(job.spec?.hyperparams || {}) ], project: job.metadata.project,