Skip to content

Commit 728c6bb

Browse files
committedJun 3, 2013
Merge pull request #5 from burtonjc/master
Adding ability to choose from your organizations and view their repos.
2 parents 555a560 + 3824e80 commit 728c6bb

File tree

6 files changed

+390
-82
lines changed

6 files changed

+390
-82
lines changed
 

‎changeset/data/github/Adapter.js

+97-11
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Ext.define('changeset.data.github.Adapter', {
4545
* Base url for all Github api requests.
4646
*/
4747
apiUrl: 'https://api.github.com',
48-
48+
4949
/**
5050
* @cfg {Int}
5151
* Page size to use for api calls.
@@ -58,7 +58,7 @@ Ext.define('changeset.data.github.Adapter', {
5858

5959
constructor: function(config) {
6060
Ext.apply(this, config);
61-
61+
6262
var urlParts = window.location.href.split('?');
6363
this.stateId = 'githubAdapter-' + urlParts[0];
6464
if (urlParts.length > 1) {
@@ -105,6 +105,7 @@ Ext.define('changeset.data.github.Adapter', {
105105
username: this.username,
106106
authToken: this.authToken,
107107
repository: this.repository,
108+
organization: this.organization,
108109
branch: this.branch
109110
};
110111
},
@@ -117,6 +118,14 @@ Ext.define('changeset.data.github.Adapter', {
117118
return 'Login to your GitHub account';
118119
},
119120

121+
/**
122+
* Get the currently logged in user's username
123+
* @return {String}
124+
*/
125+
getUserName: function() {
126+
return this.username;
127+
},
128+
120129
/**
121130
* Return a url to the repository.
122131
* @return {String}
@@ -138,13 +147,34 @@ Ext.define('changeset.data.github.Adapter', {
138147
* @param {changeset.model.Repository}
139148
*/
140149
setRepository: function(repository) {
141-
if( !this.repository || this.repository.name !== repository.raw.name ) {
150+
if( !this.repository || this.repository.name !== repository.get('name') ) {
142151
this.branch = null;
143152
}
144153
this.repository = repository.raw;
145154
this.fireEvent('statechange', this);
146155
},
147156

157+
/*
158+
* Gets the currently selected organization.
159+
* @return {Object}
160+
*/
161+
getOrganization: function() {
162+
return this.organization;
163+
},
164+
165+
/*
166+
* Set the repository to fetch data from.
167+
* @param {changeset.model.Repository}
168+
*/
169+
setOrganization: function(organization) {
170+
if (!this.organization || this.organization.login !== organization.get('login')) {
171+
this.repository = null;
172+
this.branch = null;
173+
}
174+
this.organization = organization.raw || organization.data;
175+
this.fireEvent('statechange', this);
176+
},
177+
148178
/*
149179
* Gets the currently selected branch.
150180
* @return {Object}
@@ -163,19 +193,20 @@ Ext.define('changeset.data.github.Adapter', {
163193
},
164194

165195
/**
166-
* Constructs a store which populates repository models.
196+
* Constructs a store which populates organization models.
167197
* @param {Function} callback Function to call after store is created.
168198
* @param {Object} scope Scope to execute callback with.
169199
*/
170-
getRepositoryStore: function(callback, scope) {
200+
getOrganizationStore: function(callback, scope) {
171201
var url = [
172202
this.apiUrl,
173-
'user',
174-
'repos'
203+
'users',
204+
this.username,
205+
'orgs'
175206
].join('/');
176207

177208
var store = Ext.create('Ext.data.Store', {
178-
model: 'changeset.model.Repository',
209+
model: 'changeset.model.Organization',
179210
proxy: Ext.create('changeset.data.github.Proxy', {
180211
url: url
181212
})
@@ -184,6 +215,60 @@ Ext.define('changeset.data.github.Adapter', {
184215
callback.call(scope, store);
185216
},
186217

218+
/**
219+
* Constructs a store which populates repository models.
220+
* @param {Function} callback Function to call after store is created.
221+
* @param {Object} scope Scope to execute callback with.
222+
*/
223+
getRepositoryStore: function(callback, scope) {
224+
var url = [this.apiUrl];
225+
226+
if (this.organization.url) {
227+
url = url.concat([
228+
'orgs',
229+
this.organization.login,
230+
'repos'
231+
]);
232+
} else {
233+
url = url.concat([
234+
'user',
235+
'repos'
236+
]);
237+
}
238+
239+
var store = Ext.create('Ext.data.Store', {
240+
model: 'changeset.model.Repository',
241+
proxy: Ext.create('changeset.data.github.Proxy', {
242+
url: url.join('/')
243+
}),
244+
buffered: true,
245+
pageSize: this.pageSize,
246+
listeners: {
247+
load: {
248+
fn: function(store, records, successful, eOpts) {
249+
if (successful && records.length === store.pageSize) {
250+
store.prefetchPage(store.currentPage + 1);
251+
return false;
252+
}
253+
},
254+
single: true
255+
},
256+
prefetch: function(store, records, successful, operation, eOpts) {
257+
if (successful) {
258+
store.add(records);
259+
if (records.length === store.pageSize) {
260+
store.prefetchPage(store.currentPage + 1);
261+
} else {
262+
store.fireEvent('load');
263+
}
264+
}
265+
}
266+
}
267+
});
268+
269+
callback.call(scope, store);
270+
},
271+
187272
/**
188273
* Constructs a store which populates branch models.
189274
* @param {Function} callback Function to call after store is created.
@@ -282,7 +367,7 @@ Ext.define('changeset.data.github.Adapter', {
282367
}
283368
})
284369
});
285-
370+
286371
callback.call(scope, store);
287372
},
288373

@@ -333,7 +418,7 @@ Ext.define('changeset.data.github.Adapter', {
333418
* @param {String} password Password to login with.
334419
*/
335420
authenticate: function(username, password) {
336-
this.username = username;
421+
this.username = username;
337422

338423
Ext.Ajax.request({
339424
url: this.apiUrl + '/authorizations',
@@ -368,6 +453,7 @@ Ext.define('changeset.data.github.Adapter', {
368453
*/
369454
logout: function() {
370455
this.repository = null;
456+
this.organization = null;
371457
this.branch = null;
372458
this.username = null;
373459
this.authToken = null;
@@ -420,7 +506,7 @@ Ext.define('changeset.data.github.Adapter', {
420506
}
421507
},
422508

423-
_onBeforeAjaxRequest: function(ext, opts) {
509+
_onBeforeAjaxRequest: function(ext, opts) {
424510
if (Ext.isEmpty(opts.headers)) {
425511
opts.headers = {};
426512
}

‎changeset/data/github/CommitStore.js

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ Ext.define('changeset.data.github.CommitStore', {
1010

1111
model: 'changeset.model.Commit',
1212

13+
constructor: function() {
14+
this.callParent(arguments);
15+
this.on('beforeload', function(store, operation, eOpts) {
16+
this._addShaToOptions(1);
17+
}, this, {single:true});
18+
},
19+
1320
/**
1421
* Github's commit endpoint's paging is a little funky.
1522
*

‎changeset/model/Organization.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Ext.define('changeset.model.Organization', {
2+
extend: 'Ext.data.Model',
3+
idProperty: 'login',
4+
fields: [
5+
{name: 'url', type: 'string'},
6+
{name: 'login', type: 'string'}
7+
]
8+
});

‎changeset/ui/ChangesetBrowser.js

+83-30
Original file line numberDiff line numberDiff line change
@@ -56,39 +56,62 @@ Ext.define('changeset.ui.ChangesetBrowser', {
5656
}]
5757
});
5858

59-
this._addRepoChooser();
59+
this._addOrganizationChooser();
6060
},
6161

62-
_addFilter: function() {
63-
if (this.down('changesetfilter')) {
64-
return;
65-
}
62+
_addOrganizationChooser: function() {
63+
var toolbar = this.down('#topToolbar'),
64+
valueField = 'login';
6665

67-
var toolbar = this.down('#topToolbar');
68-
var filter = toolbar.insert(4, {
69-
xtype: 'changesetfilter',
70-
width: 210,
71-
listeners: {
72-
filter: this._onFilter,
73-
afterrender: function(cmp) {
74-
var tip = Ext.create('Rally.ui.tooltip.ToolTip', {
75-
target: cmp.getEl(),
76-
anchor: 'right',
77-
hideDelay: 0,
78-
html: 'Filter commits by: <br /> <ul><li>-- message</li><li>-- author</li><li>-- revision</li></ul>'
79-
});
80-
},
81-
scope: this
82-
}
83-
});
66+
this.adapter.getOrganizationStore(function(store) {
67+
var combo = toolbar.insert(2, {
68+
xtype: 'rallycombobox',
69+
margin: '0 5 0 0',
70+
store: store,
71+
fieldLabel: 'Org:',
72+
labelWidth: 30,
73+
displayField: valueField,
74+
// allowNoEntry: true,
75+
// noEntryText: this.adapter.getUserName(),
76+
listeners: {
77+
beforeselect: function(combo, record) {
78+
if (record && record.get('login') !== this.adapter.getOrganization().login) {
79+
this._onOrganizationSelect(record);
80+
}
81+
},
82+
scope: this
83+
}
84+
});
85+
86+
store.on('load', function() {
87+
store.insert(0, [{login: this.adapter.getUserName(), url: null}]);
88+
var org = this.adapter.getOrganization(),
89+
selectedOrg = org ? store.findRecord('login', org.login) : store.getAt(0);
90+
combo.select(selectedOrg);
91+
this._onOrganizationSelect(selectedOrg);
92+
}, this, {single: true});
93+
store.load();
94+
}, this);
95+
},
96+
97+
_onOrganizationSelect: function(organization) {
98+
this.adapter.setOrganization(organization);
99+
this.removeAll();
100+
this._addRepoChooser();
84101
},
85102

86103
_addRepoChooser: function() {
87-
var toolbar = this.down('#topToolbar');
88-
var valueField = 'name';
104+
var toolbar = this.down('#topToolbar'),
105+
valueField = 'name',
106+
combo = toolbar.down('#repoChooser');
107+
if (combo) {
108+
toolbar.remove(combo);
109+
}
110+
89111
this.adapter.getRepositoryStore(function(store) {
90-
var combo = toolbar.insert(2, {
112+
var combo = toolbar.insert(3, {
91113
xtype: 'rallycombobox',
114+
itemId: 'repoChooser',
92115
margin: '0 5 0 0',
93116
store: store,
94117
fieldLabel: 'Repo:',
@@ -107,9 +130,12 @@ Ext.define('changeset.ui.ChangesetBrowser', {
107130
store.on('load', function() {
108131
var repo = this.adapter.getRepository();
109132
var selectedRepo = repo ? store.findRecord('name', repo.name) : store.getAt(0);
110-
combo.select(selectedRepo);
111-
this._onRepositorySelect(selectedRepo);
133+
if (selectedRepo) {
134+
combo.select(selectedRepo);
135+
this._onRepositorySelect(selectedRepo);
136+
}
112137
}, this, {single: true});
138+
113139
store.load();
114140
}, this);
115141
},
@@ -129,7 +155,7 @@ Ext.define('changeset.ui.ChangesetBrowser', {
129155

130156
var valueField = 'name';
131157
this.adapter.getBranchStore(function(store) {
132-
combo = toolbar.insert(3, {
158+
combo = toolbar.insert(4, {
133159
xtype: 'rallycombobox',
134160
itemId: 'branchChooser',
135161
margin: '0 5 0 0',
@@ -148,8 +174,11 @@ Ext.define('changeset.ui.ChangesetBrowser', {
148174
});
149175

150176
store.on('load', function() {
151-
var branch = this.adapter.getBranch();
152-
var selectedBranch = branch ? store.findRecord('name', branch.name) : store.getAt(0);
177+
var currentBranch = this.adapter.getBranch(),
178+
branchName = currentBranch ? currentBranch.name : 'master',
179+
selectedBranch = store.findRecord('name', branchName);
180+
selectedBranch = selectedBranch || store.getAt(0);
181+
153182
combo.select(selectedBranch);
154183
this._onBranchSelect(selectedBranch);
155184
}, this, {single: true});
@@ -164,6 +193,30 @@ Ext.define('changeset.ui.ChangesetBrowser', {
164193
this._addGrid();
165194
},
166195

196+
_addFilter: function() {
197+
if (this.down('changesetfilter')) {
198+
return;
199+
}
200+
201+
var toolbar = this.down('#topToolbar');
202+
var filter = toolbar.insert(5, {
203+
xtype: 'changesetfilter',
204+
width: 210,
205+
listeners: {
206+
filter: this._onFilter,
207+
afterrender: function(cmp) {
208+
var tip = Ext.create('Rally.ui.tooltip.ToolTip', {
209+
target: cmp.getEl(),
210+
anchor: 'right',
211+
hideDelay: 0,
212+
html: 'Filter commits by: <br /> <ul><li>-- message</li><li>-- author</li><li>-- revision</li></ul>'
213+
});
214+
},
215+
scope: this
216+
}
217+
});
218+
},
219+
167220
_addGrid: function() {
168221
var callback = function(store) {
169222
var grid = this.add({

‎config.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"changeset/model/Comment.js",
1010
"changeset/model/Commit.js",
1111
"changeset/model/ChangesetFile.js",
12+
"changeset/model/Organization.js",
1213
"changeset/model/Repository.js",
1314

1415
"changeset/data/CommentLocator.js",

‎deploy/App.html

+194-41
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@
7777
{name: 'changes', type: 'integer'},
7878
{name: 'diff', type: 'string'}
7979
]
80+
}); Ext.define('changeset.model.Organization', {
81+
extend: 'Ext.data.Model',
82+
idProperty: 'login',
83+
fields: [
84+
{name: 'url', type: 'string'},
85+
{name: 'login', type: 'string'}
86+
]
8087
}); Ext.define('changeset.model.Repository', {
8188
extend: 'Ext.data.Model',
8289
idProperty: 'name',
@@ -224,7 +231,7 @@
224231
* Base url for all Github api requests.
225232
*/
226233
apiUrl: 'https://api.github.com',
227-
234+
228235
/**
229236
* @cfg {Int}
230237
* Page size to use for api calls.
@@ -237,7 +244,7 @@
237244

238245
constructor: function(config) {
239246
Ext.apply(this, config);
240-
247+
241248
var urlParts = window.location.href.split('?');
242249
this.stateId = 'githubAdapter-' + urlParts[0];
243250
if (urlParts.length > 1) {
@@ -284,6 +291,7 @@
284291
username: this.username,
285292
authToken: this.authToken,
286293
repository: this.repository,
294+
organization: this.organization,
287295
branch: this.branch
288296
};
289297
},
@@ -296,6 +304,14 @@
296304
return 'Login to your GitHub account';
297305
},
298306

307+
/**
308+
* Get the currently logged in user's username
309+
* @return {String}
310+
*/
311+
getUserName: function() {
312+
return this.username;
313+
},
314+
299315
/**
300316
* Return a url to the repository.
301317
* @return {String}
@@ -317,13 +333,34 @@
317333
* @param {changeset.model.Repository}
318334
*/
319335
setRepository: function(repository) {
320-
if( !this.repository || this.repository.name !== repository.raw.name ) {
336+
if( !this.repository || this.repository.name !== repository.get('name') ) {
321337
this.branch = null;
322338
}
323339
this.repository = repository.raw;
324340
this.fireEvent('statechange', this);
325341
},
326342

343+
/*
344+
* Gets the currently selected organization.
345+
* @return {Object}
346+
*/
347+
getOrganization: function() {
348+
return this.organization;
349+
},
350+
351+
/*
352+
* Set the repository to fetch data from.
353+
* @param {changeset.model.Repository}
354+
*/
355+
setOrganization: function(organization) {
356+
if (!this.organization || this.organization.login !== organization.get('login')) {
357+
this.repository = null;
358+
this.branch = null;
359+
}
360+
this.organization = organization.raw || organization.data;
361+
this.fireEvent('statechange', this);
362+
},
363+
327364
/*
328365
* Gets the currently selected branch.
329366
* @return {Object}
@@ -342,19 +379,20 @@
342379
},
343380

344381
/**
345-
* Constructs a store which populates repository models.
382+
* Constructs a store which populates organization models.
346383
* @param {Function} callback Function to call after store is created.
347384
* @param {Object} scope Scope to execute callback with.
348385
*/
349-
getRepositoryStore: function(callback, scope) {
386+
getOrganizationStore: function(callback, scope) {
350387
var url = [
351388
this.apiUrl,
352-
'user',
353-
'repos'
389+
'users',
390+
this.username,
391+
'orgs'
354392
].join('/');
355393

356394
var store = Ext.create('Ext.data.Store', {
357-
model: 'changeset.model.Repository',
395+
model: 'changeset.model.Organization',
358396
proxy: Ext.create('changeset.data.github.Proxy', {
359397
url: url
360398
})
@@ -363,6 +401,60 @@
363401
callback.call(scope, store);
364402
},
365403

404+
/**
405+
* Constructs a store which populates repository models.
406+
* @param {Function} callback Function to call after store is created.
407+
* @param {Object} scope Scope to execute callback with.
408+
*/
409+
getRepositoryStore: function(callback, scope) {
410+
var url = [this.apiUrl];
411+
412+
if (this.organization.url) {
413+
url = url.concat([
414+
'orgs',
415+
this.organization.login,
416+
'repos'
417+
]);
418+
} else {
419+
url = url.concat([
420+
'user',
421+
'repos'
422+
]);
423+
}
424+
425+
var store = Ext.create('Ext.data.Store', {
426+
model: 'changeset.model.Repository',
427+
proxy: Ext.create('changeset.data.github.Proxy', {
428+
url: url.join('/')
429+
}),
430+
buffered: true,
431+
pageSize: this.pageSize,
432+
listeners: {
433+
load: {
434+
fn: function(store, records, successful, eOpts) {
435+
if (successful && records.length === store.pageSize) {
436+
store.prefetchPage(store.currentPage + 1);
437+
return false;
438+
}
439+
},
440+
single: true
441+
},
442+
prefetch: function(store, records, successful, operation, eOpts) {
443+
if (successful) {
444+
store.add(records);
445+
if (records.length === store.pageSize) {
446+
store.prefetchPage(store.currentPage + 1);
447+
} else {
448+
store.fireEvent('load');
449+
}
450+
}
451+
}
452+
}
453+
});
454+
455+
callback.call(scope, store);
456+
},
457+
366458
/**
367459
* Constructs a store which populates branch models.
368460
* @param {Function} callback Function to call after store is created.
@@ -462,7 +554,7 @@
462554
}
463555
})
464556
});
465-
557+
466558
callback.call(scope, store);
467559
},
468560

@@ -513,7 +605,7 @@
513605
* @param {String} password Password to login with.
514606
*/
515607
authenticate: function(username, password) {
516-
this.username = username;
608+
this.username = username;
517609

518610
Ext.Ajax.request({
519611
url: this.apiUrl + '/authorizations',
@@ -548,6 +640,7 @@
548640
*/
549641
logout: function() {
550642
this.repository = null;
643+
this.organization = null;
551644
this.branch = null;
552645
this.username = null;
553646
this.authToken = null;
@@ -600,7 +693,7 @@
600693
}
601694
},
602695

603-
_onBeforeAjaxRequest: function(ext, opts) {
696+
_onBeforeAjaxRequest: function(ext, opts) {
604697
if (Ext.isEmpty(opts.headers)) {
605698
opts.headers = {};
606699
}
@@ -673,6 +766,13 @@
673766

674767
model: 'changeset.model.Commit',
675768

769+
constructor: function() {
770+
this.callParent(arguments);
771+
this.on('beforeload', function(store, operation, eOpts) {
772+
this._addShaToOptions(1);
773+
}, this, {single:true});
774+
},
775+
676776
/**
677777
* Github's commit endpoint's paging is a little funky.
678778
*
@@ -1684,39 +1784,62 @@
16841784
}]
16851785
});
16861786

1687-
this._addRepoChooser();
1787+
this._addOrganizationChooser();
16881788
},
16891789

1690-
_addFilter: function() {
1691-
if (this.down('changesetfilter')) {
1692-
return;
1693-
}
1790+
_addOrganizationChooser: function() {
1791+
var toolbar = this.down('#topToolbar'),
1792+
valueField = 'login';
16941793

1695-
var toolbar = this.down('#topToolbar');
1696-
var filter = toolbar.insert(4, {
1697-
xtype: 'changesetfilter',
1698-
width: 210,
1699-
listeners: {
1700-
filter: this._onFilter,
1701-
afterrender: function(cmp) {
1702-
var tip = Ext.create('Rally.ui.tooltip.ToolTip', {
1703-
target: cmp.getEl(),
1704-
anchor: 'right',
1705-
hideDelay: 0,
1706-
html: 'Filter commits by: <br /> <ul><li>-- message</li><li>-- author</li><li>-- revision</li></ul>'
1707-
});
1708-
},
1709-
scope: this
1710-
}
1711-
});
1794+
this.adapter.getOrganizationStore(function(store) {
1795+
var combo = toolbar.insert(2, {
1796+
xtype: 'rallycombobox',
1797+
margin: '0 5 0 0',
1798+
store: store,
1799+
fieldLabel: 'Org:',
1800+
labelWidth: 30,
1801+
displayField: valueField,
1802+
// allowNoEntry: true,
1803+
// noEntryText: this.adapter.getUserName(),
1804+
listeners: {
1805+
beforeselect: function(combo, record) {
1806+
if (record && record.get('login') !== this.adapter.getOrganization().login) {
1807+
this._onOrganizationSelect(record);
1808+
}
1809+
},
1810+
scope: this
1811+
}
1812+
});
1813+
1814+
store.on('load', function() {
1815+
store.insert(0, [{login: this.adapter.getUserName(), url: null}]);
1816+
var org = this.adapter.getOrganization(),
1817+
selectedOrg = org ? store.findRecord('login', org.login) : store.getAt(0);
1818+
combo.select(selectedOrg);
1819+
this._onOrganizationSelect(selectedOrg);
1820+
}, this, {single: true});
1821+
store.load();
1822+
}, this);
1823+
},
1824+
1825+
_onOrganizationSelect: function(organization) {
1826+
this.adapter.setOrganization(organization);
1827+
this.removeAll();
1828+
this._addRepoChooser();
17121829
},
17131830

17141831
_addRepoChooser: function() {
1715-
var toolbar = this.down('#topToolbar');
1716-
var valueField = 'name';
1832+
var toolbar = this.down('#topToolbar'),
1833+
valueField = 'name',
1834+
combo = toolbar.down('#repoChooser');
1835+
if (combo) {
1836+
toolbar.remove(combo);
1837+
}
1838+
17171839
this.adapter.getRepositoryStore(function(store) {
1718-
var combo = toolbar.insert(2, {
1840+
var combo = toolbar.insert(3, {
17191841
xtype: 'rallycombobox',
1842+
itemId: 'repoChooser',
17201843
margin: '0 5 0 0',
17211844
store: store,
17221845
fieldLabel: 'Repo:',
@@ -1735,9 +1858,12 @@
17351858
store.on('load', function() {
17361859
var repo = this.adapter.getRepository();
17371860
var selectedRepo = repo ? store.findRecord('name', repo.name) : store.getAt(0);
1738-
combo.select(selectedRepo);
1739-
this._onRepositorySelect(selectedRepo);
1861+
if (selectedRepo) {
1862+
combo.select(selectedRepo);
1863+
this._onRepositorySelect(selectedRepo);
1864+
}
17401865
}, this, {single: true});
1866+
17411867
store.load();
17421868
}, this);
17431869
},
@@ -1757,7 +1883,7 @@
17571883

17581884
var valueField = 'name';
17591885
this.adapter.getBranchStore(function(store) {
1760-
combo = toolbar.insert(3, {
1886+
combo = toolbar.insert(4, {
17611887
xtype: 'rallycombobox',
17621888
itemId: 'branchChooser',
17631889
margin: '0 5 0 0',
@@ -1776,8 +1902,11 @@
17761902
});
17771903

17781904
store.on('load', function() {
1779-
var branch = this.adapter.getBranch();
1780-
var selectedBranch = branch ? store.findRecord('name', branch.name) : store.getAt(0);
1905+
var currentBranch = this.adapter.getBranch(),
1906+
branchName = currentBranch ? currentBranch.name : 'master',
1907+
selectedBranch = store.findRecord('name', branchName);
1908+
selectedBranch = selectedBranch || store.getAt(0);
1909+
17811910
combo.select(selectedBranch);
17821911
this._onBranchSelect(selectedBranch);
17831912
}, this, {single: true});
@@ -1792,6 +1921,30 @@
17921921
this._addGrid();
17931922
},
17941923

1924+
_addFilter: function() {
1925+
if (this.down('changesetfilter')) {
1926+
return;
1927+
}
1928+
1929+
var toolbar = this.down('#topToolbar');
1930+
var filter = toolbar.insert(5, {
1931+
xtype: 'changesetfilter',
1932+
width: 210,
1933+
listeners: {
1934+
filter: this._onFilter,
1935+
afterrender: function(cmp) {
1936+
var tip = Ext.create('Rally.ui.tooltip.ToolTip', {
1937+
target: cmp.getEl(),
1938+
anchor: 'right',
1939+
hideDelay: 0,
1940+
html: 'Filter commits by: <br /> <ul><li>-- message</li><li>-- author</li><li>-- revision</li></ul>'
1941+
});
1942+
},
1943+
scope: this
1944+
}
1945+
});
1946+
},
1947+
17951948
_addGrid: function() {
17961949
var callback = function(store) {
17971950
var grid = this.add({

0 commit comments

Comments
 (0)
Please sign in to comment.