diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-03-25 16:10:52 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-03-25 16:10:52 +0100 |
commit | 1ed6c9b4d45b84522c46d781c185bbe21dd42543 (patch) | |
tree | 2e1341cbf23943a31af262b46b6ac193f56a1efe /server/sonar-web/src/main/js/apps/issues/facets | |
parent | 6a1706b702005a66ebed806730bdf50a361e6c1f (diff) | |
download | sonarqube-1ed6c9b4d45b84522c46d781c185bbe21dd42543.tar.gz sonarqube-1ed6c9b4d45b84522c46d781c185bbe21dd42543.zip |
SONAR-6158 On a project Issues page, it should be possible to easily select the Leak period to filter new issues
Diffstat (limited to 'server/sonar-web/src/main/js/apps/issues/facets')
-rw-r--r-- | server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js index f2fdce3cbf5..95f22a4cd71 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js @@ -37,7 +37,8 @@ export default BaseFacet.extend({ 'click .js-all': 'onAllClick', 'click .js-last-week': 'onLastWeekClick', 'click .js-last-month': 'onLastMonthClick', - 'click .js-last-year': 'onLastYearClick' + 'click .js-last-year': 'onLastYearClick', + 'click .js-leak': 'onLeakClick' }); }, @@ -98,6 +99,7 @@ export default BaseFacet.extend({ createdAfter: null, createdBefore: null, createdAt: null, + sinceLeakPeriod: null, createdInLast: null }); }, @@ -109,6 +111,7 @@ export default BaseFacet.extend({ createdAfter: periodStart, createdBefore: periodEnd, createdAt: null, + sinceLeakPeriod: null, createdInLast: null }); }, @@ -118,6 +121,7 @@ export default BaseFacet.extend({ createdAfter: null, createdBefore: null, createdAt: null, + sinceLeakPeriod: null, createdInLast: period }); }, @@ -141,11 +145,26 @@ export default BaseFacet.extend({ return this.selectPeriod('1y'); }, + onLeakClick (e) { + e.preventDefault(); + this.options.app.state.updateFilter({ + createdAfter: null, + createdBefore: null, + createdAt: null, + createdInLast: null, + sinceLeakPeriod: 'true' + }); + }, + serializeData () { + const hasLeak = this.options.app.state.get('contextComponentQualifier') === 'TRK'; + return _.extend(BaseFacet.prototype.serializeData.apply(this, arguments), { + hasLeak, periodStart: this.options.app.state.get('query').createdAfter, periodEnd: this.options.app.state.get('query').createdBefore, createdAt: this.options.app.state.get('query').createdAt, + sinceLeakPeriod: this.options.app.state.get('query').sinceLeakPeriod, createdInLast: this.options.app.state.get('query').createdInLast }); } |