bito-code-review[bot] commented on code in PR #36955:
URL: https://github.com/apache/superset/pull/36955#discussion_r2686688494
##########
superset-frontend/src/dashboard/actions/chartCustomizationActions.ts:
##########
@@ -204,10 +230,31 @@ export function saveChartCustomization(
dispatch(onSave(lastModifiedTime));
}
- const { dashboardState } = getState();
- const chartIds = dashboardState.sliceIds || [];
- if (chartIds.length > 0) {
- chartIds.forEach(chartId => {
+ const sliceEntities = getState().sliceEntities || {};
+ const slices = sliceEntities.slices || {};
+
+ const changedItems: ChartCustomizationItem[] = [];
+
+ changedItems.push(...removedItems);
+
+ chartCustomizationItems.forEach(newItem => {
+ const existingItem = existingItemsMap.get(newItem.id);
+ if (existingItem && !newItem.removed) {
+ if (!isEqual(existingItem.customization, newItem.customization)) {
+ changedItems.push(existingItem);
+ }
+ }
+ });
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing re-query for new customizations</b></div>
<div id="fix">
In the loop over `chartCustomizationItems`, add an `else if (!existingItem
&& hasValidColumn(newItem.customization?.column))` branch to push `newItem` so
that newly added customizations trigger chart updates.
</div>
</div>
<small><i>Code Review Run #9d6af9</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]