description template field type validation fix
This commit is contained in:
parent
0c2fb8cbef
commit
2204119503
|
@ -154,7 +154,11 @@ public class FieldPersist {
|
||||||
.iff(() -> !this.isNull(item.getData()) && item.getData().getFieldType() != null)
|
.iff(() -> !this.isNull(item.getData()) && item.getData().getFieldType() != null)
|
||||||
.on(FieldPersist._data)
|
.on(FieldPersist._data)
|
||||||
.over(item.getData())
|
.over(item.getData())
|
||||||
.using(() -> this.fieldDataHelperServiceProvider.get(item.getData().getFieldType()).getPersistModelValidator())
|
.using(() -> this.fieldDataHelperServiceProvider.get(item.getData().getFieldType()).getPersistModelValidator()),
|
||||||
|
this.spec()
|
||||||
|
.iff(() -> !this.isNull(item.getData()))
|
||||||
|
.must(() -> !this.isNull(item.getData().getFieldType()))
|
||||||
|
.failOn(FieldPersist._data + '.' + BaseFieldDataPersist._fieldType).failWith(messageSource.getMessage("Validation_Required", new Object[]{BaseFieldDataPersist._fieldType}, LocaleContextHolder.getLocale()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,8 @@ import java.util.List;
|
||||||
use = JsonTypeInfo.Id.NAME,
|
use = JsonTypeInfo.Id.NAME,
|
||||||
include = JsonTypeInfo.As.PROPERTY,
|
include = JsonTypeInfo.As.PROPERTY,
|
||||||
property = "fieldType",
|
property = "fieldType",
|
||||||
visible = true)
|
visible = true,
|
||||||
|
defaultImpl = LabelDataPersist.class)
|
||||||
@JsonSubTypes({
|
@JsonSubTypes({
|
||||||
@JsonSubTypes.Type(value = ExternalSelectDataPersist.class, name = FieldType.Names.ExternalSelect),
|
@JsonSubTypes.Type(value = ExternalSelectDataPersist.class, name = FieldType.Names.ExternalSelect),
|
||||||
@JsonSubTypes.Type(value = LabelDataPersist.class, name = FieldType.Names.BooleanDecision),
|
@JsonSubTypes.Type(value = LabelDataPersist.class, name = FieldType.Names.BooleanDecision),
|
||||||
|
|
Loading…
Reference in New Issue