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

FLME-340: invalidate activities list when consent is accepted #480

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

swain
Copy link
Contributor

@swain swain commented Dec 1, 2023

Changes

If a user has been enrolled into a program before their first login, we need to refresh their activity list whenever they accept a consent. Accepting consent can result in new activities showing up.

Screenshots

@coveralls
Copy link

coveralls commented Dec 1, 2023

Pull Request Test Coverage Report for Build 7072141838

  • 10 of 12 (83.33%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 83.92%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/hooks/useActivities.tsx 1 3 33.33%
Totals Coverage Status
Change from base Build 7065529364: 0.2%
Covered Lines: 3257
Relevant Lines: 3769

💛 - Coveralls

@swain swain force-pushed the FLME-340 branch 6 times, most recently from 391085d to 9a8f36b Compare December 2, 2023 00:34
@swain swain marked this pull request as ready for review December 2, 2023 01:43
@swain swain changed the title fix: invalidate activities list when consent is accepted FLME-340: invalidate activities list when consent is accepted Dec 2, 2023
@@ -25,7 +25,7 @@ jest.mock('./useHttpClient', () => ({
const useActiveProjectMock = useActiveProject as jest.Mock;
const useHttpClientMock = useHttpClient as jest.Mock;

const renderHookInContext = (useHook: Function) => {
const renderHookInContext = <T extends any>(useHook: () => T) => {
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for extending any here?

Comment on lines +50 to +51
queryClient.resetQueries({ queryKey: ACTIVITIES_QUERY_KEY });
await options?.onSuccess?.(data, variables);
Copy link
Member

Choose a reason for hiding this comment

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

Should we leave a comment here about why we refresh the activities on refresh? It might not be obvious for other devs in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absolutely. I'll follow-up with that.

@swain swain merged commit 0ef4beb into master Dec 4, 2023
3 checks passed
@swain swain deleted the FLME-340 branch December 4, 2023 14:58
Copy link

github-actions bot commented Dec 4, 2023

🎉 This PR is included in version 9.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Has been released to the package repository (NPM, etc) label Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Has been released to the package repository (NPM, etc)
Projects
None yet
3 participants