From 1e26480cb2c8341bce5c9f028d020a520d68bae8 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 15 Sep 2015 17:54:25 +0200 Subject: [PATCH] SONAR-6331 revert overview page --- .../server/ServerTest/url_ending_by_jsp.html | 4 +- .../ui/i18n/default-locale-is-english.html | 6 +- .../test/resources/ui/i18n/french-locale.html | 6 +- .../ui/i18n/locale-with-france-country.html | 6 +- .../ui/i18n/locale-with-swiss-country.html | 6 +- server/sonar-web/Gruntfile.coffee | 1 - .../apps/nav/component/component-nav-menu.jsx | 26 ++- .../src/main/js/apps/nav/links-mixin.jsx | 3 +- .../src/main/js/apps/overview/app.jsx | 22 -- .../src/main/js/apps/overview/card.jsx | 7 - .../src/main/js/apps/overview/cards.jsx | 7 - .../src/main/js/apps/overview/empty.jsx | 13 -- .../main/js/apps/overview/gate-condition.jsx | 35 ---- .../main/js/apps/overview/gate-conditions.jsx | 21 -- .../src/main/js/apps/overview/gate.jsx | 24 --- .../main/js/apps/overview/helpers/donut.jsx | 41 ---- .../apps/overview/helpers/drilldown-link.jsx | 96 --------- .../js/apps/overview/helpers/gate-link.jsx | 8 - .../js/apps/overview/helpers/issues-link.jsx | 11 - .../overview/helpers/measure-variation.jsx | 11 - .../main/js/apps/overview/helpers/measure.jsx | 11 - .../js/apps/overview/helpers/period-label.jsx | 15 -- .../js/apps/overview/helpers/profile-link.jsx | 8 - .../main/js/apps/overview/helpers/rating.jsx | 12 -- .../main/js/apps/overview/leak-coverage.jsx | 46 ----- .../src/main/js/apps/overview/leak-dups.jsx | 43 ---- .../src/main/js/apps/overview/leak-issues.jsx | 70 ------- .../src/main/js/apps/overview/leak-size.jsx | 31 --- .../src/main/js/apps/overview/leak.jsx | 32 --- .../src/main/js/apps/overview/main.jsx | 101 ---------- .../src/main/js/apps/overview/meta.jsx | 67 ------ .../js/apps/overview/nutshell-coverage.jsx | 47 ----- .../main/js/apps/overview/nutshell-dups.jsx | 47 ----- .../main/js/apps/overview/nutshell-issues.jsx | 69 ------- .../main/js/apps/overview/nutshell-size.jsx | 35 ---- .../src/main/js/apps/overview/nutshell.jsx | 23 --- .../common/handlebars-extensions.js | 4 - server/sonar-web/src/main/js/helpers/Url.jsx | 2 +- server/sonar-web/src/main/less/pages.less | 1 - .../src/main/less/pages/overview.less | 190 ------------------ .../app/controllers/dashboard_controller.rb | 30 ++- .../app/controllers/overview_controller.rb | 29 --- .../WEB-INF/app/views/overview/index.html.erb | 177 ---------------- .../resources/org/sonar/l10n/core.properties | 32 --- 44 files changed, 45 insertions(+), 1431 deletions(-) delete mode 100644 server/sonar-web/src/main/js/apps/overview/app.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/card.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/cards.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/empty.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/gate-condition.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/gate-conditions.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/gate.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/helpers/donut.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/helpers/drilldown-link.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/helpers/gate-link.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/helpers/issues-link.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/helpers/measure-variation.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/helpers/measure.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/helpers/period-label.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/helpers/profile-link.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/helpers/rating.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/leak-coverage.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/leak-dups.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/leak-issues.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/leak-size.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/leak.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/main.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/meta.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/nutshell-coverage.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/nutshell-dups.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/nutshell-issues.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/nutshell-size.jsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/nutshell.jsx 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 diff --git a/it/it-tests/src/test/resources/server/ServerTest/url_ending_by_jsp.html b/it/it-tests/src/test/resources/server/ServerTest/url_ending_by_jsp.html index ffb2216a1b3..4e8715c3d18 100644 --- a/it/it-tests/src/test/resources/server/ServerTest/url_ending_by_jsp.html +++ b/it/it-tests/src/test/resources/server/ServerTest/url_ending_by_jsp.html @@ -9,12 +9,12 @@ open - /sonar/overview/index/myproject.jsp + /sonar/dashboard/index/myproject.jsp waitForElementPresent - css=.overview + css=#dashboard diff --git a/it/it-tests/src/test/resources/ui/i18n/default-locale-is-english.html b/it/it-tests/src/test/resources/ui/i18n/default-locale-is-english.html index 71123d9ce0c..f2e23f196a1 100644 --- a/it/it-tests/src/test/resources/ui/i18n/default-locale-is-english.html +++ b/it/it-tests/src/test/resources/ui/i18n/default-locale-is-english.html @@ -15,17 +15,17 @@ open - /sonar/overview/index?id=sample&locale=foo + /sonar/dashboard/index?id=sample&locale=foo waitForText - css=.navbar-context + css=#content regexp:.*Jan.*|.*Feb.*|.*Mar.*|.*Apr.*|.*May.*|.*Jun.*|.*Jul.*|.*Aug.*|.*Sep.*|.*Oct.*|.*Nov.*|.*Dec.* waitForText - css=.overview + css=#content *0.0%* diff --git a/it/it-tests/src/test/resources/ui/i18n/french-locale.html b/it/it-tests/src/test/resources/ui/i18n/french-locale.html index 8fd6d8db3dd..74f2f320a02 100644 --- a/it/it-tests/src/test/resources/ui/i18n/french-locale.html +++ b/it/it-tests/src/test/resources/ui/i18n/french-locale.html @@ -15,17 +15,17 @@ open - /sonar/overview/index?id=sample&locale=fr + /sonar/dashboard/index?id=sample&locale=fr waitForText - css=.navbar-context + css=#content regexp:.*jan.*|.*fév.*|.*mar.*|.*avr.*|.*mai.*|.*juin.*|.*juil.*|.*août.*|.*sept.*|.*oct.*|.*nov.*|.*déc.* waitForText - css=.overview + css=#content *0,0%* diff --git a/it/it-tests/src/test/resources/ui/i18n/locale-with-france-country.html b/it/it-tests/src/test/resources/ui/i18n/locale-with-france-country.html index e8c6431f414..e65cd5e95bf 100644 --- a/it/it-tests/src/test/resources/ui/i18n/locale-with-france-country.html +++ b/it/it-tests/src/test/resources/ui/i18n/locale-with-france-country.html @@ -15,17 +15,17 @@ open - /sonar/overview/index?id=sample&locale=fr-FR + /sonar/dashboard/index?id=sample&locale=fr-FR waitForText - css=.navbar-context + css=#content regexp:.*jan.*|.*fév.*|.*mar.*|.*avr.*|.*mai.*|.*juin.*|.*juil.*|.*août.*|.*sept.*|.*oct.*|.*nov.*|.*déc.* waitForText - css=.overview + css=#content *0,0%* diff --git a/it/it-tests/src/test/resources/ui/i18n/locale-with-swiss-country.html b/it/it-tests/src/test/resources/ui/i18n/locale-with-swiss-country.html index 6073c0f5127..888f5d8f3a8 100644 --- a/it/it-tests/src/test/resources/ui/i18n/locale-with-swiss-country.html +++ b/it/it-tests/src/test/resources/ui/i18n/locale-with-swiss-country.html @@ -15,17 +15,17 @@ open - /sonar/overview/index?id=sample&locale=fr-CH + /sonar/dashboard/index?id=sample&locale=fr-CH waitForText - css=.navbar-context + css=#content regexp:.*jan.*|.*fév.*|.*mar.*|.*avr.*|.*mai.*|.*juin.*|.*juil.*|.*août.*|.*sept.*|.*oct.*|.*nov.*|.*déc.* waitForText - css=.overview + css=#content *0.0%* diff --git a/server/sonar-web/Gruntfile.coffee b/server/sonar-web/Gruntfile.coffee index 3e0626d7789..2a35ef057db 100644 --- a/server/sonar-web/Gruntfile.coffee +++ b/server/sonar-web/Gruntfile.coffee @@ -149,7 +149,6 @@ module.exports = (grunt) -> 'build-app:measures' 'build-app:metrics' 'build-app:nav' - 'build-app:overview' 'build-app:project-permissions' 'build-app:provisioning' 'build-app:quality-gates' diff --git a/server/sonar-web/src/main/js/apps/nav/component/component-nav-menu.jsx b/server/sonar-web/src/main/js/apps/nav/component/component-nav-menu.jsx index c3679649e63..ae156463086 100644 --- a/server/sonar-web/src/main/js/apps/nav/component/component-nav-menu.jsx +++ b/server/sonar-web/src/main/js/apps/nav/component/component-nav-menu.jsx @@ -8,14 +8,24 @@ const SETTINGS_URLS = [ '/project/deletion' ]; -const MORE_URLS = ['/dashboards', '/dashboard', '/plugins/resource']; - export default React.createClass({ mixins: [DashboardNameMixin, LinksMixin], renderOverviewLink() { - const url = `/overview/index?id=${encodeURIComponent(this.props.component.key)}`; - return this.renderLink(url, window.t('overview.page'), '/overview'); + if (_.size(this.props.component.dashboards) === 0) { + return null; + } + let firstDashboard = _.first(this.props.component.dashboards); + let url = `/dashboard/index?id=${encodeURIComponent(this.props.component.key)}`; + let name = this.getLocalizedDashboardName(firstDashboard.name); + return this.renderLink(url, name, () => { + /* eslint eqeqeq: 0 */ + let pathMatch = window.location.pathname === `${window.baseUrl}/dashboard` || + window.location.pathname === `${window.baseUrl}/dashboard/index`; + let params = window.getQueryParams(); + let paramMatch = !params['did'] || params['did'] == firstDashboard.key; + return pathMatch && paramMatch ? 'active' : null; + }); }, renderComponentsLink() { @@ -156,12 +166,8 @@ export default React.createClass({ }, renderMore() { - let isActive = MORE_URLS.some(url => { - return window.location.href.indexOf(url) !== -1; - }), - className = 'dropdown' + (isActive ? ' active' : ''); return ( -
  • +
  • {window.t('more')}  @@ -175,7 +181,7 @@ export default React.createClass({ }, renderDashboards() { - let dashboards = (this.props.component.dashboards || []).map(d => { + let dashboards = _.rest(this.props.component.dashboards || []).map(d => { let url = `/dashboard?id=${encodeURIComponent(this.props.component.key)}&did=${d.key}`; let name = this.getLocalizedDashboardName(d.name); return this.renderLink(url, name); diff --git a/server/sonar-web/src/main/js/apps/nav/links-mixin.jsx b/server/sonar-web/src/main/js/apps/nav/links-mixin.jsx index e807c5a26d0..7e9d76121aa 100644 --- a/server/sonar-web/src/main/js/apps/nav/links-mixin.jsx +++ b/server/sonar-web/src/main/js/apps/nav/links-mixin.jsx @@ -7,8 +7,9 @@ export default { renderLink(url, title, highlightUrl = url) { let fullUrl = window.baseUrl + url; + let check = _.isFunction(highlightUrl) ? highlightUrl : this.activeLink; return ( -
  • +
  • {title}
  • ); diff --git a/server/sonar-web/src/main/js/apps/overview/app.jsx b/server/sonar-web/src/main/js/apps/overview/app.jsx deleted file mode 100644 index 475b1c0348f..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/app.jsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; -import Main from './main'; -import Empty from './empty'; - -const $ = jQuery; - -export default { - start(options) { - $('html').toggleClass('dashboard-page', options.component.hasSnapshot); - window.requestMessages().done(() => { - const el = document.querySelector(options.el); - const inner = options.component.hasSnapshot ? ( -
    - ) : ; - React.render(inner, el); - }); - } -}; diff --git a/server/sonar-web/src/main/js/apps/overview/card.jsx b/server/sonar-web/src/main/js/apps/overview/card.jsx deleted file mode 100644 index a22146246d3..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/card.jsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; - -export default React.createClass({ - render() { - return
  • {this.props.children}
  • ; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/cards.jsx b/server/sonar-web/src/main/js/apps/overview/cards.jsx deleted file mode 100644 index 3d69cf8bf3a..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/cards.jsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; - -export default React.createClass({ - render() { - return
      {this.props.children}
    ; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/empty.jsx b/server/sonar-web/src/main/js/apps/overview/empty.jsx deleted file mode 100644 index 78c5320a1f8..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/empty.jsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; - -export default React.createClass({ - render() { - return ( -
    -
    - {window.t('provisioning.no_analysis')} -
    -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/gate-condition.jsx b/server/sonar-web/src/main/js/apps/overview/gate-condition.jsx deleted file mode 100644 index cd2c4ec4f18..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/gate-condition.jsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import Card from './card'; -import Measure from './helpers/measure'; -import {periodLabel, getPeriodDate} from './helpers/period-label'; -import DrilldownLink from './helpers/drilldown-link'; - -export default React.createClass({ - render() { - const - metricName = window.t('metric', this.props.condition.metric.name, 'name'), - threshold = this.props.condition.level === 'ERROR' ? - this.props.condition.error : this.props.condition.warning, - iconClassName = 'icon-alert-' + this.props.condition.level.toLowerCase(), - period = this.props.condition.period ? - `(${periodLabel(this.props.component.periods, this.props.condition.period)})` : null, - periodDate = getPeriodDate(this.props.component.periods, this.props.condition.period); - - return ( -
    -

    {metricName} {period}

    -
    -   - - -   - - {window.t('quality_gates.operator', this.props.condition.op, 'short')}  - - -
    -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/gate-conditions.jsx b/server/sonar-web/src/main/js/apps/overview/gate-conditions.jsx deleted file mode 100644 index dddac46e6e4..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/gate-conditions.jsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -import Cards from './cards'; -import Card from './card'; -import GateCondition from './gate-condition'; - -export default React.createClass({ - render() { - const conditions = this.props.gate.conditions - .filter((c) => { - return c.level !== 'OK'; - }) - .map((c) => { - return ( - - - - ); - }); - return {conditions}; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/gate.jsx b/server/sonar-web/src/main/js/apps/overview/gate.jsx deleted file mode 100644 index f805da9cd6a..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/gate.jsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react'; -import GateConditions from './gate-conditions'; - -export default React.createClass({ - render() { - if (!this.props.gate || !this.props.gate.level) { - return null; - } - - const - badgeClassName = 'badge badge-' + this.props.gate.level.toLowerCase(), - badgeText = window.t('overview.gate', this.props.gate.level); - - return ( -
    -
    - {window.t('overview.quality_gate')} - {badgeText} -
    - -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/donut.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/donut.jsx deleted file mode 100644 index 58ba8a36736..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/helpers/donut.jsx +++ /dev/null @@ -1,41 +0,0 @@ -import React from 'react'; - -const Sector = React.createClass({ - render() { - const arc = d3.svg.arc() - .outerRadius(this.props.radius) - .innerRadius(this.props.radius - this.props.thickness); - return ; - } -}); - -export default React.createClass({ - getDefaultProps() { - return { - size: 30, - thickness: 6 - }; - }, - - render() { - const radius = this.props.size / 2; - const pie = d3.layout.pie().sort(null) - .value(d => { - return d.value - }); - const data = this.props.data; - const sectors = pie(data).map((d, i) => { - return ; - }); - return ( - - {sectors} - - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/drilldown-link.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/drilldown-link.jsx deleted file mode 100644 index 57b2996d26b..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/helpers/drilldown-link.jsx +++ /dev/null @@ -1,96 +0,0 @@ -import React from 'react'; -import IssuesLink from './issues-link'; - -export default React.createClass({ - render() { - if (this.isIssueMeasure()) { - return this.renderIssuesLink(); - } - - let params = { id: this.props.component, metric: this.props.metric }; - if (this.props.period) { - params.period = this.props.period; - } - - const - query = Object.keys(params).map(key => { - return `${key}=${encodeURIComponent(params[key])}`; - }).join('&'), - url = `${baseUrl}/drilldown/measures?${query}`; - - return {this.props.children}; - }, - - isIssueMeasure() { - const ISSUE_MEASURES = [ - 'violations', - 'blocker_violations', - 'critical_violations', - 'major_violations', - 'minor_violations', - 'info_violations', - 'new_blocker_violations', - 'new_critical_violations', - 'new_major_violations', - 'new_minor_violations', - 'new_info_violations', - 'open_issues', - 'reopened_issues', - 'confirmed_issues', - 'false_positive_issues' - ]; - return ISSUE_MEASURES.indexOf(this.props.metric) !== -1; - }, - - propsToIssueParams() { - let params = {}; - if (this.props.periodDate) { - params.createdAfter = moment(this.props.periodDate).format('YYYY-MM-DDTHH:mm:ssZZ'); - } - switch (this.props.metric) { - case 'blocker_violations': - case 'new_blocker_violations': - _.extend(params, { resolved: 'false', severities: 'BLOCKER' }); - break; - case 'critical_violations': - case 'new_critical_violations': - _.extend(params, { resolved: 'false', severities: 'CRITICAL' }); - break; - case 'major_violations': - case 'new_major_violations': - _.extend(params, { resolved: 'false', severities: 'MAJOR' }); - break; - case 'minor_violations': - case 'new_minor_violations': - _.extend(params, { resolved: 'false', severities: 'MINOR' }); - break; - case 'info_violations': - case 'new_info_violations': - _.extend(params, { resolved: 'false', severities: 'INFO' }); - break; - case 'open_issues': - _.extend(params, { resolved: 'false', statuses: 'OPEN' }); - break; - case 'reopened_issues': - _.extend(params, { resolved: 'false', statuses: 'REOPENED' }); - break; - case 'confirmed_issues': - _.extend(params, { resolved: 'false', statuses: 'CONFIRMED' }); - break; - case 'false_positive_issues': - _.extend(params, { resolutions: 'FALSE-POSITIVE' }); - break; - default: - _.extend(params, { resolved: 'false' }); - } - return params; - }, - - renderIssuesLink() { - return ( - - {this.props.children} - - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/gate-link.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/gate-link.jsx deleted file mode 100644 index 7a5e63d9e15..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/helpers/gate-link.jsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; - -export default React.createClass({ - render() { - const url = `${baseUrl}/quality_gates/show/${this.props.gate}`; - return {this.props.children}; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/issues-link.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/issues-link.jsx deleted file mode 100644 index 365bee7d643..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/helpers/issues-link.jsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -export default React.createClass({ - render() { - const params = Object.keys(this.props.params).map((key) => { - return `${key}=${encodeURIComponent(this.props.params[key])}`; - }).join('|'), - url = `${baseUrl}/component_issues/index?id=${encodeURIComponent(this.props.component)}#${params}`; - return {this.props.children}; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/measure-variation.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/measure-variation.jsx deleted file mode 100644 index 8c84737524e..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/helpers/measure-variation.jsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -export default React.createClass({ - render() { - if (this.props.value == null || isNaN(this.props.value)) { - return null; - } - const formatted = window.formatMeasureVariation(this.props.value, this.props.type); - return {formatted}; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/measure.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/measure.jsx deleted file mode 100644 index 078e1257dbb..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/helpers/measure.jsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -export default React.createClass({ - render() { - if (this.props.value == null || isNaN(this.props.value)) { - return null; - } - const formatted = window.formatMeasure(this.props.value, this.props.type); - return {formatted}; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/period-label.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/period-label.jsx deleted file mode 100644 index 996ea01f96b..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/helpers/period-label.jsx +++ /dev/null @@ -1,15 +0,0 @@ -export let periodLabel = (periods, periodIndex) => { - let period = _.findWhere(periods, { index: periodIndex }); - if (!period) { - return null; - } - return window.tp(`overview.period.${period.mode}`, period.modeParam); -}; - -export let getPeriodDate = (periods, periodIndex) => { - let period = _.findWhere(periods, { index: periodIndex }); - if (!period) { - return null; - } - return moment(period.date).toDate(); -}; diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/profile-link.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/profile-link.jsx deleted file mode 100644 index 3d22d8f4c3d..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/helpers/profile-link.jsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; - -export default React.createClass({ - render() { - const url = `${baseUrl}/profiles/show?key=${encodeURIComponent(this.props.profile)}`; - return {this.props.children}; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/rating.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/rating.jsx deleted file mode 100644 index 9b37f948908..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/helpers/rating.jsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -export default React.createClass({ - render() { - if (this.props.value == null || isNaN(this.props.value)) { - return null; - } - const formatted = window.formatMeasure(this.props.value, 'RATING'); - const className = 'rating rating-' + formatted; - return {formatted}; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/leak-coverage.jsx b/server/sonar-web/src/main/js/apps/overview/leak-coverage.jsx deleted file mode 100644 index 6106e8732db..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/leak-coverage.jsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import Card from './card'; -import Measure from './helpers/measure'; -import MeasureVariation from './helpers/measure-variation'; -import DrilldownLink from './helpers/drilldown-link'; -import Donut from './helpers/donut'; - -export default React.createClass({ - render() { - const - newCoverage = parseInt(this.props.leak.newCoverage, 10), - tests = this.props.leak.tests, - donutData = [ - { value: newCoverage, fill: '#85bb43' }, - { value: 100 - newCoverage, fill: '#d4333f' } - ]; - - if (newCoverage == null || isNaN(newCoverage)) { - return null; - } - - return ( - -
    -
    - -
    -
    - - - - - - {window.t('overview.metric.new_coverage')} -
    -
    -
      -
    • -   - {window.t('overview.metric.tests')} -
    • -
    -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/leak-dups.jsx b/server/sonar-web/src/main/js/apps/overview/leak-dups.jsx deleted file mode 100644 index 80ff5441d27..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/leak-dups.jsx +++ /dev/null @@ -1,43 +0,0 @@ -import React from 'react'; -import Card from './card'; -import MeasureVariation from './helpers/measure-variation'; -import DrilldownLink from './helpers/drilldown-link'; -import Donut from './helpers/donut'; - -export default React.createClass({ - render() { - const - density = this.props.leak.duplications, - lines = this.props.leak.duplicatedLines, - donutData = [ - { value: density, fill: '#f3ca8e' }, - { value: 100 - density, fill: '#e6e6e6' } - ]; - - if (density == null) { - return null; - } - - return ( - -
    -
    - -
    -
    - - - - {window.t('overview.metric.duplications')} -
    -
    -
      -
    • -   - {window.t('overview.metric.duplicated_lines')} -
    • -
    -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/leak-issues.jsx b/server/sonar-web/src/main/js/apps/overview/leak-issues.jsx deleted file mode 100644 index 558eb8e95bc..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/leak-issues.jsx +++ /dev/null @@ -1,70 +0,0 @@ -import React from 'react'; -import Card from './card'; -import Measure from './helpers/measure'; -import MeasureVariation from './helpers/measure-variation'; -import IssuesLink from './helpers/issues-link'; -import DrilldownLink from './helpers/drilldown-link'; -import SeverityIcon from 'components/shared/severity-icon'; -import StatusIcon from 'components/shared/status-icon'; -import SeverityHelper from 'components/shared/severity-helper'; -import {getPeriodDate} from './helpers/period-label'; - -export default React.createClass({ - render() { - const - newDebt = this.props.leak.newDebt, - issues = this.props.leak.newIssues, - blockerIssues = this.props.leak.newBlockerIssues, - criticalIssues = this.props.leak.newCriticalIssues, - issuesToReview = this.props.leak.newOpenIssues + this.props.leak.newReopenedIssues, - periodDate = moment(getPeriodDate(this.props.component.periods, '3')).format('YYYY-MM-DDTHH:mm:ssZZ'); - - return ( - -
    -
    - - - - - - {window.t('overview.metric.new_debt')} -
    -
    - - - - - - {window.t('overview.metric.new_issues')} -
    -
    -
      -
    • -   - - - -
    • -
    • -   - - - -
    • -
    • -   - - - -
    • -
    -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/leak-size.jsx b/server/sonar-web/src/main/js/apps/overview/leak-size.jsx deleted file mode 100644 index 80cecebd141..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/leak-size.jsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react'; -import Card from './card'; -import MeasureVariation from './helpers/measure-variation'; -import DrilldownLink from './helpers/drilldown-link'; - -export default React.createClass({ - render() { - const - lines = this.props.leak.lines, - files = this.props.leak.files; - - return ( - -
    -
    - - - - {window.t('overview.metric.lines')} -
    -
    - - - - {window.t('overview.metric.files')} -
    -
    -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/leak.jsx b/server/sonar-web/src/main/js/apps/overview/leak.jsx deleted file mode 100644 index 06dc5501a59..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/leak.jsx +++ /dev/null @@ -1,32 +0,0 @@ -import React from 'react'; -import Cards from './cards'; -import LeakIssues from './leak-issues'; -import LeakCoverage from './leak-coverage'; -import LeakSize from './leak-size'; -import LeakDups from './leak-dups'; -import {periodLabel} from './helpers/period-label'; - -export default React.createClass({ - render() { - if (_.size(this.props.component.periods) < 3) { - return null; - } - - const period = periodLabel(this.props.component.periods, '3'); - - return ( -
    -
    - {window.t('overview.water_leak')} - {period} -
    - - - - - - -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/main.jsx b/server/sonar-web/src/main/js/apps/overview/main.jsx deleted file mode 100644 index 5a9408f0821..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/main.jsx +++ /dev/null @@ -1,101 +0,0 @@ -import React from 'react'; -import Gate from './gate'; -import Leak from './leak'; -import Nutshell from './nutshell'; -import Meta from './meta'; -import {getPeriodDate} from './helpers/period-label'; - -const $ = jQuery; - -export default React.createClass({ - getInitialState() { - return { leak: this.props.leak, measures: this.props.measures }; - }, - - componentDidMount() { - if (this._hasWaterLeak()) { - this.requestLeakIssues(); - this.requestLeakDebt(); - } - this.requestNutshellIssues(); - this.requestNutshellDebt(); - }, - - _hasWaterLeak() { - return !!_.findWhere(this.props.component.periods, { index: '3' }); - }, - - _requestIssues(data) { - const url = `${baseUrl}/api/issues/search`; - data.ps = 1; - data.componentUuids = this.props.component.id; - return $.get(url, data); - }, - - requestLeakIssues() { - const createdAfter = moment(getPeriodDate(this.props.component.periods, '3')).format('YYYY-MM-DDTHH:mm:ssZZ'); - this._requestIssues({ resolved: 'false', createdAfter, facets: 'severities,statuses' }).done(r => { - const - severitiesFacet = _.findWhere(r.facets, { property: 'severities' }).values, - statusesFacet = _.findWhere(r.facets, { property: 'statuses' }).values; - - this.setState({ - leak: _.extend({}, this.state.leak, { - newIssues: r.total, - newBlockerIssues: _.findWhere(severitiesFacet, { val: 'BLOCKER' }).count, - newCriticalIssues: _.findWhere(severitiesFacet, { val: 'CRITICAL' }).count, - newOpenIssues: _.findWhere(statusesFacet, { val: 'OPEN' }).count, - newReopenedIssues: _.findWhere(statusesFacet, { val: 'REOPENED' }).count - }) - }); - }); - }, - - requestNutshellIssues() { - this._requestIssues({ resolved: 'false', facets: 'severities,statuses' }).done(r => { - const - severitiesFacet = _.findWhere(r.facets, { property: 'severities' }).values, - statusesFacet = _.findWhere(r.facets, { property: 'statuses' }).values; - - this.setState({ - measures: _.extend({}, this.state.measures, { - issues: r.total, - blockerIssues: _.findWhere(severitiesFacet, { val: 'BLOCKER' }).count, - criticalIssues: _.findWhere(severitiesFacet, { val: 'CRITICAL' }).count, - openIssues: _.findWhere(statusesFacet, { val: 'OPEN' }).count, - reopenedIssues: _.findWhere(statusesFacet, { val: 'REOPENED' }).count - }) - }); - }); - }, - - requestLeakDebt() { - const createdAfter = moment(getPeriodDate(this.props.component.periods, '3')).format('YYYY-MM-DDTHH:mm:ssZZ'); - this._requestIssues({ resolved: 'false', createdAfter, facets: 'severities', facetMode: 'debt' }).done(r => { - this.setState({ - leak: _.extend({}, this.state.leak, { newDebt: r.debtTotal }) - }); - }); - }, - - requestNutshellDebt() { - this._requestIssues({ resolved: 'false', facets: 'severities', facetMode: 'debt' }).done(r => { - this.setState({ - measures: _.extend({}, this.state.measures, { debt: r.debtTotal }) - }); - }); - }, - - render() { - return ( -
    -
    - - - -
    - -
    - ); - } -}) diff --git a/server/sonar-web/src/main/js/apps/overview/meta.jsx b/server/sonar-web/src/main/js/apps/overview/meta.jsx deleted file mode 100644 index 8951b60453c..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/meta.jsx +++ /dev/null @@ -1,67 +0,0 @@ -import React from 'react'; -import ProfileLink from './helpers/profile-link'; -import GateLink from './helpers/gate-link'; - -export default React.createClass({ - render() { - const - profiles = (this.props.component.profiles || []).map(profile => { - return ( -
  • - ({profile.language}) - {profile.name} -
  • - ); - }), - links = (this.props.component.links || []).map(link => { - const iconClassName = `little-spacer-right icon-color-link icon-${link.type}`; - return ( -
  • - - {link.name} -
  • - ); - }); - - const descriptionCard = this.props.component.description ? ( -
    -
    {this.props.component.description}
    -
    - ) : null, - - linksCard = _.size(this.props.component.links) > 0 ? ( -
    -
      {links}
    -
    - ) : null, - - profilesCard = _.size(this.props.component.profiles) > 0 ? ( -
    -

    {window.t('overview.quality_profiles')}

    -
      {profiles}
    -
    - ) : null, - - gateCard = this.props.component.gate ? ( -
    -

    {window.t('overview.quality_gate')}

    -
      -
    • - {this.props.component.gate.isDefault ? - (Default) : null} - {this.props.component.gate.name} -
    • -
    -
    - ) : null; - - return ( -
    - {descriptionCard} - {linksCard} - {profilesCard} - {gateCard} -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/nutshell-coverage.jsx b/server/sonar-web/src/main/js/apps/overview/nutshell-coverage.jsx deleted file mode 100644 index 763353983cb..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/nutshell-coverage.jsx +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react'; -import Card from './card'; -import Measure from './helpers/measure'; -import DrilldownLink from './helpers/drilldown-link'; -import Donut from './helpers/donut'; - -export default React.createClass({ - render() { - const - coverage = this.props.measures.coverage, - tests = this.props.measures.tests, - donutData = [ - { value: coverage, fill: '#85bb43' }, - { value: 100 - coverage, fill: '#d4333f' } - ]; - - if (coverage == null) { - return null; - } - - return ( - -
    -
    - -
    -
    - - - - - - {window.t('overview.metric.coverage')} -
    -
    -
      -
    • - - -   - {window.t('overview.metric.tests')} -
    • -
    -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/nutshell-dups.jsx b/server/sonar-web/src/main/js/apps/overview/nutshell-dups.jsx deleted file mode 100644 index 827dc45ae5e..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/nutshell-dups.jsx +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react'; -import Card from './card'; -import Measure from './helpers/measure'; -import DrilldownLink from './helpers/drilldown-link'; -import Donut from './helpers/donut'; - -export default React.createClass({ - render() { - const - density = this.props.measures.duplications, - lines = this.props.measures.duplicatedLines, - donutData = [ - { value: density, fill: '#f3ca8e' }, - { value: 100 - density, fill: '#e6e6e6' } - ]; - - if (density == null) { - return null; - } - - return ( - -
    -
    - -
    -
    - - - - - - {window.t('overview.metric.duplications')} -
    -
    -
      -
    • - - -   - {window.t('overview.metric.duplicated_lines')} -
    • -
    -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/nutshell-issues.jsx b/server/sonar-web/src/main/js/apps/overview/nutshell-issues.jsx deleted file mode 100644 index d61332cbb01..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/nutshell-issues.jsx +++ /dev/null @@ -1,69 +0,0 @@ -import React from 'react'; -import Card from './card'; -import Measure from './helpers/measure'; -import Rating from './helpers/rating'; -import IssuesLink from './helpers/issues-link'; -import DrilldownLink from './helpers/drilldown-link'; -import SeverityIcon from 'components/shared/severity-icon'; -import SeverityHelper from 'components/shared/severity-helper'; -import StatusIcon from 'components/shared/status-icon'; - -export default React.createClass({ - render() { - const - debt = this.props.measures.debt, - rating = this.props.measures.sqaleRating, - issues = this.props.measures.issues, - blockerIssues = this.props.measures.blockerIssues, - criticalIssues = this.props.measures.criticalIssues, - issuesToReview = this.props.measures.openIssues + this.props.measures.reopenedIssues; - - return ( - -
    -
    - - - -
    -
    - - - - - - {window.t('overview.metric.debt')} -
    -
    - - - - - - {window.t('overview.metric.issues')} -
    -
    -
      -
    • -   - - - -
    • -
    • -   - - - -
    • -
    • -   - - - -
    • -
    -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/nutshell-size.jsx b/server/sonar-web/src/main/js/apps/overview/nutshell-size.jsx deleted file mode 100644 index 366d29c2e7a..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/nutshell-size.jsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import Card from './card'; -import Measure from './helpers/measure'; -import DrilldownLink from './helpers/drilldown-link'; - -export default React.createClass({ - render() { - const - lines = this.props.measures['lines'], - files = this.props.measures['files']; - - return ( - -
    -
    - - - - - - {window.t('overview.metric.lines')} -
    -
    - - - - - - {window.t('overview.metric.files')} -
    -
    -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/nutshell.jsx b/server/sonar-web/src/main/js/apps/overview/nutshell.jsx deleted file mode 100644 index d645bfaf52e..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/nutshell.jsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import Cards from './cards'; -import NutshellIssues from './nutshell-issues'; -import NutshellCoverage from './nutshell-coverage'; -import NutshellSize from './nutshell-size'; -import NutshellDups from './nutshell-dups'; - -export default React.createClass({ - render() { - const props = { measures: this.props.measures, component: this.props.component }; - return ( -
    -
    {window.t('overview.project_in_a_nutshell')}
    - - - - - - -
    - ); - } -}); diff --git a/server/sonar-web/src/main/js/components/common/handlebars-extensions.js b/server/sonar-web/src/main/js/components/common/handlebars-extensions.js index 6e5d8e03a74..bddf43df1f6 100644 --- a/server/sonar-web/src/main/js/components/common/handlebars-extensions.js +++ b/server/sonar-web/src/main/js/components/common/handlebars-extensions.js @@ -33,10 +33,6 @@ return baseUrl + '/dashboard/index?id=' + encodeURIComponent(componentKey); }); - Handlebars.registerHelper('componentOverviewPermalink', function (componentKey) { - return baseUrl + '/overview/index?id=' + encodeURIComponent(componentKey); - }); - Handlebars.registerHelper('componentDashboardPermalink', function (componentKey, dashboardKey) { var params = [ { key: 'id', value: componentKey }, diff --git a/server/sonar-web/src/main/js/helpers/Url.jsx b/server/sonar-web/src/main/js/helpers/Url.jsx index e88ddb55808..7fa21b44f0f 100644 --- a/server/sonar-web/src/main/js/helpers/Url.jsx +++ b/server/sonar-web/src/main/js/helpers/Url.jsx @@ -2,5 +2,5 @@ export function getProjectUrl(project) { if (typeof project !== 'string') { throw new TypeError("Project ID or KEY should be passed"); } - return `${window.baseUrl}/overview?id=${encodeURIComponent(project)}`; + return `${window.baseUrl}/dashboard?id=${encodeURIComponent(project)}`; } diff --git a/server/sonar-web/src/main/less/pages.less b/server/sonar-web/src/main/less/pages.less index b0e1b6ce99a..91623b3d1f3 100644 --- a/server/sonar-web/src/main/less/pages.less +++ b/server/sonar-web/src/main/less/pages.less @@ -7,4 +7,3 @@ @import "pages/quality-gates"; @import "pages/maintenance"; @import "pages/login"; -@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 e4ec6a5bb44..00000000000 --- a/server/sonar-web/src/main/less/pages/overview.less +++ /dev/null @@ -1,190 +0,0 @@ -@import (reference) "../variables"; -@import (reference) "../mixins"; -@import (reference) "../init/type"; - -.overview { - display: table; - width: 100%; - min-height: ~"calc(100vh - @{navbarGlobalHeight} - @{navbarContextHeight} - @{pageFooterHeight})"; -} - -.overview-main { - display: table-cell; - vertical-align: top; - .box-sizing(border-box); - background-color: #fff; -} - -.overview-gate { - .clearfix; - padding: 50px 30px; -} - -.overview-gate-box { - float: left; - .size(120px, 70px); - padding: 10px; - .box-sizing(border-box); - line-height: 24px; - color: #fff; - font-size: 16px; - font-weight: 300; -} - -.overview-gate-box-error { background-color: @red; } - -.overview-gate-box-warn { background-color: @orange; } - -.overview-gate-box-ok { background-color: @green; } - -.overview-gate-conditions { - line-height: 70px; - font-size: 0; - white-space: nowrap; - overflow: hidden; - - & > li { - display: inline-block; - vertical-align: middle; - padding: 0 20px; - .box-sizing(border-box); - font-size: @baseFontSize; - line-height: 1; - } -} - -.overview-gate-condition-metric { - //color: mix(@baseFontColor, @barBackgroundColor, 70%); - font-weight: 300; - font-size: 15px; - //letter-spacing: 0.03em; -} - -.overview-gate-condition-value { - margin-top: 8px; - font-weight: 300; - font-size: 20px; - - i { - position: relative; - top: -1px; - } -} - -.overview-gate-condition-itself { - padding-left: 4px; - color: mix(@baseFontColor, @barBackgroundColor, 70%); - font-size: 13px; -} - -.overview-gate-condition-level { - margin-top: 8px; -} - -.overview-leak { - padding: 50px 30px; - border-top: 1px solid @barBorderColor; - border-bottom: 1px solid @barBorderColor; -} - -.overview-title { - margin-bottom: 20px; - font-size: 24px; - font-weight: 300; - - & > .badge { - position: relative; - top: -2px; - margin-left: 15px; - padding: 8px 15px; - font-size: 16px; - } -} - -.overview-leak-period { - margin-left: 10px; - font-size: 16px; -} - -.overview-nutshell { - padding: 50px 30px; -} - -.overview-cards { -} - -.overview-card { - display: inline-block; - vertical-align: top; - width: 200px; - margin-right: 30px; - .box-sizing(border-box); - - &:last-child { margin-right: 0; } - - .overview-main & { - font-weight: 300; - font-size: 14px; - } -} - -.overview-measure { - font-size: 28px; -} - -.overview-measure-label { - font-size: 16px; -} - -.overview-meta { - display: table-cell; - vertical-align: top; - width: 180px; - padding: 30px; - border-left: 1px solid @barBorderColor; - background-color: @barBackgroundColor; - - .panel { - border: none !important; - } -} - -.overview-meta-description { - line-height: 1.5; -} - -.overview-meta-header { - color: #797979; -} - -.overview-meta-list { - & > li { - padding-bottom: 4px; - .text-ellipsis; - } -} - -@media (max-width: 1200px) { - .overview { - display: block; - } - - .overview-main { - display: block; - } - - .overview-meta { - display: block; - width: auto; - border-top: 1px solid @barBorderColor; - border-left: none; - } -} - -@media (min-width: 1201px) { - .overview-meta .overview-card { - width: 180px; - margin-right: 0; - margin-bottom: 30px; - } -} 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 9c084dea979..7c6fdc34a30 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 @@ -17,8 +17,6 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -include ERB::Util - class DashboardController < ApplicationController SECTION=Navigation::SECTION_RESOURCE @@ -27,24 +25,20 @@ class DashboardController < ApplicationController def index load_resource() - if @resource && @resource.display_dashboard? && !params[:did] && !params[:name] - overview_url = url_for({:controller => 'overview', :action => :index}) + '?id=' + url_encode(@resource.key) - return redirect_to overview_url - end - if !@resource || @resource.display_dashboard? - redirect_if_bad_component() - load_dashboard() - load_authorized_widget_definitions() - else - if !@resource || !@snapshot + if !@resource || @resource.display_dashboard? redirect_if_bad_component() + load_dashboard() + load_authorized_widget_definitions() else - # display the layout of the parent without the sidebar, usually the directory, but display the file viewers - @hide_sidebar = true - @file = @resource - @project = @snapshot.parent.project - @metric=params[:metric] - render :action => 'no_dashboard' + if !@resource || !@snapshot + redirect_if_bad_component() + else + # display the layout of the parent without the sidebar, usually the directory, but display the file viewers + @hide_sidebar = true + @file = @resource + @project = @snapshot.parent.project + @metric=params[:metric] + render :action => 'no_dashboard' end end end 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 746bc651be8..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb +++ /dev/null @@ -1,29 +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 - - 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 f95b57d8e3e..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb +++ /dev/null @@ -1,177 +0,0 @@ -<% - links_size = @resource.project_links.size - - profiles = [] - if @snapshot - qprofiles_measure = @snapshot.measure(Metric::QUALITY_PROFILES) - if qprofiles_measure && !qprofiles_measure.data.blank? - profiles = JSON.parse qprofiles_measure.data - end - end - profiles_size = profiles.size - - is_gate_default = false - gate = nil - gate_id = Property.value('sonar.qualitygate', @resource && @resource.id, nil) - unless gate_id - gate_id=Property.value('sonar.qualitygate', nil, nil) - is_gate_default = false || gate_id - end - if gate_id - gate = Internal.quality_gates.get(gate_id.to_i) - end -%> - -<% - if @snapshot - m = @snapshot.measure(Metric::QUALITY_GATE_DETAILS) - if m && !m.data.blank? - details = JSON.parse m.data - m.alert_status = details['level'] - raw_conditions = details['conditions'] - conditions = [] - missing_metric = false - raw_conditions.each do |condition| - if metric(condition['metric']).nil? - missing_metric = true - else - conditions << condition - end - end - alert_metric = metric(Metric::ALERT_STATUS) - end - end -%> - -<% content_for :extra_script do %> - -<% end %> 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 8590692e193..7ad9f19649f 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -3032,35 +3032,3 @@ update_center.status.COMPATIBLE=Compatible update_center.status.INCOMPATIBLE=Incompatible update_center.status.REQUIRES_SYSTEM_UPGRADE=Requires system update update_center.status.DEPS_REQUIRE_SYSTEM_UPGRADE=Some of dependencies requires system update - - - -#------------------------------------------------------------------------------ -# -# OVERVIEW -# -#------------------------------------------------------------------------------ -overview.quality_gate=Quality Gate -overview.quality_profiles=Quality Profiles -overview.water_leak=Water Leak -overview.project_in_a_nutshell=Project In a Nutshell - -overview.metric.new_coverage=New Coverage -overview.metric.tests=tests -overview.metric.duplications=Duplications -overview.metric.duplicated_lines=lines -overview.metric.debt=Debt -overview.metric.issues=Issues -overview.metric.new_debt=New Debt -overview.metric.new_issues=New Issues -overview.metric.lines=Lines -overview.metric.files=Files -overview.metric.coverage=Coverage - -overview.period.previous_version=since {0} -overview.period.previous_analysis=since previous analysis -overview.period.days=last {0} days - -overview.gate.ERROR=Failed -overview.gate.WARN=Warning -overview.gate.OK=Passed -- 2.39.5