yeatmanlab / roar-dashboard

A dashboard to administer ROAR assessments
https://roar.education
Other
4 stars 4 forks source link

Fix reactivity in TanStack query composables #791

Closed maximilianoertel closed 1 month ago

maximilianoertel commented 1 month ago

Proposed changes

This PR fixes some reactivity issues that were identified across the TanStack query composables. The implemented changes ensure proper reactivity for queries that depend on data from a store or another query.

To reduce code duplication, this PR introduces a computeQueryOverrides which is responsible for:

Additionally, this PR both overhauls existing and introduces new unit tests. Further unit tests will be introduced in subsequent PRs.

Types of changes

Checklist

Justification of missing checklist items

n/a

Further comments

n/a


Ref yeatmanlab/roar#318

github-actions[bot] commented 1 month ago

Visit the preview URL for this PR (updated for commit 2b06b5c):

https://roar-staging--pr791-ref-318-query-compos-iu8doqev.web.app

(expires Thu, 19 Sep 2024 10:30:34 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2631e9c58fd0104ecbfddd72a62245ddac467460

cypress[bot] commented 1 month ago

roar-dashboard-e2e    Run #6368

Run Properties:  status check passed Passed #6368  •  git commit 2b06b5c1b2: E2E Tests for PR 791 "Fix reactivity in TanStack query composables" from commit ...
Project roar-dashboard-e2e
Branch Review ref/318/query-composables-reactivity-fix
Run status status check passed Passed #6368
Run duration 05m 34s
Commit git commit 2b06b5c1b2: E2E Tests for PR 791 "Fix reactivity in TanStack query composables" from commit ...
Committer Maximilian Oertel
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 26
View all changes introduced in this branch ↗︎
github-actions[bot] commented 1 month ago

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 2.93% 224 / 7629
🔵 Statements 2.83% 238 / 8396
🔵 Functions 3.47% 65 / 1868
🔵 Branches 1.6% 73 / 4548
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/components/ListOrgs.vue 0% 0% 0% 0% 135-141, 143-148, 144-146, 145, 147, 150-155, 151-153, 152, 154, 157-158, 160-162, 164-165, 165, 167-194, 168-173, 175, 175, 177-182, 179-181, 183-186, 184-185, 187-189, 188, 190-192, 191, 193, 196-199, 198, 201, 201, 203-205, 207-209, 208, 211-213, 219-221, 224-241, 227-232, 235-240, 244-254, 245-253, 272-335, 273-334, 275, 277-285, 278-284, 287-295, 288-294, 298, 300-315, 300-315, 318, 320-325, 327-333, 337-385, 338-343, 345-350, 346-349, 352-355, 353-354, 357-382, 384, 387-400, 388, 388-399, 390-398, 402-408, 403-407, 405-406, 410-412, 411, 415-418, 416, 416-417, 420-422, 421, 421, 424-426, 425, 425, 428-430, 429, 432-434, 433, 436-439, 438, 3-4, 1, 16, 21, 33, 37, 49, 70, 78, 80, 92, 95, 102, 105, 1-14, 1-23, 1-39, 63, 1-72, 90, 100
src/composables/queries/useAdministrationsListQuery.js 0% 0% 0% 0% 18-60, 20-22, 25-26, 26-27, 27, 30, 30-31, 31-32, 35-36, 39-43, 40-42, 45-59, 48-56
src/composables/queries/useDistrictSchoolsQuery.js 0% 0% 0% 0% 20-41, 22-24, 27-28, 28, 31, 31-32, 32, 32-33, 35-40, 37
src/composables/queries/useDistrictsQuery.js 0% 0% 0% 0% 17-38, 19-21, 24-25, 25, 28, 28-29, 29-30, 32-37, 34
src/composables/queries/useDsgfOrgQuery.js 100% 100% 100% 100%
src/composables/queries/useGroupsQuery.js 0% 0% 0% 0% 17-38, 19-21, 24-25, 25, 28, 28-29, 29-30, 32-37, 34
src/composables/queries/useOrgsTableQuery.js 0% 0% 0% 0% 24-52, 25, 28-29, 29, 32, 32-33, 33-34, 36-51, 39-48
src/composables/queries/useSchoolClassesQuery.js 0% 0% 0% 0% 20-41, 22-24, 27-28, 28, 31, 31-32, 32, 32-33, 35-40, 37
src/composables/queries/useSurveyResponsesQuery.js 100% 100% 100% 100%
src/composables/queries/useUserAssignmentsQuery.js 100% 100% 100% 100%
src/composables/queries/useUserClaimsQuery.js 100% 100% 100% 100%
src/composables/queries/useUserDataQuery.js 100% 100% 100% 100%
src/composables/queries/useUserStudentDataQuery.js 100% 100% 100% 100%
src/helpers/computeQueryOverrides.js 100% 100% 100% 100%
Generated in workflow #307