Commit f67cd5f6f8fb4475d08b8385f361e105d44c2d66
Committed by
João M. M. da Silva
1 parent
63ab22be
Exists in
master
and in
22 other branches
[Mezuro] Refactoring processing.js. It needs testing.
Showing
1 changed file
with
14 additions
and
14 deletions
Show diff stats
plugins/mezuro/public/javascripts/processing.js
| @@ -19,7 +19,7 @@ function display_metric_history() { | @@ -19,7 +19,7 @@ function display_metric_history() { | ||
| 19 | var metric_name = jQuery(this).attr('show-metric-history'); | 19 | var metric_name = jQuery(this).attr('show-metric-history'); |
| 20 | toggle_mezuro("." + metric_name); | 20 | toggle_mezuro("." + metric_name); |
| 21 | metricName = metric_name; | 21 | metricName = metric_name; |
| 22 | - callAction('module', 'module_metrics_history', {module_id: module_id, module_result_id: module_result_id}, show_metrics); | 22 | + callAction('module_result', 'metric_result_history', {metric_name: metric_name, module_result_id: module_result_id}, show_metrics); |
| 23 | return false; | 23 | return false; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| @@ -27,7 +27,7 @@ function display_metric_history() { | @@ -27,7 +27,7 @@ function display_metric_history() { | ||
| 27 | function display_grade_history() { | 27 | function display_grade_history() { |
| 28 | var module_name = jQuery(this).attr('data-module-name'); | 28 | var module_name = jQuery(this).attr('data-module-name'); |
| 29 | toggle_mezuro("#historical-grade"); | 29 | toggle_mezuro("#historical-grade"); |
| 30 | - callAction('module', 'module_grade_history', {module_name: module_name}, show_grades); | 30 | + callAction('module_result', 'module_result_history', {module_result_id: module_result_id}, show_grades); |
| 31 | return false; | 31 | return false; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| @@ -51,7 +51,7 @@ function reloadModule(){ | @@ -51,7 +51,7 @@ function reloadModule(){ | ||
| 51 | var results_root_id = jQuery(this).attr('results_root_id'); | 51 | var results_root_id = jQuery(this).attr('results_root_id'); |
| 52 | showLoadingProcess(false); | 52 | showLoadingProcess(false); |
| 53 | processingTree = true; | 53 | processingTree = true; |
| 54 | - callAction('module_result', 'project_tree', {results_root_id: results_root_id }, showProjectTree); | 54 | +// callAction('module_result', 'project_tree', {results_root_id: results_root_id }, showProjectTree); |
| 55 | callAction('module_result', 'module_result', {results_root_id: results_root_id}, showModuleResult); | 55 | callAction('module_result', 'module_result', {results_root_id: results_root_id}, showModuleResult); |
| 56 | return false; | 56 | return false; |
| 57 | } | 57 | } |
| @@ -67,7 +67,7 @@ function reloadProject(date){ | @@ -67,7 +67,7 @@ function reloadProject(date){ | ||
| 67 | showLoadingProcess(true); | 67 | showLoadingProcess(true); |
| 68 | 68 | ||
| 69 | callAction('processing', 'processing', {date: date}, showProjectResult); | 69 | callAction('processing', 'processing', {date: date}, showProjectResult); |
| 70 | - callAction('module_result', 'project_tree', {date: date}, showProjectTree); | 70 | +// callAction('module_result', 'project_tree', {date: date}, showProjectTree); |
| 71 | callAction('module_result', 'module_result', {date: date}, showModuleResult); | 71 | callAction('module_result', 'module_result', {date: date}, showModuleResult); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| @@ -80,9 +80,9 @@ function showProcessingFor(state){ | @@ -80,9 +80,9 @@ function showProcessingFor(state){ | ||
| 80 | jQuery('#msg-time').html(''); | 80 | jQuery('#msg-time').html(''); |
| 81 | jQuery('#processing-state').html('<div style="color:Green">READY</div>'); | 81 | jQuery('#processing-state').html('<div style="color:Green">READY</div>'); |
| 82 | callAction('processing', 'processing', {}, showProcessing); | 82 | callAction('processing', 'processing', {}, showProcessing); |
| 83 | - callAction('processing','project_tree', {}, showProjectTree); | 83 | +// callAction('processing','project_tree', {}, showProjectTree); |
| 84 | //var module_result_id = jQuery("#processing").attr('results_root_id'); //TODO Waiting for ModuleResultController refactoring | 84 | //var module_result_id = jQuery("#processing").attr('results_root_id'); //TODO Waiting for ModuleResultController refactoring |
| 85 | - //callAction('module_result', 'module_result', {module_result_id: module_result_id}, showModuleResult); //TODO Waiting for ModuleResultController refactoring | 85 | + callAction('module_result', 'module_result', {module_result_id: module_result_id}, showModuleResult); //TODO Waiting for ModuleResultController refactoring |
| 86 | } | 86 | } |
| 87 | else if (state.endsWith("ING")) { | 87 | else if (state.endsWith("ING")) { |
| 88 | jQuery('#processing-state').html('<div style="color:DarkGoldenRod">'+ state +'</div>'); | 88 | jQuery('#processing-state').html('<div style="color:DarkGoldenRod">'+ state +'</div>'); |
| @@ -103,18 +103,18 @@ function showProjectResult(content) { | @@ -103,18 +103,18 @@ function showProjectResult(content) { | ||
| 103 | jQuery('#processing').html(content); | 103 | jQuery('#processing').html(content); |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | -function showProjectTree(content){ | ||
| 107 | - processingTree = false; | ||
| 108 | - jQuery('#project-tree').html(content); | ||
| 109 | - return false; | ||
| 110 | -} | 106 | +//function showProjectTree(content){ |
| 107 | +// processingTree = false; | ||
| 108 | +// jQuery('#project-tree').html(content); | ||
| 109 | +// return false; | ||
| 110 | +//} | ||
| 111 | 111 | ||
| 112 | //TODO Waiting for ModuleResultController refactoring | 112 | //TODO Waiting for ModuleResultController refactoring |
| 113 | function showModuleResult(content){ | 113 | function showModuleResult(content){ |
| 114 | - if (processingTree != true){ | 114 | +// if (processingTree != true){ |
| 115 | jQuery('#module-result').html(content); | 115 | jQuery('#module-result').html(content); |
| 116 | - } | ||
| 117 | - return false; | 116 | +// } |
| 117 | +// return false; | ||
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | function callAction(controller, action, params, callback){ | 120 | function callAction(controller, action, params, callback){ |