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

feat(#9269): pass last three months target docs to contact summary #9394

Merged
merged 13 commits into from
Sep 4, 2024

Conversation

dianabarsan
Copy link
Member

@dianabarsan dianabarsan commented Aug 29, 2024

Description

Adds new analytics property to CHTDatasourceAPI in webapp.
This analytics property gets a targetDocs() list passed to contact-summary. This list has the latest 3 target docs for the contact.
When generating the contact summary of one of the logged in user's facilities, pass the logged in user's target docs to contact-summary.

#9269

Code review checklist

  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or e2e where appropriate
  • Internationalised: All user facing text
  • Backwards compatible: Works with existing data and configuration or includes a migration. Any breaking changes documented in the release notes.

Compose URLs

If Build CI hasn't passed, these may 404:

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@dianabarsan
Copy link
Member Author

Hi @latin-panda

This became sort of urgent https://medic.slack.com/archives/C044NKVMD4Z/p1725011773530029?thread_ts=1724962197.807179&cid=C044NKVMD4Z
Can you please review? These changes are already approved by Gareth for the FR branch here: #9279 and is already deployed on several prod instances. This PR does involve some minimal refactors to the target-aggregates service, to reconcile the changes between the FR and the recent last months target aggregates.

@dianabarsan
Copy link
Member Author

cc @lorerod

Appreciate it!

Signed-off-by: Diana Barsan <[email protected]>
Signed-off-by: Diana Barsan <[email protected]>
@lorerod
Copy link
Contributor

lorerod commented Aug 30, 2024

@dianabarsan, is this feature only applicable to online users?

@dianabarsan
Copy link
Member Author

@lorerod no, it's applicable for all users.

Copy link
Contributor

@lorerod lorerod left a comment

Choose a reason for hiding this comment

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

Thanks, @diana. This looks great. I just left a couple of suggestions, but none are a blocker.

Copy link
Contributor

@latin-panda latin-panda left a comment

Choose a reason for hiding this comment

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

Thanks @dianabarsan! ✨
Mostly minor suggestions, and a couple of questions where I didn't fully understand

webapp/src/ts/app.component.ts Outdated Show resolved Hide resolved
webapp/src/ts/effects/contacts.effects.ts Outdated Show resolved Hide resolved
webapp/src/ts/effects/contacts.effects.ts Outdated Show resolved Hide resolved
webapp/src/ts/effects/contacts.effects.ts Outdated Show resolved Hide resolved
webapp/src/ts/services/enketo.service.ts Outdated Show resolved Hide resolved
webapp/src/ts/services/target-aggregates.service.ts Outdated Show resolved Hide resolved
webapp/src/ts/services/target-aggregates.service.ts Outdated Show resolved Hide resolved
webapp/src/ts/services/target-aggregates.service.ts Outdated Show resolved Hide resolved
@latin-panda
Copy link
Contributor

Just curious: do you think this will make the contact details page slower? Something we need to monitor?

@dianabarsan
Copy link
Member Author

do you think this will make the contact details page slower? Something we need to monitor?

It does add a two extra queries. I had performance in mind when I designed this and rewrote it three times until I was satisfied.

Copy link
Contributor

@latin-panda latin-panda left a comment

Choose a reason for hiding this comment

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

Great job! 🤩 Ship it 🛫

oh, if you haven't already, remember to document it in cht-docs

@dianabarsan dianabarsan merged commit bbe5ded into master Sep 4, 2024
45 checks passed
@dianabarsan dianabarsan deleted the 9269-last-three-months-targets branch September 4, 2024 13:03
dianabarsan added a commit that referenced this pull request Sep 4, 2024
…9394)

Adds new analytics property to CHTDatasourceAPI in webapp.
This analytics property gets a targetDocs() list passed to contact-summary. This list has the latest 3 target docs for the contact.
When generating the contact summary of one of the logged in user's facilities, pass the logged in user's target docs to contact-summary.

#9269

(cherry picked from commit bbe5ded)
witash pushed a commit that referenced this pull request Sep 5, 2024
…9394)

Adds new analytics property to CHTDatasourceAPI in webapp.
This analytics property gets a targetDocs() list passed to contact-summary. This list has the latest 3 target docs for the contact.
When generating the contact summary of one of the logged in user's facilities, pass the logged in user's target docs to contact-summary.

#9269

(cherry picked from commit bbe5ded)
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