Merge branch 'main' into next

This commit is contained in:
GitHub Actions Bot 2024-08-06 03:05:45 +00:00
commit 7cb923f7bd
3 changed files with 11 additions and 2 deletions

View File

@ -451,23 +451,30 @@ function useSubmit() {
const api = useAPIClient();
const { setVisible } = useActionContext();
const { values, submit } = useForm();
const field = useField();
const buttonSchema = useFieldSchema();
const { service } = useTableBlockContext();
const { userJob, execution } = useFlowContext();
const { name: actionKey } = buttonSchema;
const { name: formKey } = buttonSchema.parent.parent;
const { assignedValues = {} } = buttonSchema?.['x-action-settings'] ?? {};
return {
async run() {
if (execution.status || userJob.status) {
return;
}
await submit();
field.data = field.data || {};
field.data.loading = true;
await api.resource('users_jobs').submit({
filterByTk: userJob.id,
values: {
result: { [formKey]: values, _: actionKey },
result: { [formKey]: { ...values, ...assignedValues.values }, _: actionKey },
},
});
field.data.loading = false;
setVisible(false);
service.refresh();
},

View File

@ -39,6 +39,7 @@ import {
useSchemaInitializer,
useSchemaInitializerItem,
useSchemaOptionsContext,
useVariableScope,
} from '@nocobase/client';
import WorkflowPlugin, {
DetailsBlockProvider,
@ -358,7 +359,7 @@ function ActionInitializer() {
...actionProps,
useAction: '{{ useSubmit }}',
},
'x-designer': 'Action.Designer',
'x-designer': 'ManualActionDesigner',
'x-action': `${action}`,
}}
type="x-action"

View File

@ -70,6 +70,7 @@ function UpdateFormDesigner() {
});
dn.refresh();
}}
width="60%"
/>
<SchemaSettingsLinkageRules collectionName={name} />
<SchemaSettingsDivider />