mirror of https://github.com/rancher/ui.git
commit
4262459c6f
|
|
@ -54,7 +54,7 @@ export default Component.extend({
|
|||
}
|
||||
|
||||
return out;
|
||||
});
|
||||
}).filter((c) => !c.disabled); // searchable-select doesn't use the disable flag
|
||||
}),
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { inject as service } from '@ember/service';
|
|||
import Component from '@ember/component';
|
||||
import C from 'ui/utils/constants';
|
||||
import layout from './template';
|
||||
import { get, set, computed } from '@ember/object';
|
||||
import { get, set, setProperties, computed } from '@ember/object';
|
||||
|
||||
export default Component.extend({
|
||||
access: service(),
|
||||
|
|
@ -36,7 +36,7 @@ export default Component.extend({
|
|||
|
||||
this.sendAction('action', null);
|
||||
|
||||
console.log('Cleared principal');
|
||||
// console.log('@add:Cleared principal');
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -46,17 +46,8 @@ export default Component.extend({
|
|||
var input = get(addInput, 'value').trim();
|
||||
let match = get(this, 'allPrincipals').findBy('id', input);
|
||||
|
||||
var setPrincipal = (principal) => {
|
||||
set(this, 'addInput', '');
|
||||
set(this, 'selected', principal);
|
||||
|
||||
this.sendAction('action', principal);
|
||||
|
||||
console.log('Set principal to 1', JSON.stringify(principal));
|
||||
}
|
||||
|
||||
if (match) {
|
||||
setPrincipal(match);
|
||||
this.send('selectExact', match);
|
||||
|
||||
set(this, 'checking', false);
|
||||
} else {
|
||||
|
|
@ -71,7 +62,7 @@ export default Component.extend({
|
|||
if ( xhr.body && typeof xhr.body === 'object' ) {
|
||||
let principal = get(xhr, 'body');
|
||||
|
||||
setPrincipal(principal);
|
||||
this.send('selectExact', principal);
|
||||
}
|
||||
}).catch((xhr) => {
|
||||
this.sendAction('onError', `Principal not found: ${ xhr.statusText }`);
|
||||
|
|
@ -85,11 +76,11 @@ export default Component.extend({
|
|||
addObject(info) {
|
||||
this.sendAction('action', info);
|
||||
|
||||
set(this, 'selected', info);
|
||||
|
||||
console.log('Set principal to 2', JSON.stringify(info));
|
||||
|
||||
set(this, 'filter', get(info, 'name'));
|
||||
setProperties(this, {
|
||||
selected: info,
|
||||
filter: get(info, 'name')
|
||||
});
|
||||
// console.log('@addObject:Set principal:', JSON.stringify(info));
|
||||
},
|
||||
|
||||
selectExact(match) {
|
||||
|
|
@ -98,9 +89,11 @@ export default Component.extend({
|
|||
if ( !cur ) {
|
||||
this.sendAction('action', match);
|
||||
|
||||
set(this, 'selected', match);
|
||||
|
||||
console.log('Set principal to 3', JSON.stringify(match));
|
||||
setProperties(this, {
|
||||
addInput: '',
|
||||
selected: match
|
||||
});
|
||||
// console.log('@selectExact:Set principal:', JSON.stringify(match));
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1 +1,6 @@
|
|||
<input type="text" oninput={{perform search value="target.value"}} placeholder={{t (if (eq access.provider 'githubconfig') 'inputIdentity.placeholder.generic' 'inputIdentity.placeholder.github')}} class="form-control"/>
|
||||
<input
|
||||
type="text"
|
||||
oninput={{perform search value="target.value"}}
|
||||
placeholder={{t (if (eq access.provider "githubconfig") "inputIdentity.placeholder.generic" "inputIdentity.placeholder.github")}}
|
||||
class="form-control"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue