From 7889a50bb34b1533061774dd2506ce441b90c1c9 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 8 Apr 2015 17:07:52 +0200 Subject: [PATCH] revert SONAR-6331 --- server/sonar-web/Gruntfile.coffee | 7 - .../src/main/hbs/nav/nav-context-navbar.hbs | 14 +- .../hbs/overview/_overview-gate-condition.hbs | 15 -- .../main/hbs/overview/overview-coverage.hbs | 25 -- .../src/main/hbs/overview/overview-debt.hbs | 21 -- .../hbs/overview/overview-duplications.hbs | 22 -- .../src/main/hbs/overview/overview-gate.hbs | 22 -- .../src/main/hbs/overview/overview-issues.hbs | 21 -- .../src/main/hbs/overview/overview-layout.hbs | 1 - .../hbs/overview/overview-main-layout.hbs | 12 - .../src/main/hbs/overview/overview-size.hbs | 24 -- .../src/main/js/nav/context-navbar-view.js | 28 +- server/sonar-web/src/main/js/overview/app.js | 58 ---- .../src/main/js/overview/controller.js | 58 ---- .../sonar-web/src/main/js/overview/layout.js | 32 --- .../main/js/overview/main/coverage-view.js | 50 ---- .../src/main/js/overview/main/debt-view.js | 50 ---- .../js/overview/main/duplications-view.js | 50 ---- .../src/main/js/overview/main/gate-view.js | 43 --- .../src/main/js/overview/main/issues-view.js | 50 ---- .../src/main/js/overview/main/layout.js | 47 ---- .../src/main/js/overview/main/size-view.js | 50 ---- .../src/main/js/overview/models/state.js | 248 ------------------ .../sonar-web/src/main/js/overview/router.js | 37 --- .../src/main/js/overview/trend-view.js | 182 ------------- server/sonar-web/src/main/less/pages.less | 1 - .../src/main/less/pages/overview.less | 106 -------- .../app/controllers/dashboard_controller.rb | 7 - .../app/controllers/overview_controller.rb | 31 --- .../WEB-INF/app/views/overview/index.html.erb | 40 --- server/sonar-web/src/test/js/overview.js | 87 ------ .../src/test/json/overview/issues.json | 11 - .../src/test/json/overview/measures.json | 102 ------- .../src/test/json/overview/metrics.json | 123 --------- .../src/test/json/overview/timemachine.json | 63 ----- server/sonar-web/src/test/views/overview.jade | 16 -- .../resources/org/sonar/l10n/core.properties | 19 +- 37 files changed, 12 insertions(+), 1761 deletions(-) delete mode 100644 server/sonar-web/src/main/hbs/overview/_overview-gate-condition.hbs delete mode 100644 server/sonar-web/src/main/hbs/overview/overview-coverage.hbs delete mode 100644 server/sonar-web/src/main/hbs/overview/overview-debt.hbs delete mode 100644 server/sonar-web/src/main/hbs/overview/overview-duplications.hbs delete mode 100644 server/sonar-web/src/main/hbs/overview/overview-gate.hbs delete mode 100644 server/sonar-web/src/main/hbs/overview/overview-issues.hbs delete mode 100644 server/sonar-web/src/main/hbs/overview/overview-layout.hbs delete mode 100644 server/sonar-web/src/main/hbs/overview/overview-main-layout.hbs delete mode 100644 server/sonar-web/src/main/hbs/overview/overview-size.hbs delete mode 100644 server/sonar-web/src/main/js/overview/app.js delete mode 100644 server/sonar-web/src/main/js/overview/controller.js delete mode 100644 server/sonar-web/src/main/js/overview/layout.js delete mode 100644 server/sonar-web/src/main/js/overview/main/coverage-view.js delete mode 100644 server/sonar-web/src/main/js/overview/main/debt-view.js delete mode 100644 server/sonar-web/src/main/js/overview/main/duplications-view.js delete mode 100644 server/sonar-web/src/main/js/overview/main/gate-view.js delete mode 100644 server/sonar-web/src/main/js/overview/main/issues-view.js delete mode 100644 server/sonar-web/src/main/js/overview/main/layout.js delete mode 100644 server/sonar-web/src/main/js/overview/main/size-view.js delete mode 100644 server/sonar-web/src/main/js/overview/models/state.js delete mode 100644 server/sonar-web/src/main/js/overview/router.js delete mode 100644 server/sonar-web/src/main/js/overview/trend-view.js delete mode 100644 server/sonar-web/src/main/less/pages/overview.less delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb delete mode 100644 server/sonar-web/src/test/js/overview.js delete mode 100644 server/sonar-web/src/test/json/overview/issues.json delete mode 100644 server/sonar-web/src/test/json/overview/measures.json delete mode 100644 server/sonar-web/src/test/json/overview/metrics.json delete mode 100644 server/sonar-web/src/test/json/overview/timemachine.json delete mode 100644 server/sonar-web/src/test/views/overview.jade diff --git a/server/sonar-web/Gruntfile.coffee b/server/sonar-web/Gruntfile.coffee index 3d2718f5575..9191ea6a716 100644 --- a/server/sonar-web/Gruntfile.coffee +++ b/server/sonar-web/Gruntfile.coffee @@ -246,10 +246,6 @@ module.exports = (grunt) -> name: 'widgets/issue-filter' out: '<%= grunt.option("assetsDir") || pkg.assets %>build/js/widgets/issue-filter.js' - overview: options: - name: 'overview/app' - out: '<%= grunt.option("assetsDir") || pkg.assets %>build/js/overview/app.js' - handlebars: options: @@ -306,9 +302,6 @@ module.exports = (grunt) -> '<%= grunt.option("assetsDir") || pkg.assets %>js/templates/workspace.js': [ '<%= pkg.sources %>hbs/workspace/**/*.hbs' ] - '<%= grunt.option("assetsDir") || pkg.assets %>js/templates/overview.js': [ - '<%= pkg.sources %>hbs/overview/**/*.hbs' - ] clean: 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 74d0196ce6a..b86d833e3d9 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 @@ -21,8 +21,8 @@ diff --git a/server/sonar-web/src/main/hbs/overview/_overview-gate-condition.hbs b/server/sonar-web/src/main/hbs/overview/_overview-gate-condition.hbs deleted file mode 100644 index c3c278b9fd9..00000000000 --- a/server/sonar-web/src/main/hbs/overview/_overview-gate-condition.hbs +++ /dev/null @@ -1,15 +0,0 @@ -
  • - - {{#canHaveDrilldownUrl metric period}} - {{formatMeasure actual type}} - {{else}} - {{formatMeasure actual type}} - {{/canHaveDrilldownUrl}} - {{t 'metric' metric 'name'}} - {{default periodName period}} -
  • diff --git a/server/sonar-web/src/main/hbs/overview/overview-coverage.hbs b/server/sonar-web/src/main/hbs/overview/overview-coverage.hbs deleted file mode 100644 index ce3d7a41109..00000000000 --- a/server/sonar-web/src/main/hbs/overview/overview-coverage.hbs +++ /dev/null @@ -1,25 +0,0 @@ - - -
    -
    {{t 'metric.coverage.name'}}
    -
    - {{#notNull coverage}} - {{formatMeasure coverage 'PERCENT'}} - {{else}} - – - {{/notNull}} -
    - {{#notNull newCoverage3}} -
    {{period3Name}}
    - {{formatMeasure newCoverage3 'PERCENT'}} - {{t 'overview.on_new_code'}} - {{/notNull}} -
    - -
    -
    -
    diff --git a/server/sonar-web/src/main/hbs/overview/overview-debt.hbs b/server/sonar-web/src/main/hbs/overview/overview-debt.hbs deleted file mode 100644 index 6c4e6445de6..00000000000 --- a/server/sonar-web/src/main/hbs/overview/overview-debt.hbs +++ /dev/null @@ -1,21 +0,0 @@ - - -
    -
    {{t 'metric.sqale_index.name'}}
    - - {{#notNull issues3}} -
    {{period3Name}}
    - {{formatMeasure newDebt 'WORK_DUR'}} - {{t 'overview.new'}} - {{/notNull}} -
    - -
    -
    -
    diff --git a/server/sonar-web/src/main/hbs/overview/overview-duplications.hbs b/server/sonar-web/src/main/hbs/overview/overview-duplications.hbs deleted file mode 100644 index 6c675595748..00000000000 --- a/server/sonar-web/src/main/hbs/overview/overview-duplications.hbs +++ /dev/null @@ -1,22 +0,0 @@ - - -
    -
    {{t 'metric.duplicated_lines_density.short_name'}}
    - - {{#notNull duplications3}} -
    {{period3Name}}
    - {{formatMeasureVariation duplications3 'PERCENT'}} - {{/notNull}} -
    - -
    -
    -
    diff --git a/server/sonar-web/src/main/hbs/overview/overview-gate.hbs b/server/sonar-web/src/main/hbs/overview/overview-gate.hbs deleted file mode 100644 index a354e431b1e..00000000000 --- a/server/sonar-web/src/main/hbs/overview/overview-gate.hbs +++ /dev/null @@ -1,22 +0,0 @@ - - -{{#notEmpty gateConditions}} -
    -
    -
      - {{#eachEven gateConditions}} - {{> '_overview-gate-condition'}} - {{/eachEven}} -
    -
    -
    -
      - {{#eachOdd gateConditions}} - {{> '_overview-gate-condition'}} - {{/eachOdd}} -
    -
    -
    -{{/notEmpty}} diff --git a/server/sonar-web/src/main/hbs/overview/overview-issues.hbs b/server/sonar-web/src/main/hbs/overview/overview-issues.hbs deleted file mode 100644 index 09940d8cc95..00000000000 --- a/server/sonar-web/src/main/hbs/overview/overview-issues.hbs +++ /dev/null @@ -1,21 +0,0 @@ - - -
    -
    {{t 'overview.issues'}}
    - - {{#notNull issues3}} -
    {{period3Name}}
    - {{formatMeasure issues3 'INT'}} - {{t 'overview.new'}} - {{/notNull}} -
    - -
    -
    -
    diff --git a/server/sonar-web/src/main/hbs/overview/overview-layout.hbs b/server/sonar-web/src/main/hbs/overview/overview-layout.hbs deleted file mode 100644 index a0a7d067a0e..00000000000 --- a/server/sonar-web/src/main/hbs/overview/overview-layout.hbs +++ /dev/null @@ -1 +0,0 @@ -
    diff --git a/server/sonar-web/src/main/hbs/overview/overview-main-layout.hbs b/server/sonar-web/src/main/hbs/overview/overview-main-layout.hbs deleted file mode 100644 index 827246359f9..00000000000 --- a/server/sonar-web/src/main/hbs/overview/overview-main-layout.hbs +++ /dev/null @@ -1,12 +0,0 @@ -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    diff --git a/server/sonar-web/src/main/hbs/overview/overview-size.hbs b/server/sonar-web/src/main/hbs/overview/overview-size.hbs deleted file mode 100644 index 907e4727c9f..00000000000 --- a/server/sonar-web/src/main/hbs/overview/overview-size.hbs +++ /dev/null @@ -1,24 +0,0 @@ - - -
    -
    {{t 'metric.ncloc.name'}}
    - - - {{#notNull ncloc3}} -
    -
    {{period3Name}}
    - {{formatMeasureVariation ncloc3 'SHORT_INT'}} -
    - {{/notNull}} -
    - -
    -
    -
    - - 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 eccfd034dfc..6107a4276a2 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, OVERVIEW_URLS = [ - '/design', '/libraries', '/dashboards', '/dashboard' + '/design', '/libraries', '/dashboards' ], SETTINGS_URLS = [ '/project/settings', '/project/profile', '/project/qualitygate', '/manual_measures/index', @@ -39,8 +39,7 @@ define([ }, events: { - 'click .js-favorite': 'onFavoriteClick', - 'show.bs.dropdown .js-meta-dropdown': 'onMetaDropdownShow' + 'click .js-favorite': 'onFavoriteClick' }, onRender: function () { @@ -59,35 +58,22 @@ define([ }); }, - onMetaDropdownShow: function () { - var that = this; - this.requestMeta().done(function (r) { - that.$('.js-meta').html(r); - }); - }, - - requestMeta: function () { - var url = baseUrl + '/widget/show', - options = { - id: 'description', - resource: this.model.get('contextKey') - }; - return $.get(url, options); - }, - serializeData: function () { var href = window.location.href, + search = window.location.search, isMoreActive = _.some(OVERVIEW_URLS, function (url) { return href.indexOf(url) !== -1; - }), + }) || (href.indexOf('/dashboard') !== -1 && search.indexOf('did=') !== -1), isSettingsActive = _.some(SETTINGS_URLS, function (url) { return href.indexOf(url) !== -1; - }); + }), + isOverviewActive = !isMoreActive && href.indexOf('/dashboard') !== -1 && search.indexOf('did=') === -1; return _.extend(Marionette.Layout.prototype.serializeData.apply(this, arguments), { canManageContextDashboards: !!window.SS.user, contextKeyEncoded: encodeURIComponent(this.model.get('contextKey')), + isOverviewActive: isOverviewActive, isSettingsActive: isSettingsActive, isMoreActive: isMoreActive }); diff --git a/server/sonar-web/src/main/js/overview/app.js b/server/sonar-web/src/main/js/overview/app.js deleted file mode 100644 index 04f885f2683..00000000000 --- a/server/sonar-web/src/main/js/overview/app.js +++ /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([ - 'overview/layout', - 'overview/controller', - 'overview/router', - 'overview/models/state' -], function (Layout, - Controller, - Router, - State) { - - var $ = jQuery, - App = new Marionette.Application(); - - App.addInitializer(function () { - $('body').addClass('dashboard-page'); - - // add state model - this.state = new State(window.overviewConf); - this.state.set('period3Name', 'During Leak Period'); - - // create and render layout - this.layout = new Layout({ - el: '.overview', - model: this.state - }).render(); - - // create controller - this.controller = new Controller({ state: this.state, layout: this.layout }); - - // start router - this.router = new Router({ controller: this.controller }); - Backbone.history.start(); - }); - - window.requestMessages().done(function () { - App.start(); - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/controller.js b/server/sonar-web/src/main/js/overview/controller.js deleted file mode 100644 index 69f50d885bd..00000000000 --- a/server/sonar-web/src/main/js/overview/controller.js +++ /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. - */ -define([ - 'overview/main/layout', - 'overview/main/gate-view', - 'overview/main/size-view', - 'overview/main/issues-view', - 'overview/main/debt-view', - 'overview/main/coverage-view', - 'overview/main/duplications-view' -], function (MainLayout, - GateView, - SizeView, - IssuesView, - DebtView, - CoverageView, - DuplicationsView) { - - return Marionette.Controller.extend({ - - initialize: function (options) { - this.state = options.state; - this.layout = options.layout; - }, - - main: function () { - var options = { model: this.state }, - mainLayout = new MainLayout(options); - this.layout.mainRegion.show(mainLayout); - mainLayout.gateRegion.show(new GateView(options)); - mainLayout.sizeRegion.show(new SizeView(options)); - mainLayout.issuesRegion.show(new IssuesView(options)); - mainLayout.debtRegion.show(new DebtView(options)); - mainLayout.coverageRegion.show(new CoverageView(options)); - mainLayout.duplicationsRegion.show(new DuplicationsView(options)); - this.state.fetch(); - } - - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/layout.js b/server/sonar-web/src/main/js/overview/layout.js deleted file mode 100644 index 97cd93d0ca6..00000000000 --- a/server/sonar-web/src/main/js/overview/layout.js +++ /dev/null @@ -1,32 +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/overview' -], function () { - - return Marionette.Layout.extend({ - template: Templates['overview-layout'], - - regions: { - mainRegion: '.js-region' - } - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/main/coverage-view.js b/server/sonar-web/src/main/js/overview/main/coverage-view.js deleted file mode 100644 index 28bb1e5c7a0..00000000000 --- a/server/sonar-web/src/main/js/overview/main/coverage-view.js +++ /dev/null @@ -1,50 +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([ - 'overview/trend-view', - 'templates/overview' -], function (TrendView) { - - return Marionette.Layout.extend({ - template: Templates['overview-coverage'], - - modelEvents: { - 'change': 'render' - }, - - onRender: function () { - var trend = this.model.get('coverageTrend'), - hasCoverage = this.model.get('coverage') != null; - if (_.size(trend) > 1 && hasCoverage) { - this.trendView = new TrendView({ data: trend, type: 'PERCENT' }); - this.trendView.render() - .$el.appendTo(this.$('#overview-coverage-trend')); - this.trendView.update(); - } - }, - - onClose: function () { - if (this.trendView != null) { - this.trendView.detachEvents().remove(); - } - } - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/main/debt-view.js b/server/sonar-web/src/main/js/overview/main/debt-view.js deleted file mode 100644 index 80861a82152..00000000000 --- a/server/sonar-web/src/main/js/overview/main/debt-view.js +++ /dev/null @@ -1,50 +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([ - 'overview/trend-view', - 'templates/overview' -], function (TrendView) { - - return Marionette.Layout.extend({ - template: Templates['overview-debt'], - - modelEvents: { - 'change': 'render' - }, - - onRender: function () { - var trend = this.model.get('debtTrend'), - hasDebt = this.model.get('debt') != null; - if (_.size(trend) > 1 && hasDebt) { - this.trendView = new TrendView({ data: trend, type: 'WORK_DUR' }); - this.trendView.render() - .$el.appendTo(this.$('#overview-debt-trend')); - this.trendView.update(); - } - }, - - onClose: function () { - if (this.trendView != null) { - this.trendView.detachEvents().remove(); - } - } - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/main/duplications-view.js b/server/sonar-web/src/main/js/overview/main/duplications-view.js deleted file mode 100644 index a1310587288..00000000000 --- a/server/sonar-web/src/main/js/overview/main/duplications-view.js +++ /dev/null @@ -1,50 +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([ - 'overview/trend-view', - 'templates/overview' -], function (TrendView) { - - return Marionette.Layout.extend({ - template: Templates['overview-duplications'], - - modelEvents: { - 'change': 'render' - }, - - onRender: function () { - var trend = this.model.get('duplicationsTrend'), - hasDuplications = this.model.get('duplications') != null; - if (_.size(trend) > 1 && hasDuplications) { - this.trendView = new TrendView({ data: trend, type: 'PERCENT' }); - this.trendView.render() - .$el.appendTo(this.$('#overview-duplications-trend')); - this.trendView.update(); - } - }, - - onClose: function () { - if (this.trendView != null) { - this.trendView.detachEvents().remove(); - } - } - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/main/gate-view.js b/server/sonar-web/src/main/js/overview/main/gate-view.js deleted file mode 100644 index 22b4f1c2a0c..00000000000 --- a/server/sonar-web/src/main/js/overview/main/gate-view.js +++ /dev/null @@ -1,43 +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/overview' -], function () { - - return Marionette.Layout.extend({ - template: Templates['overview-gate'], - - modelEvents: { - 'change': 'render' - }, - - onRender: function () { - if (this.model.has('gateStatus')) { - this.$el.closest('.overview-card').addClass('overview-gate-' + this.model.get('gateStatus').toLowerCase()); - } - this.$('[data-toggle="tooltip"]').tooltip({ container: 'body', placement: 'bottom' }); - }, - - onClose: function () { - this.$('[data-toggle="tooltip"]').tooltip('destroy'); - } - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/main/issues-view.js b/server/sonar-web/src/main/js/overview/main/issues-view.js deleted file mode 100644 index bfda55b2578..00000000000 --- a/server/sonar-web/src/main/js/overview/main/issues-view.js +++ /dev/null @@ -1,50 +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([ - 'overview/trend-view', - 'templates/overview' -], function (TrendView) { - - return Marionette.Layout.extend({ - template: Templates['overview-issues'], - - modelEvents: { - 'change': 'render' - }, - - onRender: function () { - var trend = this.model.get('issuesTrend'), - hasIssues = this.model.get('issues') != null; - if (_.size(trend) > 1 && hasIssues) { - this.trendView = new TrendView({ data: trend, type: 'SHORT_INT' }); - this.trendView.render() - .$el.appendTo(this.$('#overview-issues-trend')); - this.trendView.update(); - } - }, - - onClose: function () { - if (this.trendView != null) { - this.trendView.detachEvents().remove(); - } - } - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/main/layout.js b/server/sonar-web/src/main/js/overview/main/layout.js deleted file mode 100644 index c0e46deffd5..00000000000 --- a/server/sonar-web/src/main/js/overview/main/layout.js +++ /dev/null @@ -1,47 +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/overview' -], function () { - - return Marionette.Layout.extend({ - template: Templates['overview-main-layout'], - - regions: { - gateRegion: '#overview-gate', - sizeRegion: '#overview-size', - issuesRegion: '#overview-issues', - debtRegion: '#overview-debt', - coverageRegion: '#overview-coverage', - duplicationsRegion: '#overview-duplications' - }, - - modelEvents: { - 'change': 'toggleRegions' - }, - - toggleRegions: function () { - var conditions = this.model.get('gateConditions'), - hasGate = _.isArray(conditions) && conditions.length > 0; - this.$(this.gateRegion.el).toggleClass('hidden', !hasGate); - } - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/main/size-view.js b/server/sonar-web/src/main/js/overview/main/size-view.js deleted file mode 100644 index 07917e89c52..00000000000 --- a/server/sonar-web/src/main/js/overview/main/size-view.js +++ /dev/null @@ -1,50 +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([ - 'overview/trend-view', - 'templates/overview' -], function (TrendView) { - - return Marionette.Layout.extend({ - template: Templates['overview-size'], - - modelEvents: { - 'change': 'render' - }, - - onRender: function () { - var trend = this.model.get('sizeTrend'), - hasSize = this.model.get('ncloc') != null; - if (_.size(trend) > 1 && hasSize) { - this.trendView = new TrendView({ data: trend, type: 'SHORT_INT' }); - this.trendView.render() - .$el.appendTo(this.$('#overview-size-trend')); - this.trendView.update(); - } - }, - - onClose: function () { - if (this.trendView != null) { - this.trendView.detachEvents().remove(); - } - } - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/models/state.js b/server/sonar-web/src/main/js/overview/models/state.js deleted file mode 100644 index d3be4446ee1..00000000000 --- a/server/sonar-web/src/main/js/overview/models/state.js +++ /dev/null @@ -1,248 +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(function () { - - var $ = jQuery, - GATE_METRIC = 'quality_gate_details', - SIZE_METRIC = 'ncloc', - ISSUES_METRIC = 'violations', - DEBT_METRIC = 'sqale_index', - NEW_DEBT_METRIC = 'new_technical_debt', - SQALE_RATING_METRIC = 'sqale_rating', - COVERAGE_METRIC = 'coverage', - NEW_COVERAGE_METRIC = 'new_coverage', - DUPLICATIONS_METRIC = 'duplicated_lines_density'; - - return Backbone.Model.extend({ - - defaults: function () { - return { - qualityGateStatus: 'ERROR' - }; - }, - - hasPeriod: function (index) { - var property = 'period' + index + 'Date'; - return !!this.get(property); - }, - - fetch: function () { - var that = this; - this.fetchMetrics().done(function () { - that.fetchMeasures(); - that.fetchTrends(); - that.fetchIssues(); - }); - }, - - fetchMetrics: function () { - var that = this, - url = baseUrl + '/api/metrics'; - return $.get(url).done(function (r) { - that.set('metrics', r); - }); - }, - - fetchMeasures: function () { - var that = this, - url = baseUrl + '/api/resources/index', - options = { - resource: this.get('componentKey'), - metrics: [ - GATE_METRIC, - SIZE_METRIC, - DEBT_METRIC, - NEW_DEBT_METRIC, - SQALE_RATING_METRIC, - COVERAGE_METRIC, - NEW_COVERAGE_METRIC, - DUPLICATIONS_METRIC - ].join(','), - includetrends: true - }; - return $.get(url, options).done(function (r) { - if (!_.isArray(r) || !_.isArray(r[0].msr)) { - return; - } - that.parseGate(r[0].msr); - that.parseSize(r[0].msr); - that.parseDebt(r[0].msr); - that.parseCoverage(r[0].msr); - that.parseDuplications(r[0].msr); - }); - }, - - parseGate: function (msr) { - var that = this, - measure = _.findWhere(msr, { key: GATE_METRIC }); - if (measure != null) { - var metrics = this.get('metrics'), - gateData = JSON.parse(measure.data), - gateConditions = gateData.conditions, - gateConditionsWithMetric = gateConditions.map(function (c) { - var metric = _.findWhere(metrics, { key: c.metric }), - type = metric != null ? metric.val_type : null, - periodDate = that.get('period' + c.period + 'Date'), - periodName = that.get('period' + c.period + 'Name'); - return _.extend(c, { - type: type, - periodName: periodName, - periodDate: periodDate - }); - }); - this.set({ - gateStatus: gateData.level, - gateConditions: gateConditionsWithMetric - }); - } - }, - - parseSize: function (msr) { - var nclocMeasure = _.findWhere(msr, { key: SIZE_METRIC }); - if (nclocMeasure != null) { - this.set({ - ncloc: nclocMeasure.val, - ncloc3: nclocMeasure.var3 - }); - } - }, - - fetchIssues: function () { - var that = this; - - function fetchIssuesByPeriod (field, createdAfter) { - var url = baseUrl + '/api/issues/search', - options = { - ps: 1, - resolved: 'false', - componentUuids: that.get('componentUuid') - }; - if (createdAfter != null) { - _.extend(options, { createdAfter: createdAfter }); - } - return $.get(url, options).done(function (r) { - that.set(field, r.total); - }); - } - - fetchIssuesByPeriod('issues', null); - if (this.hasPeriod(3)) { - fetchIssuesByPeriod('issues3', this.get('period3Date')); - } - }, - - parseDebt: function (msr) { - var debtMeasure = _.findWhere(msr, { key: DEBT_METRIC }), - newDebtMeasure = _.findWhere(msr, { key: NEW_DEBT_METRIC }), - sqaleRatingMeasure = _.findWhere(msr, { key: SQALE_RATING_METRIC }); - if (debtMeasure != null) { - this.set({ debt: debtMeasure.val }); - } - if (newDebtMeasure != null) { - this.set({ newDebt: newDebtMeasure.var3 }); - } - if (sqaleRatingMeasure != null) { - this.set({ sqaleRating: sqaleRatingMeasure.val }); - } - }, - - parseCoverage: function (msr) { - var coverageMeasure = _.findWhere(msr, { key: COVERAGE_METRIC }), - newCoverageMeasure = _.findWhere(msr, { key: NEW_COVERAGE_METRIC }); - if (coverageMeasure != null) { - this.set({ - coverage: coverageMeasure.val, - coverage3: coverageMeasure.var3 - }); - } - if (newCoverageMeasure != null) { - this.set({ - newCoverage3: newCoverageMeasure.var3 - }); - } - }, - - parseDuplications: function (msr) { - var duplicationsMeasure = _.findWhere(msr, { key: DUPLICATIONS_METRIC }); - if (duplicationsMeasure != null) { - this.set({ - duplications: duplicationsMeasure.val, - duplications3: duplicationsMeasure.var3 - }); - } - }, - - fetchTrends: function () { - var that = this, - url = baseUrl + '/api/timemachine/index', - options = { - resource: this.get('componentKey'), - metrics: [ - SIZE_METRIC, - ISSUES_METRIC, - DEBT_METRIC, - COVERAGE_METRIC, - DUPLICATIONS_METRIC - ].join(',') - }; - return $.get(url, options).done(function (r) { - if (_.isArray(r)) { - that.parseSizeTrend(r[0]); - that.parseIssuesTrend(r[0]); - that.parseDebtTrend(r[0]); - that.parseCoverageTrend(r[0]); - that.parseDuplicationsTrend(r[0]); - } - }); - }, - - parseTrend: function (r, property, metric) { - var that = this, - index = _.pluck(r.cols, 'metric').indexOf(metric); - if (index !== -1) { - var trend = r.cells.map(function (cell) { - return { val: cell.d, count: cell.v[index] || 0 }; - }); - that.set(property, trend); - } - }, - - parseSizeTrend: function (r) { - this.parseTrend(r, 'sizeTrend', SIZE_METRIC); - }, - - parseIssuesTrend: function (r) { - this.parseTrend(r, 'issuesTrend', ISSUES_METRIC); - }, - - parseDebtTrend: function (r) { - this.parseTrend(r, 'debtTrend', DEBT_METRIC); - }, - - parseCoverageTrend: function (r) { - this.parseTrend(r, 'coverageTrend', COVERAGE_METRIC); - }, - - parseDuplicationsTrend: function (r) { - this.parseTrend(r, 'duplicationsTrend', DUPLICATIONS_METRIC); - } - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/router.js b/server/sonar-web/src/main/js/overview/router.js deleted file mode 100644 index ace5ffd7e9b..00000000000 --- a/server/sonar-web/src/main/js/overview/router.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(function () { - - return Backbone.Router.extend({ - - routes: { - '': 'main' - }, - - initialize: function (options) { - this.controller = options.controller; - }, - - main: function () { - this.controller.main(); - } - }); - -}); diff --git a/server/sonar-web/src/main/js/overview/trend-view.js b/server/sonar-web/src/main/js/overview/trend-view.js deleted file mode 100644 index 24c31e503b1..00000000000 --- a/server/sonar-web/src/main/js/overview/trend-view.js +++ /dev/null @@ -1,182 +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(function () { - - function trans (left, top) { - return 'translate(' + left + ', ' + top + ')'; - } - - var $ = jQuery; - - - return Backbone.View.extend({ - - initialize: function (options) { - this.data = options.data; - this.type = options.type || 'INT'; - this.width = 0; - this.height = 0; - }, - - attachEvents: function () { - this.detachEvents(); - var event = 'resize.trend-' + this.cid, - update = _.throttle(_.bind(this.update, this), 50); - $(window).on(event, update); - }, - - detachEvents: function () { - var event = 'resize.trend-' + this.cid; - $(window).off(event); - return this; - }, - - render: function () { - var that = this, - data = this.data; - this.container = d3.select(this.el); - this.svg = this.container.append('svg') - .classed('sonar-d3', true); - this.plot = this.svg.append('g') - .classed('plot', true); - - this.xScale = d3.time.scale() - .domain(d3.extent(data, function (d) { - return moment(d.val).toDate(); - })) - .nice(); - this.yScale = d3.scale.linear() - .domain(d3.extent(data, function (d) { - return d.count; - })) - .nice(); - - this.line = d3.svg.line() - .x(function (d) { - return that.xScale(moment(d.val).toDate()); - }) - .y(function (d) { - return that.yScale(d.count); - }) - .interpolate('linear'); - - this.xScaleTicks = this.xScale.ticks(5); - this.yScaleTicks = this.yScale.ticks(3); - - this.xTicks = this.xScaleTicks.map(function (tick) { - return that.plot.append('text') - .datum(tick) - .text(that.xScale.tickFormat()(tick)) - .attr('dy', '0') - .style('text-anchor', 'middle') - .style('font-size', '10px') - .style('font-weight', '300') - .style('fill', '#aaa'); - }); - this.yTicks = this.yScaleTicks.map(function (tick) { - return that.plot.append('text') - .datum(tick) - .text(window.formatMeasure(tick, that.type)) - .attr('dy', '5px') - .style('text-anchor', 'end') - .style('font-size', '10px') - .style('font-weight', '300') - .style('fill', '#aaa'); - }); - - this.xTickLines = this.xScaleTicks.map(function (tick) { - return that.plot.append('line') - .datum(tick) - .style('stroke', '#eee') - .style('shape-rendering', 'crispedges'); - }); - this.yTickLines = this.yScaleTicks.map(function (tick) { - return that.plot.append('line') - .datum(tick) - .style('stroke', '#eee') - .style('shape-rendering', 'crispedges'); - }); - - this.path = this.plot.append('path') - .datum(data) - .classed('line', true) - .style('stroke', 'rgb(31, 119, 180)'); - - this.attachEvents(); - - return this; - }, - - update: function () { - var that = this, - width = this.$el.closest('.overview-trend').width(), - height = 150, - marginLeft = 20, - marginRight = 50, - marginTop = 5, - marginBottom = 25, - availableWidth = width - marginLeft - marginRight, - availableHeight = height - marginTop - marginBottom; - - this.svg - .attr('width', width) - .attr('height', height); - - this.plot.attr('transform', trans(marginLeft, marginTop)); - this.xScale.range([0, availableWidth]); - this.yScale.range([availableHeight, 0]); - - this.path - .attr('d', this.line); - - this.xTicks.forEach(function (tick) { - tick - .attr('x', that.xScale(tick.datum())) - .attr('y', availableHeight + 20); - }); - - this.yTicks.forEach(function (tick) { - tick - .attr('x', availableWidth + 50) - .attr('y', that.yScale(tick.datum())); - }); - - this.xTickLines.forEach(function (tick) { - tick - .attr('x1', that.xScale(tick.datum())) - .attr('x2', that.xScale(tick.datum())) - .attr('y1', 0) - .attr('y2', availableHeight); - }); - - this.yTickLines.forEach(function (tick) { - tick - .attr('x1', 0) - .attr('x2', availableWidth) - .attr('y1', that.yScale(tick.datum())) - .attr('y2', that.yScale(tick.datum())); - }); - - return this; - } - - }); - -}); diff --git a/server/sonar-web/src/main/less/pages.less b/server/sonar-web/src/main/less/pages.less index ce3a8a86fd9..a24699b5834 100644 --- a/server/sonar-web/src/main/less/pages.less +++ b/server/sonar-web/src/main/less/pages.less @@ -25,4 +25,3 @@ @import "pages/issues"; @import "pages/libraries"; @import "pages/quality-gates"; -@import "pages/overview"; diff --git a/server/sonar-web/src/main/less/pages/overview.less b/server/sonar-web/src/main/less/pages/overview.less deleted file mode 100644 index 4582868d23e..00000000000 --- a/server/sonar-web/src/main/less/pages/overview.less +++ /dev/null @@ -1,106 +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. - */ -@import (reference) "../variables"; -@import (reference) "../mixins"; -@import (reference) "../init/links"; - -.overview { - padding: 10px; - .box-sizing(border-box); - overflow: hidden; -} - -.overview-card { - .clearfix; - padding: 20px; - border: 1px solid @barBorderColor; - background: @white; -} - -.overview-card:not(.hidden) + .overview-card { - margin-top: 20px; -} - -.overview-gate-ok { border: 2px solid @green; } - -.overview-gate-warn { border: 2px solid @orange; } - -.overview-gate-error { border: 2px solid @red; } - -.overview-gate-condition { - padding-left: 1px; -} - -.overview-container { - margin-top: 20px; -} - -.overview-card-header { - margin-bottom: 20px; - padding-bottom: 20px; - border-bottom: 1px solid @barBorderColor; -} - -.overview-status { - margin: 0; - padding: 0 6px; - color: #fff !important; - font-weight: 300; - - a& { - .link-no-underline; - - &:hover, &:focus, &:active { - opacity: 0.8; - } - } -} - -.overview-status-OK { background-color: @green; } -.overview-status-WARN { background-color: @orange; } -.overview-status-ERROR { background-color: @red; } - -.overview-highlight { - float: left; - width: 160px; - padding-right: 20px; - .box-sizing(border-box); -} - -.overview-trend { - padding-left: 160px; - - .note { font-size: 10px; } -} - -.overview-main-measure { - line-height: 1.3; - margin-bottom: 20px; - font-size: 36px; - font-weight: 300; - - .rating { font-size: 30px; } -} - -.overview-measure { - line-height: 1.5; - font-size: 20px; - font-weight: 300; -} diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb index 7e5101285b0..9ec1e477893 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb @@ -29,7 +29,6 @@ class DashboardController < ApplicationController if !@resource || @resource.display_dashboard? redirect_if_bad_component() load_dashboard() - redirect_if_overview() load_authorized_widget_definitions() else if !@resource || !@snapshot @@ -215,12 +214,6 @@ class DashboardController < ApplicationController end end - def redirect_if_overview - if @resource && @snapshot && !params[:did] && !params[:name] - redirect_to :controller => 'overview', :action => 'index', :id => @resource.key - end - end - def project_not_found flash[:error] = message('dashboard.project_not_found') redirect_to :action => :index diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb deleted file mode 100644 index 5a78c39505d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb +++ /dev/null @@ -1,31 +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 OverviewController < ApplicationController - before_filter :init_resource_for_user_role - helper DashboardHelper - - SECTION=Navigation::SECTION_RESOURCE - - def index - - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb deleted file mode 100644 index 48eb422c5d9..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb +++ /dev/null @@ -1,40 +0,0 @@ -<% if @snapshot %> -
    - - <% - period1Name = short_period_label(@snapshot, 1) - period2Name = short_period_label(@snapshot, 2) - period3Name = short_period_label(@snapshot, 3) - - period1Date = @snapshot.period_datetime(1) - period2Date = @snapshot.period_datetime(2) - period3Date = @snapshot.period_datetime(3) - %> - - -<% else %> -
    -

    <%= message('provisioning.no_analysis') -%>

    -
    -<% end %> diff --git a/server/sonar-web/src/test/js/overview.js b/server/sonar-web/src/test/js/overview.js deleted file mode 100644 index 78c2dcbb23a..00000000000 --- a/server/sonar-web/src/test/js/overview.js +++ /dev/null @@ -1,87 +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('Overview'); - -lib.initMessages(); -lib.changeWorkingDirectory('overview'); -lib.configureCasper(); - - -casper.test.begin(testName(), 22, function (test) { - casper - .start(lib.buildUrl('overview'), function () { - lib.setDefaultViewport(); - - lib.mockRequestFromFile('/api/metrics', 'metrics.json'); - lib.mockRequestFromFile('/api/resources/index', 'measures.json'); - lib.mockRequestFromFile('/api/timemachine/index', 'timemachine.json'); - lib.mockRequestFromFile('/api/issues/search', 'issues.json'); - }) - - .then(function () { - casper.evaluate(function () { - require(['/js/overview/app.js']); - }); - }) - - .then(function () { - casper.waitForText('165k'); - }) - - .then(function () { - test.assertSelectorContains('#overview-gate', '7'); - test.assertSelectorContains('#overview-gate', '64.7%'); - test.assertSelectorContains('#overview-gate', '2'); - test.assertSelectorContains('#overview-gate', '5'); - test.assertSelectorContains('#overview-gate', '0'); - test.assertElementCount('#overview-gate .overview-status', 9); - test.assertElementCount('#overview-gate .overview-status-ERROR', 3); - test.assertElementCount('#overview-gate .overview-status-WARN', 1); - test.assertElementCount('#overview-gate .overview-status-OK', 5); - - test.assertSelectorContains('#overview-size', '165k'); - test.assertSelectorContains('#overview-size', '+3.9k'); - test.assertExists('#overview-size-trend path'); - - test.assertSelectorContains('#overview-issues', '1.6k'); - test.assertExists('#overview-issues-trend path'); - - test.assertSelectorContains('#overview-debt', '66'); - test.assertExists('#overview-debt-trend path'); - - test.assertSelectorContains('#overview-coverage', '83.9%'); - test.assertSelectorContains('#overview-coverage', '90.0%'); - test.assertExists('#overview-coverage-trend path'); - - test.assertSelectorContains('#overview-duplications', '1.0%'); - test.assertSelectorContains('#overview-duplications', '+0.1%'); - test.assertExists('#overview-duplications-trend path'); - }) - - .then(function () { - lib.sendCoverage(); - }) - - .run(function () { - test.done(); - }); -}); diff --git a/server/sonar-web/src/test/json/overview/issues.json b/server/sonar-web/src/test/json/overview/issues.json deleted file mode 100644 index ffc685c0c48..00000000000 --- a/server/sonar-web/src/test/json/overview/issues.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "total": 1605, - "p": 1, - "ps": 1, - "projects": [], - "components": [], - "issues": [], - "rules": [], - "users": [], - "languages": [] -} diff --git a/server/sonar-web/src/test/json/overview/measures.json b/server/sonar-web/src/test/json/overview/measures.json deleted file mode 100644 index 826a1ab308d..00000000000 --- a/server/sonar-web/src/test/json/overview/measures.json +++ /dev/null @@ -1,102 +0,0 @@ -[ - { - "id": 2865, - "key": "org.codehaus.sonar:sonar", - "name": "SonarQube", - "scope": "PRJ", - "qualifier": "TRK", - "date": "2015-03-30T23:08:38+0200", - "creationDate": null, - "lname": "SonarQube", - "version": "5.2-SNAPSHOT", - "description": "Open source platform for continuous inspection of code quality", - "p1": "previous_analysis", - "p1p": "2015-03-30", - "p1d": "2015-03-30T18:41:20+0200", - "p2": "days", - "p2p": "365", - "p2d": "2014-04-07T23:34:01+0200", - "p3": "previous_version", - "p3p": "5.1", - "p3d": "2015-03-10T12:05:17+0100", - "msr": [ - { - "key": "ncloc", - "val": 165077, - "frmt_val": "165,077", - "trend": 0, - "var": 2, - "var1": 14, - "fvar1": "14", - "var2": 62886, - "fvar2": "62,886", - "var3": 3916, - "fvar3": "3,916" - }, - { - "key": "duplicated_lines_density", - "val": 1, - "frmt_val": "1.0%", - "trend": 0, - "var": 0, - "var1": 0, - "fvar1": "0.0%", - "var2": -0.1, - "fvar2": "-0.1%", - "var3": 0.1, - "fvar3": "0.1%" - }, - { - "key": "sqale_index", - "val": 31929, - "frmt_val": "66d", - "trend": 1, - "var": -2, - "var1": -2, - "fvar1": "-2min", - "var2": -23834, - "fvar2": "-49d", - "var3": -30819, - "fvar3": "-64d" - }, - { - "key": "sqale_rating", - "val": 1, - "frmt_val": "A", - "data": "A", - "trend": 0, - "var": 0, - "var1": 0, - "fvar1": "0", - "var2": 0, - "fvar2": "0", - "var3": 0, - "fvar3": "0" - }, - { - "key": "coverage", - "val": 83.9, - "frmt_val": "83.9%", - "trend": 0, - "var": 0, - "var1": 0, - "fvar1": "0.0%", - "var3": 0.600000000000009, - "fvar3": "0.6%" - }, - { - "key": "new_coverage", - "var1": 88.2352941176471, - "fvar1": "88.2%", - "var2": 87.9254132585941, - "fvar2": "87.9%", - "var3": 90.0445765230312, - "fvar3": "90.0%" - }, - { - "key": "quality_gate_details", - "data": "{\"level\":\"ERROR\",\"conditions\":[{\"metric\":\"blocker_violations\",\"op\":\"GT\",\"period\":3,\"warning\":\"\",\"error\":\"0\",\"actual\":\"7.0\",\"level\":\"ERROR\"},{\"metric\":\"new_coverage\",\"op\":\"LT\",\"period\":3,\"warning\":\"\",\"error\":\"85\",\"actual\":\"64.67002385369732\",\"level\":\"ERROR\"},{\"metric\":\"critical_violations\",\"op\":\"GT\",\"period\":3,\"warning\":\"\",\"error\":\"0\",\"actual\":\"2.0\",\"level\":\"ERROR\"},{\"metric\":\"open_issues\",\"op\":\"GT\",\"warning\":\"0\",\"error\":\"\",\"actual\":\"5.0\",\"level\":\"WARN\"},{\"metric\":\"reopened_issues\",\"op\":\"GT\",\"warning\":\"0\",\"error\":\"\",\"actual\":\"0.0\",\"level\":\"OK\"},{\"metric\":\"sqale_debt_ratio\",\"op\":\"GT\",\"warning\":\"\",\"error\":\"5\",\"actual\":\"0.6\",\"level\":\"OK\"},{\"metric\":\"test_errors\",\"op\":\"GT\",\"warning\":\"\",\"error\":\"0\",\"actual\":\"0.0\",\"level\":\"OK\"},{\"metric\":\"test_failures\",\"op\":\"GT\",\"warning\":\"\",\"error\":\"0\",\"actual\":\"0.0\",\"level\":\"OK\"},{\"metric\":\"skipped_tests\",\"op\":\"GT\",\"warning\":\"0\",\"error\":\"\",\"actual\":\"0.0\",\"level\":\"OK\"}]}" - } - ] - } -] diff --git a/server/sonar-web/src/test/json/overview/metrics.json b/server/sonar-web/src/test/json/overview/metrics.json deleted file mode 100644 index 34f7af93d1c..00000000000 --- a/server/sonar-web/src/test/json/overview/metrics.json +++ /dev/null @@ -1,123 +0,0 @@ -[ - { - "key": "blocker_violations", - "name": "Blocker issues", - "description": "Blocker issues", - "domain": "Issues", - "qualitative": true, - "user_managed": false, - "direction": -1, - "val_type": "INT", - "hidden": false - }, - { - "key": "new_overall_coverage", - "name": "Overall coverage on new code", - "description": "Overall coverage of new/changed code", - "domain": "Tests (Overall)", - "qualitative": true, - "user_managed": false, - "direction": 1, - "val_type": "PERCENT", - "hidden": false - }, - { - "key": "overall_coverage", - "name": "Overall coverage", - "description": "Overall test coverage", - "domain": "Tests (Overall)", - "qualitative": true, - "user_managed": false, - "direction": 1, - "val_type": "PERCENT", - "hidden": false - }, - { - "key": "open_issues", - "name": "Open issues", - "description": "Open issues", - "domain": "Issues", - "qualitative": false, - "user_managed": false, - "direction": -1, - "val_type": "INT", - "hidden": false - }, - { - "key": "sqale_debt_ratio", - "name": "Technical Debt Ratio", - "description": "Ratio of the actual technical debt compared to the estimated cost to develop the whole source code from scratch.", - "domain": "Technical Debt", - "qualitative": true, - "user_managed": false, - "direction": -1, - "val_type": "PERCENT", - "hidden": false - }, - { - "key": "new_coverage", - "name": "Coverage on new code", - "description": "Coverage of new/changed code", - "domain": "Tests", - "qualitative": true, - "user_managed": false, - "direction": 1, - "val_type": "PERCENT", - "hidden": false - }, - { - "key": "reopened_issues", - "name": "Reopened issues", - "description": "Reopened issues", - "domain": "Issues", - "qualitative": true, - "user_managed": false, - "direction": -1, - "val_type": "INT", - "hidden": false - }, - { - "key": "skipped_tests", - "name": "Skipped unit tests", - "description": "Number of skipped unit tests", - "domain": "Tests", - "qualitative": true, - "user_managed": false, - "direction": -1, - "val_type": "INT", - "hidden": false - }, - { - "key": "critical_violations", - "name": "Critical issues", - "description": "Critical issues", - "domain": "Issues", - "qualitative": true, - "user_managed": false, - "direction": -1, - "val_type": "INT", - "hidden": false - }, - { - "key": "test_errors", - "name": "Unit tests errors", - "description": "Number of unit test errors", - "domain": "Tests", - "qualitative": true, - "user_managed": false, - "direction": -1, - "val_type": "INT", - "hidden": false - }, - { - "key": "test_failures", - "name": "Unit tests failures", - "description": "Number of unit test failures", - "domain": "Tests", - "qualitative": true, - "user_managed": false, - "direction": -1, - "val_type": "INT", - "hidden": false - } -] diff --git a/server/sonar-web/src/test/json/overview/timemachine.json b/server/sonar-web/src/test/json/overview/timemachine.json deleted file mode 100644 index 1ac438fc2bb..00000000000 --- a/server/sonar-web/src/test/json/overview/timemachine.json +++ /dev/null @@ -1,63 +0,0 @@ -[ - { - "cols": [ - { - "metric": "ncloc" - }, - { - "metric": "violations" - }, - { - "metric": "sqale_index" - }, - { - "metric": "coverage" - }, - { - "metric": "duplicated_lines_density" - } - ], - "cells": [ - { - "d": "2011-10-02T00:01:00+0200", - "v": [ - 53922, - 1174, - 70409, - 15, - 0.8 - ] - }, - { - "d": "2011-10-25T12:27:41+0200", - "v": [ - 59063, - 3710, - 71528, - 12, - 0.7 - ] - }, - { - "d": "2011-11-04T09:24:35+0100", - "v": [ - 56003, - 1244, - 73259, - 13, - 0.9 - ] - }, - { - "d": "2011-11-08T16:11:09+0100", - "v": [ - 56004, - 1221, - 72029, - 16, - 0.9 - ] - } - ] - } -] diff --git a/server/sonar-web/src/test/views/overview.jade b/server/sonar-web/src/test/views/overview.jade deleted file mode 100644 index 4e381f1ce6d..00000000000 --- a/server/sonar-web/src/test/views/overview.jade +++ /dev/null @@ -1,16 +0,0 @@ -extends layouts/main - -block body - #content - .overview - script. - window.overviewConf = { - period1Name: 'since previous analysis', - period1Date: '2015-03-30T18:41:20+0200', - period2Name: 'over 365 days', - period2Date: '2014-04-07T23:34:01+0200', - period3Name: 'since previous version', - period3Date: '2015-03-10T12:05:17+0100', - componentKey: 'org.codehaus.sonar:sonar', - componentUuid: '69e57151-be0d-4157-adff-c06741d88879' - }; 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 0b1657038ba..076bb28d8e7 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -2259,7 +2259,7 @@ metric.generated_ncloc.abbreviation=Gen. LOC metric.lines.name=Lines metric.lines.description=Lines -metric.ncloc.name=Lines of Code +metric.ncloc.name=Lines of code metric.ncloc.description=Non Commenting Lines of Code metric.ncloc.abbreviation=LOC @@ -2985,20 +2985,3 @@ workspace.minimize=Minimize workspace.full_window=Expand to full window workspace.normal_size=Collapse to normal size workspace.close=Remove from the list of pinned files - - - - -#------------------------------------------------------------------------------ -# -# OVERVIEW -# -#------------------------------------------------------------------------------ -overview.size=Size -overview.gate=Quality Gate -overview.issues=Issues -overview.debt=Technical Debt -overview.testing=Testing -overview.duplications=Duplications -overview.new=new -overview.on_new_code=on new code -- 2.39.5