refactor(plugin-workflow): hide unused form in manual ui after done (#2526)

This commit is contained in:
Junyi 2023-08-24 20:07:44 +07:00 committed by GitHub
parent 42acff6c75
commit 54692387d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View File

@ -47,7 +47,7 @@ export function FormBlockProvider(props) {
const resource = api.resource(props.collection);
const __parent = useContext(BlockRequestContext);
return (
return !userJob.status || values ? (
<CollectionProvider collection={props.collection}>
<RecordProvider record={values} parent={false}>
<BlockRequestContext.Provider value={{ block: 'form', props, field, service, resource, __parent }}>
@ -71,5 +71,5 @@ export function FormBlockProvider(props) {
</BlockRequestContext.Provider>
</RecordProvider>
</CollectionProvider>
);
) : null;
}

View File

@ -40,7 +40,7 @@ function CustomFormBlockProvider(props) {
[values],
);
return (
return !userJob.status || values ? (
<CollectionProvider
collection={{
...props.collection,
@ -59,7 +59,7 @@ function CustomFormBlockProvider(props) {
</FormBlockContext.Provider>
</RecordProvider>
</CollectionProvider>
);
) : null;
}
function CustomFormBlockInitializer({ insert, ...props }) {
@ -104,10 +104,6 @@ function CustomFormBlockInitializer({ insert, ...props }) {
'x-component': 'ActionBar',
'x-component-props': {
layout: 'one-column',
style: {
marginTop: '1.5em',
flexWrap: 'wrap',
},
},
'x-initializer': 'AddActionButton',
properties: {