Skip to content

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

chore: hide OAuth2 succeed message and non-select warning dialog buttons (#8576)

boojack061a6afdad4e
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index d5ed0516c7..14f8467363 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -1,5 +1,4 @@
<template>
- <!-- it is recommended by naive-ui that we leave the local to null when the language is en -->
<NConfigProvider
:key="key"
:locale="generalLang"
diff --git a/frontend/src/layouts/SQLEditorLayout.vue b/frontend/src/layouts/SQLEditorLayout.vue
index 888760d0f0..206b0a1b3a 100644
--- a/frontend/src/layouts/SQLEditorLayout.vue
+++ b/frontend/src/layouts/SQLEditorLayout.vue
@@ -26,7 +26,6 @@
<script lang="ts" setup>
import { useLocalStorage } from "@vueuse/core";
import { computed, onMounted } from "vue";
-import { useRoute } from "vue-router";
import BannersWrapper from "@/components/BannersWrapper.vue";
import ProvideSQLEditorContext from "@/components/ProvideSQLEditorContext.vue";
import {
@@ -38,23 +37,23 @@ import { SQLEditorMode } from "@/types";
const actuatorStore = useActuatorV1Store();
const sqlEditorStore = useSQLEditorStore();
-const route = useRoute();
const showBanners = computed(() => {
return sqlEditorStore.mode === "BUNDLED";
});
onMounted(() => {
- let mode = route.query.mode as SQLEditorMode;
- const storage = useLocalStorage<SQLEditorMode>(
+ const searchParams = new URLSearchParams(window.location.search);
+ let mode = (searchParams.get("mode") || "BUNDLED") as SQLEditorMode;
+ const cachedMode = useLocalStorage<SQLEditorMode>(
"bb.sql-editor.mode",
"BUNDLED"
);
if (mode != "BUNDLED" && mode != "STANDALONE") {
- mode = storage.value;
+ mode = cachedMode.value;
}
- storage.value = mode;
+ cachedMode.value = mode;
sqlEditorStore.setSQLEditorState({
mode,
});
diff --git a/frontend/src/views/OAuthCallback.vue b/frontend/src/views/OAuthCallback.vue
index f4d8f4483d..6483c619d3 100644
--- a/frontend/src/views/OAuthCallback.vue
+++ b/frontend/src/views/OAuthCallback.vue
@@ -1,7 +1,7 @@
<template>
<div class="p-4">
- <div>{{ state.message }}</div>
<div v-if="state.hasError" class="mt-2">
+ <div>{{ state.message }}</div>
<button
v-if="state.oAuthState?.popup"
type="button"
diff --git a/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue b/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue
index 48e0f5451f..7aa73a91f2 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue
@@ -21,7 +21,7 @@
<template #action>
<strong>
{{
- sqlEditorStore.mode === "BUNDLED"
+ showActionButtons
? isDDL
? $t("database.edit-schema")
: $t("database.change-data")
@@ -31,7 +31,7 @@
</template>
<template #reaction>
{{
- sqlEditorStore.mode === "BUNDLED"
+ showActionButtons
? $t("sql-editor.and-submit-an-issue")
: $t("sql-editor.to-enable-admin-mode")
}}
@@ -43,7 +43,7 @@
<div class="execute-hint-content mt-4 flex justify-between">
<div
- v-if="sqlEditorStore.mode === 'BUNDLED'"
+ v-if="showActionButtons"
class="flex justify-start items-center space-x-2"
>
<AdminModeButton @enter="$emit('close')" />
@@ -51,7 +51,7 @@
<div class="flex flex-1 justify-end items-center space-x-2">
<NButton @click="handleClose">{{ $t("common.close") }}</NButton>
<NButton
- v-if="sqlEditorStore.mode === 'BUNDLED'"
+ v-if="showActionButtons"
type="primary"
@click="gotoCreateIssue"
>
@@ -98,6 +98,8 @@ const isDDL = computed(() => {
return data !== null ? isDDLStatement(data, "some") : false;
});
+const showActionButtons = computed(() => sqlEditorStore.mode === "BUNDLED");
+
const handleClose = () => {
emit("close");
};