mirror of https://github.com/rancher/ui.git
Fix avatars on access controls page (rancher/rancher#2183)
This commit is contained in:
parent
8d56eeffde
commit
19b5826d9f
|
|
@ -54,6 +54,13 @@ export default Ember.Controller.extend({
|
|||
return str;
|
||||
}.property('originalModel.allowedIdentities.[]','wasRestricted'),
|
||||
|
||||
allowedActualIdentities: function() {
|
||||
return this.get('model.allowedIdentities').map((obj) => {
|
||||
obj.type = 'identity';
|
||||
return this.get('store').createRecord(obj);
|
||||
});
|
||||
}.property('model.allowedIdentities.[]'),
|
||||
|
||||
wasShowing: false,
|
||||
showingAccessControl: function() {
|
||||
var show = this.get('wasShowing');
|
||||
|
|
@ -61,11 +68,11 @@ export default Ember.Controller.extend({
|
|||
|
||||
if ( restricted )
|
||||
{
|
||||
if ( this.get('model.allowedIdentities.length') > 1 )
|
||||
if ( this.get('allowedActualIdentities.length') > 1 )
|
||||
{
|
||||
show = true;
|
||||
}
|
||||
else if ( this.get('model.allowedIdentities.firstObject.id') !== this.get('access.identity.id') )
|
||||
else if ( this.get('allowedActualIdentities.firstObject.id') !== this.get('access.identity.id') )
|
||||
{
|
||||
show = true;
|
||||
}
|
||||
|
|
@ -78,7 +85,7 @@ export default Ember.Controller.extend({
|
|||
|
||||
this.set('wasShowing', show);
|
||||
return show;
|
||||
}.property('model.allowedIdentities.@each.id','isRestricted','wasShowing'),
|
||||
}.property('allowedActualIdentities.@each.id','isRestricted','wasShowing'),
|
||||
|
||||
destinationUrl: function() {
|
||||
return window.location.origin+'/';
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<h5>Authorized Users and Organizations</h5>
|
||||
|
||||
<ul class="list-unstyled gh-block-list">
|
||||
{{#each model.allowedIdentities as |item|}}
|
||||
{{#each allowedActualIdentities as |item|}}
|
||||
<li>
|
||||
{{#identity-block identity=item}}
|
||||
<button class="btn-circle-x btn-sm pull-right gh-action" {{action "removeIdentity" item}}></button>
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{#if (eq model.allowedIdentities.length 0)}}
|
||||
{{#if (eq allowedActualIdentities.length 0)}}
|
||||
<span class="text-muted">None</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue