Skip to content

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

chore: fix export button (#14550)

Liu Ji84e20694e5f9
diff --git a/frontend/src/customAppProfile.ts b/frontend/src/customAppProfile.ts
index 37634d96b0..3e0f44903e 100644
--- a/frontend/src/customAppProfile.ts
+++ b/frontend/src/customAppProfile.ts
@@ -99,7 +99,6 @@ const overrideAppFeatures = (
"bb.feature.hide-trial": true,
"bb.feature.sql-editor.disallow-edit-schema": true,
"bb.feature.sql-editor.sql-check-style": "PREFLIGHT",
- "bb.feature.sql-editor.disallow-export-query-data": true,
"bb.feature.sql-editor.disallow-request-query": true,
"bb.feature.databases.operations": new Set([
"SYNC-SCHEMA",
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
index 9835a32710..d67a3243af 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
@@ -228,6 +228,7 @@ import { isValidDatabaseName, isValidInstanceName } from "@/types";
import { ExportFormat } from "@/types/proto/v1/common";
import { Engine } from "@/types/proto/v1/common";
import { PolicyType } from "@/types/proto/v1/org_policy_service";
+import { DatabaseChangeMode } from "@/types/proto/v1/setting_service";
import type {
QueryResult,
QueryRow,
@@ -282,6 +283,10 @@ const { dark, keyword } = useSQLResultViewContext();
const tabStore = useSQLEditorTabStore();
const editorStore = useSQLEditorStore();
const { exportData } = useExportData();
+const appFeatureDisallowExport = useAppFeature(
+ "bb.feature.sql-editor.disallow-export-query-data"
+);
+const databaseChangeMode = useAppFeature("bb.feature.database-change-mode");
const currentTab = computed(() => tabStore.currentTab);
const { instance: connectedInstance } = useConnectionOfCurrentSQLEditorTab();
@@ -296,10 +301,6 @@ const disallowExportQueryData = computed(() => {
const disableDataExport =
exportDataPolicy.value?.exportDataPolicy?.disable ?? false;
- const appFeatureDisallowExport = useAppFeature(
- "bb.feature.sql-editor.disallow-export-query-data"
- );
-
return disableDataExport || appFeatureDisallowExport.value;
});
@@ -326,12 +327,6 @@ const showSearchFeature = computed(() => {
});
const allowToExportData = computed(() => {
- // The current plan doesn't have access control feature.
- // Fallback to true.
- if (!featureToRef("bb.feature.access-control").value) {
- return true;
- }
-
if (hasWorkspacePermissionV2("bb.policies.update")) {
return true;
}
@@ -344,6 +339,19 @@ const allowToRequestExportData = computed(() => {
if (!database) {
return false;
}
+
+ // The current plan doesn't have access control feature.
+ // Developers can not self-helped to request export.
+ if (!featureToRef("bb.feature.access-control").value) {
+ return false;
+ }
+
+ // SQL Editor Mode has no issues
+ // So we cannot self-helped to request export either.
+ if (databaseChangeMode.value === DatabaseChangeMode.EDITOR) {
+ return false;
+ }
+
if (!isValidDatabaseName(database.name)) {
return false;
}