mirror of https://github.com/buster-so/buster.git
fix bad render states
This commit is contained in:
parent
b496523a4c
commit
2788f7e675
|
@ -102,7 +102,7 @@ export const SaveToDashboardDropdown: React.FC<{
|
|||
onOpenChange={onOpenChange}
|
||||
footerContent={memoizedButton}
|
||||
items={items}>
|
||||
<AppTooltip title={showDropdown ? '' : 'Save to collection'}>{children} </AppTooltip>
|
||||
<AppTooltip title={showDropdown ? '' : 'Save to dashboard'}>{children} </AppTooltip>
|
||||
</Dropdown>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -10,8 +10,7 @@ export const EditScatterDotSize: React.FC<{
|
|||
scatterDotSize: IBusterMetricChartConfig['scatterDotSize'];
|
||||
scatterAxis: ScatterAxis;
|
||||
onUpdateChartConfig: (config: Partial<IBusterMetricChartConfig>) => void;
|
||||
}> = React.memo(
|
||||
({ scatterDotSize, scatterAxis, onUpdateChartConfig }) => {
|
||||
}> = React.memo(({ scatterDotSize, scatterAxis, onUpdateChartConfig }) => {
|
||||
const hasSize = !isEmpty(scatterAxis.size);
|
||||
const defaultValue = hasSize ? scatterDotSize : scatterDotSize[0];
|
||||
|
||||
|
@ -35,7 +34,5 @@ export const EditScatterDotSize: React.FC<{
|
|||
/>
|
||||
</LabelAndInput>
|
||||
);
|
||||
},
|
||||
() => true
|
||||
);
|
||||
});
|
||||
EditScatterDotSize.displayName = 'EditScatterDotSize';
|
||||
|
|
|
@ -76,7 +76,6 @@ export const EditShowHeadline: React.FC<{
|
|||
/>
|
||||
</LabelAndInput>
|
||||
);
|
||||
},
|
||||
() => true
|
||||
}
|
||||
);
|
||||
EditShowHeadline.displayName = 'EditShowHeadline';
|
||||
|
|
|
@ -22,18 +22,18 @@ export const EditShowLegend: React.FC<{
|
|||
allYAxisColumnNames
|
||||
});
|
||||
|
||||
console.log('showLegend', showLegend);
|
||||
|
||||
return (
|
||||
<LabelAndInput label={'Show legend'}>
|
||||
<div className="flex justify-end">
|
||||
<Switch
|
||||
defaultChecked={showLegend ?? false}
|
||||
checked={showLegend}
|
||||
onCheckedChange={(v) => onUpdateChartConfig({ showLegend: v })}
|
||||
/>
|
||||
</div>
|
||||
</LabelAndInput>
|
||||
);
|
||||
},
|
||||
() => true
|
||||
}
|
||||
);
|
||||
EditShowLegend.displayName = 'EditShowLegend';
|
||||
|
|
|
@ -11,8 +11,7 @@ export const MISSING_VALUES_OPTIONS: SelectItem[] = [
|
|||
export const EditReplaceMissingData: React.FC<{
|
||||
replaceMissingDataWith: IColumnLabelFormat['replaceMissingDataWith'];
|
||||
onUpdateColumnConfig: (columnLabelFormat: Partial<IColumnLabelFormat>) => void;
|
||||
}> = React.memo(
|
||||
({ replaceMissingDataWith, onUpdateColumnConfig }) => {
|
||||
}> = React.memo(({ replaceMissingDataWith, onUpdateColumnConfig }) => {
|
||||
const selectedValue = useMemo(() => {
|
||||
if (replaceMissingDataWith === null) return '🧸✂️';
|
||||
return 0;
|
||||
|
@ -32,8 +31,6 @@ export const EditReplaceMissingData: React.FC<{
|
|||
/>
|
||||
</LabelAndInput>
|
||||
);
|
||||
},
|
||||
() => true
|
||||
);
|
||||
});
|
||||
|
||||
EditReplaceMissingData.displayName = 'EditReplaceMissingData';
|
||||
|
|
|
@ -7,8 +7,7 @@ export const EditHeaderTitle: React.FC<{
|
|||
value: string | undefined;
|
||||
type: 'header' | 'subHeader';
|
||||
onUpdateChartConfig: (chartConfig: Partial<IBusterMetricChartConfig>) => void;
|
||||
}> = React.memo(
|
||||
({ value, onUpdateChartConfig, type }) => {
|
||||
}> = React.memo(({ value, onUpdateChartConfig, type }) => {
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
const key: keyof IBusterMetricChartConfig =
|
||||
type === 'header' ? 'metricHeader' : 'metricSubHeader';
|
||||
|
@ -32,8 +31,6 @@ export const EditHeaderTitle: React.FC<{
|
|||
<Input ref={inputRef} placeholder={placeholder} defaultValue={value} onChange={onChange} />
|
||||
</LabelAndInput>
|
||||
);
|
||||
},
|
||||
() => true
|
||||
);
|
||||
});
|
||||
|
||||
EditHeaderTitle.displayName = 'EditHeaderTitle';
|
||||
|
|
Loading…
Reference in New Issue