Skip to content

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

chore: set project parent (#14961)

Danny Xu90b4c25891ec
diff --git a/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue b/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
index e32de79795..14d5f3c8a8 100644
--- a/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
+++ b/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
@@ -160,14 +160,14 @@ interface LocalState {
}
const props = defineProps<{
- project?: ComposedProject;
+ project: ComposedProject;
selectedTab?: AnomalyTabId;
}>();
const { t } = useI18n();
const databaseStore = useDatabaseV1Store();
const environmentStore = useEnvironmentV1Store();
-const allAnomalyList = await useAnomalyV1Store().fetchAnomalyList({});
+const allAnomalyList = await useAnomalyV1Store().fetchAnomalyList(props.project?.name, {});
const instanceList = useInstanceResourceList();
const environmentList = useEnvironmentV1List(false /* !showDeleted */);
diff --git a/frontend/src/store/modules/v1/anomaly.ts b/frontend/src/store/modules/v1/anomaly.ts
index 521a131d4f..97de915db7 100644
--- a/frontend/src/store/modules/v1/anomaly.ts
+++ b/frontend/src/store/modules/v1/anomaly.ts
@@ -15,8 +15,9 @@ const buildFilter = (find: FindAnomalyMessage): string => {
export const useAnomalyV1Store = defineStore("anomaly_v1", {
actions: {
- async fetchAnomalyList(find: FindAnomalyMessage) {
+ async fetchAnomalyList(project: string, find: FindAnomalyMessage) {
const resp = await anomalyServiceClient.searchAnomalies({
+ parent: project,
filter: buildFilter(find),
});
return resp.anomalies;
diff --git a/frontend/src/views/AnomalyCenterDashboard.vue b/frontend/src/views/AnomalyCenterDashboard.vue
deleted file mode 100644
index db9d5c71bb..0000000000
--- a/frontend/src/views/AnomalyCenterDashboard.vue
+++ /dev/null
@@ -1,18 +0,0 @@
-<template>
- <div class="px-4">
- <AnomalyCenterDashboard :selected-tab="selectedTab" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed } from "vue";
-import type { AnomalyTabId } from "@/components/AnomalyCenter/AnomalyCenterDashboard.vue";
-import AnomalyCenterDashboard from "@/components/AnomalyCenter/AnomalyCenterDashboard.vue";
-import { hasWorkspacePermissionV2 } from "@/utils";
-
-const selectedTab = computed((): AnomalyTabId => {
- return hasWorkspacePermissionV2("bb.instances.update")
- ? "instance"
- : "database";
-});
-</script>
diff --git a/frontend/src/views/DatabaseDetail/DatabaseDetail.vue b/frontend/src/views/DatabaseDetail/DatabaseDetail.vue
index e8c4f8fb57..239d191406 100644
--- a/frontend/src/views/DatabaseDetail/DatabaseDetail.vue
+++ b/frontend/src/views/DatabaseDetail/DatabaseDetail.vue
@@ -305,9 +305,10 @@ const disableSchemaEditor = useAppFeature(
const databaseChangeMode = useAppFeature("bb.feature.database-change-mode");
onMounted(async () => {
- anomalyList.value = await useAnomalyV1Store().fetchAnomalyList({
- database: database.value.name,
- });
+ anomalyList.value = await useAnomalyV1Store().fetchAnomalyList(
+ database.value.project,
+ {database: database.value.name}
+ );
});
watch(
@@ -398,9 +399,10 @@ const handleGotoSQLEditorFailed = () => {
};
const updateAnomalyList = async () => {
- anomalyList.value = await useAnomalyV1Store().fetchAnomalyList({
- database: database.value.name,
- });
+ anomalyList.value = await useAnomalyV1Store().fetchAnomalyList(
+ database.value.project,
+ {database: database.value.name}
+ );
};
const environment = computed(() => {