Skip to content

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

chore: update db dashboard in standalone mode (#9203)

boojackdce9befca238
diff --git a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseOperations.vue b/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseOperations.vue
index 7abf945d4b..0d529af7eb 100644
--- a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseOperations.vue
+++ b/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseOperations.vue
@@ -75,6 +75,7 @@
</template>
<script lang="ts" setup>
+import { storeToRefs } from "pinia";
import { computed, h, VNode, reactive, ref } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
@@ -92,6 +93,7 @@ import {
useGracefulRequest,
useDBSchemaV1Store,
pushNotification,
+ useActuatorV1Store,
} from "@/store";
import { ComposedDatabase, DEFAULT_PROJECT_V1_NAME } from "@/types";
import { Database } from "@/types/proto/v1/database_service";
@@ -140,12 +142,14 @@ const schemaEditorContext = ref<{
});
const { t } = useI18n();
+const router = useRouter();
+const actuatorStore = useActuatorV1Store();
const databaseStore = useDatabaseV1Store();
const projectStore = useProjectV1Store();
const dbSchemaStore = useDBSchemaV1Store();
const currentUserV1 = useCurrentUserV1();
const currentUserIamPolicy = useCurrentUserIamPolicy();
-const router = useRouter();
+const { pageMode } = storeToRefs(actuatorStore);
const selectedProjectNames = computed(() => {
return new Set(props.databases.map((db) => db.project));
@@ -239,7 +243,8 @@ const generateMultiDb = async (
) => {
if (
type === "bb.issue.database.schema.update" &&
- allowUsingSchemaEditorV1(props.databases)
+ allowUsingSchemaEditorV1(props.databases) &&
+ pageMode.value === "BUNDLED"
) {
schemaEditorContext.value.databaseIdList = [
...selectedDatabaseUidList.value,
@@ -309,21 +314,30 @@ const syncSchema = async () => {
};
const actions = computed((): DatabaseAction[] => {
- const resp: DatabaseAction[] = [
- {
+ const resp: DatabaseAction[] = [];
+ if (pageMode.value === "BUNDLED") {
+ resp.push({
icon: h(RefreshIcon),
text: t("common.sync"),
disabled: props.databases.length < 1,
click: syncSchema,
- },
- ];
- if (allowTransferProject.value) {
- resp.unshift({
- icon: h(SwitchHorizontalIcon),
- text: t("database.transfer-project"),
- disabled: !selectedProjectUid.value,
- click: () => (state.showTransferOutDatabaseForm = true),
});
+ if (allowTransferProject.value) {
+ resp.unshift({
+ icon: h(SwitchHorizontalIcon),
+ text: t("database.transfer-project"),
+ disabled: !selectedProjectUid.value,
+ click: () => (state.showTransferOutDatabaseForm = true),
+ });
+ }
+ if (allowEditLabels.value) {
+ resp.push({
+ icon: h(TagIcon),
+ text: t("database.edit-labels"),
+ disabled: false,
+ click: () => (state.showLabelEditorDrawer = true),
+ });
+ }
}
if (!selectedProjectNames.value.has(DEFAULT_PROJECT_V1_NAME)) {
if (allowChangeData.value) {
@@ -343,14 +357,6 @@ const actions = computed((): DatabaseAction[] => {
});
}
}
- if (allowEditLabels.value) {
- resp.push({
- icon: h(TagIcon),
- text: t("database.edit-labels"),
- disabled: false,
- click: () => (state.showLabelEditorDrawer = true),
- });
- }
return resp;
});
diff --git a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseTableRow.vue b/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseTableRow.vue
index a0af8e2893..dbb7f73974 100644
--- a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseTableRow.vue
+++ b/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseTableRow.vue
@@ -9,6 +9,7 @@
<div class="bb-grid-cell">
<div class="flex items-center space-x-2">
<SQLEditorButtonV1
+ v-if="!isStandaloneMode"
:database="database"
:disabled="!allowQuery"
:tooltip="true"
@@ -53,9 +54,10 @@
</template>
<script lang="ts" setup>
+import { storeToRefs } from "pinia";
import { computed } from "vue";
import { InstanceV1Name, EnvironmentV1Name } from "@/components/v2";
-import { useEnvironmentV1Store } from "@/store";
+import { useActuatorV1Store, useEnvironmentV1Store } from "@/store";
import { ComposedDatabase } from "@/types";
import { isPITRDatabaseV1 } from "@/utils";
import LabelsColumn from "./LabelsColumn.vue";
@@ -77,9 +79,16 @@ const props = defineProps<{
defineEmits(["goto-sql-editor-failed"]);
+const actuatorStore = useActuatorV1Store();
+const { pageMode } = storeToRefs(actuatorStore);
+
const environment = computed(() => {
return useEnvironmentV1Store().getEnvironmentByName(
props.database.environment
);
});
+
+const isStandaloneMode = computed(() => {
+ return pageMode.value === "STANDALONE";
+});
</script>
diff --git a/frontend/src/views/DatabaseDashboard.vue b/frontend/src/views/DatabaseDashboard.vue
index 1bb28e6fbf..b9b90874b6 100644
--- a/frontend/src/views/DatabaseDashboard.vue
+++ b/frontend/src/views/DatabaseDashboard.vue
@@ -8,7 +8,7 @@
/>
<div class="flex items-center space-x-4">
- <NTooltip v-if="canVisitUnassignedDatabases">
+ <NTooltip v-if="canVisitUnassignedDatabases && !isStandaloneMode">
<template #trigger>
<router-link
:to="{
@@ -62,6 +62,9 @@
:database-group-list="filteredDatabaseGroupList"
:show-placeholder="true"
:show-selection-column="true"
+ :custom-click="isStandaloneMode"
+ @select-database="(db: ComposedDatabase) =>
+ toggleDatabasesSelection([db as ComposedDatabase], !isDatabaseSelected(db))"
>
<template #selection-all="{ databaseList }">
<input
@@ -107,6 +110,7 @@
<script lang="ts" setup>
import { NInputGroup, NTooltip } from "naive-ui";
+import { storeToRefs } from "pinia";
import { computed, watchEffect, onMounted, reactive, ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import {
@@ -117,6 +121,7 @@ import {
} from "@/components/v2";
import { isDatabase } from "@/components/v2/Model/DatabaseV1Table/utils";
import {
+ useActuatorV1Store,
useCurrentUserV1,
useDBGroupStore,
useDatabaseV1Store,
@@ -159,6 +164,8 @@ const router = useRouter();
const uiStateStore = useUIStateStore();
const environmentV1Store = useEnvironmentV1Store();
const { projectList } = useProjectV1ListByCurrentUser();
+const actuatorStore = useActuatorV1Store();
+const { pageMode } = storeToRefs(actuatorStore);
const state = reactive<LocalState>({
instanceFilter: String(UNKNOWN_ID),
@@ -184,6 +191,10 @@ const preparePolicyList = () => {
watchEffect(preparePolicyList);
+const isStandaloneMode = computed(() => {
+ return pageMode.value === "STANDALONE";
+});
+
const selectedEnvironment = computed(() => {
const { environment } = route.query;
return environment