Skip to content

Commit 70f5ceb

Browse files
committed
listens for ancestor filters
1 parent 67022e5 commit 70f5ceb

File tree

5 files changed

+57
-22
lines changed

5 files changed

+57
-22
lines changed

config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"apiKey": "_PUT_APIKEY_HERE_",
66
"javascript": [
77
"node_modules/@agile-central-technical-services/utils-shared-views/index.js",
8+
"node_modules/@agile-central-technical-services/utils-ancestor-pi-app-filter/index.js",
89
"node_modules/@agile-central-technical-services/utils-ancestor-pi-inline-filter/index.js",
910
"src/javascript/utils/*.js",
1011
"src/javascript/*.js"

deploy/Ugly.txt

Lines changed: 6 additions & 5 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "custom-grid-with-deep-export",
3-
"version": "1.2.11",
3+
"version": "1.3.0",
44
"scripts": {
55
"debug": "grunt debug",
66
"debug:watch": "nodemon --exec grunt debug",
@@ -9,6 +9,7 @@
99
"deploy-debugsdk:watch": "nodemon --exec grunt deploy-debugsdk"
1010
},
1111
"dependencies": {
12+
"@agile-central-technical-services/utils-ancestor-pi-app-filter": "^3.0.0",
1213
"@agile-central-technical-services/utils-ancestor-pi-inline-filter": "^1.0.12",
1314
"@agile-central-technical-services/utils-shared-views": "^1.0.2"
1415
},

src/javascript/app.js

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ Ext.define("custom-grid-with-deep-export", {
77
align: 'stretch'
88
},
99
items: [{
10+
id: Utils.AncestorPiAppFilter.RENDER_AREA_ID,
11+
xtype: 'container',
12+
layout: {
13+
type: 'hbox',
14+
align: 'middle',
15+
defaultMargins: '0 10 10 0',
16+
}
17+
}, {
1018
id: 'grid-area',
1119
xtype: 'container',
1220
flex: 1,
@@ -40,22 +48,37 @@ Ext.define("custom-grid-with-deep-export", {
4048
this._buildStore();
4149
},
4250
launch: function() {
43-
Rally.data.util.PortfolioItemHelper.getPortfolioItemTypes()
44-
.then({
45-
success: function(portfolioItemTypes) {
46-
this.portfolioItemTypes = _.sortBy(portfolioItemTypes, function(type) {
47-
return type.get('Ordinal');
48-
});
49-
this._buildStore();
50-
},
51-
failure: function(msg) {
52-
this._showError(msg);
51+
this.ancestorFilterPlugin = Ext.create('Utils.AncestorPiAppFilter', {
52+
ptype: 'UtilsAncestorPiAppFilter',
53+
pluginId: 'ancestorFilterPlugin',
54+
settingsConfig: {
55+
//labelWidth: 150,
56+
//margin: 10
57+
},
58+
listeners: {
59+
scope: this,
60+
ready: function(plugin) {
61+
Rally.data.util.PortfolioItemHelper.getPortfolioItemTypes().then({
62+
scope: this,
63+
success: function(portfolioItemTypes) {
64+
this.portfolioItemTypes = _.sortBy(portfolioItemTypes, function(type) {
65+
return type.get('Ordinal');
66+
});
67+
68+
plugin.addListener({
69+
scope: this,
70+
select: this.viewChange
71+
});
72+
this.viewChange();
73+
},
74+
failure: function(msg) {
75+
this._showError(msg);
76+
},
77+
})
5378
},
54-
scope: this
55-
});
56-
var listenerConfig = {
57-
scope: this
58-
}
79+
}
80+
});
81+
this.addPlugin(this.ancestorFilterPlugin);
5982
},
6083

6184
// Usual monkey business to size gridboards
@@ -93,11 +116,17 @@ Ext.define("custom-grid-with-deep-export", {
93116
var gridArea = this.down('#grid-area')
94117
gridArea.removeAll();
95118

119+
var currentModelName = this.modelNames[0];
120+
96121
var filters = this.getSetting('query') ? [Rally.data.wsapi.Filter.fromQueryString(this.getSetting('query'))] : [];
97122
var timeboxScope = this.getContext().getTimeboxScope();
98123
if (timeboxScope && timeboxScope.isApplicable(store.model)) {
99124
filters.push(timeboxScope.getQueryFilter());
100125
}
126+
var ancestorFilter = this.ancestorFilterPlugin.getFilterForType(currentModelName);
127+
if (ancestorFilter) {
128+
filters.push(ancestorFilter);
129+
}
101130
this.logger.log('_addGridboard', store);
102131

103132
var context = this.getContext();
@@ -106,7 +135,6 @@ Ext.define("custom-grid-with-deep-export", {
106135
dataContext.project = null;
107136
}
108137
var summaryRowFeature = Ext.create('Rally.ui.grid.feature.SummaryRow');
109-
var currentModelName = this.modelNames[0];
110138
this.gridboard = gridArea.add({
111139
xtype: 'rallygridboard',
112140
context: context,

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# yarn lockfile v1
33

44

5+
"@agile-central-technical-services/utils-ancestor-pi-app-filter@^3.0.0":
6+
version "3.0.0"
7+
resolved "https://registry.yarnpkg.com/@agile-central-technical-services/utils-ancestor-pi-app-filter/-/utils-ancestor-pi-app-filter-3.0.0.tgz#ddcf9eed9b13154b0b39168db416bf41feb2dc65"
8+
59
"@agile-central-technical-services/utils-ancestor-pi-inline-filter@^1.0.12":
610
version "1.0.12"
711
resolved "https://registry.yarnpkg.com/@agile-central-technical-services/utils-ancestor-pi-inline-filter/-/utils-ancestor-pi-inline-filter-1.0.12.tgz#eb82287496305bec975beea03ff7a510588e05ee"

0 commit comments

Comments
 (0)