From 4461895cc782410df5c6ec9e02b97c9557d37783 Mon Sep 17 00:00:00 2001 From: Diego Araújo Date: Wed, 7 Oct 2015 14:49:56 -0300 Subject: [PATCH] Add Hotspot metric result accordion --- app/views/repositories/_hotspot_metric_results_error.html.erb | 1 + app/views/repositories/load_error.js.erb | 3 ++- app/views/repositories/show.html.erb | 6 ++++++ config/locales/views/repository/en.yml | 6 ++++-- config/locales/views/repository/pt.yml | 2 ++ features/repository/show/hotspot_metric_results.feature | 17 +++++++++++++++++ features/repository/show/independent.feature | 4 ++-- features/repository/show/metric_results.feature | 8 ++++---- features/repository/show/repository_info.feature | 4 ++-- 9 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 app/views/repositories/_hotspot_metric_results_error.html.erb create mode 100644 features/repository/show/hotspot_metric_results.feature diff --git a/app/views/repositories/_hotspot_metric_results_error.html.erb b/app/views/repositories/_hotspot_metric_results_error.html.erb new file mode 100644 index 0000000..610a88a --- /dev/null +++ b/app/views/repositories/_hotspot_metric_results_error.html.erb @@ -0,0 +1 @@ +

<%= t('activemodel.errors.repository.no_hotspot_metric_results') %>

diff --git a/app/views/repositories/load_error.js.erb b/app/views/repositories/load_error.js.erb index 9500c99..89bc0de 100644 --- a/app/views/repositories/load_error.js.erb +++ b/app/views/repositories/load_error.js.erb @@ -1,3 +1,4 @@ $('div#processing_information').html('<%= escape_javascript(render partial: "processing_information") %>'); $('div#module_tree').html('<%= escape_javascript(render partial: "module_tree_error") %>'); -$('div#metric_results').html('<%= escape_javascript(render partial: "metric_results_error") %>'); \ No newline at end of file +$('div#hotspot_metric_results').html('<%= escape_javascript(render partial: "hotspot_metric_results_error") %>'); +$('div#metric_results').html('<%= escape_javascript(render partial: "metric_results_error") %>'); diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 9448395..21e90af 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -64,6 +64,11 @@
<%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %>
+
+

<%= t('repository.show.hotspot_metric_results') %>

+
<%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %>
+
+

<%= t('repository.show.metric_results') %>

<%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %>
@@ -81,6 +86,7 @@ collapsible: true, }); $("#module-accordion").accordion({active: false}) + $("#hotspot-metric-accordion").accordion({active: false}) $("#metric-accordion").accordion({active: false}) }); diff --git a/config/locales/views/repository/en.yml b/config/locales/views/repository/en.yml index 503eb6b..29cbc4d 100644 --- a/config/locales/views/repository/en.yml +++ b/config/locales/views/repository/en.yml @@ -25,7 +25,8 @@ en: branch: "The branch to be analyzed." errors: repository: - no_metric_results: "Repository process returned with error. There are no metric results." + no_metric_results: "Repository process returned with error. There are no tree metric results." + no_hotspot_metric_results: "Repository process returned with error. There are no hotspot metric results." no_modeule_tree: "Repository process returned with error. There is no module tree." unstarted_processing: "This Repository has no processings yet. Please, wait an instant as we start it." repository: @@ -33,6 +34,7 @@ en: reprocess: "Reprocess" processing_information: "Processing Information" modules_tree: "Modules Tree" - metric_results: "Metric Results" + hotspot_metric_results: "Hotspot Metric Results" + metric_results: "Tree Metric Results" loading: "Loading data. Please, wait." date_processing: "Retrieve the closest processing information from" diff --git a/config/locales/views/repository/pt.yml b/config/locales/views/repository/pt.yml index 8ba3d50..811e761 100644 --- a/config/locales/views/repository/pt.yml +++ b/config/locales/views/repository/pt.yml @@ -26,6 +26,7 @@ pt: errors: repository: no_metric_results: "O processamento do Repósitório retornou um erro. Não há Resultados de Métrica." + no_hotspot_metric_results: "O processamento do Repósitório retornou um erro. Não há Resultados de Métricas de Hotspot." no_modeule_tree: "Repository process returned with error. Não há uma Árvore de Módulos." unstarted_processing: "Este Repositório ainda não tem Processamentos. Por favor, aguarde um instante enquanto o iniciamos." repository: @@ -33,6 +34,7 @@ pt: reprocess: "Reprocessar" processing_information: "Informação do Processamento" modules_tree: "Árvore de Módulos" + hotspot_metric_results: "Resultados de Métricas de Hotspot" metric_results: "Resultados de Métrica" loading: "Carregando os dados. Por favor, aguarde." date_processing: "Obtenha a informação de processamento mais próxima a" diff --git a/features/repository/show/hotspot_metric_results.feature b/features/repository/show/hotspot_metric_results.feature new file mode 100644 index 0000000..fa29848 --- /dev/null +++ b/features/repository/show/hotspot_metric_results.feature @@ -0,0 +1,17 @@ +Feature: Repository hotspot metric results + In order to better understand the results of the analysis + As a regular user + I should see the hotspot metric results list + + @kalibro_configuration_restart @kalibro_processor_restart @javascript + Scenario: Should show the error message when the process fails + Given I am a regular user + And I am signed in + And I have a sample project + And I have a sample configuration with native metrics + And I have a sample of an invalid repository within the sample project + And I start to process that repository + And I wait up for a error processing + When I visit the repository show page + And I click the "Hotspot Metric Results" h3 + Then I should see "Repository process returned with error. There are no hotspot metric results." diff --git a/features/repository/show/independent.feature b/features/repository/show/independent.feature index 7c7e309..b050ea9 100644 --- a/features/repository/show/independent.feature +++ b/features/repository/show/independent.feature @@ -22,7 +22,7 @@ Feature: Date Select And I should see "AGGREGATING time" And I should see "CALCULATING time" And I should see "INTERPRETING time" - When I click the "Metric Results" h3 + When I click the "Tree Metric Results" h3 And I click the "Modules Tree" h3 Then I should see "Metric" And I should see "Value" @@ -35,4 +35,4 @@ Feature: Date Select Then I should see "PREPARING" When I click the Back link And I wait for "5" seconds - Then I should be at the Repositories index \ No newline at end of file + Then I should be at the Repositories index diff --git a/features/repository/show/metric_results.feature b/features/repository/show/metric_results.feature index 2b2cae7..d550edd 100644 --- a/features/repository/show/metric_results.feature +++ b/features/repository/show/metric_results.feature @@ -16,7 +16,7 @@ Feature: Repository metric results And I ask for the module result of the given processing And I ask for the metric results of the given module result When I visit the repository show page - And I click the "Metric Results" h3 + And I click the "Tree Metric Results" h3 And I see a sample metric's name And I click on the sample metric's name Then I should see "Loading data. Please, wait." @@ -34,7 +34,7 @@ Feature: Repository metric results And I ask for the module result of the given processing And I ask for the metric results of the given module result When I visit the repository show page - And I click the "Metric Results" h3 + And I click the "Tree Metric Results" h3 And I see a sample metric's name Then I should see "Missing range" @@ -48,8 +48,8 @@ Feature: Repository metric results And I start to process that repository And I wait up for a error processing When I visit the repository show page - And I click the "Metric Results" h3 - Then I should see "Repository process returned with error. There are no metric results." + And I click the "Tree Metric Results" h3 + Then I should see "Repository process returned with error. There are no tree metric results." # TODO: Scenario: Should show the graphic of a given metric # It was getting really difficult to test this because of Poltergeist's timeouts diff --git a/features/repository/show/repository_info.feature b/features/repository/show/repository_info.feature index d19e41c..bcd8e74 100644 --- a/features/repository/show/repository_info.feature +++ b/features/repository/show/repository_info.feature @@ -40,7 +40,7 @@ Feature: Show Repository And I should see "AGGREGATING time" And I should see "CALCULATING time" And I should see "INTERPRETING time" - When I click the "Metric Results" h3 + When I click the "Tree Metric Results" h3 And I click the "Modules Tree" h3 Then I should see "Metric" And I should see "Value" @@ -67,7 +67,7 @@ Feature: Show Repository And I should see "Configuration" And I should see "State" And I should see "Creation Date" - When I click the "Metric Results" h3 + When I click the "Tree Metric Results" h3 Then I should see "Loading data. Please, wait." When I click the "Modules Tree" h3 Then I should see "Loading data. Please, wait." -- libgit2 0.21.2