YARN-8652. [UI2] YARN UI2 breaks if getUserInfo REST API is not available in older versions. Contributed by Akhil PB.
This commit is contained in:
parent
0cc6e03945
commit
bbeca0107e
|
@ -65,6 +65,9 @@ export default Ember.Controller.extend({
|
|||
}.property('model.clusterInfo'),
|
||||
|
||||
userInfo: function() {
|
||||
return this.model.userInfo.get('firstObject');
|
||||
if (this.model.userInfo) {
|
||||
return this.model.userInfo.get('firstObject');
|
||||
}
|
||||
return null;
|
||||
}.property('model.userInfo'),
|
||||
});
|
||||
|
|
|
@ -23,7 +23,9 @@ export default AbstractRoute.extend({
|
|||
model() {
|
||||
return Ember.RSVP.hash({
|
||||
clusterInfo: this.store.findAll('ClusterInfo', {reload: true}),
|
||||
userInfo: this.store.findAll('cluster-user-info', {reload: true})
|
||||
userInfo: this.store.findAll('cluster-user-info', {reload: true}).catch(function() {
|
||||
return null;
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue