Skip to content

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

chore: update process bar styles (#2207)

boojack2107c4b926e6
diff --git a/.github/workflows/sql-review.yml b/.github/workflows/sql-review.yml
index 1f9701aecc..9cb48d7ed5 100644
--- a/.github/workflows/sql-review.yml
+++ b/.github/workflows/sql-review.yml
@@ -7,7 +7,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Check SQL
- uses: bytebase/[email protected]
+ uses: bytebase/[email protected]
with:
override-file-path: ./sql-review-override.yml
database-type: POSTGRES
diff --git a/frontend/src/assets/book-demo.webp b/frontend/src/assets/book-demo.webp
new file mode 100644
index 0000000000..e2695829fe
Binary files /dev/null and b/frontend/src/assets/book-demo.webp differ
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index c52e0c4ebe..4caadf3112 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -6,7 +6,7 @@ import i18n from "./plugins/i18n";
import NaiveUI from "./plugins/naive-ui";
import dayjs from "./plugins/dayjs";
import highlight from "./plugins/highlight";
-import "./plugins/demo";
+import mountDemoApp from "./plugins/demo";
import { router } from "./router";
import {
pinia,
@@ -153,4 +153,10 @@ const restoreUser = () => {
};
Promise.all([initActuator(), initSubscription(), restoreUser()]).finally(() => {
app.mount("#app");
+
+ // Try to mount demo vue app instance
+ const serverInfo = useActuatorStore().serverInfo;
+ if ((serverInfo && serverInfo.demo && serverInfo.demoName) || isDev()) {
+ mountDemoApp();
+ }
});
diff --git a/frontend/src/plugins/demo/components/DemoDrawer.vue b/frontend/src/plugins/demo/components/DemoDrawer.vue
deleted file mode 100644
index df3653a85c..0000000000
--- a/frontend/src/plugins/demo/components/DemoDrawer.vue
+++ /dev/null
@@ -1,42 +0,0 @@
-<template>
- <div
- class="demo-drawer-container px-6 py-6 fixed right-0 top-0 w-96 h-screen flex flex-col justify-start items-start shadow-xl bg-white"
- >
- <div
- class="absolute top-4 right-4 w-6 h-6 flex flex-row justify-center items-center rounded cursor-pointer hover:bg-gray-100"
- @click="handleCloseButtonClick"
- >
- <span class="text-2xl -mt-1">&times;</span>
- </div>
- <p class="text-4xl my-2">🎉</p>
- <p class="text-xl font-medium">Demo Completed</p>
- <div class="text-base leading-6 mt-4">
- <p>If you have a question about site</p>
- <p>If you have a question about site</p>
- <p>If you have a question about site</p>
- </div>
- <div class="w-full text-base leading-6 mt-4">
- <p>And here are the other demos:</p>
- <ul class="list-disc ml-6 leading-7 my-1">
- <li>demo1</li>
- <li>demo2</li>
- <li>demo3</li>
- <li>demo4</li>
- </ul>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-const emits = defineEmits(["close"]);
-
-const handleCloseButtonClick = () => {
- emits("close");
-};
-</script>
-
-<style scoped>
-.demo-drawer-container {
- z-index: 10001;
-}
-</style>
diff --git a/frontend/src/plugins/demo/components/DemoWrapper.vue b/frontend/src/plugins/demo/components/DemoWrapper.vue
index 7d190965af..4cf057fee5 100644
--- a/frontend/src/plugins/demo/components/DemoWrapper.vue
+++ b/frontend/src/plugins/demo/components/DemoWrapper.vue
@@ -1,24 +1,17 @@
<template>
- <Transition name="drawer">
- <DemoDrawer v-if="state.showDemoDrawer" @close="handleDemoDrawerClose" />
- </Transition>
- <Transition name="process-bar">
- <ProcessBar
- v-if="state.showProcessBar"
- @finish.once="handleProcessFinished"
- />
- </Transition>
+ <ProcessBar v-if="state.showProcessBar" @close.once="handleProcessClose" />
</template>
<script lang="ts" setup>
-import { onMounted, reactive } from "vue";
+import { onMounted, reactive, watchEffect } from "vue";
+import { useRoute } from "vue-router";
+import { removeDemo } from "..";
import { fetchDemoDataWithName } from "../data";
import useAppStore from "../store";
-import DemoDrawer from "./DemoDrawer.vue";
import ProcessBar from "./ProcessBar.vue";
interface LocalState {
- showDemoDrawer: boolean;
+ completed: boolean;
showProcessBar: boolean;
}
@@ -27,10 +20,11 @@ const props = defineProps<{
}>();
const state = reactive<LocalState>({
- showDemoDrawer: false,
+ completed: false,
showProcessBar: false,
});
+const route = useRoute();
const store = useAppStore();
onMounted(async () => {
@@ -49,32 +43,23 @@ onMounted(async () => {
} catch (error) {
// do nth
}
-});
-const handleDemoDrawerClose = () => {
- state.showDemoDrawer = false;
-};
+ watchEffect(() => {
+ if (state.completed) {
+ return;
+ }
+
+ if (String(route.name).startsWith("auth")) {
+ state.showProcessBar = false;
+ } else {
+ state.showProcessBar = true;
+ }
+ });
+});
-const handleProcessFinished = () => {
- state.showDemoDrawer = true;
+const handleProcessClose = () => {
+ state.showProcessBar = false;
+ state.completed = true;
+ removeDemo();
};
</script>
-
-<style scoped>
-.drawer-enter-active,
-.drawer-leave-active,
-.process-bar-leave-active,
-.process-bar-leave-active {
- @apply transition-all duration-300;
-}
-
-.drawer-enter-from,
-.drawer-leave-to {
- @apply translate-x-full;
-}
-
-.process-bar-enter-from,
-.process-bar-leave-to {
- @apply translate-y-full;
-}
-</style>
diff --git a/frontend/src/plugins/demo/components/ProcessBar.vue b/frontend/src/plugins/demo/components/ProcessBar.vue
index e5e2d37d4f..dcc4b2e7c2 100644
--- a/frontend/src/plugins/demo/components/ProcessBar.vue
+++ b/frontend/src/plugins/demo/components/ProcessBar.vue
@@ -1,7 +1,26 @@
<template>
- <div class="process-bar-container">
+ <div
+ v-show="!showRequestDemoDialog"
+ class="process-bar-container"
+ :class="isCompleted ? 'completed' : ''"
+ >
+ <span
+ v-if="isCompleted"
+ class="absolute right-3 top-3 p-px rounded cursor-pointer hover:bg-gray-100 hover:shadow"
+ @click="handleCloseButtonClick"
+ >
+ <heroicons-outline:x class="w-5 h-auto" />
+ </span>
+ <div
+ v-if="isCompleted"
+ class="w-full flex flex-col justify-start items-start my-2"
+ >
+ <p class="text-gray-800 w-full text-2xl leading-10">
+ <span class="text-3xl mr-2">🎉</span> Demo completed
+ </p>
+ </div>
<div
- v-if="currentProcessData"
+ v-else-if="currentProcessData"
class="w-full flex flex-col justify-start items-start"
>
<p class="text-gray-800 w-full leading-7">
@@ -14,68 +33,129 @@
</p>
<span
class="border px-3 py-1 mt-2 rounded-lg text-indigo-600 bg-indigo-50 cursor-pointer hover:opacity-80"
+ :class="actionButtonFlag ? 'cursor-not-allowed !opacity-80' : ''"
@click="handleBackToDemoButtonClick"
>👉 Get back to Demo</span
>
</div>
+
<div
class="my-4 bg-gray-200 w-full flex flex-row justify-start items-center rounded-full overflow-hidden"
>
<div
- class="h-2 bg-indigo-600 rounded-full transition-all"
+ class="h-1 bg-indigo-600 rounded-full transition-all"
:style="{
width: processBarWidth,
}"
></div>
</div>
<div
- class="w-full grid text-base text-gray-400"
+ class="relative w-full grid text-base text-gray-400"
:class="`grid-cols-${processDataList.length}`"
>
<div
v-for="(processData, index) in processDataList"
:key="index"
- class="select-none text-center first:text-left last:text-right"
- :class="`${
- index <= currentProcessIndex
- ? 'text-indigo-600 cursor-pointer hover:opacity-80'
- : ''
- } ${
- index <= currentProcessIndex + 1
- ? 'cursor-pointer hover:opacity-80'
+ class="select-none flex flex-col justify-start items-center first:items-start last:items-end"
+ :class="`${index <= currentProcessIndex ? 'text-indigo-600' : ''} ${
+ index <= currentProcessIndex + 1 && !isCompleted
+ ? 'cursor-pointer'
: ''
}`"
@click="handleProcessItemClick(processData)"
>
- {{ processData.title }}
+ <span
+ class="absolute -top-6 block w-3 h-3 rounded-full bg-gray-200"
+ :class="`${index <= currentProcessIndex ? 'bg-indigo-600' : ''}`"
+ ></span>
+ <p>{{ processData.title }}</p>
+ </div>
+ </div>
+
+ <div
+ v-if="isCompleted"
+ class="w-full mt-6 flex flex-col justify-start items-start"
+ >
+ <div class="w-full flex flex-row justify-between items-center">
+ <button
+ class="w-auto flex flex-row justify-center items-center border px-3 leading-10 select-none rounded-md hover:opacity-60"
+ :class="actionButtonFlag ? 'cursor-wait !opacity-80' : ''"
+ @click="handleRestartButtonClick"
+ >
+ <heroicons-outline:refresh class="w-5 h-auto mr-2" /> Replay
+ </button>
+ <button
+ class="w-auto flex flex-row justify-center items-center border px-3 leading-10 select-none rounded-md hover:opacity-60"
+ >
+ <heroicons-outline:book-open class="w-5 h-auto mr-2" /> Deploy now
+ </button>
+ <button
+ class="w-auto flex flex-row justify-center items-center px-3 leading-10 select-none rounded-md font-medium bg-indigo-600 text-white shadow hover:opacity-80"
+ @click="showRequestDemoDialog = true"
+ >
+ <heroicons-outline:chat class="w-5 h-auto mr-2" /> Request full demo
+ </button>
+ </div>
+
+ <hr class="w-full bg-gray-50 mt-6" />
+
+ <div class="mt-6 w-full grid grid-cols-3 leading-9">
+ <p class="col-span-1">More quickly demos:</p>
+ <div class="w-full col-span-2 grid grid-cols-2 leading-9">
+ <a
+ class="text-indigo-600 w-full flex flex-row justify-start items-center hover:underline"
+ target="_blank"
+ href="#placeholder"
+ >VCS Integration<heroicons-outline:arrow-right
+ class="w-4 h-auto ml-2"
+ /></a>
+ <a
+ class="text-indigo-600 w-full flex flex-row justify-start items-center hover:underline"
+ target="_blank"
+ href="#placeholder"
+ >SQL Editor<heroicons-outline:arrow-right class="w-4 h-auto ml-2"
+ /></a>
+ <a
+ class="text-indigo-600 w-full flex flex-row justify-start items-center hover:underline"
+ target="_blank"
+ href="#placeholder"
+ >SQL Review<heroicons-outline:arrow-right class="w-4 h-auto ml-2"
+ /></a>
+ </div>
</div>
</div>
<div
+ v-else
v-show="
currentProcessIndex >= 0 && currentProcessIndex < processDataList.length
"
class="w-full flex flex-row justify-between items-center mt-2"
>
<span
- class="border px-3 py-1 mt-2 rounded-lg text-indigo-600 bg-indigo-50 cursor-pointer hover:opacity-80"
- :class="
+ class="border px-3 py-1 mt-2 rounded-lg text-indigo-600 bg-indigo-50 cursor-pointer select-none hover:opacity-80"
+ :class="`${
currentProcessIndex === 0 ? '!opacity-40 !cursor-not-allowed' : ''
- "
+ } ${actionButtonFlag ? '!cursor-wait !opacity-80' : ''}`"
@click="handlePrevButtonClick"
>👈 Prev</span
>
<span
- class="border px-3 py-1 mt-2 rounded-lg text-indigo-600 bg-indigo-50 cursor-pointer hover:opacity-80"
- :class="
- currentProcessIndex === processDataList.length - 1
- ? '!opacity-40 !cursor-not-allowed'
- : ''
- "
+ class="border px-3 py-1 mt-2 rounded-lg text-indigo-600 bg-indigo-50 cursor-pointer select-none hover:opacity-80"
+ :class="actionButtonFlag ? '!cursor-wait !opacity-80' : ''"
@click="handleNextButtonClick"
- >Next 👉</span
+ >{{
+ currentProcessIndex < processDataList.length - 1
+ ? "Next 👉"
+ : "Complete"
+ }}</span
>
</div>
</div>
+
+ <RequestDemoDialog
+ v-show="showRequestDemoDialog"
+ @close="handleRequestDemoDialogClose"
+ />
</template>
<script lang="ts" setup>
@@ -84,8 +164,9 @@ import { useRoute, useRouter } from "vue-router";
import { first, indexOf } from "lodash-es";
import { ProcessData } from "../types";
import useAppStore from "../store";
+import RequestDemoDialog from "./RequestDemoDialog.vue";
-const emit = defineEmits(["finish"]);
+const emit = defineEmits(["close"]);
const route = useRoute();
const router = useRouter();
@@ -93,7 +174,11 @@ const router = useRouter();
const store = useAppStore();
const processDataList = computed(() => store.processDataList);
+const isCompleted = ref<boolean>(false);
+const actionButtonFlag = ref(false);
const currentProcessIndex = ref<number>(-1);
+const showRequestDemoDialog = ref(false);
+
const currentProcessData = computed(() => {
return currentProcessIndex.value >= 0
? processDataList.value[currentProcessIndex.value]
@@ -111,6 +196,7 @@ const processBarWidth = computed(() => {
watch(
route,
() => {
+ actionButtonFlag.value = false;
let matchedProcessDataIndex = -1;
for (let i = 0; i < processDataList.value.length; i++) {
const processData = processDataList.value[i];
@@ -120,12 +206,6 @@ watch(
}
}
currentProcessIndex.value = matchedProcessDataIndex;
- if (
- matchedProcessDataIndex >= 0 &&
- matchedProcessDataIndex === processDataList.value.length - 1
- ) {
- emit("finish");
- }
},
{
immediate: true,
@@ -133,6 +213,11 @@ watch(
);
const handleProcessItemClick = (processData: ProcessData) => {
+ if (isCompleted.value) {
+ return;
+ }
+
+ actionButtonFlag.value = true;
const index = indexOf(processDataList.value, processData);
if (currentProcessIndex.value + 1 >= index) {
router.push(processData.url);
@@ -142,30 +227,67 @@ const handleProcessItemClick = (processData: ProcessData) => {
const handlePrevButtonClick = () => {
const process = processDataList.value[currentProcessIndex.value - 1];
if (process) {
+ actionButtonFlag.value = true;
router.push(process.url);
}
};
-const handleNextButtonClick = () => {
+const handleNextButtonClick = async () => {
+ if (currentProcessIndex.value === processDataList.value.length - 1) {
+ isCompleted.value = true;
+ return;
+ }
+
const process = processDataList.value[currentProcessIndex.value + 1];
if (process) {
- router.push(process.url);
+ actionButtonFlag.value = true;
+ await router.push(process.url);
}
};
-const handleBackToDemoButtonClick = () => {
+const handleCloseButtonClick = () => {
+ emit("close");
+};
+
+const handleRestartButtonClick = async () => {
const process = first(processDataList.value);
if (process) {
- router.push(process.url);
+ actionButtonFlag.value = true;
+ await router.push(process.url);
}
};
+
+const handleBackToDemoButtonClick = async () => {
+ const process = first(processDataList.value);
+ if (process) {
+ actionButtonFlag.value = true;
+ await router.push(process.url);
+ }
+};
+
+const handleRequestDemoDialogClose = () => {
+ showRequestDemoDialog.value = false;
+};
+
+watch(currentProcessIndex, () => {
+ if (currentProcessIndex.value === processDataList.value.length - 1) {
+ // do nth
+ } else {
+ isCompleted.value = false;
+ }
+});
</script>
<style scoped>
.process-bar-container {
- @apply max-w-full fixed bottom-6 left-1/2 -translate-x-1/2 translate-y-0 transition-transform duration-500 flex flex-col justify-start items-center bg-white px-8 py-6 rounded-lg;
+ @apply max-w-full fixed bottom-6 left-1/2 -translate-x-1/2 translate-y-0 flex flex-col justify-start items-center bg-white px-8 py-6 rounded-lg;
min-width: 600px;
z-index: 10001;
box-shadow: 0 0 24px 8px rgb(0 0 0 / 20%);
+ transition: bottom ease 0.4s;
+}
+
+.completed {
+ @apply bottom-1/2 translate-y-1/2;
}
</style>
diff --git a/frontend/src/plugins/demo/components/RequestDemoDialog.vue b/frontend/src/plugins/demo/components/RequestDemoDialog.vue
new file mode 100644
index 0000000000..6f146bb62f
--- /dev/null
+++ b/frontend/src/plugins/demo/components/RequestDemoDialog.vue
@@ -0,0 +1,87 @@
+<template>
+ <div
+ class="dialog-wrapper fixed top-0 left-0 w-full h-full flex flex-col justify-center items-center"
+ >
+ <div
+ class="dialog-container bg-white relative rounded-lg px-2 pb-6 w-72 h-auto flex flex-col justify-start items-center"
+ >
+ <span
+ class="absolute right-3 top-3 p-px rounded cursor-pointer hover:bg-gray-100 hover:shadow"
+ @click="handleCloseButtonClick"
+ >
+ <heroicons-outline:x class="w-5 h-auto" />
+ </span>
+ <img src="../../../assets/book-demo.webp" class="w-full h-auto" alt="" />
+ <template v-if="!submitted">
+ <input
+ ref="emailInputRef"
+ v-model="email"
+ type="text"
+ class="w-60 rounded shadow-inner border-gray-300 text-center"
+ placeholder="Enter your email"
+ @keydown="handleInputKeydown"
+ />
+ <button
+ class="w-60 px-4 mt-4 flex flex-row justify-center items-center leading-10 rounded shadow bg-indigo-600 text-white hover:opacity-80"
+ @click="handleRequestButtonClick"
+ >
+ <heroicons-outline:chat class="w-5 h-auto mr-2" /> Request full demo
+ </button>
+ </template>
+ <template v-else>
+ <p class="text-indigo-600 text-xl my-2 font-medium">
+ <span class="text-2xl mr-2">🙌</span>Congratulations
+ </p>
+ <p class="text-sm text-gray-600 leading-10">
+ We will contact you in 1 business day!
+ </p>
+ </template>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { ref } from "vue";
+
+const emit = defineEmits(["close"]);
+
+const emailInputRef = ref<HTMLInputElement>();
+const email = ref("");
+const submitted = ref(false);
+
+const handleInputKeydown = (event: KeyboardEvent) => {
+ if (event.code === "Enter") {
+ handleRequestButtonClick();
+ }
+};
+
+const handleCloseButtonClick = () => {
+ emit("close");
+};
+
+const handleRequestButtonClick = async () => {
+ if (email.value === "") {
+ return;
+ }
+
+ const analytics = (window as any).analytics;
+ analytics.identify(email.value, {
+ integrations: {
+ MailChimp: {
+ subscriptionStatus: "subscribed",
+ },
+ },
+ });
+ submitted.value = true;
+};
+</script>
+
+<style scoped>
+.dialog-wrapper {
+ z-index: 100000;
+}
+.dialog-wrapper > .dialog-container {
+ z-index: 100000;
+ box-shadow: 0 0 24px 8px rgb(0 0 0 / 20%);
+}
+</style>
diff --git a/frontend/src/plugins/demo/index.ts b/frontend/src/plugins/demo/index.ts
index f3d037d1fa..f79bfa8468 100644
--- a/frontend/src/plugins/demo/index.ts
+++ b/frontend/src/plugins/demo/index.ts
@@ -1,56 +1,86 @@
import axios from "axios";
import { isNull } from "lodash-es";
import { createApp } from "vue";
+import { isDev } from "@/utils";
import { router } from "@/router";
import * as storage from "./storage";
import { piniaInstance } from "./store";
import { initLocationListenerForDemo } from "./listener";
import DemoWrapper from "./components/DemoWrapper.vue";
+import { removeHint } from "./hint";
+import { removeGuideDialog } from "./guide";
+import { waitBodyLoaded } from "./utils";
const invalidDemoNameList = ["dev", "prod"];
-// initial guide listeners when window loaded
-window.addEventListener(
- "load",
- async () => {
- const serverInfo = (
- await axios.get<{
- demo: boolean;
- demoName: string;
- }>(`/api/actuator/info`)
- ).data;
-
- // only show demo in feature demo mode.
- if (
- serverInfo.demo &&
- serverInfo.demoName &&
- !invalidDemoNameList.includes(serverInfo.demoName)
- ) {
- const demoName = serverInfo.demoName;
- if (demoName) {
- // mount the demo vue app
- const demoDrawerContainer = document.createElement("div");
- document.body.appendChild(demoDrawerContainer);
- const app = createApp(DemoWrapper, {
- demoName,
- });
- app.use(router).use(piniaInstance).mount(demoDrawerContainer);
-
- // TODO(steven): refactor the pure js element into vue
- await initLocationListenerForDemo();
- }
+const initDemo = async (demoName: string) => {
+ await waitBodyLoaded();
+ // mount the demo vue app
+ const demoAppContainer = document.createElement("div");
+ document.body.appendChild(demoAppContainer);
+ const app = createApp(DemoWrapper, {
+ demoName,
+ });
+ app.use(router).use(piniaInstance).mount(demoAppContainer);
+
+ storage.set({
+ demo: {
+ name: demoName,
+ },
+ });
+ // TODO(steven): refactor the pure js element into vue
+ await initLocationListenerForDemo();
+
+ // inject segment script
+ const scriptElement = document.createElement("script");
+ scriptElement.innerHTML = `
+ !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methods[e];analytics[key]=analytics.factory(key)}analytics.load=function(key,e){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);analytics._loadOptions=e};analytics._writeKey="CVXXNXv3EzfQPYqHoYvlDDDOXmKa9XOj";;analytics.SNIPPET_VERSION="4.15.3";
+ analytics.load("CVXXNXv3EzfQPYqHoYvlDDDOXmKa9XOj");
+ analytics.page();
+ }}();`;
+ document.body.appendChild(scriptElement);
+};
+
+const mountDemoApp = async () => {
+ const serverInfo = (
+ await axios.get<{
+ demo: boolean;
+ demoName: string;
+ version: string;
+ }>(`/api/actuator/info`)
+ ).data;
+
+ // only show demo in feature demo mode.
+ if (
+ serverInfo.demo &&
+ serverInfo.demoName &&
+ !invalidDemoNameList.includes(serverInfo.demoName)
+ ) {
+ const demoName = serverInfo.demoName;
+ if (demoName) {
+ initDemo(demoName);
}
+ }
- // If there is a `cleardemo` flag in the url, then clear the demo storage.
+ // only using in dev mode
+ if (isDev()) {
const params = new URLSearchParams(window.location.search);
+ const demoName = params.get("demo") ?? "";
+ if (demoName) {
+ initDemo(demoName);
+ }
+
const clearDemo = params.get("cleardemo");
if (!isNull(clearDemo)) {
storage.remove(["demo", "guide"]);
}
- },
- {
- once: true,
}
-);
+};
+
+export const removeDemo = () => {
+ storage.remove(["demo", "guide"]);
+ removeHint();
+ removeGuideDialog();
+};
-export default null;
+export default mountDemoApp;
diff --git a/frontend/src/plugins/demo/utils.ts b/frontend/src/plugins/demo/utils.ts
index 329761f0b8..6e401084ec 100644
--- a/frontend/src/plugins/demo/utils.ts
+++ b/frontend/src/plugins/demo/utils.ts
@@ -136,6 +136,26 @@ export const waitForTargetElement = (
});
};
+export const waitBodyLoaded = () => {
+ return new Promise((resolve) => {
+ let t = setTimeout(() => {
+ resolve(undefined);
+ }, 1000);
+
+ const observer = new MutationObserver(() => {
+ clearTimeout(t);
+ t = setTimeout(() => {
+ resolve(undefined);
+ }, 1000);
+ });
+
+ observer.observe(document.body, {
+ childList: true,
+ subtree: true,
+ });
+ });
+};
+
// checkUrlMatched is used to check if the given url's pathname is matched with the location pathname.
export const checkUrlPathnameMatched = (url: string) => {
const urlObject = new URL(url);
diff --git a/store/demo/schema-migration-history/10001__data.sql b/store/demo/schema-migration-history/10001__data.sql
index adf89b4294..e036d5e13b 100644
--- a/store/demo/schema-migration-history/10001__data.sql
+++ b/store/demo/schema-migration-history/10001__data.sql
@@ -81,22 +81,22 @@ INSERT INTO "public"."col" ("id", "row_status", "creator_id", "created_ts", "upd
(248, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 132, 'Manager', 12, NULL, 'f', 'varchar(14)', 'utf8mb4', 'utf8mb4_0900_ai_ci', ''),
(249, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 132, 'PhoneNo', 9, NULL, 'f', 'varchar(15)', 'utf8mb4', 'utf8mb4_0900_ai_ci', '');
-INSERT INTO "public"."idx" ("id", "row_status", "creator_id", "created_ts", "updater_id", "updated_ts", "database_id", "table_id", "name", "expression", "position", "type", "unique", "visible", "comment") VALUES
-(158, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 126, 'PRIMARY', 'dept_no', 1, 'BTREE', 't', 't', ''),
-(159, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 126, 'dept_name', 'dept_name', 1, 'BTREE', 't', 't', ''),
-(160, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 127, 'PRIMARY', 'emp_no', 1, 'BTREE', 't', 't', ''),
-(161, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 127, 'PRIMARY', 'from_date', 2, 'BTREE', 't', 't', ''),
-(162, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 128, 'PRIMARY', 'emp_no', 1, 'BTREE', 't', 't', ''),
-(163, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 128, 'PRIMARY', 'title', 2, 'BTREE', 't', 't', ''),
-(164, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 128, 'PRIMARY', 'from_date', 3, 'BTREE', 't', 't', ''),
-(165, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 129, 'PRIMARY', 'emp_no', 1, 'BTREE', 't', 't', ''),
-(166, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 129, 'PRIMARY', 'dept_no', 2, 'BTREE', 't', 't', ''),
-(167, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 129, 'dept_no', 'dept_no', 1, 'BTREE', 'f', 't', ''),
-(168, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 130, 'PRIMARY', 'emp_no', 1, 'BTREE', 't', 't', ''),
-(169, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 130, 'PRIMARY', 'dept_no', 2, 'BTREE', 't', 't', ''),
-(170, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 130, 'dept_no', 'dept_no', 1, 'BTREE', 'f', 't', ''),
-(171, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 131, 'PRIMARY', 'drift_no', 1, 'BTREE', 't', 't', ''),
-(172, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 132, 'PRIMARY', 'emp_no', 1, 'BTREE', 't', 't', '');
+INSERT INTO "public"."idx" ("id", "row_status", "creator_id", "created_ts", "updater_id", "updated_ts", "database_id", "table_id", "name", "expression", "position", "type", "primary", "unique", "visible", "comment") VALUES
+(158, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 126, 'PRIMARY', 'dept_no', 1, 'BTREE', false, 't', 't', ''),
+(159, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 126, 'dept_name', 'dept_name', 1, 'BTREE', false, 't', 't', ''),
+(160, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 127, 'PRIMARY', 'emp_no', 1, 'BTREE', false, 't', 't', ''),
+(161, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 127, 'PRIMARY', 'from_date', 2, 'BTREE', false, 't', 't', ''),
+(162, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 128, 'PRIMARY', 'emp_no', 1, 'BTREE', false, 't', 't', ''),
+(163, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 128, 'PRIMARY', 'title', 2, 'BTREE', false, 't', 't', ''),
+(164, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 128, 'PRIMARY', 'from_date', 3, 'BTREE', false, 't', 't', ''),
+(165, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 129, 'PRIMARY', 'emp_no', 1, 'BTREE', false, 't', 't', ''),
+(166, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 129, 'PRIMARY', 'dept_no', 2, 'BTREE', false, 't', 't', ''),
+(167, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 129, 'dept_no', 'dept_no', 1, 'BTREE', false, 'f', 't', ''),
+(168, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 130, 'PRIMARY', 'emp_no', 1, 'BTREE', false, 't', 't', ''),
+(169, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 130, 'PRIMARY', 'dept_no', 2, 'BTREE', false, 't', 't', ''),
+(170, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 130, 'dept_no', 'dept_no', 1, 'BTREE', false, 'f', 't', ''),
+(171, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 131, 'PRIMARY', 'drift_no', 1, 'BTREE', false, 't', 't', ''),
+(172, 'NORMAL', 1, 1657274592, 1, 1657274592, 103, 132, 'PRIMARY', 'emp_no', 1, 'BTREE', false, 't', 't', '');
INSERT INTO "public"."data_source" ("id", "row_status", "creator_id", "created_ts", "updater_id", "updated_ts", "instance_id", "database_id", "name", "type", "username", "password", "ssl_key", "ssl_cert", "ssl_ca") VALUES
(101, 'NORMAL', 1, 1657272778, 1, 1657272778, 101, 101, 'Admin data source', 'ADMIN', 'root', '', '', '', ''),