-
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
(fix) Resolve issue with loading previous values #378
Conversation
Pending: test coverage |
Size Change: -390 B (-0.03%) Total Size: 1.15 MB ℹ️ View Unchanged
|
96d7b16
to
4425b29
Compare
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.
Was the failure mainly caused by the sessionMode
? I see other changes were around the date component but that might have been an effect of moving the date formatter to the utils file.
@@ -62,6 +62,7 @@ const FormEngine = ({ | |||
const [showSidebar, setShowSidebar] = useState(false); | |||
const [isSubmitting, setIsSubmitting] = useState(false); | |||
const [isFormDirty, setIsFormDirty] = useState(false); | |||
const sessionMode = !isEmpty(mode) ? mode : !isEmpty(encounterUUID) ? 'edit' : 'enter'; |
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.
👀
Those changes are necessary for date specific fields. They are basically about formatting the previous date value. |
Requirements
Summary
For some reason the workspace no longer provides the "session mode" details to the root component. As result, we end up with an
undefined
"session mode" value which causes side effects like the "use previous value" feature not working. This PR ensures we infer the session mode in such scenarios. It the obs adapter to ensure that we properly format the date object to a display string.Screenshots
Related Issue
https://openmrs.atlassian.net/browse/O3-3918
Other