Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: add `noguide` flag in dev mode (#2537)
boojack6faa306fbd55
diff --git a/frontend/src/components/CreateInstanceForm.vue b/frontend/src/components/CreateInstanceForm.vueindex c9f77ceda5..7831c53760 100644--- a/frontend/src/components/CreateInstanceForm.vue+++ b/frontend/src/components/CreateInstanceForm.vue@@ -241,7 +241,7 @@</template><script lang="ts" setup>-import { computed, reactive, watch } from "vue";+import { computed, reactive, ref, watch } from "vue";import { useRouter } from "vue-router";import EnvironmentSelect from "./EnvironmentSelect.vue";import CreateDataSourceExample from "./CreateDataSourceExample.vue";@@ -308,6 +308,9 @@ const state = reactive<LocalState>({isCreatingInstance: false,});+// For creating database onboarding guide, we only try to start our embedded sample postgres instance once.+const hasCreatingEmbeddedPostgresInstance = ref(false);+const allowCreate = computed(() => {return state.instance.name && state.instance.host;});@@ -339,7 +342,10 @@ const isInOnboaringCreateDatabaseGuide = computed(() => {});const warningModalOkText = computed(() => {- if (isInOnboaringCreateDatabaseGuide.value) {+ if (+ isInOnboaringCreateDatabaseGuide.value &&+ !hasCreatingEmbeddedPostgresInstance.value+ ) {return t("instance.add-a-postgresql-sample-instance");} else {return t("instance.ignore-and-create");@@ -430,7 +436,10 @@ const updateInstance = (field: string, value: string) => {const handleWarningModalOkClick = async () => {// When user get the warning of incorrect instance info in creating database onboarding guide,// we'd like to display the `create an embedded PostgreSQL database` button instead of `ignore and create`.- if (isInOnboaringCreateDatabaseGuide.value) {+ if (+ isInOnboaringCreateDatabaseGuide.value &&+ !hasCreatingEmbeddedPostgresInstance.value+ ) {const connectionInfo =await useInstanceStore().createEmbeddedPostgresInstance();state.instance = {@@ -447,6 +456,7 @@ const handleWarningModalOkClick = async () => {title: t("common.success"),description: t("instance.successfully-created-postgresql-instance"),});+ hasCreatingEmbeddedPostgresInstance.value = true;state.showCreateInstanceWarningModal = false;} else {state.showCreateInstanceWarningModal = false;diff --git a/frontend/src/components/OnboardingGuide.vue b/frontend/src/components/OnboardingGuide.vueindex 5edc95e3f3..c854ccccfc 100644--- a/frontend/src/components/OnboardingGuide.vue+++ b/frontend/src/components/OnboardingGuide.vue@@ -5,7 +5,8 @@</template><script lang="ts" setup>-import { ref, watch } from "vue";+import { onMounted, ref, watch } from "vue";+import { useRoute, useRouter } from "vue-router";import {useCurrentUser,useProjectStore,@@ -14,7 +15,7 @@ import {useOnboardingGuideStore,} from "@/store";import { UNKNOWN_ID } from "@/types";-import { isOwner } from "@/utils";+import { isDev, isOwner } from "@/utils";import CreateDatabaseGuide from "./OnboardingGuides/CreateDatabaseGuide.vue";const currentUser = useCurrentUser();@@ -22,7 +23,26 @@ const guideStore = useOnboardingGuideStore();const shouldShowCreateDatabaseGuide = ref(false);+const route = useRoute();+const router = useRouter();++onMounted(async () => {+ await router.isReady();+ if (currentUser.value.id !== UNKNOWN_ID) {+ shouldShowCreateDatabaseGuide.value =+ await checkShouldShowCreateDatabaseGuide();+ if (shouldShowCreateDatabaseGuide.value) {+ guideStore.setGuideName("create-database");+ }+ }+});+const checkShouldShowCreateDatabaseGuide = async () => {+ // Do not show guide in dev mode and `noguide` flag in query.+ if (isDev() && route.query.noguide) {+ return false;+ }+// Show create database guide when user is owner and no data at all.if (isOwner(currentUser.value.role)) {const instanceList = await useInstanceStore().fetchInstanceList();@@ -42,22 +62,16 @@ const checkShouldShowCreateDatabaseGuide = async () => {return false;};-watch(- currentUser,- async () => {- // Check should show guide only when user is logged in.- if (currentUser.value.id !== UNKNOWN_ID) {- shouldShowCreateDatabaseGuide.value =- await checkShouldShowCreateDatabaseGuide();- if (shouldShowCreateDatabaseGuide.value) {- guideStore.setGuideName("create-database");- }+watch(currentUser, async () => {+ // Check should show guide only when user is logged in.+ if (currentUser.value.id !== UNKNOWN_ID) {+ shouldShowCreateDatabaseGuide.value =+ await checkShouldShowCreateDatabaseGuide();+ if (shouldShowCreateDatabaseGuide.value) {+ guideStore.setGuideName("create-database");}- },- {- immediate: true,}-);+});watch(guideStore,diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex a8a7b8b63c..0d8e97f889 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -1575,7 +1575,7 @@"click-new-project": "Click \"New Project\" to create a project","click-new-database": "Click \"New Database\" to create a database","click-approve": "Click \"Approve\" to perform the issue",- "wait-issue-finished": "Wait the issue finished",+ "wait-issue-finished": "...waiting for the issue finished","back-to-home": "Back to home","finished-dialog": {"you-have-done": "You have done:",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex e281144444..94cfecc849 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -1575,7 +1575,7 @@"click-new-project": "点击\"创建项目\"按钮","click-new-database": "点击\"创建数据库\"按钮","click-approve": "点击\"批准\"按钮来执行这个工单",- "wait-issue-finished": "等待工单完成中",+ "wait-issue-finished": "...等待工单执行完成","back-to-home": "回到主页","finished-dialog": {"you-have-done": "你已经完成了:",diff --git a/frontend/src/types/onboardingGuide.ts b/frontend/src/types/onboardingGuide.tsindex 7c3a98617e..279b10fcb5 100644--- a/frontend/src/types/onboardingGuide.ts+++ b/frontend/src/types/onboardingGuide.ts@@ -1 +1,2 @@+// OnboardingGuideType is type for the unique names of onboarding guide.export type OnboardingGuideType = "create-database";diff --git a/frontend/vite.config.ts b/frontend/vite.config.tsindex 1f2a36163e..9307098ccd 100644--- a/frontend/vite.config.ts+++ b/frontend/vite.config.ts@@ -16,6 +16,7 @@ export default defineConfig(() => {const IS_RUNNING_GITPOD =process.env["GITPOD_WORKSPACE_ID"] !== null &&process.env["GITPOD_WORKSPACE_ID"] !== undefined;+return {plugins: [vue(),@@ -49,7 +50,7 @@ export default defineConfig(() => {"/api": {target: "http://localhost:8080/api",changeOrigin: true,- rewrite: (path) => path.replace(/^\/api/, ""),+ rewrite: (path: string) => path.replace(/^\/api/, ""),},},hmr: {