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

(fix) O3-2662: Unable to attach images when registering/editing a patient #1585

Merged
merged 3 commits into from
Jan 30, 2024

Conversation

jwnasambu
Copy link
Contributor

@jwnasambu jwnasambu commented Jan 15, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Screenshots

Screenshot 2024-01-15 at 6 24 03 PM

Related Issue

https://openmrs.atlassian.net/browse/O3-2662

Other

@Vijaykv5
Copy link
Contributor

Vijaykv5 commented Jan 16, 2024

@jwnasambu @jwamalwa I tried to replicate your fixes locally, but the error in toast notifications along with a .then error still seems visible to me.
PFA :

Screen.Recording.2024-01-16.at.11.57.08.PM.mov

@jwnasambu
Copy link
Contributor Author

jwnasambu commented Jan 16, 2024

@Vijaykv5 you are right! I tried declaring the return type of showModal as Promise, to use the then method without encountering the TypeScript error but in vain. I must admit I need guidance on how to go past the error.

cc @ibacher, @vasharma05, @denniskigen

@jwnasambu jwnasambu marked this pull request as draft January 16, 2024 20:51
@ibacher
Copy link
Member

ibacher commented Jan 19, 2024

The expectation is that saveFile() returns a promise, which could be done with return Promise.resolve().

Comment on lines 20 to 23
saveFile(file: UploadedFile) {
setDataUri(file.base64Content);
onCapturePhoto(file.base64Content, toOmrsIsoString(new Date()));
close();
Copy link
Contributor

Choose a reason for hiding this comment

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

  saveFile(file: UploadedFile) {
    setDataUri(file.base64Content);
    onCapturePhoto(file.base64Content, toOmrsIsoString(new Date()));
    close();
    return Promise.resolve();

Copy link
Contributor

Choose a reason for hiding this comment

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

This will fix @jwnasambu

Copy link
Contributor

@njiddasalifu njiddasalifu 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 @jwnasambu,I wanted to create a ticket for this but found its already beeing addressed here.

@jwnasambu jwnasambu marked this pull request as ready for review January 22, 2024 08:56
@jwnasambu
Copy link
Contributor Author

Thanks @ibacher, @Vijaykv5 , @njiddasalifu thanks for the review. The issue is fixed.

@Vijaykv5
Copy link
Contributor

@ibacher May you can review this PR
It seems good for me!

@ibacher ibacher changed the title (fix)O3-2662: Unable to attach images when registering/editing a patient (fix) O3-2662: Unable to attach images when registering/editing a patient Jan 30, 2024
@ibacher ibacher merged commit 7deb35a into openmrs:main Jan 30, 2024
6 checks passed
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.

5 participants