From 9b6396391e23445b49540115bffa47ca473536ca Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 18 Apr 2016 15:02:56 +0200 Subject: [PATCH] SONAR-7446 Replace usage of facetMode 'debt' by 'effort' in Issues page --- server/sonar-web/src/main/js/api/issues.js | 2 +- .../apps/issues/templates/facets/issues-mode-facet.hbs | 6 +++--- .../src/main/js/apps/overview/main/code-smells.js | 4 ++-- .../src/main/js/helpers/handlebars/formatFacetValue.js | 2 +- .../main/js/helpers/handlebars/issueFilterItemLink.js | 4 ++-- .../main/js/helpers/handlebars/issueFilterTotalLink.js | 4 ++-- .../src/main/js/helpers/handlebars/issueFilterValue.js | 2 +- .../src/main/js/widgets/issue-filter/widget.js | 10 +++++----- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/server/sonar-web/src/main/js/api/issues.js b/server/sonar-web/src/main/js/api/issues.js index d4b6b4932bf..86ea25a9b30 100644 --- a/server/sonar-web/src/main/js/api/issues.js +++ b/server/sonar-web/src/main/js/api/issues.js @@ -56,7 +56,7 @@ export function getAssignees (query) { export function getIssuesCount (query) { const url = window.baseUrl + '/api/issues/search'; - const data = _.extend({}, query, { ps: 1, facetMode: 'debt' }); + const data = _.extend({}, query, { ps: 1, facetMode: 'effort' }); return getJSON(url, data).then(r => { return { issues: r.total, debt: r.debtTotal }; }); diff --git a/server/sonar-web/src/main/js/apps/issues/templates/facets/issues-mode-facet.hbs b/server/sonar-web/src/main/js/apps/issues/templates/facets/issues-mode-facet.hbs index 6e8ec1de40f..bfbce223cf7 100644 --- a/server/sonar-web/src/main/js/apps/issues/templates/facets/issues-mode-facet.hbs +++ b/server/sonar-web/src/main/js/apps/issues/templates/facets/issues-mode-facet.hbs @@ -6,9 +6,9 @@
  • - - + +
  • diff --git a/server/sonar-web/src/main/js/apps/overview/main/code-smells.js b/server/sonar-web/src/main/js/apps/overview/main/code-smells.js index d731a4c84d8..cc7cba65253 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/code-smells.js +++ b/server/sonar-web/src/main/js/apps/overview/main/code-smells.js @@ -71,7 +71,7 @@ export const CodeSmells = React.createClass({ + params={{ resolved: 'false', types: 'CODE_SMELL', facetMode: 'effort', sinceLeakPeriod: 'true' }}> @@ -131,7 +131,7 @@ export const CodeSmells = React.createClass({ + params={{ resolved: 'false', types: 'CODE_SMELL', facetMode: 'effort' }}> diff --git a/server/sonar-web/src/main/js/helpers/handlebars/formatFacetValue.js b/server/sonar-web/src/main/js/helpers/handlebars/formatFacetValue.js index 366f77c6678..5764325afc4 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/formatFacetValue.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/formatFacetValue.js @@ -20,7 +20,7 @@ import { formatMeasure } from '../measures'; module.exports = function (value, facetMode) { - const formatter = facetMode === 'debt' ? 'SHORT_WORK_DUR' : 'SHORT_INT'; + const formatter = facetMode === 'effort' ? 'SHORT_WORK_DUR' : 'SHORT_INT'; return formatMeasure(value, formatter); }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/issueFilterItemLink.js b/server/sonar-web/src/main/js/helpers/handlebars/issueFilterItemLink.js index 92c18bcc5ca..10b926d86a2 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/issueFilterItemLink.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/issueFilterItemLink.js @@ -32,8 +32,8 @@ module.exports = function (query, property, value, mode) { const criterion = {}; criterion[property] = value; const r = _.extend({}, query, criterion); - if (mode === 'debt') { - r.facetMode = 'debt'; + if (mode === 'effort') { + r.facetMode = 'effort'; } if (r.componentKey != null) { return window.baseUrl + '/component_issues/index?id=' + encodeURIComponent(r.componentKey) + diff --git a/server/sonar-web/src/main/js/helpers/handlebars/issueFilterTotalLink.js b/server/sonar-web/src/main/js/helpers/handlebars/issueFilterTotalLink.js index c5212c6fcfb..96e6863eefc 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/issueFilterTotalLink.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/issueFilterTotalLink.js @@ -30,8 +30,8 @@ function getQuery (query, separator) { module.exports = function (query, mode) { const r = _.extend({}, query); - if (mode === 'debt') { - r.facetMode = 'debt'; + if (mode === 'effort') { + r.facetMode = 'effort'; } if (r.componentKey != null) { return window.baseUrl + '/component_issues/index?id=' + encodeURIComponent(r.componentKey) + diff --git a/server/sonar-web/src/main/js/helpers/handlebars/issueFilterValue.js b/server/sonar-web/src/main/js/helpers/handlebars/issueFilterValue.js index dc5ea72598e..9d1dbab3dc4 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/issueFilterValue.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/issueFilterValue.js @@ -20,6 +20,6 @@ import { formatMeasure } from '../measures'; module.exports = function (value, mode) { - const formatter = mode === 'debt' ? 'SHORT_WORK_DUR' : 'SHORT_INT'; + const formatter = mode === 'effort' ? 'SHORT_WORK_DUR' : 'SHORT_INT'; return formatMeasure(value, formatter); }; diff --git a/server/sonar-web/src/main/js/widgets/issue-filter/widget.js b/server/sonar-web/src/main/js/widgets/issue-filter/widget.js index 64c5d09fbe4..da6b2f1ca77 100644 --- a/server/sonar-web/src/main/js/widgets/issue-filter/widget.js +++ b/server/sonar-web/src/main/js/widgets/issue-filter/widget.js @@ -51,8 +51,8 @@ const defaultLink = function (item, property, query, index, items, mode) { const criterion = {}; criterion[property] = item.val; const r = _.extend({}, query, criterion); - if (mode === 'debt') { - r.facetMode = 'debt'; + if (mode === 'effort') { + r.facetMode = 'effort'; } if (r.componentKey != null) { return window.baseUrl + '/component_issues/index?id=' + encodeURIComponent(r.componentKey) + @@ -176,8 +176,8 @@ const byDistributionConf = { createdAfter: createdAfter.format('YYYY-MM-DD'), createdBefore: createdBefore.format('YYYY-MM-DD') }); - if (mode === 'debt') { - r.facetMode = 'debt'; + if (mode === 'effort') { + r.facetMode = 'effort'; } if (r.componentKey != null) { return window.baseUrl + '/component_issues/index?id=' + encodeURIComponent(r.componentKey) + @@ -306,7 +306,7 @@ export default Marionette.ItemView.extend({ items, maxResultsReached: items.length >= FACET_LIMIT, maxResults: items.length, - total: facetMode === 'debt' ? r.debtTotal : r.total + total: facetMode === 'effort' ? r.debtTotal : r.total }); } }); -- 2.39.5