Skip to content

Commit

Permalink
- implemented #1129
Browse files Browse the repository at this point in the history
  • Loading branch information
boriskovar-m2ms committed Aug 15, 2023
1 parent 86a1a7c commit 6052870
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 6052870

Please sign in to comment.