Skip to content

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

fix: missing database group feature guard (#10957)

ecmadao5184ef310c84
diff --git a/frontend/src/components/DatabaseGroup/DatabaseGroupTable.vue b/frontend/src/components/DatabaseGroup/DatabaseGroupTable.vue
index 0911ec3a71..1eedeb0c1d 100644
--- a/frontend/src/components/DatabaseGroup/DatabaseGroupTable.vue
+++ b/frontend/src/components/DatabaseGroup/DatabaseGroupTable.vue
@@ -2,7 +2,7 @@
<BBGrid
:column-list="COLUMN_LIST"
:data-source="databaseGroupList"
- :row-clickable="true"
+ :row-clickable="rowClickable"
:show-placeholder="true"
row-key="name"
class="border"
@@ -32,6 +32,7 @@ import { ComposedDatabaseGroup } from "@/types";
import { DatabaseGroup } from "@/types/proto/v1/project_service";
const props = defineProps<{
+ rowClickable?: boolean;
databaseGroupList: ComposedDatabaseGroup[];
showEdit?: boolean;
}>();
diff --git a/frontend/src/components/DatabaseGroup/ProjectDatabaseGroupPanel.vue b/frontend/src/components/DatabaseGroup/ProjectDatabaseGroupPanel.vue
index 2ca96ac9bf..cf5bab2020 100644
--- a/frontend/src/components/DatabaseGroup/ProjectDatabaseGroupPanel.vue
+++ b/frontend/src/components/DatabaseGroup/ProjectDatabaseGroupPanel.vue
@@ -1,8 +1,11 @@
<template>
- <div class="w-full">
+ <div class="w-full space-y-4">
+ <FeatureAttention feature="bb.feature.database-grouping" />
+
<DatabaseGroupTable
:database-group-list="databaseGroupList"
:show-edit="allowEdit"
+ :row-clickable="hasDatabaseGroupFeature"
@edit="handleConfigureDatabaseGroup"
/>
</div>
@@ -14,12 +17,18 @@
:database-group="state.editingDatabaseGroup"
@close="state.showDatabaseGroupPanel = false"
/>
+
+ <FeatureModal
+ :open="state.showFeatureModal"
+ feature="bb.feature.database-grouping"
+ @cancel="state.showFeatureModal = false"
+ />
</template>
<script lang="ts" setup>
import { cloneDeep } from "lodash-es";
import { computed, onMounted, reactive } from "vue";
-import { useDBGroupStore } from "@/store";
+import { useDBGroupStore, hasFeature } from "@/store";
import { ComposedProject } from "@/types";
import { DatabaseGroup } from "@/types/proto/v1/project_service";
import DatabaseGroupPanel from "./DatabaseGroupPanel.vue";
@@ -27,6 +36,7 @@ import DatabaseGroupTable from "./DatabaseGroupTable.vue";
interface LocalState {
showDatabaseGroupPanel: boolean;
+ showFeatureModal: boolean;
editingDatabaseGroup?: DatabaseGroup;
}
@@ -37,9 +47,14 @@ const props = defineProps<{
const dbGroupStore = useDBGroupStore();
const state = reactive<LocalState>({
+ showFeatureModal: false,
showDatabaseGroupPanel: false,
});
+const hasDatabaseGroupFeature = computed(() => {
+ return hasFeature("bb.feature.database-grouping");
+});
+
const databaseGroupList = computed(() => {
return dbGroupStore.getDBGroupListByProjectName(props.project.name);
});
@@ -49,6 +64,10 @@ onMounted(async () => {
});
const handleConfigureDatabaseGroup = (databaseGroup: DatabaseGroup) => {
+ if (!hasDatabaseGroupFeature.value) {
+ state.showFeatureModal = true;
+ return;
+ }
state.editingDatabaseGroup = cloneDeep(databaseGroup);
state.showDatabaseGroupPanel = true;
};
diff --git a/frontend/src/store/modules/v1/subscription.ts b/frontend/src/store/modules/v1/subscription.ts
index dcaa07b6c3..65a823ad47 100644
--- a/frontend/src/store/modules/v1/subscription.ts
+++ b/frontend/src/store/modules/v1/subscription.ts
@@ -134,7 +134,11 @@ export const useSubscriptionV1Store = defineStore("subscription_v1", {
return this.canUpgradeTrial;
},
canUpgradeTrial(state): boolean {
- return this.isSelfHostLicense && this.currentPlan < PlanType.ENTERPRISE;
+ return (
+ this.isSelfHostLicense &&
+ this.isTrialing &&
+ this.currentPlan < PlanType.ENTERPRISE
+ );
},
isSelfHostLicense(state): boolean {
return import.meta.env.MODE.toLowerCase() !== "release-aws";