AmoghAtreya commented on code in PR #44957:
URL: https://github.com/apache/superset/pull/44957#discussion_r4187343901
##########
superset-frontend/src/explore/components/controls/ZoomConfigControl/ZoomConfigControl.tsx:
##########
@@ -84,16 +84,18 @@ export const ZoomConfigControl: FC<ZoomConfigsControlProps>
= ({
}
const newValue = { ...value };
- newValue.configs.height = height;
+ newValue.configs = { ...newValue.configs, height };
newValue.values = computeConfigValues(newValue);
onChange(newValue);
};
const onBaseSlopeChange = (slope: number) => {
setBaseSlope(slope);
if (value && isZoomConfigsLinear(value)) {
- const newValue = { ...value };
- newValue.configs.slope = slope;
+ const newValue = {
+ ...value,
+ configs: { ...value.configs, slope },
+ };
newValue.values = computeConfigValues(newValue);
onChange(newValue);
Review Comment:
Addressed. After the LINEAR type guard, `onBaseSlopeChange` now uses
`updateConfigs(value, { slope })` rather than the object-literal `{ ...value,
configs: { ... } }` form.
##########
superset-frontend/src/explore/components/controls/ZoomConfigControl/ZoomConfigControl.tsx:
##########
@@ -102,8 +104,10 @@ export const ZoomConfigControl:
FC<ZoomConfigsControlProps> = ({
const onBaseExponentChange = (exponent: number) => {
setBaseExponent(exponent);
if (value && isZoomConfigsExp(value)) {
- const newValue = { ...value };
- newValue.configs.exponent = exponent;
+ const newValue = {
+ ...value,
+ configs: { ...value.configs, exponent },
+ };
newValue.values = computeConfigValues(newValue);
onChange(newValue);
Review Comment:
Addressed. After the EXP type guard, `onBaseExponentChange` now uses
`updateConfigs(value, { exponent })`, matching the width/height/slope handlers.
--
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]