Skip to content

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

chore: ui fix (#18234)

ecmadaodcc112a4c00c
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesPanel.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesPanel.vue
index 0a2148af60..fcbf5a8959 100644
--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesPanel.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesPanel.vue
@@ -1,5 +1,5 @@
<template>
- <div class="w-full flex flex-col gap-y-4">
+ <div class="w-full flex flex-col gap-y-6">
<RulesSection
v-for="source in supportedSourceList"
:key="source"
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesSection.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesSection.vue
index f32008f47d..054b906c0f 100644
--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesSection.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesSection.vue
@@ -4,20 +4,12 @@
<div class="font-medium text-base">
{{ sourceDisplayText }}
</div>
- <div class="flex items-center gap-x-2">
- <NButton size="small" @click="handleAddRule">
- <template #icon>
- <PlusIcon class="w-4" />
- </template>
- {{ $t("custom-approval.approval-flow.add-rule") }}
- </NButton>
- <NTooltip>
- <template #trigger>
- <HelpCircleIcon class="w-4 h-4 text-control-light cursor-help" />
- </template>
- {{ $t("custom-approval.rule.first-match-wins") }}
- </NTooltip>
- </div>
+ <NButton size="small" @click="handleAddRule">
+ <template #icon>
+ <PlusIcon class="w-4" />
+ </template>
+ {{ $t("custom-approval.approval-flow.add-rule") }}
+ </NButton>
</div>
<NDataTable
@@ -40,16 +32,12 @@
</template>
<script lang="tsx" setup>
-import {
- HelpCircleIcon,
- PencilIcon,
- PlusIcon,
- TrashIcon,
-} from "lucide-vue-next";
+import { PencilIcon, PlusIcon, TrashIcon } from "lucide-vue-next";
import type { DataTableColumn } from "naive-ui";
-import { NButton, NDataTable, NPopconfirm, NTooltip } from "naive-ui";
+import { NButton, NDataTable, NPopconfirm } from "naive-ui";
import { computed, ref } from "vue";
import { useI18n } from "vue-i18n";
+import { MiniActionButton } from "@/components/v2";
import { pushNotification, useWorkspaceApprovalSettingStore } from "@/store";
import type { LocalApprovalRule } from "@/types";
import type { WorkspaceApprovalSetting_Rule_Source } from "@/types/proto-es/v1/setting_service_pb";
@@ -79,6 +67,7 @@ const columns = computed((): DataTableColumn<LocalApprovalRule>[] => [
title: t("common.title"),
key: "title",
width: 200,
+ resizable: true,
ellipsis: { tooltip: true },
render: (row) => row.title || "-",
},
@@ -86,12 +75,14 @@ const columns = computed((): DataTableColumn<LocalApprovalRule>[] => [
title: t("cel.condition.self"),
key: "condition",
ellipsis: { tooltip: true },
+ resizable: true,
render: (row) => <code class="text-xs">{row.condition || "true"}</code>,
},
{
title: t("custom-approval.approval-flow.self"),
key: "flow",
width: 280,
+ resizable: true,
render: (row) => formatApprovalFlow(row.flow),
},
{
@@ -100,9 +91,9 @@ const columns = computed((): DataTableColumn<LocalApprovalRule>[] => [
width: 100,
render: (row) => (
<div class="flex gap-x-1">
- <NButton size="tiny" onClick={() => handleEditRule(row)}>
+ <MiniActionButton onClick={() => handleEditRule(row)}>
<PencilIcon class="w-3" />
- </NButton>
+ </MiniActionButton>
<NPopconfirm
onPositiveClick={() => handleDeleteRule(row)}
positiveText={t("common.confirm")}
@@ -110,9 +101,9 @@ const columns = computed((): DataTableColumn<LocalApprovalRule>[] => [
>
{{
trigger: () => (
- <NButton size="tiny">
+ <MiniActionButton>
<TrashIcon class="w-3" />
- </NButton>
+ </MiniActionButton>
),
default: () => t("common.confirm") + "?",
}}
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/StepsTable.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/StepsTable.vue
index 22ec1180a3..74eaf0a379 100644
--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/StepsTable.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/StepsTable.vue
@@ -72,6 +72,7 @@ const columns = computed(
if (props.editable) {
return h(RoleSelect, {
suffix: "",
+ placement: "top-start",
value: stepData.role,
style: "width: 80%",
"onUpdate:value": (val: string | string[]) => {
diff --git a/frontend/src/components/ExprEditor/ConditionGroup.vue b/frontend/src/components/ExprEditor/ConditionGroup.vue
index a9df56a117..7344490272 100644
--- a/frontend/src/components/ExprEditor/ConditionGroup.vue
+++ b/frontend/src/components/ExprEditor/ConditionGroup.vue
@@ -38,7 +38,7 @@
</div>
</div>
- <div v-if="root && args.length === 0" class="px-1.5 text-gray-500">
+ <div v-if="root && args.length === 0" class="text-gray-500">
{{ $t("cel.condition.add-root-condition-placeholder") }}
</div>
<div
diff --git a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalStepItem.vue b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalStepItem.vue
index a7ad4108fd..f92637dbfa 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalStepItem.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalStepItem.vue
@@ -80,6 +80,7 @@ import {
useCurrentUserV1,
useGroupStore,
useProjectIamPolicyStore,
+ useRoleStore,
useUserStore,
} from "@/store";
import { userNamePrefix } from "@/store/modules/v1/common";
@@ -107,6 +108,7 @@ const { project } = useCurrentProjectV1();
const groupStore = useGroupStore();
const currentUser = useCurrentUserV1();
const userStore = useUserStore();
+const roleStore = useRoleStore();
const projectIamPolicyStore = useProjectIamPolicyStore();
const currentUserEmail = computed(() => currentUser.value.email);
@@ -180,6 +182,10 @@ const roleName = computed((): string => {
} else if (role === PresetRoleType.WORKSPACE_ADMIN) {
return t("role.workspace-admin.self");
}
+ const customRole = roleStore.getRoleByName(role);
+ if (customRole) {
+ return customRole.title;
+ }
}
return t("custom-approval.approval-flow.node.approver");
});
diff --git a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/PotentialApprovers.vue b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/PotentialApprovers.vue
index 362c6a718b..e62b5e2a2d 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/PotentialApprovers.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/PotentialApprovers.vue
@@ -22,7 +22,7 @@
</div>
</NPopover>
<!-- Show user avatars when 3 or fewer users -->
- <div v-else class="flex items-center gap-1">
+ <div v-else class="flex flex-col items-start gap-1">
<UserView
v-for="user in users"
:key="user.email"
diff --git a/frontend/src/components/TransferOutDatabaseForm/TransferOutDatabaseForm.vue b/frontend/src/components/TransferOutDatabaseForm/TransferOutDatabaseForm.vue
index dfe5142c2f..30c438ce06 100644
--- a/frontend/src/components/TransferOutDatabaseForm/TransferOutDatabaseForm.vue
+++ b/frontend/src/components/TransferOutDatabaseForm/TransferOutDatabaseForm.vue
@@ -9,19 +9,17 @@
>
<BBSpin />
</div>
- <div v-else class="gap-y-4 pb-4">
- <div class="gap-y-4">
- <span class="text-main text-base">
- {{ $t("database.transfer.select-databases") }}
- <span class="text-red-500">*</span>
- </span>
- <DatabaseV1Table
- :database-list="databaseList"
- :show-selection="true"
- v-model:selected-database-names="selectedDatabaseNameList"
- />
- </div>
- <NDivider class="w-full py-2" />
+ <div v-else class="flex flex-col gap-y-4 pb-4">
+ <span class="text-main text-base">
+ {{ $t("database.transfer.select-databases") }}
+ <span class="text-red-500">*</span>
+ </span>
+ <DatabaseV1Table
+ :database-list="databaseList"
+ :show-selection="true"
+ v-model:selected-database-names="selectedDatabaseNameList"
+ />
+ <NDivider class="w-full" />
<NRadioGroup v-model:value="transfer" class="gap-x-4">
<NRadio value="project">
<span class="text-main text-base">
diff --git a/frontend/src/store/modules/v1/database.ts b/frontend/src/store/modules/v1/database.ts
index 2190920809..9fd0a6cd14 100644
--- a/frontend/src/store/modules/v1/database.ts
+++ b/frontend/src/store/modules/v1/database.ts
@@ -112,10 +112,8 @@ const getListDatabaseFilter = (filter: DatabaseFilter): string => {
if (isValidInstanceName(filter.instance)) {
params.push(`instance == "${filter.instance}"`);
}
- if (filter.environment !== undefined) {
- params.push(
- `environment == "${isValidEnvironmentName(filter.environment) ? filter.environment : ""}"`
- );
+ if (isValidEnvironmentName(filter.environment)) {
+ params.push(`environment == "${filter.environment}"`);
}
if (filter.excludeUnassigned) {
params.push(`exclude_unassigned == true`);
diff --git a/frontend/src/store/modules/v1/instance.ts b/frontend/src/store/modules/v1/instance.ts
index fba39d1bd7..d8e06ccb3e 100644
--- a/frontend/src/store/modules/v1/instance.ts
+++ b/frontend/src/store/modules/v1/instance.ts
@@ -58,10 +58,8 @@ const getListInstanceFilter = (params: InstanceFilter) => {
if (isValidProjectName(params.project)) {
list.push(`project == "${params.project}"`);
}
- if (params.environment !== undefined) {
- list.push(
- `environment == "${isValidEnvironmentName(params.environment) ? params.environment : ""}"`
- );
+ if (isValidEnvironmentName(params.environment)) {
+ list.push(`environment == "${params.environment}"`);
}
if (params.host) {
list.push(`host.matches("${params.host}")`);
diff --git a/frontend/src/views/SettingWorkspaceCustomApproval.vue b/frontend/src/views/SettingWorkspaceCustomApproval.vue
index 08cd788738..0f70f33a47 100644
--- a/frontend/src/views/SettingWorkspaceCustomApproval.vue
+++ b/frontend/src/views/SettingWorkspaceCustomApproval.vue
@@ -1,6 +1,7 @@
<template>
<div class="w-full flex flex-col gap-y-4 text-sm">
<FeatureAttention :feature="PlanFeature.FEATURE_APPROVAL_WORKFLOW" />
+ <BBAttention v-if="hasCustomApprovalFeature" type="info" :description="$t('custom-approval.rule.first-match-wins')" />
<CustomApproval v-if="state.ready" />
<div v-else class="w-full py-16 flex justify-center items-center">
@@ -17,7 +18,7 @@
<script lang="ts" setup>
import { onMounted, reactive, toRef } from "vue";
-import { BBSpin } from "@/bbkit";
+import { BBAttention, BBSpin } from "@/bbkit";
import {
CustomApproval,
provideCustomApprovalContext,