Skip to content

Commit

Permalink
Fix issue when passing Boolean props false in DynamicDataTable
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminCharmes authored and ml-evs committed Nov 29, 2024
1 parent b23443b commit 0e21bb0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions webapp/src/components/DynamicDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,16 @@ export default {
const config = propsConfig[componentName] || {};
const props = Object.entries(config).reduce((acc, [prop, dataKey]) => {
if (dataKey !== true) {
const props = Object.entries(config).reduce((acc, [prop, setting]) => {
if (typeof setting === "object" && setting !== null && "value" in setting) {
acc[prop] = setting.value;
} else if (typeof setting === "boolean") {
acc[prop] = setting;
} else if (typeof setting === "string") {
if (prop === "itemType") {
acc[prop] = data.type !== undefined ? data.type : "starting_materials";
} else if (data[dataKey] !== undefined) {
acc[prop] = data[dataKey];
} else if (data[setting] !== undefined) {
acc[prop] = data[setting];
}
}
return acc;
Expand Down

0 comments on commit 0e21bb0

Please sign in to comment.