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: ensure useSubscriptions and useEnterpriseCourseEnrollments uses queryOptions.select from args #1235

Merged
merged 5 commits into from
Dec 16, 2024

Conversation

adamstankiewicz
Copy link
Member

https://2u-internal.atlassian.net/browse/ENT-9857

In both useSubscriptions and useEnterpriseCourseEnrollments, this PR ensures any optional queryOptions.select functions passed in follow the established convention of being called with an object containing the following:

return select({
  original: data, // the original query data, untransformed
  transformed: transformedData, // the transformed query data, as determined by the hook's internal `select` logic.
});

This pattern ensures any custom select functions passed to the helper query hooks (e.g., useSubscriptions) are given a choice of using the original query data or transformed query data from the parent hook.

For all changes

  • Ensure adequate tests are in place (or reviewed existing tests cover changes)
  • Ensure English strings are marked for translation. See documentation for more details.

Only if submitting a visual change

  • Ensure to attach screenshots
  • Ensure to have UX team confirm screenshots

Comment on lines +25 to +30
if (select) {
return select({
original: data,
transformed: transformedData,
});
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the primary fix for the bug ticket.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 93.47826% with 3 lines in your changes missing coverage. Please review.

Project coverage is 89.05%. Comparing base (cb3d2bf) to head (fb9b704).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/components/app/data/utils.js 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1235      +/-   ##
==========================================
+ Coverage   89.03%   89.05%   +0.02%     
==========================================
  Files         401      401              
  Lines        8670     8708      +38     
  Branches     2116     2123       +7     
==========================================
+ Hits         7719     7755      +36     
- Misses        909      911       +2     
  Partials       42       42              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@brobro10000 brobro10000 left a comment

Choose a reason for hiding this comment

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

Looks great. Nice job tackling the REVERSED state as well 👍🏽

@adamstankiewicz adamstankiewicz merged commit 9711a93 into master Dec 16, 2024
6 checks passed
@adamstankiewicz adamstankiewicz deleted the ags/bff-audit-upgrade-subs branch December 16, 2024 14:43
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.

2 participants