Skip to content

Commit 7300aa3

Browse files
committed
Merge pull request #128 from vincent99/projects
Send user header for more things
2 parents 673e364 + cc145bc commit 7300aa3

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

app/activesetting/model.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Cattle from 'ui/utils/cattle';
2+
import C from 'ui/utils/constants';
3+
4+
var ActiveSetting = Cattle.TransitioningResource.extend({
5+
});
6+
7+
ActiveSetting.reopenClass({
8+
headers: {
9+
[C.HEADER.PROJECT]: C.HEADER.PROJECT_USER_SCOPE, // Requests for projects use the user's scope, not the project
10+
}
11+
});
12+
13+
export default ActiveSetting;

app/githubconfig/model.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Cattle from 'ui/utils/cattle';
2+
import C from 'ui/utils/constants';
3+
4+
var GithubConfig = Cattle.TransitioningResource.extend({
5+
type: 'githubConfig',
6+
});
7+
8+
// Projects don't get pushed by /subscribe WS, so refresh more often
9+
GithubConfig.reopenClass({
10+
headers: {
11+
[C.HEADER.PROJECT]: C.HEADER.PROJECT_USER_SCOPE, // Requests for projects use the user's scope, not the project
12+
}
13+
});
14+
15+
export default GithubConfig;

app/setting/model.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var Setting = Cattle.TransitioningResource.extend({
66

77
Setting.reopenClass({
88
headers: {
9-
[C.HEADER.PROJECT]: undefined, // Don't send project ID header for any requests to that type
9+
[C.HEADER.PROJECT]: C.HEADER.PROJECT_USER_SCOPE, // Requests for projects use the user's scope, not the project
1010
}
1111
});
1212

app/settings/auth/route.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import AuthenticatedRouteMixin from 'ui/mixins/authenticated-route';
22
import Ember from 'ember';
3+
import C from 'ui/utils/constants';
34

45
export default Ember.Route.extend(AuthenticatedRouteMixin,{
56
model: function() {
6-
return this.get('store').find('githubconfig', null, {forceReload: true}).then(function(collection) {
7+
8+
var headers = {};
9+
headers[C.HEADER.PROJECT] = C.HEADER.PROJECT_USER_SCOPE;
10+
11+
return this.get('store').find('githubconfig', null, {headers: headers, forceReload: true}).then(function(collection) {
712
return collection.get('firstObject');
813
});
914
},

0 commit comments

Comments
 (0)