Commit 4461895cc782410df5c6ec9e02b97c9557d37783

Authored by Diego Camarinha
Committed by Heitor
1 parent fea6e25b

Add Hotspot metric result accordion

 * Includes translations
 * Replaces "Metric Results" with "Tree Metric Results"
 * Creates a feature for hotspot metric results
 * Handles the view when the processing fails

Signed off by: Eduardo Silva Araújo <duduktamg@hotmail.com>
app/views/repositories/_hotspot_metric_results_error.html.erb 0 → 100644
... ... @@ -0,0 +1 @@
  1 +<p><%= t('activemodel.errors.repository.no_hotspot_metric_results') %></p>
... ...
app/views/repositories/load_error.js.erb
1 1 $('div#processing_information').html('<%= escape_javascript(render partial: "processing_information") %>');
2 2 $('div#module_tree').html('<%= escape_javascript(render partial: "module_tree_error") %>');
3   -$('div#metric_results').html('<%= escape_javascript(render partial: "metric_results_error") %>');
4 3 \ No newline at end of file
  4 +$('div#hotspot_metric_results').html('<%= escape_javascript(render partial: "hotspot_metric_results_error") %>');
  5 +$('div#metric_results').html('<%= escape_javascript(render partial: "metric_results_error") %>');
... ...
app/views/repositories/show.html.erb
... ... @@ -64,6 +64,11 @@
64 64 <div id="module_tree"><%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %></div>
65 65 </div>
66 66  
  67 + <div id="hotspot-metric-accordion">
  68 + <h3 class="jquery-ui-accordion"><%= t('repository.show.hotspot_metric_results') %></h3>
  69 + <div id="hotspot_metric_results"><%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %></div>
  70 + </div>
  71 +
67 72 <div id="metric-accordion">
68 73 <h3 class="jquery-ui-accordion"><%= t('repository.show.metric_results') %></h3>
69 74 <div id="metric_results"><%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %></div>
... ... @@ -81,6 +86,7 @@
81 86 collapsible: true,
82 87 });
83 88 $("#module-accordion").accordion({active: false})
  89 + $("#hotspot-metric-accordion").accordion({active: false})
84 90 $("#metric-accordion").accordion({active: false})
85 91 });
86 92 </script>
... ...
config/locales/views/repository/en.yml
... ... @@ -25,7 +25,8 @@ en:
25 25 branch: "The branch to be analyzed."
26 26 errors:
27 27 repository:
28   - no_metric_results: "Repository process returned with error. There are no metric results."
  28 + no_metric_results: "Repository process returned with error. There are no tree metric results."
  29 + no_hotspot_metric_results: "Repository process returned with error. There are no hotspot metric results."
29 30 no_modeule_tree: "Repository process returned with error. There is no module tree."
30 31 unstarted_processing: "This Repository has no processings yet. Please, wait an instant as we start it."
31 32 repository:
... ... @@ -33,6 +34,7 @@ en:
33 34 reprocess: "Reprocess"
34 35 processing_information: "Processing Information"
35 36 modules_tree: "Modules Tree"
36   - metric_results: "Metric Results"
  37 + hotspot_metric_results: "Hotspot Metric Results"
  38 + metric_results: "Tree Metric Results"
37 39 loading: "Loading data. Please, wait."
38 40 date_processing: "Retrieve the closest processing information from"
... ...
config/locales/views/repository/pt.yml
... ... @@ -26,6 +26,7 @@ pt:
26 26 errors:
27 27 repository:
28 28 no_metric_results: "O processamento do Repósitório retornou um erro. Não há Resultados de Métrica."
  29 + no_hotspot_metric_results: "O processamento do Repósitório retornou um erro. Não há Resultados de Métricas de Hotspot."
29 30 no_modeule_tree: "Repository process returned with error. Não há uma Árvore de Módulos."
30 31 unstarted_processing: "Este Repositório ainda não tem Processamentos. Por favor, aguarde um instante enquanto o iniciamos."
31 32 repository:
... ... @@ -33,6 +34,7 @@ pt:
33 34 reprocess: "Reprocessar"
34 35 processing_information: "Informação do Processamento"
35 36 modules_tree: "Árvore de Módulos"
  37 + hotspot_metric_results: "Resultados de Métricas de Hotspot"
36 38 metric_results: "Resultados de Métrica"
37 39 loading: "Carregando os dados. Por favor, aguarde."
38 40 date_processing: "Obtenha a informação de processamento mais próxima a"
... ...
features/repository/show/hotspot_metric_results.feature 0 → 100644
... ... @@ -0,0 +1,17 @@
  1 +Feature: Repository hotspot metric results
  2 + In order to better understand the results of the analysis
  3 + As a regular user
  4 + I should see the hotspot metric results list
  5 +
  6 + @kalibro_configuration_restart @kalibro_processor_restart @javascript
  7 + Scenario: Should show the error message when the process fails
  8 + Given I am a regular user
  9 + And I am signed in
  10 + And I have a sample project
  11 + And I have a sample configuration with native metrics
  12 + And I have a sample of an invalid repository within the sample project
  13 + And I start to process that repository
  14 + And I wait up for a error processing
  15 + When I visit the repository show page
  16 + And I click the "Hotspot Metric Results" h3
  17 + Then I should see "Repository process returned with error. There are no hotspot metric results."
... ...
features/repository/show/independent.feature
... ... @@ -22,7 +22,7 @@ Feature: Date Select
22 22 And I should see "AGGREGATING time"
23 23 And I should see "CALCULATING time"
24 24 And I should see "INTERPRETING time"
25   - When I click the "Metric Results" h3
  25 + When I click the "Tree Metric Results" h3
26 26 And I click the "Modules Tree" h3
27 27 Then I should see "Metric"
28 28 And I should see "Value"
... ... @@ -35,4 +35,4 @@ Feature: Date Select
35 35 Then I should see "PREPARING"
36 36 When I click the Back link
37 37 And I wait for "5" seconds
38   - Then I should be at the Repositories index
39 38 \ No newline at end of file
  39 + Then I should be at the Repositories index
... ...
features/repository/show/metric_results.feature
... ... @@ -16,7 +16,7 @@ Feature: Repository metric results
16 16 And I ask for the module result of the given processing
17 17 And I ask for the metric results of the given module result
18 18 When I visit the repository show page
19   - And I click the "Metric Results" h3
  19 + And I click the "Tree Metric Results" h3
20 20 And I see a sample metric's name
21 21 And I click on the sample metric's name
22 22 Then I should see "Loading data. Please, wait."
... ... @@ -34,7 +34,7 @@ Feature: Repository metric results
34 34 And I ask for the module result of the given processing
35 35 And I ask for the metric results of the given module result
36 36 When I visit the repository show page
37   - And I click the "Metric Results" h3
  37 + And I click the "Tree Metric Results" h3
38 38 And I see a sample metric's name
39 39 Then I should see "Missing range"
40 40  
... ... @@ -48,8 +48,8 @@ Feature: Repository metric results
48 48 And I start to process that repository
49 49 And I wait up for a error processing
50 50 When I visit the repository show page
51   - And I click the "Metric Results" h3
52   - Then I should see "Repository process returned with error. There are no metric results."
  51 + And I click the "Tree Metric Results" h3
  52 + Then I should see "Repository process returned with error. There are no tree metric results."
53 53  
54 54 # TODO: Scenario: Should show the graphic of a given metric
55 55 # It was getting really difficult to test this because of Poltergeist's timeouts
... ...
features/repository/show/repository_info.feature
... ... @@ -40,7 +40,7 @@ Feature: Show Repository
40 40 And I should see "AGGREGATING time"
41 41 And I should see "CALCULATING time"
42 42 And I should see "INTERPRETING time"
43   - When I click the "Metric Results" h3
  43 + When I click the "Tree Metric Results" h3
44 44 And I click the "Modules Tree" h3
45 45 Then I should see "Metric"
46 46 And I should see "Value"
... ... @@ -67,7 +67,7 @@ Feature: Show Repository
67 67 And I should see "Configuration"
68 68 And I should see "State"
69 69 And I should see "Creation Date"
70   - When I click the "Metric Results" h3
  70 + When I click the "Tree Metric Results" h3
71 71 Then I should see "Loading data. Please, wait."
72 72 When I click the "Modules Tree" h3
73 73 Then I should see "Loading data. Please, wait."
... ...