Merge pull request #2681 from westlywright/2.2-bugs

2.2 bugs
This commit is contained in:
Westly Wright 2019-02-21 16:40:58 -07:00 committed by GitHub
commit 4262459c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 23 deletions

View File

@ -54,7 +54,7 @@ export default Component.extend({
} }
return out; return out;
}); }).filter((c) => !c.disabled); // searchable-select doesn't use the disable flag
}), }),

View File

@ -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));
} }
}, },
}, },

View File

@ -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"
/>