Skip to content

Commit

Permalink
wip: make sure we update rule when condition is changed
Browse files Browse the repository at this point in the history
And make sure we redraw data on map
  • Loading branch information
yohanboniface committed Apr 26, 2024
1 parent fc38119 commit aa89dba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 11 additions & 2 deletions umap/static/umap/js/modules/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { translate } from './i18n.js'
class Rule {
constructor(map, condition = '', options = {}) {
this.map = map
this.condition = condition
this.active = true
this.parse()
this.options = options
let isDirty = false
Object.defineProperty(this, 'isDirty', {
Expand All @@ -21,6 +19,17 @@ class Rule {
}
},
})
let _condition
Object.defineProperty(this, 'condition', {
get: () => {
return _condition
},
set: (value) => {
_condition = value
this.parse()
},
})
this.condition = condition
}

render(fields) {
Expand Down
4 changes: 4 additions & 0 deletions umap/static/umap/js/modules/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export const SCHEMA = {
type: Object,
impacts: ['data'],
},
condition: {
type: String,
impacts: ['data'],
},
dashArray: {
type: String,
impacts: ['data'],
Expand Down

0 comments on commit aa89dba

Please sign in to comment.