mirror of
https://github.com/apache/superset.git
synced 2026-05-24 09:15:19 +00:00
chore: Upgrade to React 18 (#38563)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Evan Rusackas <evan@preset.io>
This commit is contained in:
committed by
GitHub
parent
28239c18d4
commit
41a22d7918
@@ -247,7 +247,7 @@ const AgGridDataTable: FunctionComponent<AgGridTableProps> = memo(
|
||||
[serverPagination, debouncedSearch, searchId],
|
||||
);
|
||||
|
||||
const handleColSort = (colId: string, sortDir: string) => {
|
||||
const handleColSort = (colId: string, sortDir: string | null) => {
|
||||
const isSortable = shouldSort({
|
||||
colId,
|
||||
sortDir,
|
||||
@@ -301,10 +301,12 @@ const AgGridDataTable: FunctionComponent<AgGridTableProps> = memo(
|
||||
};
|
||||
|
||||
const handleColumnHeaderClick = useCallback(
|
||||
params => {
|
||||
(params: { column?: { colId?: string; sort?: string | null } }) => {
|
||||
const colId = params?.column?.colId;
|
||||
const sortDir = params?.column?.sort;
|
||||
handleColSort(colId, sortDir);
|
||||
if (colId && sortDir !== undefined) {
|
||||
handleColSort(colId, sortDir);
|
||||
}
|
||||
},
|
||||
[serverPagination, gridInitialState, percentMetrics, onSortChange],
|
||||
);
|
||||
|
||||
@@ -147,7 +147,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
|
||||
]);
|
||||
|
||||
const handleColumnStateChange = useCallback(
|
||||
agGridState => {
|
||||
(agGridState: Record<string, unknown>) => {
|
||||
if (onChartStateChange) {
|
||||
onChartStateChange(agGridState);
|
||||
}
|
||||
|
||||
@@ -70,5 +70,9 @@ export const TextCellRenderer = (params: CellRendererProps) => {
|
||||
}
|
||||
}
|
||||
|
||||
return <div>{valueFormatted ?? value}</div>;
|
||||
return (
|
||||
<div>
|
||||
{valueFormatted ?? (value instanceof Date ? value.toISOString() : value)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ export const shouldSort = ({
|
||||
gridInitialState,
|
||||
}: {
|
||||
colId: string;
|
||||
sortDir: string;
|
||||
sortDir: string | null;
|
||||
percentMetrics: string[];
|
||||
serverPagination: boolean;
|
||||
gridInitialState: GridState;
|
||||
|
||||
Reference in New Issue
Block a user