Skip to content

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

chore: remove strictProject field from SQL editor store (#17306)

boojack2fcac8d0edb3
diff --git a/frontend/src/components/ProvideSQLEditorContext.vue b/frontend/src/components/ProvideSQLEditorContext.vue
index bce84fc757..42a0572c50 100644
--- a/frontend/src/components/ProvideSQLEditorContext.vue
+++ b/frontend/src/components/ProvideSQLEditorContext.vue
@@ -1,7 +1,6 @@
<template>
<teleport to="#sql-editor-debug">
<li>[ProvideContext]project: {{ editorStore.project }}</li>
- <li>[ProvideContext]strictProject: {{ editorStore.strictProject }}</li>
<li>
[ProvideContext]projectContextReady:
{{ editorStore.projectContextReady }}
@@ -119,15 +118,12 @@ const initializeProjects = async () => {
if (typeof projectInQuery === "string" && projectInQuery) {
// Legacy "?project={project}"
project = `projects/${projectInQuery}`;
- editorStore.strictProject = true;
} else if (typeof projectInParams === "string" && projectInParams) {
// "/sql-editor/projects/{project}"
project = `projects/${projectInParams}`;
- editorStore.strictProject = "strict" in route.query;
} else {
// plain "/sql-editor"
project = editorStore.storedLastViewedProject;
- editorStore.strictProject = false;
}
if (isValidProjectName(project)) {
@@ -409,13 +405,6 @@ const syncURLWithConnection = () => {
"database"
);
- if (editorStore.strictProject) {
- // The API is weird
- // `query.strict = null` will generate "&strict" in the query string
- // while `query.strict = ""` will generate "&strict=" in the query string
- // and we prefer the shorter one
- query.strict = null;
- }
if (sheetName) {
const sheet = worksheetStore.getWorksheetByName(sheetName);
if (sheet) {
diff --git a/frontend/src/store/modules/sqlEditor/editor.ts b/frontend/src/store/modules/sqlEditor/editor.ts
index 7a5dff8f1e..35ec114399 100644
--- a/frontend/src/store/modules/sqlEditor/editor.ts
+++ b/frontend/src/store/modules/sqlEditor/editor.ts
@@ -36,8 +36,6 @@ export const useSQLEditorStore = defineStore("sqlEditor", () => {
// empty to "ALL" projects for high-privileged users
const project = ref<string>("");
- // if `true`, won't show project selector and not allowed to switch to other projects
- const strictProject = ref<boolean>(false);
// `false` if we are preparing project-scoped resources
// we should render a skeleton layout with spinner placeholders
const projectContextReady = ref<boolean>(false);
@@ -62,7 +60,6 @@ export const useSQLEditorStore = defineStore("sqlEditor", () => {
return {
resultRowsLimit,
project,
- strictProject,
projectContextReady,
storedLastViewedProject,
allowViewALLProjects,
diff --git a/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue b/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue
index 3e2fd89efb..62eaabb8a7 100644
--- a/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue
+++ b/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue
@@ -14,10 +14,7 @@
<ActionBar />
</div>
<div class="h-full flex-1 flex flex-col overflow-hidden">
- <div
- v-if="!strictProject"
- class="flex flex-row items-center gap-x-1 px-1 py-1 border-b"
- >
+ <div class="flex flex-row items-center gap-x-1 px-1 py-1 border-b">
<ProjectSelect
style="width: 100%"
class="project-select"
@@ -83,8 +80,7 @@ const editorStore = useSQLEditorStore();
const { asidePanelTab } = useSQLEditorContext();
const { isDisconnected } = storeToRefs(useSQLEditorTabStore());
-const { project, projectContextReady, strictProject } =
- storeToRefs(editorStore);
+const { project, projectContextReady } = storeToRefs(editorStore);
const containerRef = ref<HTMLDivElement>();
const { width: containerWidth } = useElementSize(containerRef);
diff --git a/frontend/src/views/sql-editor/TabList/TabList.vue b/frontend/src/views/sql-editor/TabList/TabList.vue
index 97cfa9988c..7dc5ad46ad 100644
--- a/frontend/src/views/sql-editor/TabList/TabList.vue
+++ b/frontend/src/views/sql-editor/TabList/TabList.vue
@@ -68,7 +68,6 @@
import { useResizeObserver } from "@vueuse/core";
import { PlusIcon } from "lucide-vue-next";
import { NScrollbar, useDialog } from "naive-ui";
-import { storeToRefs } from "pinia";
import scrollIntoView from "scroll-into-view-if-needed";
import { ref, reactive, nextTick, computed, onMounted, watch } from "vue";
import { useI18n } from "vue-i18n";
@@ -77,7 +76,6 @@ import ProfileDropdown from "@/components/ProfileDropdown.vue";
import { useEmitteryEventListener } from "@/composables/useEmitteryEventListener";
import {
useAppFeature,
- useSQLEditorStore,
useSQLEditorTabStore,
useTabViewStateStore,
} from "@/store";
@@ -110,7 +108,6 @@ const enableSetting = useAppFeature("bb.feature.sql-editor.enable-setting");
const { events: sheetEvents } = useSheetContext();
const scrollbarRef = ref<InstanceType<typeof NScrollbar>>();
const tabListRef = ref<InstanceType<typeof Draggable>>();
-const { strictProject } = storeToRefs(useSQLEditorStore());
const { removeViewState } = useTabViewStateStore();
const context = provideTabListContext();
const contextMenuRef = ref<InstanceType<typeof ContextMenu>>();
@@ -124,9 +121,6 @@ const hideSettingButton = computed(() => {
if (!enableSetting.value) {
return true;
}
- if (strictProject.value) {
- return true;
- }
return false;
});