plaes commented on code in PR #43692:
URL: https://github.com/apache/superset/pull/43692#discussion_r3890207710


##########
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx:
##########
@@ -332,40 +337,68 @@ export const FormattingPopoverContent = ({
   );
 
   const handleObjectChange = (value: ObjectFormattingEnum) => {
-    setObjectFormatting(value);
-
     if (value === ObjectFormattingEnum.CELL_BAR) {
       const currentColumnValue = form.getFieldValue('columnFormatting');
 
       const isCurrentColumnNumeric = numericColumns.some(
         col => col.value === currentColumnValue,
       );
 
-      if (!isCurrentColumnNumeric && numericColumns.length > 0) {
+      if (
+        !isCurrentColumnNumeric &&
+        numericColumns.length > 0 &&
+        !applyToWholeRow
+      ) {
         const newValue = numericColumns[0]?.value || '';
         form.setFieldsValue({
           columnFormatting: newValue,
         });
-        setColumnFormatting(newValue);
       }
     }
   };
 
-  const getColumnOptions = useCallback(
-    () =>
+  const handleWholeRowChange = (checked: boolean) => {
+    setApplyToWholeRow(checked);
+    // The field is kept in sync for display (the disabled select shows the
+    // "entire row" label); handleFinish derives the submitted value from
+    // the checkbox
+    form.setFieldsValue({
+      columnFormatting: checked
+        ? ObjectFormattingEnum.ENTIRE_ROW
+        : (lastColumnRef.current ??
+          allColumns.find(item => item.value === column)?.value),
+    });

Review Comment:
   Should be fixed in latest commit which also includes test for it.



-- 
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]

Reply via email to