Fix relation validation
This commit is contained in:
parent
84613f3571
commit
3f7e4187cc
@ -9,7 +9,7 @@ import { FixedSizeList } from 'react-window';
|
|||||||
import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';
|
import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';
|
||||||
|
|
||||||
import { reactSelectStyles } from '../../ui';
|
import { reactSelectStyles } from '../../ui';
|
||||||
import { stringTemplate, validations } from '../../lib/widgets';
|
import { stringTemplate } from '../../lib/widgets';
|
||||||
|
|
||||||
function arrayMove(array, from, to) {
|
function arrayMove(array, from, to) {
|
||||||
const slicedArray = array.slice();
|
const slicedArray = array.slice();
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import controlComponent from './RelationControl';
|
import controlComponent from './RelationControl';
|
||||||
import previewComponent from './RelationPreview';
|
import previewComponent from './RelationPreview';
|
||||||
import schema from './schema';
|
import schema from './schema';
|
||||||
|
import { validations } from '../../lib/widgets';
|
||||||
|
|
||||||
|
function isMultiple(field) {
|
||||||
|
return field.get('multiple', false);
|
||||||
|
}
|
||||||
|
|
||||||
function Widget(opts = {}) {
|
function Widget(opts = {}) {
|
||||||
return {
|
return {
|
||||||
@ -11,7 +16,7 @@ function Widget(opts = {}) {
|
|||||||
const min = field.get('min');
|
const min = field.get('min');
|
||||||
const max = field.get('max');
|
const max = field.get('max');
|
||||||
|
|
||||||
if (!this.isMultiple()) {
|
if (!isMultiple(field)) {
|
||||||
return { error: false };
|
return { error: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user