-
Notifications
You must be signed in to change notification settings - Fork 59
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
Form Engine UI refactor #168
Conversation
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.
Nice work with the clean up and refactors. I have some concerns about the naming and duplication of variable names
src/components/inputs/ui-select-extended/ui-select-extended.scss
Outdated
Show resolved
Hide resolved
src/components/previous-value-review/previous-value-review.component.tsx
Outdated
Show resolved
Hide resolved
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.
Nice work @arodidev, just a few comments. Maybe as a general comment: There is no linked ticket to define the scope of work which makes the review process tricky. Plus I'm in agreement with harmonizing the cross-cutting stylings but styles specific to input components shouldn't be migrated to the ohri-form-section.sccs
file.
src/components/inputs/content-switcher/ohri-content-switcher.component.tsx
Outdated
Show resolved
Hide resolved
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.
Lets merge this and have the enhancements ticketed for a different PR.
Thanks @arodidev , kindly fix the conflicts |
Thanks, resolved. |
The unresolved requested changes are blocking the merge button.
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.
Some final touch up comments
} | ||
export interface previousValue { | ||
field: string; | ||
value: string | number | Date | boolean | previousValue[]; |
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.
Which usecase is previousValue[]
for? multichoice? Not really comfortable with it
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 multi-select
input component receives its values as an array of type previousValue
@@ -20,6 +21,15 @@ export const OHRIContentSwitcher: React.FC<OHRIFormFieldProps> = ({ question, on | |||
} | |||
}, [question]); | |||
|
|||
useEffect(() => { | |||
if (!isEmpty(previousValue)) { | |||
const { value } = previousValue; |
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.
There's a little bit of inconsistency on how the previous value is being accessed. In different controls.
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.
Due to the differences in datatypes of the previousValues
for specific controls, otherwise I think the format is pretty standard across the board, maybe expound a bit?
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 isn't a show stopper. There other controls that access it with previousValue.value
and others do is this way based on your PR
@@ -144,15 +154,13 @@ const OHRIDate: React.FC<OHRIFormFieldProps> = ({ question, onChange, handler }) | |||
) : ( | |||
!question.isHidden && ( | |||
<> | |||
<div className={`${styles.formField} ${styles.row} ${styles.datetime}`}> | |||
<div className={`${styles.datetime}`}> |
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 picking but we don't need the extra literal since the other styles have been stripped
@@ -114,9 +119,9 @@ export const OHRIMultiSelect: React.FC<OHRIFormFieldProps> = ({ question, onChan | |||
readOnly={question.readonly} | |||
/> | |||
</div> | |||
<div className={styles.formField} style={{ marginTop: '0.125rem' }}> | |||
<div style={{ marginTop: '0.125rem' }}> |
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.
Is this a style that is used in other controls? Let's extract this to the scss file
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
.errorLegend legend { |
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.
Indentation on this file looks off. Please format this to 2 spaces
display: flex; | ||
flex-direction: row; | ||
align-items: baseline; | ||
.boldedLabel label { |
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.
same applies to this file around indenting
@@ -69,6 +69,16 @@ const UISelectExtended: React.FC<OHRIFormFieldProps> = ({ question, handler, onC | |||
question.value = handler?.handleFieldSubmission(question, value, encounterContext); | |||
}; | |||
|
|||
useEffect(() => { | |||
if (!isEmpty(previousValue)) { |
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.
Is this a control we want to add a previous value to? So much is happening already with the search and might have some points of failure or conflict
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 see, although previousValue
was already supported by ui-select-extended
prior to this PR.
Requirements
Summary
This PR aims to tackle various issues:
Screenshots
Screen.Recording.2024-02-06.at.08.44.46.mov
Related Issue
Other