@@ -106,7 +106,7 @@ <h5>Plot / Export data</h5>
106
106
< script >
107
107
var geoValues = [ ] ;
108
108
var currentMode = 'epivis' ;
109
-
109
+
110
110
function getFilteredGeographicValues ( geographicType ) {
111
111
var data = geoValues . reduce ( ( data , geoValue ) => {
112
112
if ( geoValue . geoType === geographicType ) {
@@ -130,7 +130,7 @@ <h5>Plot / Export data</h5>
130
130
} else {
131
131
data = [ ] ;
132
132
}
133
-
133
+
134
134
135
135
$ ( '#geographic_value' ) . select2 ( {
136
136
data : data ,
@@ -146,7 +146,7 @@ <h5>Plot / Export data</h5>
146
146
147
147
function handleModeChange ( mode ) {
148
148
document . getElementById ( "epivis-form" ) . reset ( ) ;
149
-
149
+
150
150
var choose_dates = document . getElementsByName ( 'choose_date' ) ;
151
151
if ( mode === 'epivis' ) {
152
152
currentMode = 'epivis' ;
@@ -179,7 +179,7 @@ <h5>Plot / Export data</h5>
179
179
$ ( document ) . ready ( function ( ) {
180
180
{ % for geography in signal . available_geography . all % }
181
181
{ % for unit in geography . geography_units . all % }
182
- geoValues . push ( { 'id' : '{{ unit.geo_id }}' , 'geoType' : '{{ unit.geography }}' , 'text' : '{{ unit.display_name }}' } ) ;
182
+ geoValues . push ( { 'id' : '{{ unit.geo_id }}' , 'geoType' : '{{ unit.geography }}' , 'text' : '{{ unit.display_name }}' } ) ;
183
183
{ % endfor % }
184
184
{ % endfor % }
185
185
@@ -201,11 +201,14 @@ <h5>Plot / Export data</h5>
201
201
202
202
function submitMode ( event ) {
203
203
event . preventDefault ( ) ;
204
-
204
+
205
205
var dataSource = document . getElementById ( 'source' ) . value ;
206
206
var dataSignal = document . getElementById ( 'signal' ) . value ;
207
207
var geographicType = document . getElementById ( 'geographic_type' ) . value ;
208
- var geographicValue = $ ( '#geographic_value' ) . select2 ( 'data' ) . map ( ( el ) => el . id ) . join ( ',' ) ;
208
+ // geographicValue is a comma separated string of geographic values. type can be string or integer
209
+ // in case of string, it should be converted to lowercase
210
+ // else it will be treated as integer
211
+ var geographicValue = $ ( '#geographic_value' ) . select2 ( 'data' ) . map ( ( el ) => ( typeof el . id === 'string' ) ? el . id . toLowerCase ( ) : el . id ) . join ( ',' ) ;
209
212
210
213
if ( geographicType === 'Choose...' || geographicValue === '' ) {
211
214
showWarningAlert ( "Geographic Type or Geographic Value is not selected." ) ;
0 commit comments