fixes edge case issue: when a user clicks the fieldName without a source would not render the input box. increases the width for dropdown filter in search-bar component

This commit is contained in:
Seyi Adebajo 2017-04-05 18:35:11 -07:00 committed by Mars Lan
parent 74cbbf0263
commit d9df311f40
2 changed files with 12 additions and 11 deletions

View File

@ -74,11 +74,10 @@ export default Component.extend({
// Returns a list of owners with truthy value for their confirmedBy attribute, // Returns a list of owners with truthy value for their confirmedBy attribute,
// i.e. they confirmedBy contains a userName and // i.e. they confirmedBy contains a userName and
// type is `Owner` and idType is `USER`. // type is `Owner` and idType is `USER`.
confirmedOwners: computed('owners.[]', function () { confirmedOwners: computed('owners.[]', function() {
return getWithDefault(this, 'owners', []).filter( return getWithDefault(this, 'owners', []).filter(
({ confirmedBy, type, idType }) => confirmedBy && ({ confirmedBy, type, idType }) =>
type === 'Owner' && confirmedBy && type === 'Owner' && idType === 'USER'
idType === 'USER'
); );
}), }),
@ -98,10 +97,10 @@ export default Component.extend({
* @type {Ember.ComputedProperty} * @type {Ember.ComputedProperty}
* @requires _defaultOwnerUserName * @requires _defaultOwnerUserName
*/ */
userNameInvalid: computed('owners.[]', function () { userNameInvalid: computed('owners.[]', function() {
return getWithDefault(this, 'owners', []) return getWithDefault(this, 'owners', []).filter(
.filter(({ userName }) => userName === _defaultOwnerUserName) ({ userName }) => userName === _defaultOwnerUserName
.length > 0; ).length > 0;
}), }),
didInsertElement() { didInsertElement() {
@ -190,10 +189,12 @@ export default Component.extend({
* wrapping TD element, which handles the bubbled Mouse click on the * wrapping TD element, which handles the bubbled Mouse click on the
* label * label
*/ */
willEditUserName({ source = "" }, { currentTarget: { classList } }) { willEditUserName({ source = '' }, { currentTarget: { classList } }) {
// Add the className cached in `userNameEditableClass`. This renders // Add the className cached in `userNameEditableClass`. This renders
// the input element in the DOM, and removes the label from layout // the input element in the DOM, and removes the label from layout
if (!source.includes("SCM") && typeof classList.add === 'function') { if (
source && !source.includes('SCM') && typeof classList.add === 'function'
) {
classList.add(userNameEditableClass); classList.add(userNameEditableClass);
} }
}, },

View File

@ -12,7 +12,7 @@ $height: 40px;
* Rules for the search bar filter component * Rules for the search bar filter component
*/ */
&__filter { &__filter {
width: 65px; width: 75px;
display: inline-flex; display: inline-flex;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;