-
Notifications
You must be signed in to change notification settings - Fork 112
(refactor) Add selectable orders section in testOrder question #381
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
base: main
Are you sure you want to change the base?
Conversation
|
Size Change: +377 B (+0.01%) Total Size: 3.9 MB ℹ️ View Unchanged
|
NethmiRodrigo
left a comment
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.
Thanks @CynthiaKamau! A couple of nits and a bug I came across when editing the selected orders where the default selected concept would be set to the one that you removed even after saving the edit:
Screen.Recording.2025-01-24.at.10.51.40.PM.mov
| const updatedDatePickerType = getDatePickerType(concept); | ||
| if (updatedDatePickerType) setDatePickerType(updatedDatePickerType); |
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 datepicker type is unnecessary
| const updatedDatePickerType = getDatePickerType(concept); | |
| if (updatedDatePickerType) setDatePickerType(updatedDatePickerType); |
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.
Also, prefer wrapping the if block in braces.
| const handleAnsConceptChange = (event: React.ChangeEvent<HTMLInputElement>) => | ||
| setConceptAnsToLookup(event.target.value); | ||
|
|
||
| const handleOrdersChange = (event: React.ChangeEvent<HTMLInputElement>) => setConceptToLookup(event.target.value); |
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.
Nit: empty line between the two functions
| const handleOrdersChange = (event: React.ChangeEvent<HTMLInputElement>) => setConceptToLookup(event.target.value); | |
| const handleOrdersChange = (event: React.ChangeEvent<HTMLInputElement>) => setConceptToLookup(event.target.value); | |
| {selectedOrders.length ? ( | ||
| <div> | ||
| {selectedOrders.map((answer) => ( | ||
| <Tag className={styles.tag} key={answer.concept} type={'blue'}> | ||
| {answer.label} | ||
| </Tag> | ||
| ))} | ||
| </div> | ||
| ) : null} |
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.
Its better if we can have a way to remove selected ones, similar to how you've done when editing.
| const datePickerType = getDatePickerType(concept); | ||
| if (datePickerType) { | ||
| setDatePickerType(datePickerType); | ||
| } |
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.
| const datePickerType = getDatePickerType(concept); | |
| if (datePickerType) { | |
| setDatePickerType(datePickerType); | |
| } |
|
|
||
| {questionToEdit.type === 'testOrder' && ( | ||
| <> | ||
| <Search |
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.
You've forgotten to add the form label here
|
Hey @CynthiaKamau! I did a major refactor to the question modal (that makes it much easier to add new features like this one) and unfortunately this is one of the PRs that gets affected by it. Rather than clearing the conflicts, I do think it'll be easier to just make a new PR (sorry about that!). That said, I did try to include support for |
Requirements
Summary
(refactor) Add selectable orders section in testOrder question
Screenshots
Screen.Recording.2025-01-24.at.19.38.40.mov
Related Issue
Other