Skip to content

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

fix: hide intro if no required data (#15861)

ecmadao6dcb535818e3
diff --git a/frontend/src/components/Member/MemberDataTable/index.vue b/frontend/src/components/Member/MemberDataTable/index.vue
index f8557648ca..0289647b3d 100644
--- a/frontend/src/components/Member/MemberDataTable/index.vue
+++ b/frontend/src/components/Member/MemberDataTable/index.vue
@@ -61,7 +61,7 @@ const columns = computed(
memberBinding.type === "groups",
renderExpand: (memberBinding: MemberBinding) => {
return (
- <div class="pl-20">
+ <div class="pl-20 space-y-2">
{memberBinding.group?.members.map((member) => {
const user =
userStore.getUserByIdentifier(member.member) ?? unknownUser();
diff --git a/frontend/src/components/Quickstart.vue b/frontend/src/components/Quickstart.vue
index de7d46708a..d08816b4f8 100644
--- a/frontend/src/components/Quickstart.vue
+++ b/frontend/src/components/Quickstart.vue
@@ -128,6 +128,8 @@ import {
useUIStateStore,
useProjectV1Store,
useActuatorV1Store,
+ useIssueV1Store,
+ useWorkSheetStore,
} from "@/store";
import { projectNamePrefix } from "@/store/modules/v1/common";
import type { Permission } from "@/types";
@@ -140,6 +142,8 @@ import {
// The name of the sample project.
const SAMPLE_PROJECT_NAME = "project-sample";
+const SAMPLE_ISSUE_ID = "101";
+const SAMPLE_SHEET_ID = "101";
type IntroItem = {
name: string | Ref<string>;
@@ -154,6 +158,8 @@ const { t } = useI18n();
const projectStore = useProjectV1Store();
const uiStateStore = useUIStateStore();
const actuatorStore = useActuatorV1Store();
+const issueStore = useIssueV1Store();
+const worksheetStore = useWorkSheetStore();
const hideQuickStart = useAppFeature("bb.feature.hide-quick-start");
const sampleProject = computedAsync(async () => {
@@ -167,6 +173,42 @@ const sampleProject = computedAsync(async () => {
return project;
});
+const sampleIssue = computedAsync(async () => {
+ if (!sampleProject.value) {
+ return;
+ }
+ if (!hasProjectPermissionV2(sampleProject.value, "bb.issues.get")) {
+ return;
+ }
+ const issue = await issueStore.fetchIssueByName(
+ `${sampleProject.value.name}/issues/${SAMPLE_ISSUE_ID}`,
+ {
+ // Don't need to fetch the plan and rollout.
+ withPlan: false,
+ withRollout: false,
+ },
+ true /* silent */
+ );
+ return issue;
+});
+
+const sampleWorksheet = computedAsync(async () => {
+ if (!sampleProject.value) {
+ return;
+ }
+ if (!hasProjectPermissionV2(sampleProject.value, "bb.worksheets.get")) {
+ return;
+ }
+ if (!hasProjectPermissionV2(sampleProject.value, "bb.sql.select")) {
+ return;
+ }
+ const sheet = await worksheetStore.getOrFetchWorksheetByName(
+ `${sampleProject.value.name}/sheets/${SAMPLE_SHEET_ID}`,
+ true /* silent */
+ );
+ return sheet;
+});
+
const introList = computed(() => {
const introList: IntroItem[] = [
{
@@ -177,13 +219,11 @@ const introList = computed(() => {
projectId: extractProjectResourceName(
sampleProject.value?.name ?? UNKNOWN_PROJECT_NAME
),
- issueSlug: "101",
+ issueSlug: SAMPLE_ISSUE_ID,
},
},
done: computed(() => uiStateStore.getIntroStateByKey("issue.visit")),
- hide:
- !sampleProject.value ||
- !hasProjectPermissionV2(sampleProject.value, "bb.issues.get"),
+ hide: !sampleIssue.value,
},
{
name: computed(() => t("quick-start.query-data")),
@@ -191,13 +231,11 @@ const introList = computed(() => {
name: SQL_EDITOR_WORKSHEET_MODULE,
params: {
project: SAMPLE_PROJECT_NAME,
- sheet: "101",
+ sheet: SAMPLE_SHEET_ID,
},
},
done: computed(() => uiStateStore.getIntroStateByKey("data.query")),
- hide:
- !sampleProject.value ||
- !hasProjectPermissionV2(sampleProject.value, "bb.sql.select"),
+ hide: !sampleWorksheet.value,
},
{
name: computed(() => t("quick-start.visit-project")),
diff --git a/frontend/src/store/modules/v1/issue.ts b/frontend/src/store/modules/v1/issue.ts
index e8c70522a4..1d27d16026 100644
--- a/frontend/src/store/modules/v1/issue.ts
+++ b/frontend/src/store/modules/v1/issue.ts
@@ -104,9 +104,10 @@ export const useIssueV1Store = defineStore("issue_v1", () => {
const fetchIssueByName = async (
name: string,
- composeIssueConfig?: ComposeIssueConfig
+ composeIssueConfig?: ComposeIssueConfig,
+ silent: boolean = false
) => {
- const issue = await issueServiceClient.getIssue({ name });
+ const issue = await issueServiceClient.getIssue({ name }, { silent });
return shallowComposeIssue(issue, composeIssueConfig);
};
diff --git a/frontend/src/store/modules/v1/worksheet.ts b/frontend/src/store/modules/v1/worksheet.ts
index 8a3fb4a8cf..c14bf7401a 100644
--- a/frontend/src/store/modules/v1/worksheet.ts
+++ b/frontend/src/store/modules/v1/worksheet.ts
@@ -122,21 +122,30 @@ export const useWorkSheetStore = defineStore("worksheet_v1", () => {
}
return cacheByUID.getEntity([uid, view]);
};
- const fetchWorksheetByName = async (name: string) => {
+ const fetchWorksheetByName = async (
+ name: string,
+ silent: boolean = false
+ ) => {
const uid = extractWorksheetUID(name);
if (uid.startsWith("-") || !uid) {
return undefined;
}
try {
- const worksheet = await worksheetServiceClient.getWorksheet({
- name,
- });
+ const worksheet = await worksheetServiceClient.getWorksheet(
+ {
+ name,
+ },
+ { silent }
+ );
return worksheet;
} catch {
return undefined;
}
};
- const getOrFetchWorksheetByName = async (name: string) => {
+ const getOrFetchWorksheetByName = async (
+ name: string,
+ silent: boolean = false
+ ) => {
const uid = extractWorksheetUID(name);
if (uid.startsWith("-") || !uid) {
return undefined;
@@ -150,7 +159,7 @@ export const useWorkSheetStore = defineStore("worksheet_v1", () => {
return request;
}
- const promise = fetchWorksheetByName(name);
+ const promise = fetchWorksheetByName(name, silent);
cacheByUID.setRequest([uid, "FULL"], promise);
promise.then((worksheet) => {
if (!worksheet) {