YARN-8652. [UI2] YARN UI2 breaks if getUserInfo REST API is not available in older versions. Contributed by Akhil PB.

(cherry picked from commit bbeca0107e)
This commit is contained in:
Sunil G 2018-09-18 12:44:21 +05:30
parent 8dccc4ef12
commit 75d2d0fdb1
2 changed files with 7 additions and 2 deletions

View File

@ -65,6 +65,9 @@ export default Ember.Controller.extend({
}.property('model.clusterInfo'),
userInfo: function() {
if (this.model.userInfo) {
return this.model.userInfo.get('firstObject');
}
return null;
}.property('model.userInfo'),
});

View File

@ -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;
})
});
},