fix: linkage rule title config clear exception (#1665)
* fix: linkage rule title config clear exception * fix: form linkage rules disabled without immediate effect * refactor: improve translation
This commit is contained in:
parent
1d6417f7f9
commit
59326dbf90
@ -71,6 +71,7 @@ const WithForm = (props) => {
|
||||
const { setFormValueChanged } = useActionContext();
|
||||
const linkageRules =
|
||||
(getLinkageRules(fieldSchema) || fieldSchema.parent?.['x-linkage-rules'])?.filter((k) => !k.disabled) || [];
|
||||
form.clearFormGraph();
|
||||
useEffect(() => {
|
||||
const id = uid();
|
||||
form.addEffects(id, () => {
|
||||
@ -117,7 +118,6 @@ const WithForm = (props) => {
|
||||
if (linkageRules.length > 0) {
|
||||
const id = uid();
|
||||
const linkagefields = [];
|
||||
const formGraph = form.getFormGraph();
|
||||
form.addEffects(id, () => {
|
||||
return linkageRules.map((v, index) => {
|
||||
return v.actions?.map((h) => {
|
||||
@ -140,8 +140,6 @@ const WithForm = (props) => {
|
||||
});
|
||||
return () => {
|
||||
form.removeEffects(id);
|
||||
form.clearFormGraph();
|
||||
form.setFormGraph(formGraph);
|
||||
};
|
||||
}
|
||||
}, [linkageRules]);
|
||||
|
@ -16,7 +16,8 @@ const LinkageRulesTitle = (props) => {
|
||||
const value = array?.field?.value[index];
|
||||
return (
|
||||
<Input.TextArea
|
||||
value={value.title || t('linkage rule')}
|
||||
value={value.title}
|
||||
defaultValue={t('Linkage rule')}
|
||||
onChange={(ev) => {
|
||||
ev.stopPropagation();
|
||||
array.field.value.splice(index, 1, { ...value, title: ev.target.value });
|
||||
|
Loading…
Reference in New Issue
Block a user