diff --git a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx index bc72f983a..401364e0d 100644 --- a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx +++ b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx @@ -125,6 +125,8 @@ const ConditionalFormattingControl = ({ }: ConditionalFormattingConfig) => { const columnName = (column && verboseMap?.[column]) ?? column; switch (operator) { + case COMPARATOR.NONE: + return `${columnName}`; case COMPARATOR.BETWEEN: return `${targetValueLeft} ${COMPARATOR.LESS_THAN} ${columnName} ${COMPARATOR.LESS_THAN} ${targetValueRight}`; case COMPARATOR.BETWEEN_OR_EQUAL: diff --git a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx index 571131509..b23b456c4 100644 --- a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx +++ b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx @@ -44,6 +44,7 @@ const colorSchemeOptions = [ ]; const operatorOptions = [ + { value: COMPARATOR.NONE, label: 'None' }, { value: COMPARATOR.GREATER_THAN, label: '>' }, { value: COMPARATOR.LESS_THAN, label: '<' }, { value: COMPARATOR.GREATER_OR_EQUAL, label: '≥' }, @@ -68,6 +69,9 @@ export const FormattingPopoverContent = ({ const isOperatorMultiValue = (operator?: COMPARATOR) => operator && MULTIPLE_VALUE_COMPARATORS.includes(operator); + const isOperatorNone = (operator?: COMPARATOR) => + !operator || operator === COMPARATOR.NONE; + const operatorField = useMemo( () => ( + isOperatorNone(prevValues.operator) !== + isOperatorNone(currentValues.operator) || isOperatorMultiValue(prevValues.operator) !== - isOperatorMultiValue(currentValues.operator) + isOperatorMultiValue(currentValues.operator) } > {({ getFieldValue }) => - isOperatorMultiValue(getFieldValue('operator')) ? ( + isOperatorNone(getFieldValue('operator')) ? ( + + {operatorField} + + ) : isOperatorMultiValue(getFieldValue('operator')) ? (