From f5f338fa73d29b0f015449f8981815c1519fbe07 Mon Sep 17 00:00:00 2001 From: Suhaha Date: Mon, 30 Dec 2024 16:45:52 +0800 Subject: [PATCH] archive: dm docs (#571) --- src/components/Dropdown/VersionSelect.tsx | 3 --- src/shared/resources.ts | 15 --------------- src/templates/DocSearchTemplate.tsx | 8 -------- 3 files changed, 26 deletions(-) diff --git a/src/components/Dropdown/VersionSelect.tsx b/src/components/Dropdown/VersionSelect.tsx index ad0650fee..ac74c9148 100644 --- a/src/components/Dropdown/VersionSelect.tsx +++ b/src/components/Dropdown/VersionSelect.tsx @@ -439,9 +439,6 @@ function generateArchivedWebsiteUrlByLangAndType(lang?: string, type?: string) { case "tidb-in-kubernetes": url = `${url}/tidb-in-kubernetes/v1.0`; break; - case "tidb-data-migration": - url = `${url}/tidb-data-migration/v1.0`; - break; default: break; } diff --git a/src/shared/resources.ts b/src/shared/resources.ts index 355c1eb1a..c0d46c516 100644 --- a/src/shared/resources.ts +++ b/src/shared/resources.ts @@ -497,9 +497,6 @@ export const TIDB_EN_SEARCH_INDEX_VERSION = CONFIG["docs"]["tidb"]["searchIndex"]["en"] || []; export const TIDB_ZH_SEARCH_INDEX_VERSION = CONFIG["docs"]["tidb"]["searchIndex"]["zh"] || []; -export const DM_EN_LATEST_VERSION = - CONFIG["docs"]["tidb-data-migration"]["languages"]["en"]["versions"][0]; -export const DM_EN_STABLE_VERSION = ""; export const OP_EN_STABLE_VERSION = CONFIG["docs"]["tidb-in-kubernetes"]["stable"]; @@ -510,10 +507,6 @@ export const TIDB_ZH_VERSIONS = CONFIG["docs"]["tidb"]["languages"]["zh"][ "versions" ].map((d) => convertVersionName(d, "")); -export const DM_EN_VERSIONS = CONFIG["docs"]["tidb-data-migration"][ - "languages" -]["en"]["versions"].map((d) => convertVersionName(d, DM_EN_STABLE_VERSION)); - export const OP_EN_VERSIONS = CONFIG["docs"]["tidb-in-kubernetes"]["languages"][ "en" ]["versions"].map((d) => convertVersionName(d, OP_EN_STABLE_VERSION)); @@ -533,10 +526,6 @@ export const EN_DOC_TYPE_LIST = [ name: "TiDB in Kubernetes", match: "tidb-in-kubernetes", }, - { - name: "TiDB Data Migration (DM)", - match: "tidb-data-migration", - }, ] as const; export const ZH_DOC_TYPE_LIST = [ @@ -548,10 +537,6 @@ export const ZH_DOC_TYPE_LIST = [ name: "TiDB in Kubernetes", match: "tidb-in-kubernetes", }, - { - name: "TiDB Data Migration (DM)", - match: "tidb-data-migration", - }, ]; export const ARCHIVE_WEBSITE_URL = "https://docs-archive.pingcap.com"; diff --git a/src/templates/DocSearchTemplate.tsx b/src/templates/DocSearchTemplate.tsx index 22c37a5e2..552ca396a 100644 --- a/src/templates/DocSearchTemplate.tsx +++ b/src/templates/DocSearchTemplate.tsx @@ -21,7 +21,6 @@ import { algoliaClient } from "shared/utils/algolia"; import { TIDB_EN_STABLE_VERSION, TIDB_EN_SEARCH_INDEX_VERSION, - DM_EN_LATEST_VERSION, OP_EN_STABLE_VERSION, CLOUD_EN_VERSIONS, EN_DOC_TYPE_LIST, @@ -34,11 +33,8 @@ import { FeedbackSurveyCampaign } from "components/Campaign/FeedbackSurvey"; // TiDB: get searchable versions from fetchTidbSearchIndcies // TiDB Cloud: only has one version // TiDB Operator: get stable version -// TiDB Data Migration: get latest version const fetchVersionListByDocType = (docType: string, lang: string) => { switch (docType) { - case "tidb-data-migration": - return [DM_EN_LATEST_VERSION]; case "tidb-in-kubernetes": return [OP_EN_STABLE_VERSION]; case "tidbcloud": @@ -63,8 +59,6 @@ function replaceStableVersion(match: string) { switch (match) { case "tidb": return TIDB_EN_STABLE_VERSION; - // case "tidb-data-migration": - // return DM_EN_STABLE_VERSION; case "tidb-in-kubernetes": return OP_EN_STABLE_VERSION; default: @@ -111,8 +105,6 @@ const getSearchIndexVersion = ( const latestVersion = versions[0]; const stableVersion = TIDB_EN_STABLE_VERSION?.replace("release-", "v"); return latestVersion || stableVersion; - case "tidb-data-migration": - return DM_EN_LATEST_VERSION?.replace("release-", "v"); case "tidb-in-kubernetes": return OP_EN_STABLE_VERSION?.replace("release-", "v"); default: