From: Jean-Baptiste Lievremont Date: Fri, 11 Apr 2014 11:28:22 +0000 (+0200) Subject: SONAR-5084 Add a Resolved option (alonside Unresolved) for the Resolution field in... X-Git-Tag: 4.3~43 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d251cdd677a72845a4c3beaf8ee9eefd1e8ca47f;p=sonarqube.git SONAR-5084 Add a Resolved option (alonside Unresolved) for the Resolution field in issues page --- diff --git a/sonar-server/src/main/js/issues/app.js b/sonar-server/src/main/js/issues/app.js index ee5b8fba605..35a930b2617 100644 --- a/sonar-server/src/main/js/issues/app.js +++ b/sonar-server/src/main/js/issues/app.js @@ -174,7 +174,8 @@ requirejs( enabled: true, optional: false, choices: { - '!resolved': window.SS.phrases.resolutions.UNRESOLVED, + '!resolved=true': window.SS.phrases.resolutions.RESOLVED, + '!resolved=false': window.SS.phrases.resolutions.UNRESOLVED, 'FALSE-POSITIVE': window.SS.phrases.resolutions['FALSE-POSITIVE'], 'FIXED': window.SS.phrases.resolutions.FIXED, 'REMOVED': window.SS.phrases.resolutions.REMOVED diff --git a/sonar-server/src/main/js/navigator/filters/choice-filters.js b/sonar-server/src/main/js/navigator/filters/choice-filters.js index ecc8ba6f4e9..ababc20d875 100644 --- a/sonar-server/src/main/js/navigator/filters/choice-filters.js +++ b/sonar-server/src/main/js/navigator/filters/choice-filters.js @@ -52,9 +52,7 @@ define(['handlebars', 'navigator/filters/base-filters', 'common/handlebars-exten if (this.model.get('multiple')) { if (checkbox.closest('.opposite').length > 0) { - this.options.filterView.choices.reject(function(item) { - return item.get('id')[0] === '!' - }).forEach(function(item) { + this.options.filterView.choices.each(function(item) { item.set('checked', false); }); } else { @@ -268,6 +266,11 @@ define(['handlebars', 'navigator/filters/base-filters', 'common/handlebars-exten this.choices.forEach(function(item) { if (item.get('id')[0] === '!') { var x = _.findWhere(q, { key: item.get('id').substr(1) }); + if (item.get('id').indexOf('=') >= 0) { + var key = item.get('id').split('=')[0].substr(1); + var value = item.get('id').split('=')[1]; + x = _.findWhere(q, { key: key, value: value }); + } if (x) { if (!param) { param = { value: item.get('id') }; @@ -339,7 +342,12 @@ define(['handlebars', 'navigator/filters/base-filters', 'common/handlebars-exten }); if (opposite.length > 0) { opposite.forEach(function(item) { - q[item.substr(1)] = false; + if (item.indexOf('=') >= 0) { + var paramValue = item.split('='); + q[paramValue[0].substr(1)] = paramValue[1]; + } else { + q[item.substr(1)] = false; + } }); } else { q[this.model.get('property')] = this.model.get('value').join(','); diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb index 0962c0f660d..f4447319d49 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb @@ -96,6 +96,7 @@ assignee: '<%= escape_javascript message('issue_filter.criteria.assignee') -%>', resolution: '<%= escape_javascript message('issue_filter.criteria.resolution') -%>', resolutions: { + 'RESOLVED': '<%= escape_javascript message('issue.status.RESOLVED') -%>', 'UNRESOLVED': '<%= escape_javascript message('unresolved') -%>', 'FALSE-POSITIVE': '<%= escape_javascript message('issue.resolution.FALSE-POSITIVE') -%>', 'FIXED': '<%= escape_javascript message('issue.resolution.FIXED') -%>',