-
Notifications
You must be signed in to change notification settings - Fork 251
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
MF-783: Session Check Fixup #384
Conversation
packages/esm-patient-notes-app/src/notes/visit-notes-form.component.tsx
Outdated
Show resolved
Hide resolved
const sessionUser = useSessionUser(); | ||
const sessionUser = 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.
That seems like a leftover from testing (it should still be useSessionUser
, not always 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.
Oh yes, so sorry about that. I'll push the changed asap
@@ -208,7 +208,7 @@ const VisitNotesForm: React.FC<VisitNotesFormProps> = ({ patientUuid, isTablet } | |||
); | |||
|
|||
const handleSubmit = React.useCallback( | |||
(event: SyntheticEvent<HTMLFormElement>) => { |
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 there a reason for removing the type? Having a type here is better then an implicit any
imo.
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.
It was giving an error in this file, actually I think there's an update in carbon's Button, because I'm encountering many errors in management repo too.
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.
Probably not in Carbon's Button directly, but we no longer import the components from the .../es/...
submodules which results in us suddenly having TypeScript typings for the components. -> TS can now complain in locations where we had no typings before.
I myself am not getting an error in this location. Maybe you could try pulling from master/updating packages if the error persists on your side. The issue may also just be that the HTMLFormElement
type conflicts with the button's onClick
handler type. As a quick fix, you could replace SyntheticEvent<HTMLFormElement>
with SyntheticEvent
since the event.preventDefault
call is the only thing required by the handler.
In any case, fixing the typing instead of removing them is, whenever possible, better.
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.
LGTM, thanks!
Requirements
Summary
It is a fixup for the error that comes up stating "Cannot read property UUID of null" in the patient chart.
Screenshots
None.
Related Issue
https://issues.openmrs.org/browse/MF-783
Other
None.