mirror of https://github.com/rancher/ui.git
Fix issue when loading the accounts page initially
rancher/rancher#8422
This commit is contained in:
parent
f61a9498cb
commit
62d4b7a6a0
|
|
@ -1,11 +1,16 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNames: ['box'],
|
||||
|
||||
access: Ember.inject.service(),
|
||||
account: Ember.computed.alias('access.identity'),
|
||||
classNames: ['box'],
|
||||
access: Ember.inject.service(),
|
||||
modalService: Ember.inject.service('modal'),
|
||||
account: null,
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
this.set('account', this.get('access.identity'));
|
||||
},
|
||||
|
||||
actions: {
|
||||
editPassword() {
|
||||
this.get('account').send('edit');
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
import C from 'ui/utils/constants';
|
||||
|
||||
export function initialize(instance) {
|
||||
var access = instance.lookup('service:access');
|
||||
var userStore = instance.lookup('service:user-store');
|
||||
var session = instance.lookup('service:session');
|
||||
var idnt = session.get(C.SESSION.IDENTITY) || {};
|
||||
|
||||
idnt.type = 'identity';
|
||||
|
||||
access.set('identity', userStore.createRecord(idnt));
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'identity',
|
||||
after: ['user-store'],
|
||||
initialize: initialize
|
||||
};
|
||||
|
|
@ -23,11 +23,12 @@ export default Ember.Service.extend({
|
|||
admin: null,
|
||||
|
||||
// The identity from the session isn't an actual identity model...
|
||||
identity: function() {
|
||||
var obj = this.get('session.'+C.SESSION.IDENTITY) || {};
|
||||
obj.type = 'identity';
|
||||
return this.get('userStore').createRecord(obj);
|
||||
}.property('session.'+C.SESSION.IDENTITY),
|
||||
// identity: function() {
|
||||
// var obj = this.get('session.'+C.SESSION.IDENTITY) || {};
|
||||
// obj.type = 'identity';
|
||||
// return this.get('userStore').createRecord(obj);
|
||||
// }.property('session.'+C.SESSION.IDENTITY),
|
||||
identity: null,
|
||||
|
||||
testAuth() {
|
||||
// make a call to api base because it is authenticated
|
||||
|
|
|
|||
Loading…
Reference in New Issue