Skip to content

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

refactor(sql-editor): replace SQL Editor menu with Go Back (#796)

Yunwei Xiao35bda89ba132
diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.yml
index 78ac7065fc..5148106700 100644
--- a/frontend/src/locales/en.yml
+++ b/frontend/src/locales/en.yml
@@ -1161,6 +1161,7 @@ sql-editor:
read
public: Public
public-desc: Sheet OWNER can read/write, and all others can read
+ go-back: Go Back
label:
empty-label-value: <Empty Value>
no-label: No labels
diff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.yml
index 42ead49c31..cfda3b06ff 100644
--- a/frontend/src/locales/zh-CN.yml
+++ b/frontend/src/locales/zh-CN.yml
@@ -1020,6 +1020,7 @@ sql-editor:
project-desc: 工作表所有者或者项目所有者拥有读、写权限,项目开发者拥有只读权限
public: 公开
public-desc: 工作表所有者拥有读写权限,其他人只拥有只读权限.
+ go-back: 返回
label:
empty-label-value: <空值>
no-label: 没有标签
diff --git a/frontend/src/views/SqlEditor/EditorHeader.vue b/frontend/src/views/SqlEditor/EditorHeader.vue
index 1c8503e27d..5bbd5b0b59 100644
--- a/frontend/src/views/SqlEditor/EditorHeader.vue
+++ b/frontend/src/views/SqlEditor/EditorHeader.vue
@@ -12,9 +12,9 @@
</div>
<div class="hidden sm:block">
<div class="ml-6 flex items-baseline space-x-1">
- <router-link to="/sql-editor" class="bar-link px-2 py-2 rounded-md">
- {{ $t("sql-editor.self") }}
- </router-link>
+ <a href="#" class="bar-link px-2 py-2 rounded-md" @click="goBack">
+ {{ $t("sql-editor.go-back") }}
+ </a>
</div>
</div>
</div>
@@ -245,12 +245,21 @@ export default defineComponent({
]);
useRegisterActions(i18nActions);
+ const goBack = () => {
+ if (window.history.state?.back) {
+ router.go(-1);
+ } else {
+ router.push("/");
+ }
+ };
+
return {
state,
showDBAItem,
showSwitchPlan,
inboxSummary,
toggleLocales,
+ goBack,
};
},
});