Skip to content

Commit a68e4fc

Browse files
authored
Merge pull request #15 from RallyCommunity/timebox_filter_support
Add timebox filter support
2 parents 237e285 + dc1da13 commit a68e4fc

File tree

4 files changed

+41
-19
lines changed

4 files changed

+41
-19
lines changed

deploy/App.txt

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<head>
44
<title>Custom Grid with Deep Export</title>
55
<!-- (c) 2015 Rally Software Development Corp. All Rights Reserved. -->
6-
<!-- Build Date: Fri May 18 2018 10:21:38 GMT-0600 (MDT) -->
6+
<!-- Build Date: Wed Aug 15 2018 12:11:02 GMT-0600 (MDT) -->
77

88
<script type="text/javascript">
9-
var APP_BUILD_DATE = "Fri May 18 2018 10:21:38 GMT-0600 (MDT)";
10-
var CHECKSUM = 34251012870;
9+
var APP_BUILD_DATE = "Wed Aug 15 2018 12:11:02 GMT-0600 (MDT)";
10+
var CHECKSUM = 35081721478;
1111
</script>
1212

1313
<script type="text/javascript" src="/apps/2.1/sdk.js"></script>
@@ -877,6 +877,11 @@ Ext.define("custom-grid-with-deep-export", {
877877
allowExpansionStateToBeSaved: false,
878878
enableAddNew: true,
879879

880+
onTimeboxScopeChange: function(newTimeboxScope) {
881+
this.callParent(arguments);
882+
this._buildStore();
883+
},
884+
880885
launch: function () {
881886
this.fetchPortfolioItemTypes().then({
882887
success: function(portfolioItemTypes){
@@ -912,7 +917,11 @@ Ext.define("custom-grid-with-deep-export", {
912917
this.down('#display_box').removeAll();
913918
}
914919

915-
var filters = this.getSetting('query') ? Rally.data.wsapi.Filter.fromQueryString(this.getSetting('query')) : [];
920+
var filters = this.getSetting('query') ? [Rally.data.wsapi.Filter.fromQueryString(this.getSetting('query'))] : [];
921+
var timeboxScope = this.getContext().getTimeboxScope();
922+
if (timeboxScope && timeboxScope.isApplicable(store.model)) {
923+
filters.push(timeboxScope.getQueryFilter());
924+
}
916925
this.logger.log('_addGridboard', store);
917926

918927

@@ -1055,12 +1064,14 @@ Ext.define("custom-grid-with-deep-export", {
10551064
if (grid.currentCustomFilter && grid.currentCustomFilter.filters){
10561065
filters = grid.currentCustomFilter.filters;
10571066
}
1058-
if (query){
1059-
if (filters && filters.length > 0){
1060-
return filters.and(filters, Rally.data.wsapi.Filter.fromQueryString(query));
1061-
} else {
1062-
return Rally.data.wsapi.Filter.fromQueryString(query);
1063-
}
1067+
1068+
if (query) {
1069+
filters.push(Rally.data.wsapi.Filter.fromQueryString(query));
1070+
}
1071+
1072+
var timeboxScope = this.getContext().getTimeboxScope();
1073+
if (timeboxScope && timeboxScope.isApplicable(grid.getGridOrBoard().store.model)) {
1074+
filters.push(timeboxScope.getQueryFilter());
10641075
}
10651076
return filters;
10661077
},

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"_comment": "This file is used by grunt",
33
"name": "custom-grid-with-deep-export",
4-
"version": "1.1.2",
4+
"version": "1.1.3",
55
"dependencies": {},
66
"devDependencies": {
77
"grunt": "~0.4.1",

src/javascript/app.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ Ext.define("custom-grid-with-deep-export", {
2929
allowExpansionStateToBeSaved: false,
3030
enableAddNew: true,
3131

32+
onTimeboxScopeChange: function(newTimeboxScope) {
33+
this.callParent(arguments);
34+
this._buildStore();
35+
},
36+
3237
launch: function () {
3338
this.fetchPortfolioItemTypes().then({
3439
success: function(portfolioItemTypes){
@@ -64,7 +69,11 @@ Ext.define("custom-grid-with-deep-export", {
6469
this.down('#display_box').removeAll();
6570
}
6671

67-
var filters = this.getSetting('query') ? Rally.data.wsapi.Filter.fromQueryString(this.getSetting('query')) : [];
72+
var filters = this.getSetting('query') ? [Rally.data.wsapi.Filter.fromQueryString(this.getSetting('query'))] : [];
73+
var timeboxScope = this.getContext().getTimeboxScope();
74+
if (timeboxScope && timeboxScope.isApplicable(store.model)) {
75+
filters.push(timeboxScope.getQueryFilter());
76+
}
6877
this.logger.log('_addGridboard', store);
6978

7079

@@ -207,12 +216,14 @@ Ext.define("custom-grid-with-deep-export", {
207216
if (grid.currentCustomFilter && grid.currentCustomFilter.filters){
208217
filters = grid.currentCustomFilter.filters;
209218
}
210-
if (query){
211-
if (filters && filters.length > 0){
212-
return filters.and(filters, Rally.data.wsapi.Filter.fromQueryString(query));
213-
} else {
214-
return Rally.data.wsapi.Filter.fromQueryString(query);
215-
}
219+
220+
if (query) {
221+
filters.push(Rally.data.wsapi.Filter.fromQueryString(query));
222+
}
223+
224+
var timeboxScope = this.getContext().getTimeboxScope();
225+
if (timeboxScope && timeboxScope.isApplicable(grid.getGridOrBoard().store.model)) {
226+
filters.push(timeboxScope.getQueryFilter());
216227
}
217228
return filters;
218229
},

0 commit comments

Comments
 (0)