@@ -51,6 +51,8 @@ const composedReducer = (state, action) => {
51
51
switch ( action . type ) {
52
52
case MARKER_SELECT :
53
53
return markerSelectUpdater ( state , action ) ;
54
+ default :
55
+ break ;
54
56
}
55
57
56
58
return reducers ( state , action ) ;
@@ -68,7 +70,7 @@ function markerSelectUpdater(state, action) {
68
70
) ;
69
71
const { field, values} = action . payload ;
70
72
const visState = visStateSelector ( state ) ;
71
- let currentFilterIdx = visState . filters . findIndex ( f => f . name === field && f . dataId === DATA_ID && f . tableauMarkerFilter ) ;
73
+ let currentFilterIdx = visState . filters . findIndex ( f => f . name . includes ( field ) && f . dataId . includes ( DATA_ID ) && f . tableauMarkerFilter ) ;
72
74
let nextState = visState ;
73
75
if ( values . length ) {
74
76
if ( currentFilterIdx < 0 ) {
@@ -79,7 +81,7 @@ function markerSelectUpdater(state, action) {
79
81
}
80
82
log ( 'add filter based on marker' )
81
83
// add filter
82
- nextState = visStateUpdaters . addFilterUpdater ( nextState , { dataId : DATA_ID } ) ;
84
+ nextState = visStateUpdaters . addFilterUpdater ( nextState , { dataId : [ DATA_ID ] } ) ;
83
85
84
86
// added filter should be the last one
85
87
const idx = nextState . filters . length - 1 ;
@@ -135,10 +137,10 @@ function getNewFilter(state, idx, field) {
135
137
const newFilter = {
136
138
...state . filters [ idx ] ,
137
139
...filterProp ,
138
- name : field . name ,
140
+ name : [ field . name ] ,
139
141
// can't edit dataId once name is selected
140
142
freeze : true ,
141
- fieldIdx,
143
+ fieldIdx : [ fieldIdx ] ,
142
144
// add tableau identifier to filter
143
145
tableauMarkerFilter : true
144
146
} ;
0 commit comments