Allow drag-and-drop metadata to merge with existing metadata for fields that are used as coloring
|
/* restrict added colorings to those _not_ currently present on the tree. This could be relaxed. TODO. */ |
|
for (const colorName of Object.keys(newColorings)) { |
|
if (controls.coloringsPresentOnTree.has(colorName)) { |
|
droppedColorings.add(colorName); |
|
delete newColorings[colorName]; |
|
} |
|
} |
|
/* strip those droppedColorings out of `newNodeAttrs` */ |
|
for (const colorName of droppedColorings) { |
|
for (const nodeAttr of Object.values(newNodeAttrs)) { |
|
delete nodeAttr[colorName]; // Note that this works even if `colorName` is not a property |
|
} |
|
} |
Allow drag-and-drop metadata to merge with existing metadata for fields that are used as coloring
auspice/src/actions/filesDropped/metadata.js
Lines 228 to 240 in 6370cc5