mirror of
https://github.com/maputnik/editor.git
synced 2026-01-08 06:20:00 +00:00
Notice for not supported nested filter
This commit is contained in:
@@ -11,6 +11,18 @@ const otherFilterOps = Object
|
|||||||
.keys(GlSpec.filter_operator.values)
|
.keys(GlSpec.filter_operator.values)
|
||||||
.filter(op => combiningFilterOps.indexOf(op) < 0)
|
.filter(op => combiningFilterOps.indexOf(op) < 0)
|
||||||
|
|
||||||
|
function hasCombiningFilter(filter) {
|
||||||
|
return combiningFilterOps.indexOf(filter[0]) >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function hasNestedCombiningFilter(filter) {
|
||||||
|
if(hasCombiningFilter(filter)) {
|
||||||
|
const combinedFilters = filter.slice(1)
|
||||||
|
return filter.slice(1).map(f => hasCombiningFilter(f)).filter(f => f == true).length > 0
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
class CombiningOperatorSelect extends React.Component {
|
class CombiningOperatorSelect extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
value: React.PropTypes.string.isRequired,
|
value: React.PropTypes.string.isRequired,
|
||||||
@@ -165,6 +177,11 @@ export default class CombiningFilterEditor extends React.Component {
|
|||||||
/>
|
/>
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//TODO: Implement support for nested filter
|
||||||
|
if(hasNestedCombiningFilter(filter)) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
return <div style={{
|
return <div style={{
|
||||||
padding: margins[2],
|
padding: margins[2],
|
||||||
paddingRight: 0,
|
paddingRight: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user