Commit eca8fdfa4abe90e7790abb55149f250183a8ae67

Authored by Rafael Manzo
Committed by Diego Camarinha
1 parent 5c39634f

[Mezuro] Javascript for processing state and source tree

plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb
1   -#TODO terminar esse controler e seus testes funcionais
2 1 class MezuroPluginRepositoryController < MezuroPluginProfileController
3 2  
4 3 append_view_path File.join(File.dirname(__FILE__) + '/../../views')
... ...
plugins/mezuro/public/javascripts/processing.js
... ... @@ -2,17 +2,18 @@ var processingTree = false;
2 2 var metricName;
3 3 jQuery(function (){
4 4 jQuery('.source-tree-link').live("click", reloadModule);
5   - jQuery('[show-metric-history]').live("click", display_metric_history);
6   - jQuery('[show-grade-history]').live("click", display_grade_history);
7   - jQuery('#project_date_submit').live("click", reloadProjectWithDate);
  5 + jQuery('[show-metric-history]').live("click", display_metric_history); //TODO review for project history
  6 + jQuery('[show-grade-history]').live("click", display_grade_history); //TODO review for project history
  7 + jQuery('#project_date_submit').live("click", reloadProjectWithDate); //TODO review for project history
8 8 showLoadingProcess(true);
9 9 showProcessing();
10 10 });
11 11  
12 12 function showProcessing() {
13   - callAction('processing', 'processing_state', {}, showProcessingFor);
  13 + callAction('processing', 'processing', {}, showProcessingFor);
14 14 }
15 15  
  16 +//TODO review for project history
16 17 function display_metric_history() {
17 18 var module_name = jQuery(this).attr('data-module-name');
18 19 var metric_name = jQuery(this).attr('show-metric-history');
... ... @@ -22,6 +23,7 @@ function display_metric_history() {
22 23 return false;
23 24 }
24 25  
  26 +//TODO review for project history
25 27 function display_grade_history() {
26 28 var module_name = jQuery(this).attr('data-module-name');
27 29 toggle_mezuro("#historical-grade");
... ... @@ -29,10 +31,12 @@ function display_grade_history() {
29 31 return false;
30 32 }
31 33  
  34 +//TODO review for project history
32 35 function show_metrics(content) {
33 36 jQuery('#historical-' + metricName).html(content);
34 37 }
35 38  
  39 +//TODO review for project history
36 40 function show_grades(content) {
37 41 jQuery('#historical-grade').html(content);
38 42 }
... ... @@ -42,6 +46,7 @@ function toggle_mezuro(element){
42 46 return false;
43 47 }
44 48  
  49 +//TODO Waiting for ModuleResultController refactoring
45 50 function reloadModule(){
46 51 var results_root_id = jQuery(this).attr('results_root_id');
47 52 showLoadingProcess(false);
... ... @@ -51,11 +56,13 @@ function reloadModule(){
51 56 return false;
52 57 }
53 58  
  59 +//TODO review for project history
54 60 function reloadProjectWithDate(date){
55 61 reloadProject(date + "T00:00:00+00:00");
56 62 return false;
57 63 }
58 64  
  65 +//TODO review for project history
59 66 function reloadProject(date){
60 67 showLoadingProcess(true);
61 68  
... ... @@ -73,9 +80,9 @@ function showProcessingFor(state){
73 80 jQuery('#msg-time').html('');
74 81 jQuery('#processing-state').html('<div style="color:Green">READY</div>');
75 82 callAction('processing', 'processing', {}, showProcessing);
76   - callAction('module_result','project_tree', {}, showProjectTree);
77   - var module_result_id = jQuery("#processing").attr('results_root_id');
78   - callAction('module_result', 'module_result', {module_result_id: module_result_id}, showModuleResult);
  83 + callAction('processing','project_tree', {}, showProjectTree);
  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
79 86 }
80 87 else if (state.endsWith("ING")) {
81 88 jQuery('#processing-state').html('<div style="color:DarkGoldenRod">'+ state +'</div>');
... ... @@ -102,6 +109,7 @@ function showProjectTree(content){
102 109 return false;
103 110 }
104 111  
  112 +//TODO Waiting for ModuleResultController refactoring
105 113 function showModuleResult(content){
106 114 if (processingTree != true){
107 115 jQuery('#module-result').html(content);
... ...