Skip to content
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

Merged
merged 5 commits into from
Sep 30, 2021
Merged

MF-783: Session Check Fixup #384

merged 5 commits into from
Sep 30, 2021

Conversation

vasharma05
Copy link
Member

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.

const sessionUser = useSessionUser();
const sessionUser = null;
Copy link
Member

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).

Copy link
Member Author

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>) => {
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

@manuelroemer manuelroemer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@manuelroemer manuelroemer merged commit 029b419 into openmrs:master Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants