Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: replace ts config file with json file (#1970)

ZhengXe4ce81a1dec5
diff --git a/frontend/public/help/README.md b/frontend/public/help/README.md
index 676ff67135..1fae1697ac 100644
--- a/frontend/public/help/README.md
+++ b/frontend/public/help/README.md
@@ -3,3 +3,23 @@
Let's name our help files based on routes/domains, and all files should start with `help.` to indicate that it is a help doc. For example, `help.environment.md` is the help file that stands for the whole `/environment` page. If you want to create a more detailed help file to explain *Approval Policy* under `\environment`, you can name the file to `help.environment.approval-policy.md`.
If the objective of the explanation doesn't belong to any specific route/domain, we can name it with `help.global...`.
+
+## Route map configuration guide
+
+File `routeMap.json` contains the configuration for the help system.
+
+It maps from the route name to the help document name. If you're going to add a new mapping rule, you can add a new line in it.
+
+The format is:
+
+```json
+ "name of route": "markdown's file name without '.md'"
+```
+
+For example, `"workspace.project": "help.project"` means let's connect the `help.project.md` file with the route `/project`.
+
+Note:
+
+1. Configs here only works on `/issue`, `/project`, `/db`, `/instance`, `/environment` and `/setting`. If you want to add help in other places, please ask developers for help.
+
+2. Make sure that the markdown file is available in both `/en` and `/zh` directory.
\ No newline at end of file
diff --git a/frontend/public/help/config.ts b/frontend/public/help/config.ts
deleted file mode 100644
index 280abf60d1..0000000000
--- a/frontend/public/help/config.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-// This file contains the configuration for the help system.
-
-// Below is a mapping object from the route name to the help document name.
-// If you're going to add a new mapping rule, you can add a new line between the curly brackets {}.
-// The format is:
-//
-// "name of route": "markdown's file name without '.md'",
-//
-// For example, "workspace.project": "help.project" means let's connect the help.project.md file with the route "/project".
-//
-// Note: 1. Configs here only works on /issue, /project, /db, /instance, /environment and /setting. If you
-// want to add help in other places, please ask developers for help.
-// 2. Make sure that the markdown file is in both /en and /zh directory.
-
-export const routeHelpNameMap = {
- "workspace.project": "help.project",
- "workspace.instance": "help.instance",
- "workspace.database": "help.database",
- "workspace.environment": "help.environment",
-};
diff --git a/frontend/public/help/routeMap.json b/frontend/public/help/routeMap.json
new file mode 100644
index 0000000000..0a5bf51320
--- /dev/null
+++ b/frontend/public/help/routeMap.json
@@ -0,0 +1,6 @@
+{
+ "workspace.project": "help.project",
+ "workspace.instance": "help.instance",
+ "workspace.database": "help.database",
+ "workspace.environment": "help.environment"
+}
diff --git a/frontend/src/components/Breadcrumb.vue b/frontend/src/components/Breadcrumb.vue
index ea92b4a7aa..3ae93e9515 100644
--- a/frontend/src/components/Breadcrumb.vue
+++ b/frontend/src/components/Breadcrumb.vue
@@ -74,7 +74,7 @@ import {
useProjectStore,
} from "@/store";
import HelpTriggerIcon from "@/components/HelpTriggerIcon.vue";
-import { routeHelpNameMap } from "../../public/help/config";
+import routeHelpNameMap from "../../public/help/routeMap.json";
interface BreadcrumbItem {
name: string;