Bug fix for ad auth header and add kvo compliant array modifiers

rancher/rancher#12378
This commit is contained in:
Westly Wright 2018-04-12 11:01:08 -07:00
parent 59258216c8
commit 10beda279e
No known key found for this signature in database
GPG Key ID: 4FAB3D8673DC54A3
2 changed files with 5 additions and 4 deletions

View File

@ -35,15 +35,16 @@ export default Controller.extend({
this.tlsChanged(); this.tlsChanged();
} }
}, },
createDisabled: computed('username.length','password.length', function() { createDisabled: computed('username.length','password.length', function() {
return !get(this, 'username.length') || !get(this, 'password.length'); return !get(this, 'username.length') || !get(this, 'password.length');
}), }),
numUsers: computed('adConfig.allowedIdentities.@each.externalIdType','userType','groupType', function() { numUsers: computed('adConfig.allowedPrincipalIds.[]','userType','groupType', function() {
return ( get(this, 'adConfig.allowedPrincipalIds') || [] ).filter(principal => principal.includes(C.PROJECT.TYPE_ACTIVE_DIRECTORY_USER)).get('length'); return ( get(this, 'adConfig.allowedPrincipalIds') || [] ).filter(principal => principal.includes(C.PROJECT.TYPE_ACTIVE_DIRECTORY_USER)).get('length');
}), }),
numGroups: computed('adConfig.allowedIdentities.@each.externalIdType','userType','groupType', function() { numGroups: computed('adConfig.allowedPrincipalIds.[]','userType','groupType', function() {
return ( get(this, 'adConfig.allowedPrincipalIds') || [] ).filter(principal => principal.includes(C.PROJECT.TYPE_ACTIVE_DIRECTORY_GROUP)).get('length'); return ( get(this, 'adConfig.allowedPrincipalIds') || [] ).filter(principal => principal.includes(C.PROJECT.TYPE_ACTIVE_DIRECTORY_GROUP)).get('length');
}), }),

View File

@ -33,7 +33,7 @@ export default Component.extend({
this.send('clearError'); this.send('clearError');
set(this, 'saved', false); set(this, 'saved', false);
get(this, 'model.allowedPrincipalIds').addObject(principal.id); get(this, 'model.allowedPrincipalIds').pushObject(principal.id);
}, },
removeAuthorized(id) { removeAuthorized(id) {
@ -88,7 +88,7 @@ export default Component.extend({
let found = allowedPrincipals.filter(ident => get(me, 'id') === ident).length > 0; let found = allowedPrincipals.filter(ident => get(me, 'id') === ident).length > 0;
if ( !found ) { if ( !found ) {
allowedPrincipals.addObject(get(me, 'id')); allowedPrincipals.pushObject(get(me, 'id'));
} }
} }