]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5084 Add a Resolved option (alonside Unresolved) for the Resolution field in...
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 11 Apr 2014 11:28:22 +0000 (13:28 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 11 Apr 2014 11:28:28 +0000 (13:28 +0200)
sonar-server/src/main/js/issues/app.js
sonar-server/src/main/js/navigator/filters/choice-filters.js
sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb

index ee5b8fba605abcf933de0a8fada7200c0bc276ae..35a930b2617d6157af5a3c1041e9e3c57ebb8b9c 100644 (file)
@@ -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
index ecc8ba6f4e92e875b265f15fa09740034f531e2c..ababc20d875970da144d81d827ac21493fb20136 100644 (file)
@@ -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(',');
index 0962c0f660dcae61ea471b6705f00c45c43a41aa..f4447319d492860f1402ea23d356c64a1c2c9afa 100644 (file)
@@ -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') -%>',