From: Stas Vilchik Date: Mon, 18 May 2015 08:06:36 +0000 (+0200) Subject: SONAR-6553 SONAR-6554 Drop the web part of the design space X-Git-Tag: 5.2-RC1~1928 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3c31c9522af4fe05040ac681f638a81d34a23387;p=sonarqube.git SONAR-6553 SONAR-6554 Drop the web part of the design space --- diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectDefaultDashboard.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectDefaultDashboard.java index b7deddf94a0..61d88fa3f59 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectDefaultDashboard.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectDefaultDashboard.java @@ -56,7 +56,6 @@ public final class ProjectDefaultDashboard extends DashboardTemplate { dashboard.addWidget("debt_overview", 2); dashboard.addWidget("rules", 2); dashboard.addWidget("alerts", 2); - dashboard.addWidget("file_design", 2); dashboard.addWidget("code_coverage", 2); } diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/dashboards/ProjectDefaultDashboardTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/dashboards/ProjectDefaultDashboardTest.java index ec6bea6406b..a5168888bed 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/dashboards/ProjectDefaultDashboardTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/dashboards/ProjectDefaultDashboardTest.java @@ -44,6 +44,6 @@ public class ProjectDefaultDashboardTest { Dashboard dashboard = template.createDashboard(); assertThat(dashboard.getLayout()).isEqualTo(DashboardLayout.TWO_COLUMNS); - assertThat(dashboard.getWidgets()).hasSize(10); + assertThat(dashboard.getWidgets()).hasSize(9); } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/design/FileDesignWidget.java b/server/sonar-server/src/main/java/org/sonar/server/design/FileDesignWidget.java deleted file mode 100644 index 18930483742..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/server/design/FileDesignWidget.java +++ /dev/null @@ -1,45 +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. - */ -package org.sonar.server.design; - -import org.sonar.api.web.AbstractRubyTemplate; -import org.sonar.api.web.RubyRailsWidget; -import org.sonar.api.web.UserRole; -import org.sonar.api.web.WidgetCategory; - -@UserRole(UserRole.USER) -@WidgetCategory({"Design"}) -public final class FileDesignWidget extends AbstractRubyTemplate implements RubyRailsWidget { - - @Override - public String getId() { - return "file_design"; - } - - @Override - public String getTitle() { - return "File design"; - } - - @Override - protected String getTemplatePath() { - return "/org/sonar/server/design/file_design.html.erb"; - } -} diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java index 2dac82758dc..02ccd463bef 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java @@ -143,7 +143,6 @@ import org.sonar.server.debt.DebtModelPluginRepository; import org.sonar.server.debt.DebtModelService; import org.sonar.server.debt.DebtModelXMLExporter; import org.sonar.server.debt.DebtRulesXMLImporter; -import org.sonar.server.design.FileDesignWidget; import org.sonar.server.design.db.FileDependencyDao; import org.sonar.server.design.ws.DependenciesWs; import org.sonar.server.duplication.ws.DuplicationsJsonWriter; @@ -936,7 +935,6 @@ class ServerComponents { pico.addSingleton(StringListTypeValidation.class); // Design - pico.addSingleton(FileDesignWidget.class); pico.addSingleton(DependenciesWs.class); pico.addSingleton(org.sonar.server.design.ws.ShowAction.class); diff --git a/server/sonar-server/src/main/resources/org/sonar/server/design/file_design.html.erb b/server/sonar-server/src/main/resources/org/sonar/server/design/file_design.html.erb deleted file mode 100644 index d49caa22ded..00000000000 --- a/server/sonar-server/src/main/resources/org/sonar/server/design/file_design.html.erb +++ /dev/null @@ -1,110 +0,0 @@ -<% - dsm_url = ApplicationController.root_context + '/design/index/' + @resource.key - - file_tangle_index=measure('file_tangle_index') - if file_tangle_index - file_cycles=measure('file_cycles') - file_feedback_edges=measure('file_feedback_edges') -%> -
-
-
-
- <%= message('widget.file_design.file_tangle_index') -%> - - <%= format_measure(file_tangle_index, :suffix => '', :default => '-', :url => dsm_url) -%> - <%= format_variation(file_tangle_index) if dashboard_configuration.selected_period? -%> - -
- - <% if file_cycles %> -
- <%= message('widget.file_design.cycles.suffix') -%> - - > - <%= format_measure(file_cycles, :default => '-', :url => dsm_url) %> - <%= format_variation(file_cycles) if dashboard_configuration.selected_period? -%> - -
- <% end %> -
-
- -
- <% if file_feedback_edges %> -
-
- <%= message('widget.file_design.suspect_file_dependencies') -%> - - <%= format_measure(file_feedback_edges, :url => dsm_url) -%> - <%= format_variation(file_feedback_edges) if dashboard_configuration.selected_period? -%> - -
-
- <% end %> -
-
-<% - else - package_tangle_index=measure('package_tangle_index') - if package_tangle_index - package_cycles=measure('package_cycles') - package_feedback_edges=measure('package_feedback_edges') - package_tangles=measure('package_tangles') -%> -
-
-
-
- <%= message('widget.package_design.package_tangle_index') -%> - - <%= format_measure(package_tangle_index, :suffix => '', :default => '-', :url => dsm_url) %> - <%= format_variation(package_tangle_index) if dashboard_configuration.selected_period? -%> - -
- - <% if package_cycles %> -
- <%= message('widget.package_design.cycles.suffix') -%> - - > - <%= format_measure(package_cycles, :default => '-', :url => dsm_url) %> - <%= format_variation(package_cycles) if dashboard_configuration.selected_period? -%> - -
- <% end %> -
-
- -
-
-
- <%= message('widget.package_design.dependencies_to_cut') -%> -
- - <% if package_feedback_edges %> -
- <%= message('widget.package_design.between_packages.suffix') -%> - - <%= format_measure(package_feedback_edges, :default => '-', :url => dsm_url) %> - <%= format_variation(package_feedback_edges) if dashboard_configuration.selected_period? -%> - -
- <% end %> - - <% if package_tangles %> -
- <%= message('widget.package_design.between_files.suffix') -%> - - <%= format_measure(package_tangles, :default => '-', :url => dsm_url) %> - <%= format_variation(package_tangles) if dashboard_configuration.selected_period? -%> - -
- <% end %> -
-
-
-<% - end - end -%> diff --git a/server/sonar-web/Gruntfile.coffee b/server/sonar-web/Gruntfile.coffee index e834e35331f..892a11c2f45 100644 --- a/server/sonar-web/Gruntfile.coffee +++ b/server/sonar-web/Gruntfile.coffee @@ -212,14 +212,6 @@ module.exports = (grunt) -> name: 'source-viewer/app' out: '<%= grunt.option("assetsDir") || pkg.assets %>build/js/source-viewer/app.js' - design: options: - name: 'design/app' - out: '<%= grunt.option("assetsDir") || pkg.assets %>build/js/design/app.js' - - libraries: options: - name: 'libraries/app' - out: '<%= grunt.option("assetsDir") || pkg.assets %>build/js/libraries/app.js' - monitoring: options: name: 'analysis-reports/app' out: '<%= grunt.option("assetsDir") || pkg.assets %>build/js/analysis-reports/app.js' @@ -254,8 +246,6 @@ module.exports = (grunt) -> 'requirejs:apiDocumentation' 'requirejs:drilldown' 'requirejs:sourceViewer' - 'requirejs:design' - 'requirejs:libraries' 'requirejs:monitoring' 'requirejs:nav' 'requirejs:issueFilterWidget' @@ -303,12 +293,6 @@ module.exports = (grunt) -> '<%= grunt.option("assetsDir") || pkg.assets %>js/templates/api-documentation.js': [ '<%= pkg.sources %>hbs/api-documentation/**/*.hbs' ] - '<%= grunt.option("assetsDir") || pkg.assets %>js/templates/design.js': [ - '<%= pkg.sources %>hbs/design/**/*.hbs' - ] - '<%= grunt.option("assetsDir") || pkg.assets %>js/templates/libraries.js': [ - '<%= pkg.sources %>hbs/libraries/**/*.hbs' - ] '<%= grunt.option("assetsDir") || pkg.assets %>js/templates/analysis-reports.js': [ '<%= pkg.sources %>hbs/analysis-reports/**/*.hbs' ] diff --git a/server/sonar-web/src/main/coffee/libraries/app.coffee b/server/sonar-web/src/main/coffee/libraries/app.coffee deleted file mode 100644 index edb345f2b1d..00000000000 --- a/server/sonar-web/src/main/coffee/libraries/app.coffee +++ /dev/null @@ -1,58 +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. -# - -requirejs.config - baseUrl: "#{baseUrl}/js" - - -requirejs [ - 'libraries/view' -], ( - LibrariesView -) -> - - $ = jQuery - RESOURCES_URL = "#{baseUrl}/api/resources" - DEPENDENCY_TREE_URL = "#{baseUrl}/api/dependency_tree" - App = new Marionette.Application - - - App.addInitializer -> - $.get RESOURCES_URL, resource: window.resourceKey, scopes: 'PRJ', depth: -1, (rawData) -> - components = new Backbone.Collection rawData - requests = components.map (component) -> - id = component.get 'id' - $.get DEPENDENCY_TREE_URL, resource: id, scopes: 'PRJ', (data) -> - component.set 'libraries', data - - $.when.apply($, requests).done => - components.reset components.reject (model) -> - (model.get('id') == window.resourceKey || model.get('key') == window.resourceKey) && - model.get('libraries').length == 0 - - @view = new LibrariesView app: @, collection: components - $('#project-libraries').empty().append @view.render().el - - - # Message bundles - l10nXHR = window.requestMessages() - - - jQuery.when(l10nXHR).done -> App.start() diff --git a/server/sonar-web/src/main/coffee/libraries/view.coffee b/server/sonar-web/src/main/coffee/libraries/view.coffee deleted file mode 100644 index 43a35eec309..00000000000 --- a/server/sonar-web/src/main/coffee/libraries/view.coffee +++ /dev/null @@ -1,97 +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. -# - -define [ - 'templates/libraries' -], -> - - $ = jQuery - - - - class extends Marionette.ItemView - template: Templates['libraries'] - - - ui: - filter: '.js-libraries-filter' - collapseAll: '.js-libraries-collapse-all' - expandAll: '.js-libraries-expand-all' - - - events: - 'change .js-test-libraries': 'toggleTestLibraries' - 'click @ui.collapseAll': 'collapseAll' - 'click @ui.expandAll': 'expandAll' - 'click .libraries-tree-with-subtree > a': 'toggleSubTree' - - - onRender: -> - @toggleActions() - filterFn = _.bind @filter, @ - debouncedFilterFn = _.debounce filterFn, 250 - @ui.filter.off('keyup').on 'keyup', debouncedFilterFn - - - filter: (e) -> - term = $(e.currentTarget).val() - @expandAll() - @$('.libraries-tree li').addClass 'libraries-tree-subtree-hidden' - @$('.libraries-tree li').each (index, el) => - name = $(el).children('.libraries-tree-name').text() - @showTree $(el) if name.match new RegExp(term, 'i') - - - showTree: (el) -> - el.removeClass 'libraries-tree-subtree-hidden' - el.parents('.libraries-tree-subtree-hidden').removeClass 'libraries-tree-subtree-hidden' - - - toggleTestLibraries: -> - @$('.libraries-tree').toggleClass 'libraries-tree-show-tests' - - - collapseAll: -> - @$('.libraries-tree-with-subtree').addClass 'libraries-tree-subtree-collapsed' - @toggleActions() - - - expandAll: -> - @$('.libraries-tree-with-subtree').removeClass 'libraries-tree-subtree-collapsed' - @toggleActions() - - - toggleSubTree: (e) -> - tree = $(e.currentTarget).parent() - tree.toggleClass 'libraries-tree-subtree-collapsed' - @toggleActions() - - - toggleActions: -> - subTreesCount = @$('.libraries-tree-with-subtree').length - subTreesCollapsedCount = @$('.libraries-tree-subtree-collapsed').length - @ui.collapseAll.toggle subTreesCount > subTreesCollapsedCount - @ui.expandAll.toggle subTreesCollapsedCount > 0 - - - serializeData: -> - _.extend super, - usagesUrl: "#{baseUrl}/dependencies/index?search=#{window.resourceKey}" - diff --git a/server/sonar-web/src/main/hbs/design/design.hbs b/server/sonar-web/src/main/hbs/design/design.hbs deleted file mode 100644 index 4c0be31f83e..00000000000 --- a/server/sonar-web/src/main/hbs/design/design.hbs +++ /dev/null @@ -1,55 +0,0 @@ - - - - -
- - - {{#eachIndex items}} - - - {{#eachIndex v}} - - {{/eachIndex}} - - {{/eachIndex}} - -
- {{qualifierIcon q}} {{n}} - {{#gt pt 0}} - {{pt}} - {{/gt}} - - - {{#eq index ../index}}–{{else}}{{w}}{{/eq}} -
-
- -
diff --git a/server/sonar-web/src/main/hbs/design/dsm-info.hbs b/server/sonar-web/src/main/hbs/design/dsm-info.hbs deleted file mode 100644 index 49a6cf9a6dc..00000000000 --- a/server/sonar-web/src/main/hbs/design/dsm-info.hbs +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/server/sonar-web/src/main/hbs/libraries/libraries.hbs b/server/sonar-web/src/main/hbs/libraries/libraries.hbs deleted file mode 100644 index 9d369ae19a7..00000000000 --- a/server/sonar-web/src/main/hbs/libraries/libraries.hbs +++ /dev/null @@ -1,62 +0,0 @@ -
- - -
-
- - -
- -
- - -
- - - - -
- -
-
    - {{#each items}} -
  • - {{qualifierIcon qualifier}} - {{lname}} - {{#if version}} - {{version}} - {{/if}} - {{#notEmpty libraries}} - - {{else}} - {{t 'libs.noLibraries'}} - {{/notEmpty}} -
  • - {{/each}} -
-
-
diff --git a/server/sonar-web/src/main/hbs/nav/nav-context-navbar.hbs b/server/sonar-web/src/main/hbs/nav/nav-context-navbar.hbs index 86938a5236b..11ef4f53ad7 100644 --- a/server/sonar-web/src/main/hbs/nav/nav-context-navbar.hbs +++ b/server/sonar-web/src/main/hbs/nav/nav-context-navbar.hbs @@ -108,12 +108,6 @@ {{/if}}
  • -
  • - {{t 'design.page'}} -
  • -
  • - {{t 'libraries.page'}} -
  • {{#if component.isComparable}}
  • {{t 'comparison.page'}} diff --git a/server/sonar-web/src/main/js/design/app.js b/server/sonar-web/src/main/js/design/app.js deleted file mode 100644 index c819dc485d0..00000000000 --- a/server/sonar-web/src/main/js/design/app.js +++ /dev/null @@ -1,93 +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. - */ -requirejs.config({ - baseUrl: baseUrl + '/js' -}); - - -define(['design/view'], function (DesignView) { - - var $ = jQuery, - RESOURCES_URL = baseUrl + '/api/resources', - App = new Marionette.Application(); - - App.noDataAvailable = function () { - var message = t('design.noData'); - $('#project-design').html('

    ' + message + '

    '); - }; - - App.addInitializer(function () { - var packageTangles = {}, - packageTanglesXHR = $.get(RESOURCES_URL, { - resource: window.resourceKey, - depth: 1, - metrics: 'package_tangles' - }).done(function (data) { - return data.forEach(function (component) { - packageTangles[component.id] = component.msr[0].frmt_val; - }); - }), - dsmXHR = $.get(RESOURCES_URL, { - resource: window.resourceKey, - metrics: 'dsm' - }).fail(function () { - App.noDataAvailable(); - }); - - $.when(packageTanglesXHR, dsmXHR).done(function () { - var rawData = dsmXHR.responseJSON; - if (!(_.isArray(rawData) && rawData.length === 1 && _.isArray(rawData[0].msr))) { - App.noDataAvailable(); - return; - } - - var data = JSON.parse(rawData[0].msr[0].data); - data.forEach(function (row, rowIndex) { - return row.v.forEach(function (cell, columnIndex) { - if ((cell.w != null) && cell.w > 0) { - cell.status = rowIndex < columnIndex ? 'cycle' : 'dependency'; - } - }); - }); - data = data.map(function (row) { - return _.extend(row, { - empty: row.q === 'DIR' && row.v.every(function (item) { - return item.w == null; - }) - }); - }); - - var collection = new Backbone.Collection(data); - collection.forEach(function (model) { - return model.set('pt', packageTangles[model.get('i')]); - }); - this.view = new DesignView({ - app: this, - collection: collection - }); - $('#project-design').empty().append(this.view.render().el); - }); - }); - - window.requestMessages().done(function () { - App.start(); - }); - -}); diff --git a/server/sonar-web/src/main/js/design/info-view.js b/server/sonar-web/src/main/js/design/info-view.js deleted file mode 100644 index c942cf60fed..00000000000 --- a/server/sonar-web/src/main/js/design/info-view.js +++ /dev/null @@ -1,37 +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. - */ -define([ - 'common/modals', - 'templates/design' -], function (ModalView) { - - return ModalView.extend({ - className: 'modal modal-large', - template: Templates['dsm-info'], - - serializeData: function () { - return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { - first: this.options.first, - second: this.options.second - }); - } - }); - -}); diff --git a/server/sonar-web/src/main/js/design/view.js b/server/sonar-web/src/main/js/design/view.js deleted file mode 100644 index cc4db709600..00000000000 --- a/server/sonar-web/src/main/js/design/view.js +++ /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. - */ -define([ - 'design/info-view', - 'templates/design' -], function (InfoView) { - var $ = jQuery, - API_DEPENDENCIES = baseUrl + '/api/dependencies'; - - return Marionette.Layout.extend({ - template: Templates['design'], - className: 'dsm', - - regions: { - infoRegion: '.dsm-info' - }, - - ui: { - titles: '.dsm-body-title', - cells: '.dsm-body-cell', - dependencies: '.dsm-body-dependency' - }, - - events: { - 'click @ui.titles': 'highlightComponent', - 'dblclick @ui.titles': 'goToComponent', - 'click @ui.cells': 'highlightCell', - 'dblclick @ui.dependencies': 'showDependencies', - 'change .js-hide-dir': 'toggleDirDisplay' - }, - - onRender: function () { - this.toggleDirDisplay(); - }, - - clearCells: function () { - this.ui.titles.removeClass('dsm-body-highlighted dsm-body-usage dsm-body-dependency'); - this.ui.cells.removeClass('dsm-body-highlighted dsm-body-usage dsm-body-dependency'); - }, - - highlightComponent: function (e) { - var index = this.ui.titles.index($(e.currentTarget)); - this.clearCells(); - this.highlightRow(index); - this.highlightColumn(index); - this.highlightUsages(index); - this.highlightDependencies(index); - }, - - highlightCell: function (e) { - var cell = $(e.currentTarget), - column = cell.parent().children().index(cell) - 1, - row = cell.parent().parent().children().index(cell.parent()); - this.clearCells(); - if (row === column) { - this.highlightRow(row); - this.highlightColumn(row); - this.highlightUsages(row); - this.highlightDependencies(row); - } else { - this.highlightRow(column, 'dsm-body-usage'); - this.highlightColumn(column, 'dsm-body-usage'); - this.highlightRow(row, 'dsm-body-dependency'); - this.highlightColumn(row, 'dsm-body-dependency'); - } - }, - - highlightRow: function (index, c) { - if (c == null) { - c = 'dsm-body-highlighted'; - } - this.$('.dsm-body').find('tr:eq(' + index + ')').find('td').addClass(c); - }, - - highlightColumn: function (index, c) { - if (c == null) { - c = 'dsm-body-highlighted'; - } - this.$('.dsm-body tr').each(function () { - return $(this).find('td:eq(' + (index + 1) + ')').addClass(c); - }); - }, - - highlightUsages: function (index) { - var that = this; - this.collection.at(index).get('v').forEach(function (d, i) { - if (i < index && (d.w != null)) { - that.$('tr:eq(' + i + ')').find('.dsm-body-title').addClass('dsm-body-usage'); - } - }); - }, - - highlightDependencies: function (index) { - var that = this; - this.collection.forEach(function (model, i) { - if (model.get('v')[index].w != null) { - that.$('tr:eq(' + i + ')').find('.dsm-body-title').addClass('dsm-body-dependency'); - } - }); - }, - - goToComponent: function (e) { - var cell = $(e.currentTarget), - row = cell.parent().parent().children().index(cell.parent()), - model = this.collection.at(row), - page = model.get('q') === 'CLA' || model.get('q') === 'FIL' ? 'dashboard' : 'design'; - window.location = baseUrl + '/' + page + '/index/' + model.get('i'); - }, - - showDependencies: function (e) { - var that = this, - cell = $(e.currentTarget), - column = cell.parent().children().index(cell) - 1, - row = cell.parent().parent().children().index(cell.parent()), - id = this.collection.at(row).get('v')[column].i; - if (!id) { - return; - } - return $.get(API_DEPENDENCIES, { parent: id }).done(function (data) { - new InfoView({ - collection: new Backbone.Collection(data), - first: that.collection.at(column).toJSON(), - second: that.collection.at(row).toJSON() - }).render(); - }); - }, - - toggleDirDisplay: function () { - var rows = this.$('tr'); - rows.each(function (index) { - if ($(this).data('empty') != null) { - $(this).toggleClass('hidden'); - rows.each(function () { - $(this).find('td').eq(index + 1).toggleClass('hidden'); - }); - } - }); - }, - - serializeData: function () { - var hasDirectories = this.collection.some(function (model) { - return model.get('q') === 'DIR'; - }); - return _.extend(Marionette.Layout.prototype.serializeData.apply(this, arguments), { - hasDirectories: hasDirectories - }); - } - }); - -}); diff --git a/server/sonar-web/src/main/js/nav/context-navbar-view.js b/server/sonar-web/src/main/js/nav/context-navbar-view.js index 2d13705c406..4730c38249c 100644 --- a/server/sonar-web/src/main/js/nav/context-navbar-view.js +++ b/server/sonar-web/src/main/js/nav/context-navbar-view.js @@ -23,7 +23,7 @@ define([ var $ = jQuery, MORE_URLS = [ - '/design', '/libraries', '/dashboards', '/plugins/resource' + '/dashboards', '/plugins/resource' ], SETTINGS_URLS = [ '/project/settings', '/project/profile', '/project/qualitygate', '/manual_measures/index', diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/design_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/design_controller.rb deleted file mode 100644 index 19b9435cac7..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/design_controller.rb +++ /dev/null @@ -1,38 +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 DesignController < ApplicationController - - SECTION=Navigation::SECTION_RESOURCE - before_filter :load_resource - - def index - - end - - - private - - def load_resource - @resource=Project.by_key(params[:id]) - return redirect_to(home_path) unless @resource - @snapshot=@resource.last_snapshot - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/libraries_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/libraries_controller.rb deleted file mode 100644 index 68f2fd9a066..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/libraries_controller.rb +++ /dev/null @@ -1,38 +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 LibrariesController < ApplicationController - - SECTION=Navigation::SECTION_RESOURCE - before_filter :load_resource - - def index - - end - - - private - - def load_resource - @resource=Project.by_key(params[:id]) - return redirect_to(home_path) unless @resource - @snapshot=@resource.last_snapshot - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index 7565b805190..65a6c9900fc 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -235,11 +235,7 @@ module ApplicationHelper url += 'resolved=false' end else - if metric_key == 'package_cycles' - url = url_for(options.merge({:controller => 'design', :action => 'index', :id => options[:resource]||@resource.key})) - else - url = url_for(options.merge({:controller => 'drilldown', :action => 'measures', :metric => metric_key, :id => options[:resource]||@resource.id})) - end + url = url_for(options.merge({:controller => 'drilldown', :action => 'measures', :metric => metric_key, :id => options[:resource]||@resource.id})) end url diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/design/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/design/index.html.erb deleted file mode 100644 index 4a6972ac14c..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/design/index.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<% content_for :script do %> - - -<% end %> - - -
    - -
    diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/libraries/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/libraries/index.html.erb deleted file mode 100644 index 0f1ab2d49b0..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/libraries/index.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<% content_for :script do %> - - -<% end %> - - -
    - -
    diff --git a/server/sonar-web/src/test/js/design-spec.js b/server/sonar-web/src/test/js/design-spec.js deleted file mode 100644 index 4d9e183062d..00000000000 --- a/server/sonar-web/src/test/js/design-spec.js +++ /dev/null @@ -1,131 +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. - */ -/* globals casper: false */ -var lib = require('../lib'), - testName = lib.testName('DSM'); - -lib.initMessages(); -lib.changeWorkingDirectory('design-spec'); -lib.configureCasper(); - - -casper.test.begin(testName('Base'), 9, function (test) { - casper - .start(lib.buildUrl('design'), function () { - lib.setDefaultViewport(); - - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/dependencies', 'dependencies.json'); - }) - - .then(function () { - casper.evaluate(function () { - require(['/js/design/app.js']); - }); - }) - - .then(function () { - casper.waitWhileSelector('.spinner'); - }) - - .then(function () { - test.assertSelectorContains('.dsm-body', 'src/test/java/com/maif/sonar/cobol/metrics'); - test.assertSelectorContains('.dsm-body', 'src/test/java/com/maif/sonar/cobol/repository'); - test.assertElementCount('.dsm-body-cell-dependency', 12); - test.assertElementCount('.dsm-body-cell-cycle', 1); - test.assertSelectorContains('.dsm-body-cell-cycle', '6'); - }) - - .then(function () { - casper.mouse.doubleclick('.dsm-body-cell-cycle'); - casper.waitForSelector('.modal'); - }) - - .then(function () { - test.assertElementCount('.modal .dsm-info tr', 7); - test.assertSelectorContains('.modal .dsm-info', - 'src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java'); - test.assertSelectorContains('.modal .dsm-info', - 'src/main/java/com/maif/sonar/cobol/metrics/BusinessRuleCounter.java'); - test.assertSelectorContains('.modal .dsm-info', - 'src/main/java/com/maif/sonar/cobol/metrics/TableMetricsVisitor.java'); - }) - - .then(function () { - lib.sendCoverage(); - }) - - .run(function () { - test.done(); - }); -}); - -casper.test.begin(testName('Highlight'), 13, function (test) { - casper - .start(lib.buildUrl('design'), function () { - lib.setDefaultViewport(); - - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/dependencies', 'dependencies.json'); - }) - - .then(function () { - casper.evaluate(function () { - require(['/js/design/app.js']); - }); - }) - - .then(function () { - casper.waitWhileSelector('.spinner'); - }) - - .then(function () { - casper.click('tr:nth-child(2) > .dsm-body-title'); - test.assertElementCount('.dsm-body-highlighted', 12); - test.assertElementCount('tr:nth-child(2) .dsm-body-highlighted', 7); - test.assertElementCount('td:nth-child(3).dsm-body-highlighted', 6); - }) - - .then(function () { - casper.click('tr:nth-child(3) > td:nth-child(5)'); - test.assertElementCount('.dsm-body-dependency', 12); - test.assertElementCount('tr:nth-child(3) .dsm-body-dependency', 7); - test.assertElementCount('td:nth-child(4).dsm-body-dependency', 6); - test.assertElementCount('.dsm-body-usage', 12); - test.assertElementCount('tr:nth-child(4) .dsm-body-usage', 7); - test.assertElementCount('td:nth-child(5).dsm-body-usage', 6); - test.assertElementCount('.dsm-body-dependency.dsm-body-usage', 2); - }) - - .then(function () { - casper.click('tr:nth-child(2) > td:nth-child(3)'); - test.assertElementCount('.dsm-body-highlighted', 12); - test.assertElementCount('tr:nth-child(2) .dsm-body-highlighted', 7); - test.assertElementCount('td:nth-child(3).dsm-body-highlighted', 6); - }) - - .then(function () { - lib.sendCoverage(); - }) - - .run(function () { - test.done(); - }); -}); diff --git a/server/sonar-web/src/test/json/design-spec/dependencies.json b/server/sonar-web/src/test/json/design-spec/dependencies.json deleted file mode 100644 index 7f23c19b8d5..00000000000 --- a/server/sonar-web/src/test/json/design-spec/dependencies.json +++ /dev/null @@ -1,80 +0,0 @@ -[ - { - "id": 14879226, - "fi": 8354, - "ti": 6955, - "u": "USES", - "w": 1, - "fk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fn": "src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fq": "FIL", - "tk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/metrics/BusinessRuleCounter.java", - "tn": "src/main/java/com/maif/sonar/cobol/metrics/BusinessRuleCounter.java", - "tq": "FIL" - }, - { - "id": 14879225, - "fi": 8354, - "ti": 6956, - "u": "USES", - "w": 1, - "fk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fn": "src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fq": "FIL", - "tk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/metrics/ExternalizedRuleCallCounter.java", - "tn": "src/main/java/com/maif/sonar/cobol/metrics/ExternalizedRuleCallCounter.java", - "tq": "FIL" - }, - { - "id": 14879228, - "fi": 8354, - "ti": 6957, - "u": "USES", - "w": 1, - "fk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fn": "src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fq": "FIL", - "tk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/metrics/IadUseDetector.java", - "tn": "src/main/java/com/maif/sonar/cobol/metrics/IadUseDetector.java", - "tq": "FIL" - }, - { - "id": 14879229, - "fi": 8354, - "ti": 8356, - "u": "USES", - "w": 1, - "fk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fn": "src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fq": "FIL", - "tk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/metrics/Ids2AndIadMatrixDetector.java", - "tn": "src/main/java/com/maif/sonar/cobol/metrics/Ids2AndIadMatrixDetector.java", - "tq": "FIL" - }, - { - "id": 14879227, - "fi": 8354, - "ti": 6958, - "u": "USES", - "w": 1, - "fk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fn": "src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fq": "FIL", - "tk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/metrics/Ids2UseDetector.java", - "tn": "src/main/java/com/maif/sonar/cobol/metrics/Ids2UseDetector.java", - "tq": "FIL" - }, - { - "id": 14879224, - "fi": 8354, - "ti": 12194, - "u": "USES", - "w": 1, - "fk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fn": "src/main/java/com/maif/sonar/cobol/api/MaifCobolMeasureProvider.java", - "fq": "FIL", - "tk": "com.maif.sonar:maif-cobol-plugin:src/main/java/com/maif/sonar/cobol/metrics/TableMetricsVisitor.java", - "tn": "src/main/java/com/maif/sonar/cobol/metrics/TableMetricsVisitor.java", - "tq": "FIL" - } -] diff --git a/server/sonar-web/src/test/json/design-spec/resources.json b/server/sonar-web/src/test/json/design-spec/resources.json deleted file mode 100644 index 3d06975ac57..00000000000 --- a/server/sonar-web/src/test/json/design-spec/resources.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "id": 6924, - "key": "com.maif.sonar:maif-cobol-plugin", - "name": "MAIF :: Cobol plugin", - "scope": "PRJ", - "qualifier": "TRK", - "date": "2014-07-21T23:04:05+0600", - "creationDate": null, - "lname": "MAIF :: Cobol plugin", - "version": "2.7-SNAPSHOT", - "description": "", - "msr": [ - { - "key": "dsm", - "data": "[{\"i\":24815,\"n\":\"src/test/java/com/maif/sonar/cobol/metrics\",\"q\":\"DIR\",\"v\":[{},{},{},{\"i\":14879223,\"w\":6},{},{}]},{\"i\":26762,\"n\":\"src/main/java/com/maif/sonar/cobol/plugin\",\"q\":\"DIR\",\"v\":[{},{},{},{},{},{}]},{\"i\":26758,\"n\":\"src/main/java/com/maif/sonar/cobol\",\"q\":\"DIR\",\"v\":[{\"i\":14879242,\"w\":1},{\"i\":14879258,\"w\":114},{},{},{},{}]},{\"i\":33690,\"n\":\"src/test/java/com/maif/sonar/cobol/api\",\"q\":\"DIR\",\"v\":[{\"i\":14879244,\"w\":6},{\"i\":14879373,\"w\":2},{\"i\":14879221,\"w\":1},{},{},{}]},{\"i\":24814,\"n\":\"src/test/java/com/maif/sonar/cobol/ids2\",\"q\":\"DIR\",\"v\":[{\"i\":14879237,\"w\":2},{},{\"i\":14879139,\"w\":24},{},{},{}]},{\"i\":24816,\"n\":\"src/test/java/com/maif/sonar/cobol/repository\",\"q\":\"DIR\",\"v\":[{\"i\":14879240,\"w\":1},{\"i\":14879251,\"w\":6},{\"i\":14879164,\"w\":56},{\"i\":14879230,\"w\":1},{\"i\":14879232,\"w\":4},{}]}]" - } - ] - } -] diff --git a/server/sonar-web/src/test/views/design.jade b/server/sonar-web/src/test/views/design.jade deleted file mode 100644 index 76cd2a95f22..00000000000 --- a/server/sonar-web/src/test/views/design.jade +++ /dev/null @@ -1,8 +0,0 @@ -extends layouts/main - -block body - #container - #project-design: i.spinner - - script. - window.resourceKey = 'com.maif.sonar:maif-cobol-plugin'; diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index d236951d8a2..83ca78d5b1f 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -531,8 +531,6 @@ source.page=Source timemachine.page=Time Machine comparison.page=Compare comparison_global.page=Compare Projects -design.page=Design -libraries.page=Libraries @@ -1314,20 +1312,6 @@ widget.time_machine.property.metric8.name=Metric 8 widget.time_machine.property.metric9.name=Metric 9 widget.time_machine.property.metric10.name=Metric 10 -widget.file_design.name=File Design -widget.file_design.description=Reports on files dependency cycles and tangle index. -widget.file_design.file_tangle_index=File tangle index -widget.file_design.cycles.suffix=\ cycles -widget.file_design.suspect_file_dependencies=Suspect file dependencies - -widget.package_design.name=File Design -widget.package_design.description=Reports on file and directory dependency cycles. -widget.package_design.package_tangle_index=Directory tangle index -widget.package_design.cycles.suffix=\ cycles -widget.package_design.dependencies_to_cut=Dependencies to cut -widget.package_design.between_packages.suffix=\ between directories -widget.package_design.between_files.suffix=\ between files - widget.hotspot_metric.name=Metric Hotspot widget.hotspot_metric.description=Shows the files that have the worst result for a specific metric. widget.hotspot_metric.more=More @@ -2948,35 +2932,6 @@ source_viewer.tooltip.it.uncovered=Not covered by integration tests. source_viewer.tooltip.new_code=New {0}. -#------------------------------------------------------------------------------ -# -# DESIGN -# -#------------------------------------------------------------------------------ -design.help=Help -design.legend.dependencies=Dependency -design.legend.cycles=Suspect dependency (cycle) -design.legend.uses=- uses > -design.cellTooltip=Click to highlight, double-click to display more details -design.rowTooltip=Click to highlight, double-click to zoom -design.noData=No DSM data available for the component -design.hide_empty_directories=Hide directories with no dependencies - - - -#------------------------------------------------------------------------------ -# -# LIBRARIES -# -#------------------------------------------------------------------------------ -libs.filter=Filter: -libs.displayTests=Display Test Libraries -libs.expand=Expand All -libs.collapse=Collapse All -libs.noLibraries=No libraries -libs.usageLink=Usages - - #------------------------------------------------------------------------------ #