Remove Json from available filters

This commit is contained in:
soupette 2018-05-24 18:15:35 +02:00
parent 81a96bcc46
commit eecccbcbd8
4 changed files with 32 additions and 3 deletions

View File

@ -63,12 +63,16 @@ class InputWithAutoFocus extends React.Component {
}
}
InputWithAutoFocus.defaultProps = {
filterToFocus: null,
};
InputWithAutoFocus.propTypes = {
filter: PropTypes.object.isRequired,
filterToFocus: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number,
]).isRequired,
]),
index: PropTypes.number.isRequired,
inputStyle: PropTypes.object.isRequired,
name: PropTypes.string.isRequired,

View File

@ -30,6 +30,9 @@ function FilterOptions({ filter, filterToFocus, index, onChange, onClickAdd, onC
// This component is needed in order to add the date icon inside the InputDate
const Wrapper = get(schema, [filter.attr, 'type'], 'string') === 'date' ? InputWrapper : 'div';
const selectOptionsSchema = Object
.keys(schema)
.filter(x => schema[x].type !== 'json');
return (
<Div borderLeft={!showAddButton || get(filter, 'value', '') !== ''}>
@ -38,7 +41,7 @@ function FilterOptions({ filter, filterToFocus, index, onChange, onClickAdd, onC
onChange={onChange}
name={`${index}.attr`}
value={get(filter, 'attr', '')}
selectOptions={Object.keys(schema)}
selectOptions={selectOptionsSchema}
style={selectStyle}
/>
<InputSelect

View File

@ -18,5 +18,27 @@
"appearance": ""
}
}
},
"test": {
"attributes": {
"string": {
"appearance": ""
},
"int": {
"appearance": ""
},
"float": {
"appearance": ""
},
"decimal": {
"appearance": ""
},
"date": {
"appearance": ""
},
"json": {
"appearance": ""
}
}
}
}

View File

@ -40,4 +40,4 @@
"configurable": false
}
}
}
}