@@ -92,7 +92,9 @@ export function MapMenuBar(props: MapMenuBar) {
9292 const inProgress = props . inProgress || false ;
9393
9494 const activeCombinations = useRef (
95- Object . keys ( combinations ) . length > 0 ? combinations [ 'tas::30yr' ] : { } ,
95+ Object . keys ( combinations ) . length > 0
96+ ? combinations [ 'tas::thirty_year' ]
97+ : { } ,
9698 ) ;
9799
98100 const setActiveCombinations = combo => {
@@ -146,18 +148,11 @@ export function MapMenuBar(props: MapMenuBar) {
146148 {
147149 rows : [
148150 {
149- key :
150- map_data === 'future'
151- ? 'climatological_variable'
152- : 'historical_variable' ,
151+ key : 'climatological_variable' ,
153152 groupName : '' ,
154153 ...mapParameters (
155- map_data === 'future'
156- ? 'climatological_variable'
157- : 'historical_variable' ,
158- map_data === 'future'
159- ? 'climatological_variable'
160- : 'historical_variable' ,
154+ 'climatological_variable' ,
155+ 'climatological_variable' ,
161156 ) ,
162157 disableable : false ,
163158 criteria : ( x , c ) => [ ] ,
@@ -208,14 +203,7 @@ export function MapMenuBar(props: MapMenuBar) {
208203 ? 'aggregation_period'
209204 : 'aggregation_period' ,
210205 groupName : t ( 'app.map.menu.dataSeries' ) ,
211- ...mapParameters (
212- map_data === 'future'
213- ? 'aggregation_period'
214- : 'aggregation_period' ,
215- map_data === 'future'
216- ? 'aggregation_period'
217- : 'aggregation_period' ,
218- ) ,
206+ ...mapParameters ( 'aggregation_period' , 'aggregation_period' ) ,
219207 disableable : true ,
220208 disabled : x => false ,
221209 criteria : ( x , c ) => {
@@ -231,16 +219,16 @@ export function MapMenuBar(props: MapMenuBar) {
231219 criteria : ( x , c ) => x ?. measure ,
232220 } ,
233221 {
234- key : map_data === 'future' ? 'time_window' : 'time_window ' ,
222+ key : map_data === 'future' ? 'time_window' : 'reference_period ' ,
235223 groupName : t ( 'app.map.menu.timeWindows' ) ,
236224 ...mapParameters (
237- map_data === 'future' ? 'time_window' : 'time_window ' ,
238- map_data === 'future' ? 'time_window' : 'time_window ' ,
225+ map_data === 'future' ? 'time_window' : 'reference_period ' ,
226+ map_data === 'future' ? 'time_window' : 'reference_period ' ,
239227 ) ,
240228 disableable : true ,
241- disabled : x => x . aggregation_period !== '30yr ' ,
229+ disabled : x => x . aggregation_period !== 'thirty_year ' ,
242230 criteria : ( x , c ) =>
243- c . aggregation_period !== '30yr ' ? [ ] : [ 'tw1' , 'tw2' ] ,
231+ c . aggregation_period !== 'thirty_year ' ? [ ] : [ 'tw1' , 'tw2' ] ,
244232 } ,
245233 ] ,
246234 } ,
@@ -251,16 +239,15 @@ export function MapMenuBar(props: MapMenuBar) {
251239 rows : [
252240 {
253241 multicol : [ 5 , 11 , 16 ] ,
254- key :
255- map_data === 'future' ? 'year_period' : 'historical_year_period' ,
242+ key : map_data === 'future' ? 'year_period' : 'year_period' ,
256243 groupName : '' ,
257244 ...mapParameters (
258- map_data === 'future' ? 'year_period' : 'historical_year_period ' ,
259- map_data === 'future' ? 'year_period' : 'historical_year_period ' ,
245+ map_data === 'future' ? 'year_period' : 'year_period ' ,
246+ map_data === 'future' ? 'year_period' : 'year_period ' ,
260247 ) ,
261248 disableable : true ,
262249 disabled : x => false ,
263- criteria : ( x , c ) => x ?. year_period || x ?. historical_year_period ,
250+ criteria : ( x , c ) => x ?. year_period || x ?. year_period ,
264251 } ,
265252 ] ,
266253 } ,
@@ -289,7 +276,7 @@ export function MapMenuBar(props: MapMenuBar) {
289276 React . useState < boolean > ( false ) ;
290277
291278 const all_meas = [ 'absolute' , 'anomaly' ] ;
292- const all_pers = [ 'annual' , '30yr ' ] ;
279+ const all_pers = [ 'annual' , 'thirty_year ' ] ;
293280 const all_indx = [
294281 'tas' ,
295282 'cdds' ,
@@ -320,7 +307,7 @@ export function MapMenuBar(props: MapMenuBar) {
320307
321308 ret . climatological_model = 'model_ensemble' ;
322309 ret . scenario = 'rcp85' ;
323- ret . aggregation_period = '30yr ' ;
310+ ret . aggregation_period = 'thirty_year ' ;
324311 ret . measure = 'anomaly' ;
325312 ret . time_window = 'tw1' ;
326313
@@ -341,7 +328,7 @@ export function MapMenuBar(props: MapMenuBar) {
341328 showModal . current = false ;
342329 console . log ( 'activatingCV' , value , combinations [ value ] ) ;
343330 setActiveCombinations ( combinations [ value ] ) ;
344- localCM . current = toDefault ( combinations [ value + '::30yr ' ] ) ;
331+ localCM . current = toDefault ( combinations [ value + '::thirty_year ' ] ) ;
345332 setCurrentMap ( localCM . current ) ;
346333 } else {
347334 const steps = [
@@ -484,7 +471,7 @@ export function MapMenuBar(props: MapMenuBar) {
484471 - ${ labelFor ( localCM . current . aggregation_period ) }
485472 - ${ labelFor ( localCM . current . measure ) }
486473 ${ localCM . current . time_window &&
487- localCM . current . aggregation_period === '30yr '
474+ localCM . current . aggregation_period === 'thirty_year '
488475 ? ' - ' + labelFor ( localCM . current . time_window )
489476 : ''
490477 }
@@ -610,27 +597,43 @@ export function MapMenuBar(props: MapMenuBar) {
610597 disabled = { inProgress }
611598 />
612599 </ Grid >
613- < Grid xs = { 1 } def = { 4 } sx = { SecondRowStyle } >
614- < MultiRadioSelect
615- valueSet = { menus . seasonMenuSet }
616- current_map = { current_map }
617- onChange = { handleChange }
618- sx = { SelectStyle }
619- menuSx = { SelectMenuStyle }
620- mobileIcon = { < SnowSunIcon /> }
621- className = {
622- hasMissingValues ( menus . seasonMenuSet ) ? 'NeedsSelection' : ''
623- }
624- activeCombinations = { activeCombinations . current }
625- label = { t ( 'app.map.menuBar.season' ) }
626- // label={'Season' }
627- disabled = { inProgress }
628- />
629- </ Grid >
630- { map_data !== 'past' ? (
631- < > </ >
600+
601+ { map_data === 'past' ? (
602+ < Grid xs = { 2 } def = { 8 } sx = { SecondRowStyle } >
603+ < MultiRadioSelect
604+ valueSet = { menus . seasonMenuSet }
605+ current_map = { current_map }
606+ onChange = { handleChange }
607+ sx = { SelectStyle }
608+ menuSx = { SelectMenuStyle }
609+ mobileIcon = { < SnowSunIcon /> }
610+ className = {
611+ hasMissingValues ( menus . seasonMenuSet ) ? 'NeedsSelection' : ''
612+ }
613+ activeCombinations = { activeCombinations . current }
614+ label = { t ( 'app.map.menuBar.season' ) }
615+ // label={'Season'}
616+ disabled = { inProgress }
617+ />
618+ </ Grid >
632619 ) : (
633- < Grid xs = { 1 } def = { 4 } sx = { SecondRowStyle } > </ Grid >
620+ < Grid xs = { 1 } def = { 4 } sx = { SecondRowStyle } >
621+ < MultiRadioSelect
622+ valueSet = { menus . seasonMenuSet }
623+ current_map = { current_map }
624+ onChange = { handleChange }
625+ sx = { SelectStyle }
626+ menuSx = { SelectMenuStyle }
627+ mobileIcon = { < SnowSunIcon /> }
628+ className = {
629+ hasMissingValues ( menus . seasonMenuSet ) ? 'NeedsSelection' : ''
630+ }
631+ activeCombinations = { activeCombinations . current }
632+ label = { t ( 'app.map.menuBar.season' ) }
633+ // label={'Season'}
634+ disabled = { inProgress }
635+ />
636+ </ Grid >
634637 ) }
635638 < Grid xs = { 1 } def = { 2 } sx = { SecondRowStyle } >
636639 < Box sx = { ButtonBoxStyle } >
0 commit comments