Skip to content

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

chore: fix vue-warning (#12546)

Liu Jife73b658f026
diff --git a/frontend/src/components/CommonSidebar.vue b/frontend/src/components/CommonSidebar.vue
index b2d1cb5baa..fd2d0b253f 100644
--- a/frontend/src/components/CommonSidebar.vue
+++ b/frontend/src/components/CommonSidebar.vue
@@ -84,7 +84,7 @@ export interface SidebarItem {
name?: string;
// path is required if the type is div or link
path?: string;
- icon?: VNode;
+ icon?: () => VNode;
hide?: boolean;
type: "route" | "div" | "divider" | "link";
expand?: boolean;
diff --git a/frontend/src/components/Project/useProjectSidebar.ts b/frontend/src/components/Project/useProjectSidebar.ts
index a2d61b2d74..8d64b9b3a3 100644
--- a/frontend/src/components/Project/useProjectSidebar.ts
+++ b/frontend/src/components/Project/useProjectSidebar.ts
@@ -127,7 +127,7 @@ export const useProjectSidebar = (project: Ref<ComposedProject>) => {
const sidebarList: ProjectSidebarItem[] = [
{
title: t("common.database"),
- icon: h(Database),
+ icon: () => h(Database),
type: "div",
expand: true,
children: [
@@ -167,20 +167,20 @@ export const useProjectSidebar = (project: Ref<ComposedProject>) => {
{
title: t("common.issues"),
path: PROJECT_V1_ROUTE_ISSUES,
- icon: h(CircleDot),
+ icon: () => h(CircleDot),
type: "div",
hide: isDefaultProject.value,
},
{
title: t("review-center.self"),
- icon: h(SearchCodeIcon),
+ icon: () => h(SearchCodeIcon),
path: PROJECT_V1_ROUTE_REVIEW_CENTER,
type: "div",
hide: isDefaultProject.value,
},
{
title: t("export-center.self"),
- icon: h(DownloadIcon),
+ icon: () => h(DownloadIcon),
path: PROJECT_V1_ROUTE_EXPORT_CENTER,
type: "div",
hide: isDefaultProject.value,
@@ -188,27 +188,27 @@ export const useProjectSidebar = (project: Ref<ComposedProject>) => {
{
title: t("common.branches"),
path: PROJECT_V1_ROUTE_BRANCHES,
- icon: h(GitBranch),
+ icon: () => h(GitBranch),
type: "div",
hide: isDefaultProject.value,
},
{
title: t("changelist.changelists"),
path: PROJECT_V1_ROUTE_CHANGELISTS,
- icon: h(PencilRuler),
+ icon: () => h(PencilRuler),
type: "div",
hide: isDefaultProject.value,
},
{
title: t("database.sync-schema.title"),
path: PROJECT_V1_ROUTE_SYNC_SCHEMA,
- icon: h(RefreshCcw),
+ icon: () => h(RefreshCcw),
type: "div",
hide: isDefaultProject.value,
},
{
title: t("settings.sidebar.integration"),
- icon: h(Link),
+ icon: () => h(Link),
type: "div",
hide: isDefaultProject.value,
expand: true,
@@ -227,7 +227,7 @@ export const useProjectSidebar = (project: Ref<ComposedProject>) => {
},
{
title: t("common.manage"),
- icon: h(Users),
+ icon: () => h(Users),
type: "div",
hide: isDefaultProject.value,
expand: true,
@@ -246,7 +246,7 @@ export const useProjectSidebar = (project: Ref<ComposedProject>) => {
},
{
title: t("common.setting"),
- icon: h(Settings),
+ icon: () => h(Settings),
path: PROJECT_V1_ROUTE_SETTINGS,
type: "div",
hide: isDefaultProject.value,
diff --git a/frontend/src/views/DashboardSidebar.vue b/frontend/src/views/DashboardSidebar.vue
index ae90b2ec89..c7d55c935d 100644
--- a/frontend/src/views/DashboardSidebar.vue
+++ b/frontend/src/views/DashboardSidebar.vue
@@ -159,7 +159,7 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
{
navigationId: "bb.navigation.my-issues",
title: t("issue.my-issues"),
- icon: h(HomeIcon),
+ icon: () => h(HomeIcon),
name: WORKSPACE_ROUTE_MY_ISSUES,
type: "route",
shortcuts: ["g", "m", "i"],
@@ -167,7 +167,7 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
{
navigationId: "bb.navigation.projects",
title: t("common.projects"),
- icon: h(GalleryHorizontalEndIcon),
+ icon: () => h(GalleryHorizontalEndIcon),
name: PROJECT_V1_ROUTE_DASHBOARD,
type: "route",
shortcuts: ["g", "p"],
@@ -175,7 +175,7 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
{
navigationId: "bb.navigation.instances",
title: t("common.instances"),
- icon: h(LayersIcon),
+ icon: () => h(LayersIcon),
name: INSTANCE_ROUTE_DASHBOARD,
type: "route",
shortcuts: ["g", "i"],
@@ -183,7 +183,7 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
{
navigationId: "bb.navigation.databases",
title: t("common.databases"),
- icon: h(DatabaseIcon),
+ icon: () => h(DatabaseIcon),
name: DATABASE_ROUTE_DASHBOARD,
type: "route",
shortcuts: ["g", "d"],
@@ -191,7 +191,7 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
{
navigationId: "bb.navigation.environments",
title: t("common.environments"),
- icon: h(SquareStackIcon),
+ icon: () => h(SquareStackIcon),
name: ENVIRONMENT_V1_ROUTE_DASHBOARD,
type: "route",
shortcuts: ["g", "e"],
@@ -203,7 +203,7 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
{
navigationId: "bb.navigation.review-center",
title: t("review-center.self"),
- icon: h(SearchCodeIcon),
+ icon: () => h(SearchCodeIcon),
name: WORKSPACE_ROUTE_REVIEW_CENTER,
type: "route",
shortcuts: ["g", "r", "c"],
@@ -216,7 +216,7 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
{
navigationId: "bb.navigation.export-center",
title: t("export-center.self"),
- icon: h(DownloadIcon),
+ icon: () => h(DownloadIcon),
name: WORKSPACE_ROUTE_EXPORT_CENTER,
type: "route",
shortcuts: ["g", "x", "c"],
@@ -229,14 +229,14 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
{
navigationId: "bb.navigation.anomaly-center",
title: t("anomaly-center"),
- icon: h(ShieldAlertIcon),
+ icon: () => h(ShieldAlertIcon),
name: WORKSPACE_ROUTE_ANOMALY_CENTER,
type: "route",
shortcuts: ["g", "a", "c"],
},
{
title: t("settings.sidebar.security-and-policy"),
- icon: h(ShieldCheck),
+ icon: () => h(ShieldCheck),
type: "div",
children: [
{
@@ -290,7 +290,7 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
},
{
title: t("settings.sidebar.integration"),
- icon: h(LinkIcon),
+ icon: () => h(LinkIcon),
type: "div",
children: [
{
diff --git a/frontend/src/views/SettingSidebar.vue b/frontend/src/views/SettingSidebar.vue
index 9303052599..2fdf34e4af 100644
--- a/frontend/src/views/SettingSidebar.vue
+++ b/frontend/src/views/SettingSidebar.vue
@@ -70,7 +70,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
const list: SidebarItem[] = [
{
title: t("settings.sidebar.account"),
- icon: h(UserCircle),
+ icon: () => h(UserCircle),
type: "div",
expand: true,
children: [
@@ -83,7 +83,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
},
{
title: t("settings.sidebar.workspace"),
- icon: h(Building),
+ icon: () => h(Building),
type: "div",
expand: true,
children: [
@@ -106,7 +106,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
},
{
title: t("common.archived"),
- icon: h(Archive),
+ icon: () => h(Archive),
name: SETTING_ROUTE_WORKSPACE_ARCHIVE,
type: "route",
},
diff --git a/frontend/src/views/sql-editor/EditorCommon/ReadonlyDatasourceHint.vue b/frontend/src/views/sql-editor/EditorCommon/ReadonlyDatasourceHint.vue
index d777acd177..20427ed1ed 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ReadonlyDatasourceHint.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ReadonlyDatasourceHint.vue
@@ -71,7 +71,7 @@ const gotoInstanceDetailPage = () => {
if (
settingItemList.value.findIndex(
(item) => item.name === SQL_EDITOR_SETTING_INSTANCE_MODULE
- )
+ ) >= 0
) {
router.push({
name: SQL_EDITOR_SETTING_INSTANCE_MODULE,
diff --git a/frontend/src/views/sql-editor/Setting/Sidebar/common.ts b/frontend/src/views/sql-editor/Setting/Sidebar/common.ts
index 04152e7034..0ba50a5e84 100644
--- a/frontend/src/views/sql-editor/Setting/Sidebar/common.ts
+++ b/frontend/src/views/sql-editor/Setting/Sidebar/common.ts
@@ -14,7 +14,7 @@ import sqlEditorRoutes, {
SQL_EDITOR_SETTING_INSTANCE_MODULE,
SQL_EDITOR_SETTING_PROJECT_MODULE,
} from "@/router/sqlEditor";
-import { useCurrentUserV1 } from "@/store";
+import { useCurrentUserV1, usePageMode } from "@/store";
import type { WorkspacePermission } from "@/types";
import { hasWorkspacePermissionV2 } from "@/utils";
@@ -22,6 +22,7 @@ export const useSidebarItems = () => {
const route = useRoute();
const { t } = useI18n();
const me = useCurrentUserV1();
+ const pageMode = usePageMode();
const getItemClass = (item: SidebarItem) => {
if (route.name === item.name) {
@@ -94,28 +95,33 @@ export const useSidebarItems = () => {
};
const itemList = computed((): SidebarItem[] => {
+ if (pageMode.value === "STANDALONE") {
+ // Hide SQL Editor settings entirely in STANDALONE mode
+ return [];
+ }
+
const sidebarList: SidebarItem[] = [
{
title: t("settings.sidebar.general"),
- icon: h(BuildingIcon),
+ icon: () => h(BuildingIcon),
name: SQL_EDITOR_SETTING_GENERAL_MODULE,
type: "route",
},
{
title: t("common.instances"),
- icon: h(LayersIcon),
+ icon: () => h(LayersIcon),
name: SQL_EDITOR_SETTING_INSTANCE_MODULE,
type: "route",
},
{
title: t("common.projects"),
- icon: h(GalleryHorizontalEndIcon),
+ icon: () => h(GalleryHorizontalEndIcon),
name: SQL_EDITOR_SETTING_PROJECT_MODULE,
type: "route",
},
{
title: t("common.environments"),
- icon: h(SquareStackIcon),
+ icon: () => h(SquareStackIcon),
name: SQL_EDITOR_SETTING_ENVIRONMENT_MODULE,
type: "route",
},