Skip to content

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

fix: jump out of sql editor page (#7986)

ecmadao18d49c754192
diff --git a/frontend/src/components/Issue/panel/RequestExportPanel/index.vue b/frontend/src/components/Issue/panel/RequestExportPanel/index.vue
index 4b50f09776..3bc1bd0223 100644
--- a/frontend/src/components/Issue/panel/RequestExportPanel/index.vue
+++ b/frontend/src/components/Issue/panel/RequestExportPanel/index.vue
@@ -140,6 +140,7 @@ import {
useDatabaseV1Store,
useIssueStore,
useProjectV1Store,
+ pushNotification,
} from "@/store";
import {
DatabaseResource,
@@ -172,9 +173,10 @@ interface LocalState {
const props = defineProps<{
databaseId?: string;
statement?: string;
+ redirectToIssuePage?: boolean;
}>();
-defineEmits<{
+const emit = defineEmits<{
(event: "close"): void;
}>();
@@ -330,7 +332,21 @@ const doCreateIssue = async () => {
};
const issue = await useIssueStore().createIssue(newIssue);
- router.push(`/issue/${issueSlug(issue.name, issue.id)}`);
+
+ pushNotification({
+ module: "bytebase",
+ style: "INFO",
+ title: t("issue.grant-request.request-sent"),
+ });
+
+ if (props.redirectToIssuePage) {
+ const route = router.resolve({
+ path: `/issue/${issueSlug(issue.name, issue.id)}`,
+ });
+ window.open(route.href, "_blank");
+ }
+
+ emit("close");
};
const generateIssueName = () => {
diff --git a/frontend/src/components/QuickActionPanel.vue b/frontend/src/components/QuickActionPanel.vue
index 6e375f0741..acd985e571 100644
--- a/frontend/src/components/QuickActionPanel.vue
+++ b/frontend/src/components/QuickActionPanel.vue
@@ -279,6 +279,7 @@
<RequestExportPanel
v-if="state.showRequestExportPanel"
+ :redirect-to-issue-page="true"
@close="state.showRequestExportPanel = false"
/>
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index b2c9ae8af8..816243b5ae 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -903,6 +903,7 @@
"customize": "Customize",
"data-export-attention": "The data will be exported to a file and downloaded to your local machine. And you can only do the export action once.",
"export-method": "Export method",
+ "request-sent": "Request sent",
"please-select-database-first": "Please select database first"
},
"review-sent-back": "Review sent back",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 7ca2c7e08f..1cf8a22356 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -902,6 +902,7 @@
"customize": "personalice",
"data-export-attention": "Los datos se exportarán a un archivo y se descargarán en su computadora local. Y solo puede realizar la acción de exportación una vez.",
"export-method": "Método de exportación",
+ "request-sent": "Solicitud enviada",
"please-select-database-first": "Por favor, seleccione primero la base de datos"
},
"review-sent-back": "Revisión devuelta",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 7b98c634c2..3bef0ef4db 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -900,6 +900,7 @@
"customize": "自定义",
"data-export-attention": "数据将被导出到一个文件并自动下载。而且您只能完成一次导出操作。",
"export-method": "导出方式",
+ "request-sent": "导出请求已发送",
"please-select-database-first": "请先选择数据库"
},
"review-sent-back": "审核被退回",
diff --git a/frontend/src/plugins/ai/components/AIChatToSQL.vue b/frontend/src/plugins/ai/components/AIChatToSQL.vue
index 2b81d91d82..59cdbfc0a0 100644
--- a/frontend/src/plugins/ai/components/AIChatToSQL.vue
+++ b/frontend/src/plugins/ai/components/AIChatToSQL.vue
@@ -1,6 +1,6 @@
<template>
<ChatPanel v-if="openAIKey" />
- <MockInputPlaceholder v-else />
+ <MockInputPlaceholder v-else-if="allowConfig" />
</template>
<script lang="ts" setup>
@@ -24,6 +24,15 @@ type LocalState = {
showHistoryDialog: boolean;
};
+withDefaults(
+ defineProps<{
+ allowConfig?: boolean;
+ }>(),
+ {
+ allowConfig: true,
+ }
+);
+
const emit = defineEmits<{
(
event: "apply-statement",
diff --git a/frontend/src/views/ExportCenter/index.vue b/frontend/src/views/ExportCenter/index.vue
index 6a2910cfff..77968c7e81 100644
--- a/frontend/src/views/ExportCenter/index.vue
+++ b/frontend/src/views/ExportCenter/index.vue
@@ -46,6 +46,7 @@
<RequestExportPanel
v-if="state.showRequestExportPanel"
+ :redirect-to-issue-page="true"
@close="state.showRequestExportPanel = false"
/>
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
index 6a904fb512..d547cefddd 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
@@ -120,6 +120,7 @@
v-if="state.showRequestExportPanel"
:database-id="currentTab.connection.databaseId"
:statement="result.statement"
+ :redirect-to-issue-page="sqlEditorStore.mode === 'BUNDLED'"
@close="state.showRequestExportPanel = false"
/>
</template>
@@ -147,6 +148,7 @@ import {
featureToRef,
useDatabaseV1Store,
useCurrentUserV1,
+ useSQLEditorStore,
} from "@/store";
import { useExportData } from "@/store/modules/export";
import {
@@ -200,6 +202,7 @@ const tabStore = useTabStore();
const instanceStore = useInstanceV1Store();
const databaseStore = useDatabaseV1Store();
const currentUserV1 = useCurrentUserV1();
+const sqlEditorStore = useSQLEditorStore();
const dataTable = ref<InstanceType<typeof DataTable>>();
const { exportData } = useExportData();
const currentTab = computed(() => tabStore.currentTab);
@@ -237,10 +240,6 @@ const showExportButton = computed(() => {
});
const allowToExportData = computed(() => {
- if (!featureToRef("bb.feature.access-control").value) {
- return true;
- }
-
if (
hasWorkspacePermissionV1(
"bb.permission.workspace.manage-access-control",
diff --git a/frontend/src/views/sql-editor/EditorPanel/EditorPanel.vue b/frontend/src/views/sql-editor/EditorPanel/EditorPanel.vue
index 476533a6d7..758c6c397d 100644
--- a/frontend/src/views/sql-editor/EditorPanel/EditorPanel.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/EditorPanel.vue
@@ -12,6 +12,7 @@
<AIChatToSQL
v-if="!tabStore.isDisconnected"
+ :allow-config="sqlEditorStore.mode === 'BUNDLED'"
@apply-statement="handleApplyStatement"
/>
@@ -25,7 +26,12 @@
import { ref } from "vue";
import { useExecuteSQL } from "@/composables/useExecuteSQL";
import { AIChatToSQL } from "@/plugins/ai";
-import { useCurrentTab, useInstanceV1Store, useTabStore } from "@/store";
+import {
+ useCurrentTab,
+ useInstanceV1Store,
+ useTabStore,
+ useSQLEditorStore,
+} from "@/store";
import type { Connection, ExecuteConfig, ExecuteOption } from "@/types";
import { formatEngineV1 } from "@/utils";
import {
@@ -40,6 +46,7 @@ import SheetForIssueTipsBar from "./SheetForIssueTipsBar.vue";
const tabStore = useTabStore();
const saveSheetModal = ref<InstanceType<typeof SaveSheetModal>>();
const tab = useCurrentTab();
+const sqlEditorStore = useSQLEditorStore();
const { executeReadonly } = useExecuteSQL();