-
Notifications
You must be signed in to change notification settings - Fork 82
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
(refactor) Add selectable orders section in testOrder question #381
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
|
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.
@@ -173,6 +178,7 @@ const AddQuestionModal: React.FC<AddQuestionModalProps> = ({ | |||
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
Requirements
Summary
(refactor) Add selectable orders section in testOrder question
Screenshots
Screen.Recording.2025-01-24.at.19.38.40.mov
Related Issue
Other