this.onFilterPartChanged(newFilterOp, propertyName, filterArgs)}
options={otherFilterOps}
@@ -80,6 +82,7 @@ export default class SingleFilterEditor extends React.Component {
{filterArgs.length > 0 &&
this.onFilterPartChanged(filterOp, propertyName, v.split(','))}
/>
diff --git a/src/components/SpecField.jsx b/src/components/SpecField.jsx
index 3b4dfcc5..9d73f1c1 100644
--- a/src/components/SpecField.jsx
+++ b/src/components/SpecField.jsx
@@ -6,14 +6,15 @@ import Fieldset from './Fieldset'
const typeMap = {
- color: Block,
- enum: Fieldset,
- number: Block,
- boolean: Block,
- array: Fieldset,
- resolvedImage: Block,
- number: Block,
- string: Block
+ color: () => Block,
+ enum: ({fieldSpec}) => (Object.keys(fieldSpec.values).length <= 3 ? Fieldset : Block),
+ number: () => Block,
+ boolean: () => Block,
+ array: () => Fieldset,
+ resolvedImage: () => Block,
+ number: () => Block,
+ string: () => Block,
+ formatted: () => Block,
};
export default class SpecField extends React.Component {
@@ -26,9 +27,14 @@ export default class SpecField extends React.Component {
const {props} = this;
const fieldType = props.fieldSpec.type;
- let TypeBlock = typeMap[fieldType];
- if (!TypeBlock) {
+ const typeBlockFn = typeMap[fieldType];
+
+ let TypeBlock;
+ if (typeBlockFn) {
+ TypeBlock = typeBlockFn(props);
+ }
+ else {
console.warn("No such type for '%s'", fieldType);
TypeBlock = Block;
}
diff --git a/src/components/_ZoomProperty.jsx b/src/components/_ZoomProperty.jsx
index 79ba4d99..eb55700a 100644
--- a/src/components/_ZoomProperty.jsx
+++ b/src/components/_ZoomProperty.jsx
@@ -150,6 +150,7 @@ export default class ZoomProperty extends React.Component {
>
|
this.changeZoomStop(idx, changedStop, value)}
min={0}
@@ -158,6 +159,7 @@ export default class ZoomProperty extends React.Component {
|
|