Skip to content

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

feat(frontend): minor optimizations for risk center and custom approval (#5348)

Liu Ji79322fd9cf26
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RuleSelect.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RuleSelect.vue
index 06ce32b7e7..a09cb736f9 100644
--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RuleSelect.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RuleSelect.vue
@@ -13,6 +13,7 @@
:placeholder="$t('custom-approval.approval-flow.select')"
:consistent-menu-width="false"
:disabled="disabled || !allowAdmin"
+ :filterable="true"
v-bind="selectAttrs"
/>
<NButton
@@ -23,7 +24,7 @@
:disabled="!selectedRule"
@click="toApprovalFlow"
>
- <heroicons:arrow-top-right-on-square class="w-5 h-5" />
+ <heroicons:pencil-square class="w-5 h-5" />
</NButton>
</div>
</template>
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 4e32349c3e..fe31b0b460 100644
--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesSection.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesSection.vue
@@ -83,6 +83,7 @@ const rulesMap = computed(() => {
const rows = computed(() => {
const filteredLevelList = [...filter.levels.value.values()];
+ filteredLevelList.sort((a, b) => -(a - b)); // by level DESC
const displayLevelList =
filteredLevelList.length === 0
? PresetRiskLevelList.map((item) => item.level)
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/ExprEditor/components/common.ts b/frontend/src/components/CustomApproval/Settings/components/common/ExprEditor/components/common.ts
index b1a552440b..4c7d15a05d 100644
--- a/frontend/src/components/CustomApproval/Settings/components/common/ExprEditor/components/common.ts
+++ b/frontend/src/components/CustomApproval/Settings/components/common/ExprEditor/components/common.ts
@@ -13,15 +13,15 @@ export const useSelectOptions = (expr: Ref<ConditionExpr>) => {
const context = useExprEditorContext();
const { riskSource } = context;
- const getEnvironmentOptions = () => {
+ const getEnvironmentIdOptions = () => {
const environmentList = useEnvironmentStore().getEnvironmentList();
return environmentList.map<SelectOption>((env) => ({
- label: env.name,
+ label: env.resourceId,
value: env.resourceId,
}));
};
- const getProjectOptions = () => {
+ const getProjectIdOptions = () => {
const user = useCurrentUser().value;
const projectList = useProjectStore().getProjectListByUser(user.id);
return projectList.map<SelectOption>((proj) => ({
@@ -72,10 +72,10 @@ export const useSelectOptions = (expr: Ref<ConditionExpr>) => {
const options = computed(() => {
const factor = expr.value.args[0];
if (factor === "environment_id") {
- return getEnvironmentOptions();
+ return getEnvironmentIdOptions();
}
if (factor === "project_id") {
- return getProjectOptions();
+ return getProjectIdOptions();
}
if (factor === "db_engine") {
return getDBEndingOptions();