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

View File

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