Fixed empty default values extra field range breaking page
Resolves #652
This commit is contained in:
@@ -1,18 +1,18 @@
|
|||||||
import { PlusOutlined } from "@ant-design/icons";
|
import { PlusOutlined } from "@ant-design/icons";
|
||||||
import { useTranslate } from "@refinedev/core";
|
import { useTranslate } from "@refinedev/core";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
Flex,
|
Flex,
|
||||||
Form,
|
Form,
|
||||||
FormInstance,
|
FormInstance,
|
||||||
Input,
|
Input,
|
||||||
InputNumber,
|
InputNumber,
|
||||||
Popconfirm,
|
Popconfirm,
|
||||||
Select,
|
Select,
|
||||||
Space,
|
Space,
|
||||||
Table,
|
Table,
|
||||||
message,
|
message,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import { FormItemProps, Rule } from "antd/es/form";
|
import { FormItemProps, Rule } from "antd/es/form";
|
||||||
import { ColumnType } from "antd/es/table";
|
import { ColumnType } from "antd/es/table";
|
||||||
@@ -488,10 +488,16 @@ export function ExtraFieldsSettings() {
|
|||||||
} else if (Array.isArray(val) && record.field.field_type === FieldType.choice) {
|
} else if (Array.isArray(val) && record.field.field_type === FieldType.choice) {
|
||||||
return val.join(", ");
|
return val.join(", ");
|
||||||
} else if (
|
} else if (
|
||||||
(Array.isArray(val) && record.field.field_type === FieldType.integer_range) ||
|
Array.isArray(val) && (
|
||||||
record.field.field_type === FieldType.float_range
|
record.field.field_type === FieldType.integer_range || record.field.field_type === FieldType.float_range
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
return `${val[0]} \u2013 ${val[1]}`;
|
let lower = val[0] ?? "";
|
||||||
|
let upper = val[1] ?? "";
|
||||||
|
if (lower === "" && upper === "") {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return `${lower} \u2013 ${upper}`;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user