mirror of
https://github.com/apache/superset.git
synced 2026-09-01 21:11:28 +00:00
feat: Color Picker replaces the color selection drop-down list in conditional formatting (#42053)
Co-authored-by: rusackas <evan@rusackas.com> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
rusackas
Claude
parent
eb8592d4bf
commit
b18015f63b
@@ -30,7 +30,11 @@ import {
|
||||
TimeFormats,
|
||||
} from '@superset-ui/core';
|
||||
import { GenericDataType } from '@apache-superset/core/common';
|
||||
import { getColorFormatters } from '@superset-ui/chart-controls';
|
||||
import {
|
||||
ColorSchemeEnum,
|
||||
ConditionalFormattingConfig,
|
||||
getColorFormatters,
|
||||
} from '@superset-ui/chart-controls';
|
||||
import { DateFormatter, PivotTableQueryFormData, QueryData } from '../types';
|
||||
import buildGroupbyCombinations, {
|
||||
additiveReducerFor,
|
||||
@@ -206,8 +210,17 @@ export default function transformProps(chartProps: ChartProps<QueryFormData>) {
|
||||
},
|
||||
{},
|
||||
);
|
||||
// The "Green"/"Red" trend-color tokens are resolved by the Table chart's
|
||||
// own comparison-aware formatter, which this renderer does not implement.
|
||||
// Filter them out so a stale config (e.g. carried over from switching viz
|
||||
// types) doesn't leak the raw token name through as a literal CSS color.
|
||||
const pivotConditionalFormatting = conditionalFormatting?.filter(
|
||||
(config: ConditionalFormattingConfig) =>
|
||||
config.colorScheme !== ColorSchemeEnum.Green &&
|
||||
config.colorScheme !== ColorSchemeEnum.Red,
|
||||
);
|
||||
const metricColorFormatters = getColorFormatters(
|
||||
conditionalFormatting,
|
||||
pivotConditionalFormatting,
|
||||
mainQuery.data,
|
||||
theme,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user