mirror of https://github.com/rancher/ui.git
commit
4262459c6f
|
|
@ -54,7 +54,7 @@ export default Component.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
return out;
|
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 Component from '@ember/component';
|
||||||
import C from 'ui/utils/constants';
|
import C from 'ui/utils/constants';
|
||||||
import layout from './template';
|
import layout from './template';
|
||||||
import { get, set, computed } from '@ember/object';
|
import { get, set, setProperties, computed } from '@ember/object';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
access: service(),
|
access: service(),
|
||||||
|
|
@ -36,7 +36,7 @@ export default Component.extend({
|
||||||
|
|
||||||
this.sendAction('action', null);
|
this.sendAction('action', null);
|
||||||
|
|
||||||
console.log('Cleared principal');
|
// console.log('@add:Cleared principal');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -46,17 +46,8 @@ export default Component.extend({
|
||||||
var input = get(addInput, 'value').trim();
|
var input = get(addInput, 'value').trim();
|
||||||
let match = get(this, 'allPrincipals').findBy('id', input);
|
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) {
|
if (match) {
|
||||||
setPrincipal(match);
|
this.send('selectExact', match);
|
||||||
|
|
||||||
set(this, 'checking', false);
|
set(this, 'checking', false);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -71,7 +62,7 @@ export default Component.extend({
|
||||||
if ( xhr.body && typeof xhr.body === 'object' ) {
|
if ( xhr.body && typeof xhr.body === 'object' ) {
|
||||||
let principal = get(xhr, 'body');
|
let principal = get(xhr, 'body');
|
||||||
|
|
||||||
setPrincipal(principal);
|
this.send('selectExact', principal);
|
||||||
}
|
}
|
||||||
}).catch((xhr) => {
|
}).catch((xhr) => {
|
||||||
this.sendAction('onError', `Principal not found: ${ xhr.statusText }`);
|
this.sendAction('onError', `Principal not found: ${ xhr.statusText }`);
|
||||||
|
|
@ -85,11 +76,11 @@ export default Component.extend({
|
||||||
addObject(info) {
|
addObject(info) {
|
||||||
this.sendAction('action', info);
|
this.sendAction('action', info);
|
||||||
|
|
||||||
set(this, 'selected', info);
|
setProperties(this, {
|
||||||
|
selected: info,
|
||||||
console.log('Set principal to 2', JSON.stringify(info));
|
filter: get(info, 'name')
|
||||||
|
});
|
||||||
set(this, 'filter', get(info, 'name'));
|
// console.log('@addObject:Set principal:', JSON.stringify(info));
|
||||||
},
|
},
|
||||||
|
|
||||||
selectExact(match) {
|
selectExact(match) {
|
||||||
|
|
@ -98,9 +89,11 @@ export default Component.extend({
|
||||||
if ( !cur ) {
|
if ( !cur ) {
|
||||||
this.sendAction('action', match);
|
this.sendAction('action', match);
|
||||||
|
|
||||||
set(this, 'selected', match);
|
setProperties(this, {
|
||||||
|
addInput: '',
|
||||||
console.log('Set principal to 3', JSON.stringify(match));
|
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