Skip to content

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

chore: update sidebar (#12165)

ecmadaobee7f046b79e
diff --git a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue
index 8ab65c9743..f20057532e 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue
@@ -19,7 +19,7 @@
{{ $t("settings.members.groups.group-members") }}
<router-link
:to="{
- name: SETTING_ROUTE_WORKSPACE_MEMBER,
+ name: WORKSPACE_ROUTE_MEMBERS,
query: {
name: `${userGroupNamePrefix}${binding.email}`,
},
@@ -227,7 +227,7 @@ import type { BBGridRow } from "@/bbkit";
import { BBGrid } from "@/bbkit";
import UserNameCell from "@/components/User/Settings/UserDataTableByGroup/cells/UserNameCell.vue";
import { Drawer, DrawerContent, InstanceV1Name } from "@/components/v2";
-import { SETTING_ROUTE_WORKSPACE_MEMBER } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_MEMBERS } from "@/router/dashboard/workspaceRoutes";
import {
useCurrentUserV1,
useDatabaseV1Store,
diff --git a/frontend/src/components/Quickstart.vue b/frontend/src/components/Quickstart.vue
index 63363a6259..52b96c3ae4 100644
--- a/frontend/src/components/Quickstart.vue
+++ b/frontend/src/components/Quickstart.vue
@@ -120,8 +120,8 @@ import {
INSTANCE_ROUTE_DASHBOARD,
PROJECT_V1_ROUTE_DASHBOARD,
ENVIRONMENT_V1_ROUTE_DASHBOARD,
+ WORKSPACE_ROUTE_MEMBERS,
} from "@/router/dashboard/workspaceRoutes";
-import { SETTING_ROUTE_WORKSPACE_MEMBER } from "@/router/dashboard/workspaceSetting";
import { SQL_EDITOR_WORKSHEET_MODULE } from "@/router/sqlEditor";
import {
pushNotification,
@@ -247,7 +247,7 @@ const introList = computed(() => {
{
name: computed(() => t("quick-start.visit-member")),
link: {
- name: SETTING_ROUTE_WORKSPACE_MEMBER,
+ name: WORKSPACE_ROUTE_MEMBERS,
},
done: computed(() => uiStateStore.getIntroStateByKey("member.visit")),
requiredPermissions: ["bb.policies.get"],
diff --git a/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue b/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue
index eedfca2863..38a17a59ea 100644
--- a/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue
+++ b/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue
@@ -143,7 +143,7 @@
<div v-else class="bb-grid-cell gap-x-1">
<router-link
:to="{
- name: SETTING_ROUTE_WORKSPACE_MEMBER,
+ name: WORKSPACE_ROUTE_MEMBERS,
query: {
name: item.group!.name,
},
@@ -290,8 +290,10 @@ import { useI18n } from "vue-i18n";
import { BBGrid } from "@/bbkit";
import type { BBGridColumn, BBGridRow } from "@/bbkit/types";
import { Drawer, DrawerContent } from "@/components/v2";
-import { WORKSPACE_ROUTE_USER_PROFILE } from "@/router/dashboard/workspaceRoutes";
-import { SETTING_ROUTE_WORKSPACE_MEMBER } from "@/router/dashboard/workspaceSetting";
+import {
+ WORKSPACE_ROUTE_USER_PROFILE,
+ WORKSPACE_ROUTE_MEMBERS,
+} from "@/router/dashboard/workspaceRoutes";
import {
useSettingV1Store,
usePolicyV1Store,
diff --git a/frontend/src/components/User/Settings/CreateGroupDrawer.vue b/frontend/src/components/User/Settings/CreateGroupDrawer.vue
index a972a7fb22..75f4d0c2dd 100644
--- a/frontend/src/components/User/Settings/CreateGroupDrawer.vue
+++ b/frontend/src/components/User/Settings/CreateGroupDrawer.vue
@@ -202,7 +202,14 @@ const state = reactive<LocalState>({
email: extractGroupEmail(props.group?.name ?? ""),
title: props.group?.title ?? "",
description: props.group?.description ?? "",
- members: cloneDeep(props.group?.members ?? []),
+ members: cloneDeep(
+ props.group?.members ?? [
+ UserGroupMember.fromPartial({
+ role: UserGroupMember_Role.OWNER,
+ member: `${userNamePrefix}${currentUserV1.value.email}`,
+ }),
+ ]
+ ),
},
});
diff --git a/frontend/src/router/dashboard/workspace.ts b/frontend/src/router/dashboard/workspace.ts
index 882b76b6a2..14ccda34c3 100644
--- a/frontend/src/router/dashboard/workspace.ts
+++ b/frontend/src/router/dashboard/workspace.ts
@@ -2,7 +2,6 @@ import { startCase } from "lodash-es";
import type { RouteRecordRaw } from "vue-router";
import { t } from "@/plugins/i18n";
import Home from "@/views/Home.vue";
-import SettingSidebar from "@/views/SettingSidebar.vue";
import {
PROJECT_V1_ROUTE_DASHBOARD,
INSTANCE_ROUTE_DASHBOARD,
@@ -28,6 +27,8 @@ import {
WORKSPACE_ROUTE_SSO_DETAIL,
WORKSPACE_ROUTE_MAIL_DELIVERY,
WORKSPACE_ROUTE_REVIEW_CENTER,
+ WORKSPACE_ROUTE_MEMBERS,
+ WORKSPACE_ROUTE_ROLES,
} from "./workspaceRoutes";
const workspaceRoutes: RouteRecordRaw[] = [
@@ -158,7 +159,7 @@ const workspaceRoutes: RouteRecordRaw[] = [
name: WORKSPACE_ROUTE_USER_PROFILE,
components: {
content: () => import("@/views/ProfileDashboard.vue"),
- leftSidebar: SettingSidebar,
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
},
props: true,
},
@@ -400,6 +401,26 @@ const workspaceRoutes: RouteRecordRaw[] = [
},
component: () => import("@/views/SettingWorkspaceMailDelivery.vue"),
},
+ {
+ path: "members",
+ name: WORKSPACE_ROUTE_MEMBERS,
+ meta: {
+ title: () => t("settings.sidebar.members-and-groups"),
+ requiredWorkspacePermissionList: () => ["bb.policies.get"],
+ },
+ component: () => import("@/views/SettingWorkspaceMember.vue"),
+ props: true,
+ },
+ {
+ path: "roles",
+ name: WORKSPACE_ROUTE_ROLES,
+ meta: {
+ title: () => t("settings.sidebar.custom-roles"),
+ requiredWorkspacePermissionList: () => ["bb.roles.list"],
+ },
+ component: () => import("@/views/SettingWorkspaceRole.vue"),
+ props: true,
+ },
],
},
];
diff --git a/frontend/src/router/dashboard/workspaceRoutes.ts b/frontend/src/router/dashboard/workspaceRoutes.ts
index 59d5a6b1d8..509b9c3367 100644
--- a/frontend/src/router/dashboard/workspaceRoutes.ts
+++ b/frontend/src/router/dashboard/workspaceRoutes.ts
@@ -20,6 +20,8 @@ export const WORKSPACE_ROUTE_RISK_CENTER = "workspace.risk-center";
export const WORKSPACE_ROUTE_SENSITIVE_DATA = "workspace.sensitive-data";
export const WORKSPACE_ROUTE_AUDIT_LOG = "workspace.audit-log";
export const WORKSPACE_ROUTE_MAIL_DELIVERY = "workspace.mail-delivery";
+export const WORKSPACE_ROUTE_MEMBERS = "workspace.members";
+export const WORKSPACE_ROUTE_ROLES = "workspace.roles";
export const WORKSPACE_ROUTE_GITOPS = "workspace.gitops";
export const WORKSPACE_ROUTE_GITOPS_CREATE = `${WORKSPACE_ROUTE_GITOPS}.create`;
diff --git a/frontend/src/router/dashboard/workspaceSetting.ts b/frontend/src/router/dashboard/workspaceSetting.ts
index f6e16e9fc7..04abafa195 100644
--- a/frontend/src/router/dashboard/workspaceSetting.ts
+++ b/frontend/src/router/dashboard/workspaceSetting.ts
@@ -7,8 +7,6 @@ export const SETTING_ROUTE_WORKSPACE = `${SETTING_ROUTE}.workspace`;
export const SETTING_ROUTE_PROFILE = `${SETTING_ROUTE}.profile`;
export const SETTING_ROUTE_PROFILE_TWO_FACTOR = `${SETTING_ROUTE_PROFILE}.two-factor`;
export const SETTING_ROUTE_WORKSPACE_GENERAL = `${SETTING_ROUTE_WORKSPACE}.general`;
-export const SETTING_ROUTE_WORKSPACE_MEMBER = `${SETTING_ROUTE_WORKSPACE}.member`;
-export const SETTING_ROUTE_WORKSPACE_ROLE = `${SETTING_ROUTE_WORKSPACE}.role`;
export const SETTING_ROUTE_WORKSPACE_SUBSCRIPTION = `${SETTING_ROUTE_WORKSPACE}.subscription`;
export const SETTING_ROUTE_WORKSPACE_DEBUG_LOG = `${SETTING_ROUTE_WORKSPACE}.debug-log`;
export const SETTING_ROUTE_WORKSPACE_ARCHIVE = `${SETTING_ROUTE_WORKSPACE}.archive`;
@@ -51,26 +49,6 @@ const workspaceSettingRoutes: RouteRecordRaw[] = [
component: () => import("@/views/SettingWorkspaceGeneral.vue"),
props: true,
},
- {
- path: "member",
- name: SETTING_ROUTE_WORKSPACE_MEMBER,
- meta: {
- title: () => t("settings.sidebar.members-and-groups"),
- requiredWorkspacePermissionList: () => ["bb.policies.get"],
- },
- component: () => import("@/views/SettingWorkspaceMember.vue"),
- props: true,
- },
- {
- path: "role",
- name: SETTING_ROUTE_WORKSPACE_ROLE,
- meta: {
- title: () => t("settings.sidebar.custom-roles"),
- requiredWorkspacePermissionList: () => ["bb.roles.list"],
- },
- component: () => import("@/views/SettingWorkspaceRole.vue"),
- props: true,
- },
{
path: "subscription",
name: SETTING_ROUTE_WORKSPACE_SUBSCRIPTION,
diff --git a/frontend/src/views/DashboardSidebar.vue b/frontend/src/views/DashboardSidebar.vue
index df7b7191a3..cfee0c3026 100644
--- a/frontend/src/views/DashboardSidebar.vue
+++ b/frontend/src/views/DashboardSidebar.vue
@@ -49,6 +49,9 @@ import {
WORKSPACE_ROUTE_SSO,
WORKSPACE_ROUTE_MAIL_DELIVERY,
WORKSPACE_ROUTE_REVIEW_CENTER,
+ WORKSPACE_ROUTE_MEMBERS,
+ WORKSPACE_ROUTE_ROLES,
+ WORKSPACE_ROUTE_USER_PROFILE,
} from "@/router/dashboard/workspaceRoutes";
import { useCurrentUserV1 } from "@/store";
import type { WorkspacePermission } from "@/types";
@@ -77,6 +80,14 @@ const getItemClass = (item: SidebarItem): string[] => {
const classes: string[] = [];
if (isActiveRoute) {
classes.push("router-link-active", "bg-link-hover");
+ return classes;
+ }
+ if (
+ item.name === WORKSPACE_ROUTE_MEMBERS &&
+ current?.toString() === WORKSPACE_ROUTE_USER_PROFILE
+ ) {
+ classes.push("router-link-active", "bg-link-hover");
+ return classes;
}
return classes;
};
@@ -232,6 +243,16 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
icon: h(ShieldCheck),
type: "div",
children: [
+ {
+ title: t("settings.sidebar.members-and-groups"),
+ name: WORKSPACE_ROUTE_MEMBERS,
+ type: "route",
+ },
+ {
+ title: t("settings.sidebar.custom-roles"),
+ name: WORKSPACE_ROUTE_ROLES,
+ type: "route",
+ },
{
title: t("sql-review.title"),
name: WORKSPACE_ROUTE_SQL_REVIEW,
diff --git a/frontend/src/views/SettingSidebar.vue b/frontend/src/views/SettingSidebar.vue
index d718e11d30..9303052599 100644
--- a/frontend/src/views/SettingSidebar.vue
+++ b/frontend/src/views/SettingSidebar.vue
@@ -14,13 +14,10 @@ import { useI18n } from "vue-i18n";
import type { RouteRecordRaw } from "vue-router";
import { useRoute, useRouter } from "vue-router";
import type { SidebarItem } from "@/components/CommonSidebar.vue";
-import { WORKSPACE_ROUTE_USER_PROFILE } from "@/router/dashboard/workspaceRoutes";
import workspaceSettingRoutes, {
SETTING_ROUTE_PROFILE,
SETTING_ROUTE_PROFILE_TWO_FACTOR,
SETTING_ROUTE_WORKSPACE_GENERAL,
- SETTING_ROUTE_WORKSPACE_MEMBER,
- SETTING_ROUTE_WORKSPACE_ROLE,
SETTING_ROUTE_WORKSPACE_SUBSCRIPTION,
SETTING_ROUTE_WORKSPACE_DEBUG_LOG,
SETTING_ROUTE_WORKSPACE_ARCHIVE,
@@ -50,11 +47,6 @@ const getItemClass = (item: SidebarItem) => {
list.push("router-link-active", "bg-link-hover");
}
break;
- case WORKSPACE_ROUTE_USER_PROFILE:
- if (item.name === SETTING_ROUTE_WORKSPACE_MEMBER) {
- list.push("router-link-active", "bg-link-hover");
- }
- break;
}
return list;
};
@@ -100,16 +92,6 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
name: SETTING_ROUTE_WORKSPACE_GENERAL,
type: "route",
},
- {
- title: t("settings.sidebar.members-and-groups"),
- name: SETTING_ROUTE_WORKSPACE_MEMBER,
- type: "route",
- },
- {
- title: t("settings.sidebar.custom-roles"),
- name: SETTING_ROUTE_WORKSPACE_ROLE,
- type: "route",
- },
{
title: t("settings.sidebar.subscription"),
name: SETTING_ROUTE_WORKSPACE_SUBSCRIPTION,