mirror of https://github.com/buster-so/buster.git
Use correct endpoint for dataset groups
This commit is contained in:
parent
2d2712e1d8
commit
d893eee231
|
@ -1,8 +1,8 @@
|
|||
import { mainApi } from '../../buster';
|
||||
import { ListDatasetGroupsResponse } from '../datasets';
|
||||
import { DatasetGroup } from './responseInterfaces';
|
||||
|
||||
export const listDatasetGroups = async () => {
|
||||
return mainApi.get<ListDatasetGroupsResponse[]>(`/dataset_groups`).then((res) => res.data);
|
||||
return mainApi.get<DatasetGroup[]>(`/dataset_groups`).then((res) => res.data);
|
||||
};
|
||||
|
||||
export const createDatasetGroup = async (data: { name: string }) => {
|
||||
|
|
|
@ -113,7 +113,6 @@ export const useDeployDataset = () => {
|
|||
mutationFn,
|
||||
onSuccess: (data, variables, context) => {
|
||||
queryClient.invalidateQueries({ queryKey: ['datasets', {}] });
|
||||
console.log(variables, context);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -51,7 +51,7 @@ export const ThreadControllerChart: React.FC<{
|
|||
};
|
||||
}
|
||||
|
||||
return isTable && !loading && !chartErrorMessage
|
||||
return isTable && !loading && !chartErrorMessage && (selectedData?.length ?? 0) > 0
|
||||
? {
|
||||
maxHeight: 'calc(100% - 20px)'
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ export const ThreadControllerChart: React.FC<{
|
|||
height: '100%',
|
||||
maxHeight: '600px'
|
||||
};
|
||||
}, [isTable, chartOnlyView, loading, chartErrorMessage]);
|
||||
}, [isTable, chartOnlyView, loading, chartErrorMessage, selectedData?.length]);
|
||||
|
||||
return (
|
||||
<div className={`${className} flex h-full w-full flex-col space-y-2.5 overflow-hidden`}>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { useListDatasetGroups } from '@/api/busterv2';
|
||||
import { useDatasetListDatasetGroups, useListDatasetGroups } from '@/api/busterv2';
|
||||
import React, { useState } from 'react';
|
||||
import { useDebounceSearch } from '../useDebounceSearch';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
|
@ -12,7 +12,8 @@ import { NewDatasetGroupModal } from './NewPermissionDatasetGroupModal';
|
|||
export const PermissionDatasetGroups: React.FC<{
|
||||
datasetId: string;
|
||||
}> = React.memo(({ datasetId }) => {
|
||||
const { data: datasetGroups, isFetched: isDatasetGroupsFetched } = useListDatasetGroups();
|
||||
const { data: datasetGroups, isFetched: isDatasetGroupsFetched } =
|
||||
useDatasetListDatasetGroups(datasetId);
|
||||
const [isNewDatasetGroupModalOpen, setIsNewDatasetGroupModalOpen] = useState(false);
|
||||
|
||||
const { filteredItems, searchText, handleSearchChange } = useDebounceSearch({
|
||||
|
|
|
@ -152,7 +152,6 @@ export const useBusterChartJSLegend = ({
|
|||
});
|
||||
|
||||
const onLegendItemFocus = useMemoizedFn((item: BusterChartLegendItem) => {
|
||||
// console.log('onLegendItemFocus', item);
|
||||
alert('TODO');
|
||||
});
|
||||
|
||||
|
|
|
@ -30,7 +30,9 @@ export const NoChartData: React.FC<{
|
|||
return (
|
||||
<div
|
||||
className={busterChartsTwMerge('flex h-full w-full items-center justify-center', className)}>
|
||||
<Text className={busterChartsTwMerge()}>{noDataText}</Text>
|
||||
<Text type="tertiary" className={busterChartsTwMerge()}>
|
||||
{noDataText}
|
||||
</Text>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue