Commit 4461895cc782410df5c6ec9e02b97c9557d37783
Committed by
Heitor
1 parent
fea6e25b
Exists in
colab
and in
4 other branches
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>
Showing
9 changed files
with
40 additions
and
11 deletions
Show diff stats
app/views/repositories/_hotspot_metric_results_error.html.erb
0 → 100644
| @@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||
| 1 | +<p><%= t('activemodel.errors.repository.no_hotspot_metric_results') %></p> |
app/views/repositories/load_error.js.erb
| 1 | $('div#processing_information').html('<%= escape_javascript(render partial: "processing_information") %>'); | 1 | $('div#processing_information').html('<%= escape_javascript(render partial: "processing_information") %>'); |
| 2 | $('div#module_tree').html('<%= escape_javascript(render partial: "module_tree_error") %>'); | 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 | \ No newline at end of file | 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,6 +64,11 @@ | ||
| 64 | <div id="module_tree"><%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %></div> | 64 | <div id="module_tree"><%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %></div> |
| 65 | </div> | 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 | <div id="metric-accordion"> | 72 | <div id="metric-accordion"> |
| 68 | <h3 class="jquery-ui-accordion"><%= t('repository.show.metric_results') %></h3> | 73 | <h3 class="jquery-ui-accordion"><%= t('repository.show.metric_results') %></h3> |
| 69 | <div id="metric_results"><%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %></div> | 74 | <div id="metric_results"><%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %></div> |
| @@ -81,6 +86,7 @@ | @@ -81,6 +86,7 @@ | ||
| 81 | collapsible: true, | 86 | collapsible: true, |
| 82 | }); | 87 | }); |
| 83 | $("#module-accordion").accordion({active: false}) | 88 | $("#module-accordion").accordion({active: false}) |
| 89 | + $("#hotspot-metric-accordion").accordion({active: false}) | ||
| 84 | $("#metric-accordion").accordion({active: false}) | 90 | $("#metric-accordion").accordion({active: false}) |
| 85 | }); | 91 | }); |
| 86 | </script> | 92 | </script> |
config/locales/views/repository/en.yml
| @@ -25,7 +25,8 @@ en: | @@ -25,7 +25,8 @@ en: | ||
| 25 | branch: "The branch to be analyzed." | 25 | branch: "The branch to be analyzed." |
| 26 | errors: | 26 | errors: |
| 27 | repository: | 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 | no_modeule_tree: "Repository process returned with error. There is no module tree." | 30 | no_modeule_tree: "Repository process returned with error. There is no module tree." |
| 30 | unstarted_processing: "This Repository has no processings yet. Please, wait an instant as we start it." | 31 | unstarted_processing: "This Repository has no processings yet. Please, wait an instant as we start it." |
| 31 | repository: | 32 | repository: |
| @@ -33,6 +34,7 @@ en: | @@ -33,6 +34,7 @@ en: | ||
| 33 | reprocess: "Reprocess" | 34 | reprocess: "Reprocess" |
| 34 | processing_information: "Processing Information" | 35 | processing_information: "Processing Information" |
| 35 | modules_tree: "Modules Tree" | 36 | modules_tree: "Modules Tree" |
| 36 | - metric_results: "Metric Results" | 37 | + hotspot_metric_results: "Hotspot Metric Results" |
| 38 | + metric_results: "Tree Metric Results" | ||
| 37 | loading: "Loading data. Please, wait." | 39 | loading: "Loading data. Please, wait." |
| 38 | date_processing: "Retrieve the closest processing information from" | 40 | date_processing: "Retrieve the closest processing information from" |
config/locales/views/repository/pt.yml
| @@ -26,6 +26,7 @@ pt: | @@ -26,6 +26,7 @@ pt: | ||
| 26 | errors: | 26 | errors: |
| 27 | repository: | 27 | repository: |
| 28 | no_metric_results: "O processamento do Repósitório retornou um erro. Não há Resultados de Métrica." | 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 | no_modeule_tree: "Repository process returned with error. Não há uma Árvore de Módulos." | 30 | no_modeule_tree: "Repository process returned with error. Não há uma Árvore de Módulos." |
| 30 | unstarted_processing: "Este Repositório ainda não tem Processamentos. Por favor, aguarde um instante enquanto o iniciamos." | 31 | unstarted_processing: "Este Repositório ainda não tem Processamentos. Por favor, aguarde um instante enquanto o iniciamos." |
| 31 | repository: | 32 | repository: |
| @@ -33,6 +34,7 @@ pt: | @@ -33,6 +34,7 @@ pt: | ||
| 33 | reprocess: "Reprocessar" | 34 | reprocess: "Reprocessar" |
| 34 | processing_information: "Informação do Processamento" | 35 | processing_information: "Informação do Processamento" |
| 35 | modules_tree: "Árvore de Módulos" | 36 | modules_tree: "Árvore de Módulos" |
| 37 | + hotspot_metric_results: "Resultados de Métricas de Hotspot" | ||
| 36 | metric_results: "Resultados de Métrica" | 38 | metric_results: "Resultados de Métrica" |
| 37 | loading: "Carregando os dados. Por favor, aguarde." | 39 | loading: "Carregando os dados. Por favor, aguarde." |
| 38 | date_processing: "Obtenha a informação de processamento mais próxima a" | 40 | date_processing: "Obtenha a informação de processamento mais próxima a" |
| @@ -0,0 +1,17 @@ | @@ -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,7 +22,7 @@ Feature: Date Select | ||
| 22 | And I should see "AGGREGATING time" | 22 | And I should see "AGGREGATING time" |
| 23 | And I should see "CALCULATING time" | 23 | And I should see "CALCULATING time" |
| 24 | And I should see "INTERPRETING time" | 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 | And I click the "Modules Tree" h3 | 26 | And I click the "Modules Tree" h3 |
| 27 | Then I should see "Metric" | 27 | Then I should see "Metric" |
| 28 | And I should see "Value" | 28 | And I should see "Value" |
| @@ -35,4 +35,4 @@ Feature: Date Select | @@ -35,4 +35,4 @@ Feature: Date Select | ||
| 35 | Then I should see "PREPARING" | 35 | Then I should see "PREPARING" |
| 36 | When I click the Back link | 36 | When I click the Back link |
| 37 | And I wait for "5" seconds | 37 | And I wait for "5" seconds |
| 38 | - Then I should be at the Repositories index | ||
| 39 | \ No newline at end of file | 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,7 +16,7 @@ Feature: Repository metric results | ||
| 16 | And I ask for the module result of the given processing | 16 | And I ask for the module result of the given processing |
| 17 | And I ask for the metric results of the given module result | 17 | And I ask for the metric results of the given module result |
| 18 | When I visit the repository show page | 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 | And I see a sample metric's name | 20 | And I see a sample metric's name |
| 21 | And I click on the sample metric's name | 21 | And I click on the sample metric's name |
| 22 | Then I should see "Loading data. Please, wait." | 22 | Then I should see "Loading data. Please, wait." |
| @@ -34,7 +34,7 @@ Feature: Repository metric results | @@ -34,7 +34,7 @@ Feature: Repository metric results | ||
| 34 | And I ask for the module result of the given processing | 34 | And I ask for the module result of the given processing |
| 35 | And I ask for the metric results of the given module result | 35 | And I ask for the metric results of the given module result |
| 36 | When I visit the repository show page | 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 | And I see a sample metric's name | 38 | And I see a sample metric's name |
| 39 | Then I should see "Missing range" | 39 | Then I should see "Missing range" |
| 40 | 40 | ||
| @@ -48,8 +48,8 @@ Feature: Repository metric results | @@ -48,8 +48,8 @@ Feature: Repository metric results | ||
| 48 | And I start to process that repository | 48 | And I start to process that repository |
| 49 | And I wait up for a error processing | 49 | And I wait up for a error processing |
| 50 | When I visit the repository show page | 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 | # TODO: Scenario: Should show the graphic of a given metric | 54 | # TODO: Scenario: Should show the graphic of a given metric |
| 55 | # It was getting really difficult to test this because of Poltergeist's timeouts | 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,7 +40,7 @@ Feature: Show Repository | ||
| 40 | And I should see "AGGREGATING time" | 40 | And I should see "AGGREGATING time" |
| 41 | And I should see "CALCULATING time" | 41 | And I should see "CALCULATING time" |
| 42 | And I should see "INTERPRETING time" | 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 | And I click the "Modules Tree" h3 | 44 | And I click the "Modules Tree" h3 |
| 45 | Then I should see "Metric" | 45 | Then I should see "Metric" |
| 46 | And I should see "Value" | 46 | And I should see "Value" |
| @@ -67,7 +67,7 @@ Feature: Show Repository | @@ -67,7 +67,7 @@ Feature: Show Repository | ||
| 67 | And I should see "Configuration" | 67 | And I should see "Configuration" |
| 68 | And I should see "State" | 68 | And I should see "State" |
| 69 | And I should see "Creation Date" | 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 | Then I should see "Loading data. Please, wait." | 71 | Then I should see "Loading data. Please, wait." |
| 72 | When I click the "Modules Tree" h3 | 72 | When I click the "Modules Tree" h3 |
| 73 | Then I should see "Loading data. Please, wait." | 73 | Then I should see "Loading data. Please, wait." |