From 60528709e830d424c07d290a7daf65cfcf3d9b2c Mon Sep 17 00:00:00 2001 From: Boris Kovar Date: Tue, 15 Aug 2023 12:31:31 +0200 Subject: [PATCH] - implemented #1129 --- js/hooks/useGetJobDefinition.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/js/hooks/useGetJobDefinition.js b/js/hooks/useGetJobDefinition.js index 9b5b4e90a..904c9e5eb 100644 --- a/js/hooks/useGetJobDefinition.js +++ b/js/hooks/useGetJobDefinition.js @@ -3,13 +3,19 @@ import { deepMerge } from '../utils/merge'; // Merges job definitions with fragalysis-jobs definitions const getSchemaDefinition = (configDefinitions, overrideDefinitions) => { - const mergedDefinitions = { ...configDefinitions }; + let mergedDefinitions = { ...configDefinitions }; Object.entries(overrideDefinitions).forEach(([key, overrideDefinition]) => { - let mergedDefinition = mergedDefinitions[key] || {}; + if (overrideDefinition.hasOwnProperty('ignore') && overrideDefinition['ignore'].toLowerCase() === 'true') { + if (mergedDefinitions.hasOwnProperty(key)) { + delete mergedDefinitions[key]; + } + } else { + let mergedDefinition = mergedDefinitions[key] || {}; - // mergedDefinitions[key] = { ...mergedDefinition, ...overrideDefinition }; - mergedDefinitions[key] = deepMerge({ ...mergedDefinition }, { ...overrideDefinition }); + // mergedDefinitions[key] = { ...mergedDefinition, ...overrideDefinition }; + mergedDefinitions[key] = deepMerge({ ...mergedDefinition }, { ...overrideDefinition }); + } }); return mergedDefinitions;