Commit 533ea933248a8da09ecc6b09b8a07213f834f06a

Authored by Benjamin Renard
1 parent 2ff00ead

Show description in all tooltips + Remove HTMLEditor

js/app/views/CatalogUI.js
... ... @@ -18,6 +18,7 @@ Ext.define('amdaUI.CatalogUI', {
18 18 'Ext.ux.grid.filter.NumericFilter',
19 19 'Ext.ux.grid.filter.StringFilter',
20 20 'amdaUI.OperationsTT',
  21 + 'amdaUI.DescriptionField',
21 22 'Ext.grid.plugin.BufferedRenderer',
22 23 'amdaPlotObj.PlotObjectConfig',
23 24 'amdaUI.StatusGrid',
... ... @@ -1402,14 +1403,9 @@ Ext.define('amdaUI.CatalogUI', {
1402 1403 border:false,
1403 1404 layout:'fit',
1404 1405 items:[{
1405   - xtype: 'htmleditor',
  1406 + xtype: 'descriptionfield',
1406 1407 align:'stretch',
1407   - enableFont:false,
1408   - enableFontSize:false,
1409   - enableAlignments: false,
1410   - enableColors:false,
1411 1408 name: 'description',
1412   - fieldLabel: 'Description',
1413 1409 }],
1414 1410 },
1415 1411 {
... ...
js/app/views/DescriptionField.js 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +Ext.define('amdaUI.DescriptionField', {
  2 + extend: 'Ext.form.field.TextArea',
  3 + //extend: 'Ext.form.field.HtmlEditor',
  4 + alias: 'widget.descriptionfield',
  5 +
  6 + fieldLabel: 'Description',
  7 +
  8 +});
  9 +
... ...
js/app/views/DownloadUI.js
... ... @@ -16,6 +16,7 @@ Ext.define('amdaUI.DownloadUI', {
16 16 'amdaUI.TimeSelectorUI',
17 17 'amdaUI.ParamArgumentsPlug',
18 18 'amdaUI.SendToSampButtonUI',
  19 + 'amdaUI.DescriptionField',
19 20 'amdaModel.Download',
20 21 'amdaModel.DownloadParam',
21 22 'amdaModel.RequestParamObject'
... ... @@ -652,9 +653,10 @@ Ext.define('amdaUI.DownloadUI', {
652 653 border:false,
653 654 layout:'fit',
654 655 items:[{
655   - xtype: 'textarea',
  656 + xtype: 'descriptionfield',
656 657 name: 'description',
657   - emptyText:'Description'
  658 + emptyText:'Description',
  659 + fieldLabel: ''
658 660 }]
659 661 };
660 662  
... ...
js/app/views/ParameterUI.js
... ... @@ -17,6 +17,7 @@ Ext.define('amdaUI.ParameterUI',
17 17 requires: [
18 18 'amdaUI.AliasUI',
19 19 'amdaUI.CalculatorUI',
  20 + 'amdaUI.DescriptionField',
20 21 'extensions.SelectableTextArea',
21 22 'amdaUI.ParamArgumentsPlug',
22 23 'amdaModel.RequestParamObject',
... ... @@ -603,7 +604,7 @@ Ext.define('amdaUI.ParameterUI',
603 604 {
604 605 itemId: 'formParamDescription',
605 606 name: 'description',
606   - xtype: 'textarea', fieldLabel: 'Description',
  607 + xtype: 'descriptionfield',
607 608 width: 320, height: 75,
608 609 colspan: 3
609 610 }]
... ...
js/app/views/PlotComponents/PlotTabContent.js
... ... @@ -13,6 +13,7 @@ Ext.define('amdaPlotComp.PlotTabContent', {
13 13  
14 14 requires: [
15 15 'amdaUI.TimeSelectorUI',
  16 + 'amdaUI.DescriptionField',
16 17 'amdaPlotComp.PlotTree',
17 18 'amdaPlotComp.PlotOutputForm',
18 19 'amdaPlotComp.PlotElementPanel'
... ... @@ -224,8 +225,8 @@ Ext.define('amdaPlotComp.PlotTabContent', {
224 225 bodyStyle: {background: '#dfe8f6',padding: '1', },
225 226 border:false,
226 227 layout:'fit',
227   - items:[{ xtype: 'textarea', name: 'description',
228   - id:'plot_description',emptyText:'Description'}]
  228 + items:[{ xtype: 'descriptionfield', name: 'description',
  229 + id:'plot_description',emptyText:'Description', fieldLabel: ''}]
229 230 };
230 231  
231 232 var treePanel = new Ext.form.Panel({
... ...
js/app/views/SearchUI.js
... ... @@ -16,6 +16,7 @@ Ext.define('amdaUI.SearchUI',
16 16 requires: [
17 17 'amdaUI.CalculatorUI',
18 18 'amdaUI.TimeSelectorUI',
  19 + 'amdaUI.DescriptionField',
19 20 'extensions.SelectableTextArea',
20 21 'amdaUI.ParamArgumentsPlug',
21 22 'amdaModel.RequestParamObject'
... ... @@ -599,9 +600,8 @@ Ext.define('amdaUI.SearchUI',
599 600 labelAlign: 'top', hideTrigger: true, width: 165
600 601 },
601 602 {
602   - xtype: 'textarea',
  603 + xtype: 'descriptionfield',
603 604 name: 'description',
604   - fieldLabel: 'Description',
605 605 width: 375, height: 70,
606 606 colspan: 3
607 607 }
... ...
js/app/views/StatisticsUI.js
... ... @@ -15,6 +15,7 @@ Ext.define('amdaUI.StatisticsUI',
15 15 requires: [
16 16 'amdaUI.TimeSelectorUI',
17 17 'amdaUI.ParamArgumentsPlug',
  18 + 'amdaUI.DescriptionField',
18 19 'amdaModel.StatisticParam'
19 20 ],
20 21  
... ... @@ -531,9 +532,8 @@ Ext.define('amdaUI.StatisticsUI',
531 532 items: [
532 533 this.fieldName,
533 534 {
534   - xtype: 'textarea',
  535 + xtype: 'descriptionfield',
535 536 name: 'description',
536   - fieldLabel: 'Description',
537 537 height: 125
538 538 },
539 539 this.timeSelector
... ...
js/app/views/TimeTableUI.js
... ... @@ -18,6 +18,7 @@ Ext.define('amdaUI.TimeTableUI', {
18 18 'Ext.ux.grid.filter.NumericFilter',
19 19 'amdaUI.OperationsTT',
20 20 'amdaUI.StatisticalPlug',
  21 + 'amdaUI.DescriptionField',
21 22 'Ext.grid.plugin.BufferedRenderer',
22 23 'amdaDesktop.AmdaStateProvider'
23 24 ],
... ... @@ -442,9 +443,8 @@ Ext.define('amdaUI.TimeTableUI', {
442 443 ]
443 444 },
444 445 {
445   - xtype: 'textarea',
  446 + xtype: 'descriptionfield',
446 447 name: 'description',
447   - fieldLabel: 'Description',
448 448 anchor: '100% 50%'
449 449 },
450 450 {
... ...
php/classes/AmdaAction.php
... ... @@ -189,7 +189,15 @@ class AmdaAction
189 189 case 'catalog':
190 190 if ($isLeaf) {
191 191 $info = '<b>Nb intervals:</b> '.$child->getAttribute('intervals').'<br/>';
  192 +
  193 + $objectMgr = new TimeTableMgr();
  194 + $obj_info = $objectMgr->getObject($id, $nodeType);
  195 + if (!empty($obj_info) && !empty($obj_info['description'])) {
  196 + $info .= '<b>Description:</b> '. $obj_info['description'] . '<br/>';
  197 + }
  198 +
192 199 $info .= '<b>ID:</b> '. $child->getAttribute('xml:id');
  200 +
193 201 }
194 202 break;
195 203  
... ... @@ -204,15 +212,15 @@ class AmdaAction
204 212 }
205 213 break;
206 214 case 'derivedParam':
207   - $info = $child->getAttribute('buildchain').'<br/>';
  215 + $info = '<b>Expression:</b> '. $child->getAttribute('buildchain').'<br/>';
208 216  
209 217 if($child->hasAttribute('units') && $child->getAttribute('units') != 'undefined' && $child->getAttribute('units') != '')
210 218 $info .= 'Units: '.$child->getAttribute('units').'<br/>';
211 219 $samplingMode = $child->getAttribute('sampling_mode');
212 220 if($samplingMode == 'timestep'){
213   - $info .= 'Sampling: '.$child->getAttribute('timestep').' sec';
  221 + $info .= '<b>Sampling:</b> '.$child->getAttribute('timestep').' sec'.'<br/>';
214 222 }else if($samplingMode == 'refparam'){
215   - $info .= 'Reference Parameter: '.$child->getAttribute('reference_param');
  223 + $info .= '<b>Reference Parameter:</b> '.$child->getAttribute('reference_param').'<br/>';
216 224 }
217 225  
218 226 if ($child->hasAttribute('dim_1')) {
... ... @@ -220,8 +228,17 @@ class AmdaAction
220 228 }
221 229 if ($child->hasAttribute('dim_2')) {
222 230 $dim_2 = $child->getAttribute('dim_2');
  231 +
223 232 }
224 233  
  234 + $objectMgr = new DerivedParamMgr($nodeType);
  235 + $obj_info = $objectMgr->getObject($child->getAttribute('xml:id')) ;
  236 + if (!empty($obj_info) && array_key_exists('description', $obj_info) && ($obj_info['description'] != "undefined")) {
  237 + $info .= '<b>Description:</b> '. $obj_info['description'].'<br/>';
  238 + }
  239 +
  240 + $info .= '<b>ID:</b> '. $child->getAttribute('xml:id');
  241 +
225 242 if ($isLeaf) $isParameter = true;
226 243 break;
227 244  
... ...
php/classes/RequestMgr.php
... ... @@ -363,7 +363,7 @@ class RequestMgr extends AmdaObjectMgr
363 363 }
364 364  
365 365 public function getObjectInfo($id) {
366   - $info = "Request ID: ".$id."<br/>";
  366 + $info = "<b>Request ID:</b> ".$id."<br/>";
367 367  
368 368 if (!file_exists(USERREQDIR.$id)) {
369 369 $info .= "<b>ERROR:</b> Cannot retrieve request definition file";
... ... @@ -378,8 +378,7 @@ class RequestMgr extends AmdaObjectMgr
378 378  
379 379 switch ($this->type) {
380 380 case 'request':
381   - $info .= "Plot: ";
382   - $description = $obj->description;
  381 + $info .= "<b>Plot:</b> ";
383 382 $panels_list = array();
384 383 if (!empty($obj->panels)) {
385 384 foreach ($obj->panels as $p) {
... ... @@ -411,17 +410,13 @@ class RequestMgr extends AmdaObjectMgr
411 410 else {
412 411 $info .= "Empty";
413 412 }
414   - if(!empty($description)){
415   - $info .= '<br/>Description: '.$description;
416   - }
417 413 break;
418 414 case 'condition':
419   - $info .= "Data Mining: ".htmlspecialchars($obj->expression);
  415 + $info .= "<b>Data Mining:</b> ".htmlspecialchars($obj->expression);
420 416 break;
421 417 case 'download':
422   - $info .= "Download: ";
  418 + $info .= "<b>Download:</b> ";
423 419 $params_list = array();
424   - $description = $obj->description;
425 420 if (!empty($obj->list)) {
426 421 foreach ($obj->list as $p) {
427 422 if (!in_array($p->paramid, $params_list))
... ... @@ -434,12 +429,9 @@ class RequestMgr extends AmdaObjectMgr
434 429 else {
435 430 $info .= "Empty";
436 431 }
437   - if(!empty($description)){
438   - $info .= '<br/>Description: '.$description;
439   - }
440 432 break;
441 433 case 'statistic':
442   - $info .= "Statistic: ";
  434 + $info .= "<b>Statistic:</b> ";
443 435 $functions_list = array();
444 436 if (!empty($obj->parameter)) {
445 437 foreach ($obj->parameter as $param) {
... ... @@ -453,7 +445,7 @@ class RequestMgr extends AmdaObjectMgr
453 445 if (!empty($functions_list)) {
454 446 foreach ($functions_list as $func => $params) {
455 447 $info .= "<br/>";
456   - $info .= "<b>" . $func . ":</b> " . implode(', ', $params);
  448 + $info .= "<i>" . $func . ":</i> " . implode(', ', $params);
457 449 }
458 450 }
459 451 else {
... ... @@ -468,6 +460,11 @@ class RequestMgr extends AmdaObjectMgr
468 460 $info .= "<b>ERROR:</b> Unknown request type";
469 461 }
470 462  
  463 + $description = isset($obj->description) ? $obj->description : '';
  464 + if(!empty($description)){
  465 + $info .= '<br/><b>Description:</b> '.$description;
  466 + }
  467 +
471 468 return $info;
472 469 }
473 470  
... ...