Merge branch 'main' into next

This commit is contained in:
nocobase[bot] 2025-02-06 08:49:25 +00:00
commit 2681953c9d
2 changed files with 5 additions and 6 deletions

View File

@ -183,7 +183,7 @@ describe('workflow > instructions > manual', () => {
expect(job.result).toEqual({ f1: { a: 2 }, _: 'resolve' });
});
it('values rejected will not be overrided by action assigned', async () => {
it('values rejected will be overrided by action assigned', async () => {
const n1 = await workflow.createNode({
type: 'manual',
config: {
@ -230,7 +230,7 @@ describe('workflow > instructions > manual', () => {
expect(execution.status).toBe(EXECUTION_STATUS.REJECTED);
const [job] = await execution.getJobs();
expect(job.status).toBe(JOB_STATUS.REJECTED);
expect(job.result).toEqual({ f1: { a: 1 }, _: 'reject' });
expect(job.result).toEqual({ f1: { a: 2 }, _: 'reject' });
});
it('values saved as pending will not be overrided by action assigned', async () => {

View File

@ -84,8 +84,7 @@ export async function submit(context: Context, next) {
userJob.set({
status: actionItem.status,
result:
actionItem.status > JOB_STATUS.PENDING
result: actionItem.status
? { [formKey]: Object.assign(values.result[formKey], presetValues), _: actionKey }
: Object.assign(userJob.result ?? {}, values.result),
});