Commit b1fab76f2f8b39b84814708efc8ff0451f32e7cf

Authored by Benjamin Renard
1 parent 2dfd23b1

Give the possibility to edit options of a predefined templated parameter (#9385)

js/app/views/ParameterUI.js
... ... @@ -391,7 +391,14 @@ Ext.define('amdaUI.ParameterUI',
391 391 }
392 392 var paramModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.param.id);
393 393 if (paramModule) {
394   - paramModule.addParam(nameToSent, data.records[0].get('leaf'), data.records[0].get('needsArgs'), components);
  394 + if (data.records[0].get('predefinedArgs')) {
  395 + paramModule.parseTemplatedParam(nameToSent, function(param_info) {
  396 + paramModule.addParam(param_info.paramid, data.records[0].get('leaf'), true, components, param_info.template_args);
  397 + });
  398 + }
  399 + else {
  400 + paramModule.addParam(nameToSent, data.records[0].get('leaf'), data.records[0].get('needsArgs'), components);
  401 + }
395 402 }
396 403 return true;
397 404 }
... ...
js/app/views/PlotComponents/PlotPanelForm.js
... ... @@ -132,7 +132,7 @@ Ext.define('amdaPlotComp.PlotPanelForm', {
132 132 this.addStandardCheck('panel-scatter-isotropic', 'Orthonormal scale', function(name, value, oldValue) {
133 133 me.object.set('panel-scatter-isotropic', value);
134 134 me.crtTree.refresh();
135   - }, 'When this is option is selected, a unit on the X-axis appears with the same size as a unit on the Y-axis'),
  135 + }, 'When this option is selected, a unit on the X-axis appears with the same size as a unit on the Y-axis'),
136 136 this.addStandardText('panel-epoch-centertimeid', 'Epoch Center Time Id', function(name, value, oldValue) {
137 137 me.object.set('panel-epoch-centertimeid', value);
138 138 me.crtTree.refresh();
... ...
js/app/views/SearchUI.js
... ... @@ -414,8 +414,16 @@ Ext.define('amdaUI.SearchUI',
414 414 }
415 415 var searchModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.search.id);
416 416  
417   - if (searchModule)
418   - searchModule.addParam(nameToSent, data.records[0].get('leaf'), data.records[0].get('needsArgs'), components);
  417 + if (searchModule) {
  418 + if (data.records[0].get('predefinedArgs')) {
  419 + searchModule.parseTemplatedParam(nameToSent, function(param_info) {
  420 + searchModule.addParam(param_info.paramid, data.records[0].get('leaf'), true, components, param_info.template_args);
  421 + });
  422 + }
  423 + else {
  424 + searchModule.addParam(nameToSent, data.records[0].get('leaf'), data.records[0].get('needsArgs'), components);
  425 + }
  426 + }
419 427 return true;
420 428 }
421 429 });
... ...
js/app/views/StatisticsUI.js
... ... @@ -370,7 +370,14 @@ Ext.define('amdaUI.StatisticsUI',
370 370 var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.statistics.id);
371 371 if (module)
372 372 {
373   - module.addParam(nameToSent, data.records[0].get('leaf'), data.records[0].get('needsArgs'), components);
  373 + if (data.records[0].get('predefinedArgs')) {
  374 + module.parseTemplatedParam(nameToSent, function(param_info) {
  375 + module.addParam(param_info.paramid, data.records[0].get('leaf'), true, components, param_info.template_args);
  376 + });
  377 + }
  378 + else {
  379 + module.addParam(nameToSent, data.records[0].get('leaf'), data.records[0].get('needsArgs'), components);
  380 + }
374 381 }
375 382 return true;
376 383 }
... ...