-
Notifications
You must be signed in to change notification settings - Fork 69
Autocomplete Dropdown in Generate #1600
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
Autocomplete Dropdown in Generate #1600
Conversation
… into generate-autocomplete Merging master into my local before pushing changes
Pull Request Test Coverage Report for Build 8f62c015-97d1-4d5a-a5c6-790ccfb04ae4Details
💛 - Coveralls |
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.
@matt-dahlgren nice work! I just left a few minor comments
multiple | ||
onChange={(event, newValues) => { | ||
const trunc = newValues.map(v => v.slice(0, 8)) | ||
{ |
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.
It's not necessary to have these braces, just call onSelectedChange(trunc)
<div ref={params.InputProps.ref}> | ||
<input | ||
aria-label={name} | ||
color="#76609c" |
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 should be specified in the CSS (you can add a class name to this component)
placeholder="e.g., CSC207H1, CSC324H1" | ||
onSelectedChange={this.handleCoursesChange} | ||
style={{ marginBottom: "-0.3rem" }} |
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.
Move this style into the CSS as well
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.
@matt-dahlgren nice work!
Proposed Changes
Added a dropdown functionality for the courses input field in
js/components/generate/GenerateForm.js
Now students can search for courses in the drop down and select as many as they would like. Having this select feature means that students can no longer enter a course that does not exist as they will be choosing from a list of supported classes!
Tests in
js/components/generate/__tests__/generate.test.js
have been changed to better align with the new features, most notably that text that is not within the /courses fetch() call....
The next photos show that selected courses are highlighted in the autocomplete dropdown, but are also show underneath the dropdown so that users do not need to scroll and type to find out what they have already selected.



When a course is selected again in the dropdown it will remove itself from the list of selected courses
Type of Change
(Write an
X
or a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]
into a[x]
in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)