Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/reduce-audit-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"@coding-flow/flow-types": patch
"@coding-flow/flow-core": patch
"@coding-flow/flow-approval-presenter": patch
"@coding-flow/flow-pc-form": patch
"@coding-flow/flow-pc-approval": patch
"@coding-flow/flow-mobile-approval": patch
"@coding-flow/flow-design": patch
Expand All @@ -14,3 +15,8 @@ feat: 支持减签动作 REDUCE_AUDIT(codingapi/flow-engine#266、codingapi/fl
- 新增 `ReduceAuditViewPlugin`(`ReduceAuditViewPluginKey`)用于替换减签人员选择视图;默认实现为占位,集成方应列出当前节点的待审批人(不含当前审批人)。
- 设计器新增减签动作配置:仅「减签人员范围」(script),不提供「最大可选人数」。
- `FlowMessageKey.APPROVAL_REDUCE_AUDIT` 增加默认提示文案。

fix: 测试反馈问题(codingapi/flow-frontend#72)

- 合并审批(记录合并)必须先勾选要处理的流程记录才能提交,取消勾选会同步清空选择;此前表单有数据即可绕过校验,导致未选择流程也能通过/拒绝/保存/转办。
- 设计器「相同人员提交配置」未配置时默认展示「手动审批」,与后端未配置时的实际行为一致(issue #224 已移除默认策略,不再显示空值)。
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export const SameOperatorAuditStrategy:React.FC = () => {
render={({field: {value, onChange}}: FieldRenderProps<any>) => {
return (
<Select
value={value}
// 未配置时后端按「手动审批」处理(issue #224 已将默认策略移除),
// 这里同样以手动审批作为默认展示,避免下拉框空白造成误解
value={value ?? 'MANUAL_PASS'}
onChange={onChange}
options={[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { RevokeAction } from "@/components/flow-approval/components/action/revok
import { UrgeAction } from "@/components/flow-approval/components/action/urge";
import { ActionFactory } from "@/components/flow-approval/components/action/factory";
import { dispatchApprovalFrontEvent } from "@/components/flow-approval/components/action-front-event";
import { EventBus, ObjectUtils, FlowMessageKey, FlowMessageRegistry } from "@coding-flow/flow-core";
import { EventBus, FlowMessageKey, FlowMessageRegistry } from "@coding-flow/flow-core";
import { useApprovalContext } from "@coding-flow/flow-approval-presenter";

export const FlowApprovalActions = () => {
Expand All @@ -23,10 +23,12 @@ export const FlowApprovalActions = () => {

const handlerAction = (id: string) => {
const action = actionPresenter.getAction(id);
// 合并待办必须先显式选择要处理的流程记录,不能以「表单已有数据」代替选择
// (未选择时提交会落到默认记录上,issue-72 测试反馈)
if (state.flow?.mergeable) {
const todoCount = state.flow?.todos?.length ?? 0;
const selectRecordIds = actionPresenter.getSubmitRecordIds();
const currentFormData = actionPresenter.getCurrentFormData();
if (ObjectUtils.isEmptyObject(currentFormData) && selectRecordIds.length == 0) {
if (todoCount > 1 && selectRecordIds.length == 0) {
Toast.show(FlowMessageRegistry.getInstance().get(FlowMessageKey.APPROVAL_NO_SELECTED))
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useApprovalContext, FlowActionPresenter} from "@coding-flow/flow-approval-presenter";
import React from "react";
import {message, Space} from "antd";
import {ObjectUtils, FlowMessageKey, FlowMessageRegistry} from "@coding-flow/flow-core";
import {FlowMessageKey, FlowMessageRegistry} from "@coding-flow/flow-core";
import {ActionFactory} from "@/components/flow-approval/components/action/factory";
import {UrgeAction} from "@/components/flow-approval/components/action/urge";
import {RevokeAction} from "@/components/flow-approval/components/action/revoke";
Expand All @@ -17,10 +17,13 @@ export const FlowApprovalActions = () => {
const actionPresenter = context.getPresenter().getFlowActionPresenter();

const handlerClickCheck = (id: string) => {
// 合并待办(多条记录合并成一条 todo)必须先显式选择要处理的流程记录。
// 不能以「表单已有数据」代替选择:表单数据只代表当前展示的记录,
// 未选择时提交会落到默认记录上(issue-72 测试反馈)
if (state.flow?.mergeable) {
const todoCount = state.flow?.todos?.length ?? 0;
const selectRecordIds = actionPresenter.getSubmitRecordIds();
const currentFormData = actionPresenter.getCurrentFormData();
if (ObjectUtils.isEmptyObject(currentFormData) && selectRecordIds.length == 0) {
if (todoCount > 1 && selectRecordIds.length == 0) {
message.error(
FlowMessageRegistry.getInstance().get(FlowMessageKey.APPROVAL_NO_SELECTED)
)
Expand Down
8 changes: 4 additions & 4 deletions packages/flow-pc/flow-pc-form/src/components/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export const FlowTable: React.FC<FlowTableProps> = (props) => {
return [...columns, option];
}, []);

// 回掉登记当前选中中的合并流程
// 回掉登记当前选中中的合并流程。
// 取消选择时必须同步空数组,否则 presenter 会残留上一次的选择,
// 导致「未勾选任何流程」也能提交(issue-72 测试反馈)
React.useEffect(() => {
if (recordIdList.length > 0) {
props.onMergeRecordIdsSelected?.(recordIdList);
}
props.onMergeRecordIdsSelected?.(recordIdList);
}, [recordIdList]);

// 切换是触发右侧节点列表的筛选
Expand Down
Loading