From b5248a2c1c163d99e75b6e2bac56adc1a9dfa4ec Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 7 Mar 2016 14:39:04 +0100 Subject: [PATCH] SONAR-7409 Drop the "Drilldown" page and redirect to the "Measures" page --- .../src/test/java/it/Category1Suite.java | 4 +- .../java/it/debt/TechnicalDebtWidgetTest.java | 4 +- ...Test.java => ProjectMeasuresPageTest.java} | 12 +- ...hould-open-links-on-measures-service.html} | 6 +- .../technical-debt/is-in-issues-widget.html | 2 +- ...remediation-cost-on-measures-service.html} | 6 +- .../should_display_measure_drilldown.html | 54 ------ .../should_display_measures_page.html | 29 +++ .../src/main/js/apps/drilldown/app.js | 48 ----- .../js/components/shared/drilldown-link.js | 6 +- server/sonar-web/src/main/js/helpers/urls.js | 14 +- .../app/controllers/drilldown_controller.rb | 53 +----- .../webapp/WEB-INF/app/models/drilldown.rb | 167 ------------------ .../app/views/drilldown/_footer.html.erb | 14 -- .../app/views/drilldown/measures.html.erb | 139 --------------- server/sonar-web/tests/helpers/urls-test.js | 9 +- server/sonar-web/webpack.config.js | 1 - 17 files changed, 54 insertions(+), 514 deletions(-) rename it/it-tests/src/test/java/it/measure/{ProjectDrilldownTest.java => ProjectMeasuresPageTest.java} (83%) rename it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/debt-overview/{should-open-links-on-drilldown-service.html => should-open-links-on-measures-service.html} (89%) rename it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/technical-debt/{should-open-remediationcost-on-drilldown-service.html => should-open-remediation-cost-on-measures-service.html} (89%) delete mode 100644 it/it-tests/src/test/resources/measure/ProjectDrilldownTest/should_display_measure_drilldown.html create mode 100644 it/it-tests/src/test/resources/measure/ProjectMeasuresPageTest/should_display_measures_page.html delete mode 100644 server/sonar-web/src/main/js/apps/drilldown/app.js delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/models/drilldown.rb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/_footer.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb diff --git a/it/it-tests/src/test/java/it/Category1Suite.java b/it/it-tests/src/test/java/it/Category1Suite.java index b0a519ffc7c..cfb7fca2c1a 100644 --- a/it/it-tests/src/test/java/it/Category1Suite.java +++ b/it/it-tests/src/test/java/it/Category1Suite.java @@ -33,7 +33,7 @@ import it.customMeasure.CustomMeasuresTest; import it.i18n.I18nTest; import it.measure.MeasuresWsTest; import it.measure.NewDebtRatioMeasureTest; -import it.measure.ProjectDrilldownTest; +import it.measure.ProjectMeasuresPageTest; import it.measure.ProjectOverviewTest; import it.measure.ProjectWidgetsTest; import it.measure.TechnicalDebtMeasureVariationTest; @@ -92,7 +92,7 @@ import static util.ItUtils.xooPlugin; CustomMeasuresTest.class, // measure NewDebtRatioMeasureTest.class, - ProjectDrilldownTest.class, + ProjectMeasuresPageTest.class, ProjectOverviewTest.class, ProjectWidgetsTest.class, MeasureFiltersTest.class, diff --git a/it/it-tests/src/test/java/it/debt/TechnicalDebtWidgetTest.java b/it/it-tests/src/test/java/it/debt/TechnicalDebtWidgetTest.java index 973800cb8d2..72b93fdd451 100644 --- a/it/it-tests/src/test/java/it/debt/TechnicalDebtWidgetTest.java +++ b/it/it-tests/src/test/java/it/debt/TechnicalDebtWidgetTest.java @@ -73,7 +73,7 @@ public class TechnicalDebtWidgetTest { new SeleneseTest(Selenese.builder() .setHtmlTestsInClasspath("technical-debt-in-issues-widget", "/debt/TechnicalDebtWidgetTest/technical-debt/should-have-correct-values.html", - "/debt/TechnicalDebtWidgetTest/technical-debt/should-open-remediationcost-on-drilldown-service.html", + "/debt/TechnicalDebtWidgetTest/technical-debt/should-open-remediation-cost-on-measures-service.html", "/debt/TechnicalDebtWidgetTest/technical-debt/display-differential-values.html", // SONAR-4717 "/debt/TechnicalDebtWidgetTest/technical-debt/is-in-issues-widget.html" @@ -88,7 +88,7 @@ public class TechnicalDebtWidgetTest { new SeleneseTest(Selenese.builder() .setHtmlTestsInClasspath("debt-overview-widget", "/debt/TechnicalDebtWidgetTest/debt-overview/should-have-correct-values.html", - "/debt/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-drilldown-service.html", + "/debt/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-measures-service.html", "/debt/TechnicalDebtWidgetTest/debt-overview/display-differential-values.html" ).build()).runOn(orchestrator); } diff --git a/it/it-tests/src/test/java/it/measure/ProjectDrilldownTest.java b/it/it-tests/src/test/java/it/measure/ProjectMeasuresPageTest.java similarity index 83% rename from it/it-tests/src/test/java/it/measure/ProjectDrilldownTest.java rename to it/it-tests/src/test/java/it/measure/ProjectMeasuresPageTest.java index 60b4db48715..10738476d27 100644 --- a/it/it-tests/src/test/java/it/measure/ProjectDrilldownTest.java +++ b/it/it-tests/src/test/java/it/measure/ProjectMeasuresPageTest.java @@ -30,7 +30,7 @@ import util.selenium.SeleneseTest; import static util.ItUtils.projectDir; -public class ProjectDrilldownTest { +public class ProjectMeasuresPageTest { @ClassRule public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; @@ -39,15 +39,15 @@ public class ProjectDrilldownTest { public static void inspectProject() { orchestrator.executeBuild( SonarRunner.create(projectDir("shared/xoo-sample")) - .setProjectKey("project-drilldown-test-project") - .setProjectName("ProjectDrilldownTest Project") + .setProjectKey("project-measures-page-test-project") + .setProjectName("ProjectMeasuresPageTest Project") ); } @Test - public void should_display_measure_drilldown() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("should_display_measure_drilldown", - "/measure/ProjectDrilldownTest/should_display_measure_drilldown.html" + public void should_display_measures_page() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("should_display_measures_page", + "/measure/ProjectMeasuresPageTest/should_display_measures_page.html" ).build(); new SeleneseTest(selenese).runOn(orchestrator); } diff --git a/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-drilldown-service.html b/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-measures-service.html similarity index 89% rename from it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-drilldown-service.html rename to it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-measures-service.html index 75ab403af05..6c973914330 100644 --- a/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-drilldown-service.html +++ b/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/debt-overview/should-open-links-on-measures-service.html @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/technical-debt/is-in-issues-widget.html b/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/technical-debt/is-in-issues-widget.html index 81fe0879684..4d6e710e540 100644 --- a/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/technical-debt/is-in-issues-widget.html +++ b/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/technical-debt/is-in-issues-widget.html @@ -14,7 +14,7 @@ - + diff --git a/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/technical-debt/should-open-remediationcost-on-drilldown-service.html b/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/technical-debt/should-open-remediation-cost-on-measures-service.html similarity index 89% rename from it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/technical-debt/should-open-remediationcost-on-drilldown-service.html rename to it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/technical-debt/should-open-remediation-cost-on-measures-service.html index 4c18eb9ef25..039266c60ee 100644 --- a/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/technical-debt/should-open-remediationcost-on-drilldown-service.html +++ b/it/it-tests/src/test/resources/debt/TechnicalDebtWidgetTest/technical-debt/should-open-remediation-cost-on-measures-service.html @@ -24,14 +24,14 @@ - + - + - +
should-open-links-on-drilldown-serviceshould-open-links-on-measures-service
assertTextwaitForText content *SQALE Rating*C*
assertTextwaitForText content *Technical Debt Ratio*29.1%*
assertTextwaitForText body *Effort*
assertTextwaitForText content *Technical Debt*7h 25min*
assertTextwaitForText content*Module A*com/sonar/it/samples/modules/a1*HelloA1.xoo**Module A*
diff --git a/it/it-tests/src/test/resources/measure/ProjectDrilldownTest/should_display_measure_drilldown.html b/it/it-tests/src/test/resources/measure/ProjectDrilldownTest/should_display_measure_drilldown.html deleted file mode 100644 index ce89d3df2df..00000000000 --- a/it/it-tests/src/test/resources/measure/ProjectDrilldownTest/should_display_measure_drilldown.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - should_display_measure_drilldown - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/drilldown/measures?id=project-drilldown-test-project&metric=ncloc
waitForTextid=drilldown*Sample.xoo*
waitForElementPresentcss=a[data-key="project-drilldown-test-project:src/main/xoo/sample/Sample.xoo"]
waitForElementPresentcss=a.js-drilldown-link.js-ready
clickcss=a[data-key="project-drilldown-test-project:src/main/xoo/sample/Sample.xoo"]
waitForElementPresentcss=.source-viewer
waitForTextcss=.source-viewer*src/main/xoo/sample/*Sample.xoo*
waitForTextcss=.source-viewer*public class Sample {*
- - diff --git a/it/it-tests/src/test/resources/measure/ProjectMeasuresPageTest/should_display_measures_page.html b/it/it-tests/src/test/resources/measure/ProjectMeasuresPageTest/should_display_measures_page.html new file mode 100644 index 00000000000..4e0a1cd0694 --- /dev/null +++ b/it/it-tests/src/test/resources/measure/ProjectMeasuresPageTest/should_display_measures_page.html @@ -0,0 +1,29 @@ + + + + + + should_display_measure_drilldown + + + + + + + + + + + + + + + + + + + + +
open/component_measures/ncloc?id=project-measures-page-test-project
waitForTextcontent*Lines of code*13*
waitForTextcontent*src/main/xoo/sample*
+ + diff --git a/server/sonar-web/src/main/js/apps/drilldown/app.js b/server/sonar-web/src/main/js/apps/drilldown/app.js deleted file mode 100644 index 276dd969d29..00000000000 --- a/server/sonar-web/src/main/js/apps/drilldown/app.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import $ from 'jquery'; -import Marionette from 'backbone.marionette'; -import SourceViewer from '../../components/source-viewer/main'; - -const App = new Marionette.Application(); -const init = function () { - const options = window.sonarqube; - App.addRegions({ viewerRegion: options.el }); - $('.js-drilldown-link').on('click', function (e) { - e.preventDefault(); - $(e.currentTarget).closest('table').find('.selected').removeClass('selected'); - $(e.currentTarget).closest('tr').addClass('selected'); - const uuid = $(e.currentTarget).data('uuid'); - const viewer = new SourceViewer(); - App.viewerRegion.show(viewer); - viewer.open(uuid); - if (window.drilldown.period != null) { - viewer.on('loaded', function () { - viewer.filterLinesByDate(window.drilldown.period, window.drilldown.periodName); - }); - } - }).addClass('js-ready'); -}; - -App.on('start', function (options) { - init.call(App, options); -}); - -window.sonarqube.appStarted.then(options => App.start(options)); diff --git a/server/sonar-web/src/main/js/components/shared/drilldown-link.js b/server/sonar-web/src/main/js/components/shared/drilldown-link.js index ea50a0390be..151021f9f95 100644 --- a/server/sonar-web/src/main/js/components/shared/drilldown-link.js +++ b/server/sonar-web/src/main/js/components/shared/drilldown-link.js @@ -132,10 +132,8 @@ export const DrilldownLink = React.createClass({ return this.renderIssuesLink(); } - let highlightedMetric = HIGHLIGHT_MAPPING[this.props.metric]; - let url = highlightedMetric ? - getComponentDrilldownUrl(this.props.component, highlightedMetric, this.props.period, this.props.metric) : - getComponentDrilldownUrl(this.props.component, this.props.metric, this.props.period); + const highlightedMetric = HIGHLIGHT_MAPPING[this.props.metric] || this.props.metric; + const url = getComponentDrilldownUrl(this.props.component, highlightedMetric); return {this.props.children}; } }); diff --git a/server/sonar-web/src/main/js/helpers/urls.js b/server/sonar-web/src/main/js/helpers/urls.js index 96f26039701..7826f91227f 100644 --- a/server/sonar-web/src/main/js/helpers/urls.js +++ b/server/sonar-web/src/main/js/helpers/urls.js @@ -45,20 +45,10 @@ export function getComponentIssuesUrl (componentKey, query) { * Generate URL for a component's drilldown page * @param {string} componentKey * @param {string} metric - * @param {string|number} [period] - * @param {string} [highlightedMetric] * @returns {string} */ -export function getComponentDrilldownUrl (componentKey, metric, period, highlightedMetric) { - let url = '/drilldown/measures?id=' + encodeURIComponent(componentKey) + - '&metric=' + encodeURIComponent(metric); - if (period) { - url += '&period=' + period; - } - if (highlightedMetric) { - url += '&highlight=' + encodeURIComponent(highlightedMetric); - } - return url; +export function getComponentDrilldownUrl (componentKey, metric) { + return `/component_measures/${metric}?id=${encodeURIComponent(componentKey)}`; } diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb index 2010fc86433..3ef48fcabb2 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb @@ -20,42 +20,11 @@ class DrilldownController < ApplicationController before_filter :init_resource_for_user_role - helper ProjectHelper, DashboardHelper, IssuesHelper - SECTION=Navigation::SECTION_RESOURCE def measures - @metric = select_metric(params[:metric], 'ncloc') - @highlighted_metric = Metric.by_key(params[:highlight]) || @metric - - # selected resources - if params[:rids] - selected_rids= params[:rids] - elsif params[:resource] - highlighted_resource=Project.by_key(params[:resource]) - selected_rids=(highlighted_resource ? [highlighted_resource.id] : []) - else - selected_rids=[] - end - selected_rids=selected_rids.map { |r| r.to_i } - - - # options - options={} - if params[:period] && Api::Utils.valid_period_index?(params[:period]) - @period=params[:period].to_i - options[:period]=@period - end - - # load data - @drilldown = Drilldown.new(@resource, @metric, selected_rids, self, options) - - @highlighted_resource=@drilldown.highlighted_resource - if @highlighted_resource.nil? && @drilldown.columns.empty? - @highlighted_resource=@resource - end - - @display_viewers = display_metric_viewers?(@highlighted_resource || @resource) + metric = params[:metric] || 'ncloc' + return redirect_to("/component_measures/#{metric}?id=#{url_encode(@resource.key)}") end def issues @@ -64,22 +33,4 @@ class DrilldownController < ApplicationController @severity = params[:severity] end - - private - - def select_metric(metric_key, default_key) - metric=nil - if metric_key - metric=Metric::by_key(metric_key) - end - if metric.nil? - metric=Metric::by_key(default_key) - end - metric - end - - def display_metric_viewers?(resource) - return resource.file? - end - end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/drilldown.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/drilldown.rb deleted file mode 100644 index 2da5ce2ba10..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/drilldown.rb +++ /dev/null @@ -1,167 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class Drilldown - - attr_reader :resource, :metric, :selected_resource_ids, :controller, :selected_project_not_authorized - attr_reader :snapshot, :columns, :highlighted_resource, :highlighted_snapshot - - def initialize(resource, metric, selected_resource_ids, controller, options={}) - @controller=controller - @resource=resource - @selected_resource_ids=selected_resource_ids||[] - @metric=metric - @snapshot=resource.last_snapshot - @columns=[] - - if @snapshot - column=DrilldownColumn.new(self, nil) - while column.valid? - column.init_measures(options) - if column.display? - @columns< (@base_snapshot.root_snapshot_id || @base_snapshot.id), - :islast => true, - :qualifiers => @qualifiers, - :metric_id => @drilldown.metric.id, - :path => "#{@base_snapshot.path}#{@base_snapshot.id}.%"} - - if value_column=='value' && @drilldown.metric.best_value - conditions<<' AND project_measures.value<>:best_value' - condition_values[:best_value]=@drilldown.metric.best_value - end - - if options[:exclude_zero_value] || (options[:period] && !@drilldown.metric.on_new_code?) - conditions += " AND project_measures.#{value_column}<>0" - end - - if options[:rule_id] - conditions += ' AND project_measures.rule_id=:rule' - condition_values[:rule]=options[:rule_id] - else - conditions += ' AND project_measures.rule_id IS NULL ' - end - - if @person_id - conditions += ' AND project_measures.person_id=:person_id' - condition_values[:person_id]=@person_id - else - conditions += ' AND project_measures.person_id IS NULL' - end - - @measures=ProjectMeasure.all( - :select => "project_measures.id,project_measures.metric_id,project_measures.#{value_column},project_measures.text_value,project_measures.alert_status,project_measures.alert_text,project_measures.snapshot_id", - :joins => :snapshot, - :conditions => [conditions, condition_values], - :order => order, - :limit => 200) - - @resource_per_sid={} - sids=@measures.map { |m| m.snapshot_id }.compact.uniq - unless sids.empty? - snapshots = Snapshot.all(:include => :project, :conditions => {'snapshots.id' => sids}) - snapshots.each do |snapshot| - @resource_per_sid[snapshot.id]=snapshot.project - if @drilldown.selected_resource_ids.include?(snapshot.project_id) - @selected_snapshot=snapshot - end - end - end - end - - def resource(measure) - @resource_per_sid[measure.snapshot_id] - end - - def display? - @measures && !@measures.empty? - end - - def valid? - @base_snapshot && @qualifiers && !@qualifiers.empty? - end - - def switch? - selected_snapshot && selected_snapshot.resource && selected_snapshot.resource.copy_resource - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/_footer.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/_footer.html.erb deleted file mode 100644 index 17986d4857f..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/_footer.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -
- -<% - if @display_viewers - resource = @drilldown.highlighted_resource || @drilldown.resource - if resource -%> - -<% - end - end -%> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb deleted file mode 100644 index f31229f1407..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb +++ /dev/null @@ -1,139 +0,0 @@ -
- <% if params[:period] && @snapshot.project_snapshot.periods? %> -
-

-
- - - <% if params[:highlight] %> - - <% end -%> - - - -
-

-
- <% end %> - -
-

<%= @highlighted_metric.short_name -%>

- -

- <%= format_measure(@snapshot.measure(@highlighted_metric.key), :period => @period) %> -

- <% if @highlighted_metric!=@metric %> -

- <%= message('drilldown.drilldown_on') -%>  - <%= format_measure(@metric.key, :period => @period) -%> <%= @metric.short_name -%> -

- <% end %> -
- - <% unless @drilldown.columns.size > 0 %> -
<%= h message('drilldown.no_items_found') -%>
- <% end %> - -
- <% - rids=[] - first_column=true - last_column = nil - @drilldown.columns.each_with_index do |column, index| - %> - <% if first_column %> - - - <% end %> - - - - <% if column.switch? || index==@drilldown.columns.size-1 %> - -
-
- - <% column.measures.each_with_index do |measure, row_index| - resource=column.resource(measure) - selected = column.selected_snapshot && column.selected_snapshot.project_id==resource.id - clazz = cycle("even", "odd", :name => "col_#{index}") - clazz = clazz + ' selected' if selected - %> - - - - - <% end %> -
- <% if resource.source_code? %> - - <% else %> - <%= link_to(image_tag('zoom.png'), {:id => resource.id, :metric => @metric.id}, {:class => 'nolink'}) -%> - <% end %> - <%= qualifier_icon(resource) -%>  - <% if resource.source_code? %> - <%= h resource.name(false) %> - <% else %> - <%= link_to(h(resource.name), params.merge({:only_path => true, :rids => (selected ? rids-[resource.id] : rids+[resource.id])})) -%> - <% end %> - - <%= format_measure(measure, :skip_span_id => true, :period => @period) -%> -
-
-
- <% end - first_column = column.switch? - rids< - <% if last_column && @drilldown.selected_project_not_authorized %> -

<%= message('not_authorized_to_access_project', {:params => last_column.selected_snapshot.project.name}) -%>

- <% end %> -
- - -
- - <%= render :partial => 'footer' -%> -
- -<% content_for :extra_script do %> - - -<% end %> diff --git a/server/sonar-web/tests/helpers/urls-test.js b/server/sonar-web/tests/helpers/urls-test.js index e506ea427e4..b99f948c4b2 100644 --- a/server/sonar-web/tests/helpers/urls-test.js +++ b/server/sonar-web/tests/helpers/urls-test.js @@ -56,17 +56,12 @@ describe('URLs', function () { describe('#getComponentDrilldownUrl', function () { it('should return component drilldown url', function () { expect(getComponentDrilldownUrl(SIMPLE_COMPONENT_KEY, METRIC)).to.equal( - '/drilldown/measures?id=' + SIMPLE_COMPONENT_KEY + '&metric=' + METRIC); + '/component_measures/' + METRIC + '?id=' + SIMPLE_COMPONENT_KEY); }); it('should encode component key', function () { expect(getComponentDrilldownUrl(COMPLEX_COMPONENT_KEY, METRIC)).to.equal( - '/drilldown/measures?id=' + COMPLEX_COMPONENT_KEY_ENCODED + '&metric=' + METRIC); - }); - - it('should work with period', function () { - expect(getComponentDrilldownUrl(SIMPLE_COMPONENT_KEY, METRIC, PERIOD)).to.equal( - '/drilldown/measures?id=' + SIMPLE_COMPONENT_KEY + '&metric=' + METRIC + '&period=' + PERIOD); + '/component_measures/' + METRIC + '?id=' + COMPLEX_COMPONENT_KEY_ENCODED); }); }); }); diff --git a/server/sonar-web/webpack.config.js b/server/sonar-web/webpack.config.js index 9c721550c2c..a441f2b2728 100644 --- a/server/sonar-web/webpack.config.js +++ b/server/sonar-web/webpack.config.js @@ -33,7 +33,6 @@ module.exports = { 'component-measures': './src/main/js/apps/component-measures/app.js', 'custom-measures': './src/main/js/apps/custom-measures/app.js', 'dashboard': './src/main/js/apps/dashboard/app.js', - 'drilldown': './src/main/js/apps/drilldown/app.js', 'global-permissions': './src/main/js/apps/global-permissions/app.js', 'groups': './src/main/js/apps/groups/app.js', 'issues': './src/main/js/apps/issues/app.js', -- 2.39.5