Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: approval flow and feature guard (#6985)
ecmadao3606451a8c16
diff --git a/backend/utils/utils.go b/backend/utils/utils.goindex f08e964fef..235a6a91cb 100644--- a/backend/utils/utils.go+++ b/backend/utils/utils.go@@ -717,7 +717,7 @@ func HandleIncomingApprovalSteps(ctx context.Context, s *store.Store, relayClienvar approvers []*storepb.IssuePayloadApproval_Approvervar activities []*store.ActivityMessage- step := FindNextPendingStep(approval.ApprovalTemplates[0], approvers)+ step := FindNextPendingStep(approval.ApprovalTemplates[0], approval.Approvers)if step == nil {return nil, nil, nil}diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/ExternalApprovalNodesPanel/NodeTable.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/ExternalApprovalNodesPanel/NodeTable.vueindex fc7dc254e9..72970aa677 100644--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/ExternalApprovalNodesPanel/NodeTable.vue+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/ExternalApprovalNodesPanel/NodeTable.vue@@ -54,7 +54,12 @@ import { cloneDeep, pullAt } from "lodash-es";const { t } = useI18n();const context = useCustomApprovalContext();const settingStore = useSettingV1Store();-const { allowAdmin, externalApprovalNodeContext } = context;+const {+ hasFeature,+ showFeatureModal,+ allowAdmin,+ externalApprovalNodeContext,+} = context;const settingValue = computed(() => {const setting = settingStore.getSettingByName(@@ -88,6 +93,10 @@ const nodeList = computed(() => {});const editOrViewNode = (node: ExternalApprovalSetting_Node) => {+ if (!hasFeature.value) {+ showFeatureModal.value = true;+ return;+ }externalApprovalNodeContext.value = {mode: "EDIT",node,diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/ExternalApprovalNodesPanel/Toolbar.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/ExternalApprovalNodesPanel/Toolbar.vueindex 2b448e0856..4eeafe6ffd 100644--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/ExternalApprovalNodesPanel/Toolbar.vue+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/ExternalApprovalNodesPanel/Toolbar.vue@@ -13,9 +13,18 @@ import { v4 as uuidv4 } from "uuid";import { useCustomApprovalContext } from "../context";import { ExternalApprovalSetting_Node } from "@/types/proto/v1/setting_service";const context = useCustomApprovalContext();-const { allowAdmin, externalApprovalNodeContext } = context;+const {+ hasFeature,+ showFeatureModal,+ allowAdmin,+ externalApprovalNodeContext,+} = context;const createNode = () => {+ if (!hasFeature.value) {+ showFeatureModal.value = true;+ return;+ }externalApprovalNodeContext.value = {mode: "CREATE",node: ExternalApprovalSetting_Node.fromJSON({diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/FlowTable.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/FlowTable.vueindex 5d13db84af..7a6ef3e51d 100644--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/FlowTable.vue+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/FlowTable.vue@@ -89,7 +89,7 @@ const state = reactive<LocalState>({const { t } = useI18n();const store = useWorkspaceApprovalSettingStore();const context = useCustomApprovalContext();-const { allowAdmin, dialog } = context;+const { hasFeature, showFeatureModal, allowAdmin, dialog } = context;const COLUMN_LIST = computed(() => {const columns: BBGridColumn[] = [@@ -125,6 +125,10 @@ const filteredApprovalRuleList = computed(() => {});const editApprovalTemplate = (rule: LocalApprovalRule) => {+ if (!hasFeature.value) {+ showFeatureModal.value = true;+ return;+ }dialog.value = {mode: "EDIT",rule,diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/Toolbar.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/Toolbar.vueindex ce5df8c868..a5cc29efc2 100644--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/Toolbar.vue+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/Toolbar.vue@@ -12,9 +12,13 @@ import { NButton } from "naive-ui";import { useCustomApprovalContext } from "../context";import { emptyLocalApprovalRule } from "../logic";const context = useCustomApprovalContext();-const { allowAdmin, dialog } = context;+const { hasFeature, showFeatureModal, allowAdmin, dialog } = context;const createRule = () => {+ if (!hasFeature.value) {+ showFeatureModal.value = true;+ return;+ }dialog.value = {mode: "CREATE",rule: emptyLocalApprovalRule(),diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RuleSelect.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RuleSelect.vueindex a09cb736f9..9ec45c4315 100644--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RuleSelect.vue+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RuleSelect.vue@@ -58,7 +58,7 @@ defineEmits<{const { t } = useI18n();const store = useWorkspaceApprovalSettingStore();const context = useCustomApprovalContext();-const { allowAdmin } = context;+const { hasFeature, showFeatureModal, allowAdmin } = context;const attrs = useAttrs();const selectAttrs = computed(() => ({@@ -87,6 +87,10 @@ const toApprovalFlow = () => {if (!rule) {return;}+ if (!hasFeature.value) {+ showFeatureModal.value = true;+ return;+ }context.dialog.value = {mode: "EDIT",rule,diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskCenter.vue b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskCenter.vueindex ee80bfb077..d68e3ad694 100644--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskCenter.vue+++ b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskCenter.vue@@ -33,7 +33,7 @@ import { useRiskStore } from "@/store";const riskStore = useRiskStore();const context = useRiskCenterContext();const filter = useRiskFilter();-const { allowAdmin } = context;+const { allowAdmin, hasFeature, showFeatureModal } = context;const filteredRiskList = computed(() => {let list = [...riskStore.riskList];@@ -76,6 +76,10 @@ const addRisk = () => {source: filter.source.value || SupportedSourceList[0],active: true,});+ if (!hasFeature.value) {+ showFeatureModal.value = true;+ return;+ }context.dialog.value = {mode: "CREATE",risk,diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskTable.vue b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskTable.vueindex c47a739c90..1a19e097e4 100644--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskTable.vue+++ b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskTable.vue@@ -56,7 +56,7 @@ defineProps<{const { t } = useI18n();const context = useRiskCenterContext();-const { allowAdmin } = context;+const { hasFeature, showFeatureModal, allowAdmin } = context;const COLUMN_LIST = computed(() => {const columns: BBGridColumn[] = [@@ -80,6 +80,10 @@ const COLUMN_LIST = computed(() => {});const editRisk = (risk: Risk) => {+ if (!hasFeature.value) {+ showFeatureModal.value = true;+ return;+ }context.dialog.value = {mode: "EDIT",risk,