-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed field of study select to match anywhere in string w/ highlighted text #632
Conversation
@@ -499,60 +521,6 @@ class AutoComplete extends Component { | |||
} | |||
} | |||
|
|||
AutoComplete.levenshteinDistance = (searchText, key) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removed lines here were moved to AutoCompleteSettings.js
a8653b7
to
4c4221e
Compare
AutocompleteSettings.noFilter = () => true; | ||
|
||
AutocompleteSettings.defaultFilter = AutocompleteSettings.caseInsensitivePrefixFilter = (searchText, key) => { | ||
let index = key.toLowerCase().indexOf(searchText.toLowerCase()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically outside the scope of this PR but can you replace this with key.toLowerCase().startsWith(searchText.toLowerCase())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
); | ||
return renderTestComponent(SelectField, selectProps); | ||
let renderLetterSelectField = () => { | ||
_.extend(inputProps, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not Object.assign
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm just trying to add properties to an existing object. to accomplish that, i'd need to do something awkward like inputProps = Object.assign({}, inputProps, {})
. _.extend
is meant for this exact purpose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not Object.assign(inputProps, {...})
then? At least for our purposes it's the same function, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, i misunderstood Object.assign
. fixed
}; | ||
}; | ||
|
||
export default AutoCompleteSettings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should export
each of the functions above instead of exporting this object here. We will never use this object except to retrieve its functions
564c1e1
to
022a96e
Compare
Added user page link to dropdown
Can you rebase please? |
Code looks good, I'll just check the functionality once more after rebase |
022a96e
to
c3fb135
Compare
Looks great 👍 |
What are the relevant tickets?
Fixes #578
What's this PR do?
Where should the reviewer start?
Probably SelectField.js, followed by AutoComplete.js and AutoCompleteSettings.js
How should this be manually tested?
Run through the /profile/education tab. Be sure to fill out fields of study and country/state.
Screenshots (if appropriate)