Skip to content

Commit

Permalink
#2248 After table row is deleted, propertyListener callback has same …
Browse files Browse the repository at this point in the history
…previousValue and value-fixing-final

Signed-off-by: Jerin George <[email protected]>
  • Loading branch information
Jerinjk14 committed Dec 2, 2024
1 parent 5cfe31a commit 8f2d176
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,7 @@ export default class PropertiesController {
if (typeof type !== "undefined") {
data.type = type;
}
console.log(data);

Check warning on line 1102 in canvas_modules/common-canvas/src/common-properties/properties-controller.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
this.handlers.propertyListener(data);
}
}
Expand All @@ -1116,7 +1117,16 @@ export default class PropertiesController {
const propertyId = this.convertPropertyId(inPropertyId);
const propertyValue = this.propertiesStore.getPropertyValue(propertyId);
// Parsing propertyValue
const parsedValue = propertyValue ? JSON.parse(JSON.stringify(propertyValue)) : propertyValue;
let parsedValue;
if (Array.isArray(propertyValue)) {
// Use map to preserve sparse arrays and maintain structure
parsedValue = propertyValue.map((itm) => itm);
} else if (propertyValue && typeof propertyValue === "object") {
// Shallow copy for objects
parsedValue = { ...propertyValue };
} else {
parsedValue = typeof propertyValue !== "undefined" ? propertyValue : defaultValue;
}
let filteredValue = defaultValue;

// don't return hidden/disabled values
Expand Down

0 comments on commit 8f2d176

Please sign in to comment.