Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 6052870
Author: Boris Kovar <[email protected]>
Date:   Tue Aug 15 12:31:31 2023 +0200

    - implemented #1129
  • Loading branch information
boriskovar-m2ms committed Aug 15, 2023
1 parent 86a1a7c commit b6c21b9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions js/hooks/useGetJobDefinition.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b6c21b9

Please sign in to comment.