mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 03:36:05 +00:00
fix(plugin-workflow): clear options when change collection (#547)
This commit is contained in:
parent
4a8c9c8d87
commit
fdb7b4c664
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@ -33,7 +33,7 @@
|
||||
"test",
|
||||
"--runInBand",
|
||||
// could be any single file path to debug
|
||||
"${workspaceFolder}/packages/"
|
||||
"${workspaceFolder}/packages/plugins/workflow/src/__tests__/instructions/parallel.test.ts"
|
||||
],
|
||||
"port": 9229,
|
||||
"skipFiles": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Select } from 'antd';
|
||||
import { observer, useForm } from '@formily/react';
|
||||
import { observer, useForm, useFormEffects } from '@formily/react';
|
||||
|
||||
import { useCollectionDataSource, useCollectionManager } from '../../collection-manager';
|
||||
import { useCompile } from '../../schema-component';
|
||||
@ -10,12 +10,19 @@ import { BaseTypeSet } from '../calculators';
|
||||
import { collection, filter } from '../schemas/collection';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { css } from '@emotion/css';
|
||||
import { onFieldValueChange } from '@formily/core';
|
||||
|
||||
const FieldsSelect = observer((props) => {
|
||||
const compile = useCompile();
|
||||
const { getCollectionFields } = useCollectionManager();
|
||||
const { values } = useForm();
|
||||
const { values, clearFormGraph, setValuesIn } = useForm();
|
||||
const fields = getCollectionFields(values?.config?.collection);
|
||||
useFormEffects(() => {
|
||||
onFieldValueChange('config.collection', (field) => {
|
||||
clearFormGraph('config.changed');
|
||||
setValuesIn('config.condition', null);
|
||||
});
|
||||
});
|
||||
|
||||
return (
|
||||
<Select
|
||||
|
@ -160,7 +160,7 @@ export const ScheduleConfig = () => {
|
||||
clearFormGraph('config.repeat');
|
||||
clearFormGraph('config.endsOn');
|
||||
clearFormGraph('config.limit');
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user