Skip to content

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

fix(frontend): add global dismiss option for help drawer modals (#19293)

peterzclaw5cf298c1a954
diff --git a/frontend/src/components/HelpDrawer/HelpDrawer.vue b/frontend/src/components/HelpDrawer/HelpDrawer.vue
index 441435e549..aae3811657 100644
--- a/frontend/src/components/HelpDrawer/HelpDrawer.vue
+++ b/frontend/src/components/HelpDrawer/HelpDrawer.vue
@@ -13,7 +13,15 @@
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="state.html" class="overflow-auto" v-html="state.html"></div>
<template #footer>
- <div class="flex flex-row justify-center pb-10">
+ <div class="flex flex-col items-center gap-y-4 pb-10">
+ <NButton
+ v-if="isGuide"
+ text
+ size="small"
+ @click="onDismissAll"
+ >
+ {{ $t("help-drawer.dont-show-again") }}
+ </NButton>
<div
v-if="locale === 'zh-CN'"
class="w-full flex flex-col items-center pt-2"
@@ -56,6 +64,7 @@
<script lang="ts" setup>
import type { Node, Tag } from "@markdoc/markdoc";
+import { NButton } from "naive-ui";
import { storeToRefs } from "pinia";
import { computed, reactive, ref, watch } from "vue";
import { useRoute } from "vue-router";
@@ -125,7 +134,11 @@ watch(
(pair) => pair.routeName === routeName
)?.helpName;
- if (helpId && !uiStateStore.getIntroStateByKey(`${helpId}`)) {
+ if (
+ helpId &&
+ !uiStateStore.allHelpDrawersDismissed &&
+ !uiStateStore.getIntroStateByKey(`${helpId}`)
+ ) {
state.helpTimer = window.setTimeout(() => {
helpStore.showHelp(helpId, true);
uiStateStore.saveIntroStateByKey({
@@ -163,6 +176,11 @@ watch(helpId, async (id) => {
}
});
+const onDismissAll = () => {
+ uiStateStore.allHelpDrawersDismissed = true;
+ helpStore.exitHelp();
+};
+
const onClose = () => {
if (isGuide.value) {
if (!uiStateStore.getIntroStateByKey(`${helpId.value}`)) {
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 0362f1f61f..372167a278 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -2878,5 +2878,8 @@
"permissions": "This application will be able to:",
"permission-access": "Access your Bytebase account with your permissions"
}
+ },
+ "help-drawer": {
+ "dont-show-again": "Don't show these tips again"
}
}
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 5b79c69d87..7dfe26df4c 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -2878,5 +2878,8 @@
"permissions": "Esta aplicación podrá:",
"permission-access": "Acceder a tu cuenta de Bytebase con tus permisos"
}
+ },
+ "help-drawer": {
+ "dont-show-again": "No mostrar estos consejos de nuevo"
}
}
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index c86226c096..5159da929c 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -2878,5 +2878,8 @@
"permissions": "このアプリケーションは以下のことができます:",
"permission-access": "あなたの権限で Bytebase アカウントにアクセス"
}
+ },
+ "help-drawer": {
+ "dont-show-again": "これらのヒントを再度表示しない"
}
}
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 2b6d68f9a8..37a049639f 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -2878,5 +2878,8 @@
"permissions": "Ứng dụng này sẽ có thể:",
"permission-access": "Truy cập tài khoản Bytebase của bạn với quyền hạn của bạn"
}
+ },
+ "help-drawer": {
+ "dont-show-again": "Không hiển thị các mẹo này nữa"
}
}
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 4135ebfde9..4f20cba8bf 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -2878,5 +2878,8 @@
"permissions": "此应用程序将能够:",
"permission-access": "使用您的权限访问您的 Bytebase 账户"
}
+ },
+ "help-drawer": {
+ "dont-show-again": "不再显示这些提示"
}
}
diff --git a/frontend/src/store/modules/uistate.ts b/frontend/src/store/modules/uistate.ts
index 44d4f3b952..263c7f7359 100644
--- a/frontend/src/store/modules/uistate.ts
+++ b/frontend/src/store/modules/uistate.ts
@@ -1,7 +1,9 @@
+import { useLocalStorage } from "@vueuse/core";
import { defineStore } from "pinia";
import { computed } from "vue";
import { useCurrentUserV1 } from "@/store";
import {
+ STORAGE_KEY_HELP_DRAWERS_DISMISSED,
storageKeyCollapseState,
storageKeyIntroState,
useDynamicLocalStorage,
@@ -20,6 +22,11 @@ export const useUIStateStore = defineStore("uistate", () => {
{}
);
+ const allHelpDrawersDismissed = useLocalStorage(
+ STORAGE_KEY_HELP_DRAWERS_DISMISSED,
+ false
+ );
+
const getIntroStateByKey = (key: string): boolean => {
return introState.value[key] ?? false;
};
@@ -40,6 +47,7 @@ export const useUIStateStore = defineStore("uistate", () => {
};
return {
+ allHelpDrawersDismissed,
collapseState,
introState,
saveIntroStateByKey,
diff --git a/frontend/src/utils/storage-keys.ts b/frontend/src/utils/storage-keys.ts
index 2452e9b7da..f649def4f6 100644
--- a/frontend/src/utils/storage-keys.ts
+++ b/frontend/src/utils/storage-keys.ts
@@ -11,6 +11,8 @@ export const STORAGE_KEY_SCHEMA_EDITOR_PREVIEW =
export const STORAGE_KEY_ROLES_EXPIRATION =
"bb.roles.last-expiration-selection";
export const STORAGE_KEY_AI_DISMISS = "bb.ai.dismiss-placeholder";
+export const STORAGE_KEY_HELP_DRAWERS_DISMISSED =
+ "bb.help-drawers.all-dismissed";
export const STORAGE_KEY_SQL_EDITOR_RESULT_LIMIT = "bb.sql-editor.result-limit";
export const STORAGE_KEY_SQL_EDITOR_REDIS_NODE = "bb.sql-editor.redis-node";
export const STORAGE_KEY_SQL_EDITOR_LAST_PROJECT = "bb.sql-editor.last-project";