(refactor) Add selectable orders section in testOrder question#381
(refactor) Add selectable orders section in testOrder question#381CynthiaKamau wants to merge 1 commit intomainfrom
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.
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.
The datepicker type is unnecessary
| const updatedDatePickerType = getDatePickerType(concept); | |
| if (updatedDatePickerType) setDatePickerType(updatedDatePickerType); |
There was a problem hiding this comment.
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.
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.
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.
| const datePickerType = getDatePickerType(concept); | |
| if (datePickerType) { | |
| setDatePickerType(datePickerType); | |
| } |
|
|
||
| {questionToEdit.type === 'testOrder' && ( | ||
| <> | ||
| <Search |
There was a problem hiding this comment.
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