Commit 00cfe87b3d570eba50d2bbdff45c99cb404bf5e4

Authored by Caio
2 parents 7e86bd7d a8f67508

[Mezuro] merging

plugins/mezuro/lib/kalibro/entities/project_result.rb
1 class Kalibro::Entities::ProjectResult < Kalibro::Entities::Entity 1 class Kalibro::Entities::ProjectResult < Kalibro::Entities::Entity
2 -  
3 - attr_accessor :project, :date, :load_time, :collect_time, :analysis_time, :source_tree 2 +
  3 + attr_accessor :project, :date, :load_time, :analysis_time, :source_tree, :collect_time
4 4
5 def project=(value) 5 def project=(value)
6 @project = to_entity(value, Kalibro::Entities::Project) 6 @project = to_entity(value, Kalibro::Entities::Project)
plugins/mezuro/public/javascripts/project_content.js
@@ -59,16 +59,23 @@ function reloadProject(date){ @@ -59,16 +59,23 @@ function reloadProject(date){
59 } 59 }
60 60
61 function showProjectContentFor(state){ 61 function showProjectContentFor(state){
62 - if (state == 'ERROR') 62 + if (state == 'ERROR') {
  63 + jQuery('#project-state').html('ERROR');
63 callAction('project_error', {}, showProjectResult); 64 callAction('project_error', {}, showProjectResult);
  65 + }
64 else if (state == 'READY') { 66 else if (state == 'READY') {
  67 + jQuery('#msg-time').html('');
  68 + jQuery('#project-state').html('READY');
65 callAction('project_result', {}, showProjectResult); 69 callAction('project_result', {}, showProjectResult);
66 callAction('project_tree', {}, showProjectTree); 70 callAction('project_tree', {}, showProjectTree);
67 var project_name = jQuery("#project-result").attr('data-project-name'); 71 var project_name = jQuery("#project-result").attr('data-project-name');
68 callAction('module_result', {module_name: project_name}, showModuleResult); 72 callAction('module_result', {module_name: project_name}, showModuleResult);
69 - }  
70 - else if (state.endsWith("ING")) 73 + }
  74 + else if (state.endsWith("ING")) {
  75 + jQuery('#project-state').html(state);
  76 + jQuery('#msg-time').html("The project analysis may take long. <br/> You'll receive an e-mail when it's ready!");
71 showProjectContentAfter(20); 77 showProjectContentAfter(20);
  78 + }
72 } 79 }
73 80
74 function showProjectContentAfter(seconds){ 81 function showProjectContentAfter(seconds){
plugins/mezuro/views/content_viewer/show_project.rhtml
@@ -26,6 +26,13 @@ @@ -26,6 +26,13 @@
26 <td><%= _('Configuration') %></td> 26 <td><%= _('Configuration') %></td>
27 <td><%= @project.configuration_name %></td> 27 <td><%= @project.configuration_name %></td>
28 </tr> 28 </tr>
  29 + <tr>
  30 + <td><%= _('Status')%></td>
  31 + <td>
  32 + <div id="project-state"><%= @project.state %></div>
  33 + <div id="msg-time"></div>
  34 + </td>
  35 + </tr>
29 </table> 36 </table>
30 37
31 <br /> 38 <br />