@@ -106,7 +106,7 @@ <h5>Plot / Export data</h5>
106106< script >
107107 var geoValues = [ ] ;
108108 var currentMode = 'epivis' ;
109-
109+
110110 function getFilteredGeographicValues ( geographicType ) {
111111 var data = geoValues . reduce ( ( data , geoValue ) => {
112112 if ( geoValue . geoType === geographicType ) {
@@ -130,7 +130,7 @@ <h5>Plot / Export data</h5>
130130 } else {
131131 data = [ ] ;
132132 }
133-
133+
134134
135135 $ ( '#geographic_value' ) . select2 ( {
136136 data : data ,
@@ -146,7 +146,7 @@ <h5>Plot / Export data</h5>
146146
147147 function handleModeChange ( mode ) {
148148 document . getElementById ( "epivis-form" ) . reset ( ) ;
149-
149+
150150 var choose_dates = document . getElementsByName ( 'choose_date' ) ;
151151 if ( mode === 'epivis' ) {
152152 currentMode = 'epivis' ;
@@ -179,7 +179,7 @@ <h5>Plot / Export data</h5>
179179 $ ( document ) . ready ( function ( ) {
180180 { % for geography in signal . available_geography . all % }
181181 { % 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 }}' } ) ;
183183 { % endfor % }
184184 { % endfor % }
185185
@@ -201,11 +201,14 @@ <h5>Plot / Export data</h5>
201201
202202 function submitMode ( event ) {
203203 event . preventDefault ( ) ;
204-
204+
205205 var dataSource = document . getElementById ( 'source' ) . value ;
206206 var dataSignal = document . getElementById ( 'signal' ) . value ;
207207 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 ( ',' ) ;
209212
210213 if ( geographicType === 'Choose...' || geographicValue === '' ) {
211214 showWarningAlert ( "Geographic Type or Geographic Value is not selected." ) ;
0 commit comments