diff --git a/web/src/app/app/datasets/[datasetId]/_DatasetPageContext.tsx b/web/src/app/app/datasets/[datasetId]/_DatasetPageContext.tsx index 375186938..5bba7327c 100644 --- a/web/src/app/app/datasets/[datasetId]/_DatasetPageContext.tsx +++ b/web/src/app/app/datasets/[datasetId]/_DatasetPageContext.tsx @@ -14,7 +14,7 @@ import { useDeployDataset } from '@/api/busterv2'; export const useDatasetPageContext = ({ datasetId }: { datasetId: string }) => { const segments = useSelectedLayoutSegment() as DatasetApps; - const { mutate: onUpdateDataset } = useDeployDataset(); + const { mutate: onUpdateDataset, isPending: isDeployingDataset } = useDeployDataset(); const { dataset, datasetData } = useIndividualDataset({ datasetId }); const originalDatasetSQL = dataset?.data?.sql; const datasetYmlFile = dataset?.data?.yml_file; @@ -27,7 +27,7 @@ export const useDatasetPageContext = ({ datasetId }: { datasetId: string }) => { const disablePublish = useMemo(() => { const originalSQL = datasetSQL || ''; const originalYmlFile = datasetYmlFile || ''; - return !datasetId || !sql || originalSQL === sql || !ymlFile || originalYmlFile === ymlFile; + return !datasetId || !sql || !ymlFile || (originalYmlFile === ymlFile && originalSQL === sql); }, [datasetSQL, sql, datasetId, datasetYmlFile, ymlFile]); const isChangedSQL = useMemo(() => { @@ -40,10 +40,11 @@ export const useDatasetPageContext = ({ datasetId }: { datasetId: string }) => { }); const onPublishDataset = useMemoizedFn(async () => { + if (disablePublish || !sql || !ymlFile) return; onUpdateDataset({ dataset_id: datasetId!, - sql: sql!, - yml: ymlFile! + sql: sql, + yml: ymlFile }); }); @@ -69,7 +70,8 @@ export const useDatasetPageContext = ({ datasetId }: { datasetId: string }) => { dataset, disablePublish, isChangedSQL, - datasetId + datasetId, + isDeployingDataset }; }; diff --git a/web/src/app/app/datasets/[datasetId]/_DatasetsIndividualHeader/DatasetsIndividualHeader.tsx b/web/src/app/app/datasets/[datasetId]/_DatasetsIndividualHeader/DatasetsIndividualHeader.tsx index 417f5d02a..3e1a6f9aa 100644 --- a/web/src/app/app/datasets/[datasetId]/_DatasetsIndividualHeader/DatasetsIndividualHeader.tsx +++ b/web/src/app/app/datasets/[datasetId]/_DatasetsIndividualHeader/DatasetsIndividualHeader.tsx @@ -17,6 +17,7 @@ export const DatasetsIndividualHeader: React.FC<{}> = React.memo(({}) => { const selectedApp = useDatasetPageContextSelector((state) => state.selectedApp); const dataset = useDatasetPageContextSelector((state) => state.dataset); const onPublishDataset = useDatasetPageContextSelector((state) => state.onPublishDataset); + const isDeployingDataset = useDatasetPageContextSelector((state) => state.isDeployingDataset); const resetDataset = useDatasetPageContextSelector((state) => state.resetDataset); const disablePublish = useDatasetPageContextSelector((state) => state.disablePublish); const isChangedSQL = useDatasetPageContextSelector((state) => state.isChangedSQL); @@ -25,7 +26,6 @@ export const DatasetsIndividualHeader: React.FC<{}> = React.memo(({}) => { const datasetName = dataset?.data?.name; const isAdmin = useUserConfigContextSelector((state) => state.isAdmin); - const setOpenNewDatasetModal = useDatasetContextSelector((state) => state.setOpenNewDatasetModal); const preventNavigation = !disablePublish; @@ -59,10 +59,14 @@ export const DatasetsIndividualHeader: React.FC<{}> = React.memo(({}) => {
- -
diff --git a/web/src/components/list/BusterList/BusterListReactWindow.tsx b/web/src/components/list/BusterList/BusterListReactWindow.tsx index 334d43370..ad8c05d02 100644 --- a/web/src/components/list/BusterList/BusterListReactWindow.tsx +++ b/web/src/components/list/BusterList/BusterListReactWindow.tsx @@ -16,7 +16,6 @@ export const BusterList: React.FC = ({ onSelectChange, emptyState, showHeader = true, - columnHeaderVariant, contextMenu, showSelectAll = true }) => { diff --git a/web/src/components/list/BusterList/BusterListRowComponentSelector.tsx b/web/src/components/list/BusterList/BusterListRowComponentSelector.tsx index 6acf22005..0cddd15a5 100644 --- a/web/src/components/list/BusterList/BusterListRowComponentSelector.tsx +++ b/web/src/components/list/BusterList/BusterListRowComponentSelector.tsx @@ -15,7 +15,7 @@ export const BusterListRowComponentSelector = React.forwardRef< selectedRowKeys?: string[]; rows: BusterListRow[]; style?: React.CSSProperties; - columnRowVariant: BusterListProps['columnRowVariant']; + columnRowVariant?: BusterListProps['columnRowVariant']; } >( (