diff --git a/src/components/ModelsSidebar/index.tsx b/src/components/ModelsSidebar/index.tsx index 21a0f50e..9084def6 100644 --- a/src/components/ModelsSidebar/index.tsx +++ b/src/components/ModelsSidebar/index.tsx @@ -1,5 +1,5 @@ import { Col, Row, Space } from "antd"; -import { PlusOutlined, ReloadOutlined } from "@ant-design/icons"; +import { PlusOutlined } from "@ant-design/icons"; import { useTranslation } from "react-i18next"; import cn from "classnames"; @@ -14,7 +14,6 @@ import VersionPreview from "@/components/VersionPreview"; import BranchSelection from "@/components/BranchSelection"; import type { Branch, DataSourceInfo } from "@/types/dataSource"; import type { Dataschema } from "@/types/dataschema"; -import { isSmartGenerated } from "@/utils/provenanceParser"; import TrashColoredIcon from "@/assets/trash-colored.svg"; import VerticalDots from "@/assets/dots-vertical.svg"; @@ -52,7 +51,6 @@ export interface ModelsSidebarProps { onDataSourceChange: (dataSource: DataSourceInfo | null) => void; versionsCount?: number; onVersionsOpen?: () => void; - onReprofile?: (schema: Dataschema) => void; } const icons = { @@ -82,7 +80,6 @@ const ModelsSidebar: FC = ({ dataSourceId, versionsCount, onVersionsOpen, - onReprofile, }) => { const { t } = useTranslation(["models", "common"]); @@ -221,24 +218,6 @@ const ModelsSidebar: FC = ({ align="center" size={8} > - {onReprofile && isSmartGenerated(f.code || "") && ( - - )} void; versionsCount?: number; onVersionsOpen?: () => void; - onReprofile?: (schema: Dataschema) => void; - reprofileTarget?: { table: string; schema: string } | null; cubeRegistry?: CubeRegistry; onRefreshRegistry?: () => void; } @@ -145,8 +142,6 @@ export const Models: React.FC = ({ onConnect, versionsCount, onVersionsOpen, - onReprofile, - reprofileTarget, cubeRegistry, onRefreshRegistry, }) => { @@ -269,7 +264,6 @@ export const Models: React.FC = ({ dataSourceId={dataSource?.id} versionsCount={versionsCount} onVersionsOpen={onVersionsOpen} - onReprofile={onReprofile} /> } @@ -333,16 +327,8 @@ export const Models: React.FC = ({ branches={branches} onComplete={onSmartGenComplete} onCancel={onModalClose} - initialTable={ - reprofileTarget?.table ?? - smartGenQueryTarget?.table ?? - undefined - } - initialSchema={ - reprofileTarget?.schema ?? - smartGenQueryTarget?.schema ?? - undefined - } + initialTable={smartGenQueryTarget?.table ?? undefined} + initialSchema={smartGenQueryTarget?.schema ?? undefined} /> @@ -427,13 +413,7 @@ const ModelsWrapper: React.FC = () => { variables: { branch_id: currentBranch?.id }, }); - const [reprofileTarget, setReprofileTarget] = useState<{ - table: string; - schema: string; - } | null>(null); - const onModalClose = (goBack: boolean = false) => { - setReprofileTarget(null); if (history.state && goBack) { history.back(); } else { @@ -643,20 +623,6 @@ const ModelsWrapper: React.FC = () => { onModalClose(true); }; - const onReprofile = (fileSchema: Dataschema) => { - // Parse source table/schema from the model's provenance metadata - const provenance = parseProvenance(fileSchema.code || ""); - if (provenance?.sourceTable && provenance?.sourceDatabase) { - setReprofileTarget({ - table: provenance.sourceTable, - schema: provenance.sourceDatabase, - }); - } else { - setReprofileTarget(null); - } - setLocation(`${basePath}/${curSource?.id}/${currentBranch?.id}/smartgen`); - }; - const fetching = version?.fetching || deleteMutation.fetching || @@ -1001,8 +967,6 @@ const ModelsWrapper: React.FC = () => { `${basePath}/${curSource?.id}/${currentBranch?.id}/versions` ) } - onReprofile={isClickHouse ? onReprofile : undefined} - reprofileTarget={reprofileTarget} cubeRegistry={cubeRegistry} onRefreshRegistry={refreshRegistry} />