mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-05 21:57:45 +08:00
fix(plugin-sequence): avoid invalid value from ArrayTable.useRecord()
(#2859)
This commit is contained in:
parent
e920629a91
commit
d3bf9a7a4d
@ -40,9 +40,11 @@ function RuleTypeSelect(props) {
|
||||
}
|
||||
|
||||
function RuleOptions() {
|
||||
const { type, options } = ArrayTable.useRecord();
|
||||
const ruleType = RuleTypes[type];
|
||||
const compile = useCompile();
|
||||
const { values } = useForm();
|
||||
const index = ArrayTable.useIndex();
|
||||
const { type, options } = values.patterns[index];
|
||||
const ruleType = RuleTypes[type];
|
||||
return (
|
||||
<div
|
||||
className={css`
|
||||
@ -210,9 +212,9 @@ export function RuleConfigForm() {
|
||||
const { t } = useTranslation();
|
||||
const compile = useCompile();
|
||||
const schemaOptions = useContext(SchemaOptionsContext);
|
||||
const form = useForm();
|
||||
const { type, options } = ArrayTable.useRecord();
|
||||
const { values, setValuesIn } = useForm();
|
||||
const index = ArrayTable.useIndex();
|
||||
const { type, options } = values.patterns[index];
|
||||
const ruleType = RuleTypes[type];
|
||||
return ruleType?.fieldset ? (
|
||||
<Button
|
||||
@ -252,7 +254,7 @@ export function RuleConfigForm() {
|
||||
initialValues: options,
|
||||
})
|
||||
.then((values) => {
|
||||
form.setValuesIn(`patterns.${index}`, { type, options: { ...values } });
|
||||
setValuesIn(`patterns.${index}`, { type, options: { ...values } });
|
||||
})
|
||||
.catch((err) => {
|
||||
error(err);
|
||||
|
Loading…
Reference in New Issue
Block a user