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' }); 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({ const n1 = await workflow.createNode({
type: 'manual', type: 'manual',
config: { config: {
@ -230,7 +230,7 @@ describe('workflow > instructions > manual', () => {
expect(execution.status).toBe(EXECUTION_STATUS.REJECTED); expect(execution.status).toBe(EXECUTION_STATUS.REJECTED);
const [job] = await execution.getJobs(); const [job] = await execution.getJobs();
expect(job.status).toBe(JOB_STATUS.REJECTED); 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 () => { it('values saved as pending will not be overrided by action assigned', async () => {

View File

@ -84,10 +84,9 @@ export async function submit(context: Context, next) {
userJob.set({ userJob.set({
status: actionItem.status, status: actionItem.status,
result: result: actionItem.status
actionItem.status > JOB_STATUS.PENDING ? { [formKey]: Object.assign(values.result[formKey], presetValues), _: actionKey }
? { [formKey]: Object.assign(values.result[formKey], presetValues), _: actionKey } : Object.assign(userJob.result ?? {}, values.result),
: Object.assign(userJob.result ?? {}, values.result),
}); });
const handler = instruction.formTypes.get(forms[formKey].type); const handler = instruction.formTypes.get(forms[formKey].type);