yeatmanlab / roar-dashboard

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

Migrate Administrator homepage to composable TanStack queries #782

Closed maximilianoertel closed 1 month ago

maximilianoertel commented 1 month ago

Proposed changes

This PR updates the Home Administrator page to use composable TanStack queries.

Following the recently merged PR #749, this PR also includes some optimisations in regards to loading and fetching of administrations data. Leveraging the newly introduced useAdministrationsQuery composable, we can toggle between regular and test data and display the loading state when switching. Once fetched, data is kept in cache/memory until garbage collection time.

As the added reactivity inside the query composable adds additional complexity, this PR does not yet include unit tests. Those will be added as part of a separate PR.

https://github.com/user-attachments/assets/2cecd306-4bfa-426d-9883-71d8f91c64ac

Types of changes

What types of changes does this pull request introduce?

Checklist

Justification of missing checklist items

Further comments

Ref https://github.com/yeatmanlab/roar/issues/318

github-actions[bot] commented 1 month ago

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 1.22% 92 / 7536
🔵 Statements 1.18% 98 / 8291
🔵 Functions 1.09% 20 / 1830
🔵 Branches 0.68% 31 / 4509
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/composables/queries/useAdministrationsQuery.js 0% 0% 0% 0% 17-58, 19-21, 24-25, 25-26, 26, 29, 29-30, 30, 33-34, 37-41, 38-40, 43-57, 46-54
src/constants/queryKeys.js 0% 100% 100% 0% 1-9
src/helpers/query/administrations.js 0% 0% 0% 0% 11-16, 12, 15, 19-141, 30-34, 36-65, 37-40, 38-39, 42-64, 43-45, 47-63, 67-73, 77-111, 78-84, 88-94, 98-110, 99-109, 105, 114-124, 115-123, 126-138, 127-137, 140, 143-168, 144-165, 147-149, 151-162, 153-158, 154-157, 156, 159, 164, 167, 170-214, 171-213, 173-182, 181, 184, 186-207, 188-206, 189-197, 190-196, 199-205, 201-203, 202, 209-211, 211-212, 216-264, 218-243, 219-228, 227, 229-242, 246-250, 248, 250, 252-253, 255-261, 256, 256-260, 263, 266-328, 275-327, 277-289, 288, 291, 293-314, 295-313, 296-304, 297-303, 306-312, 308-310, 309, 316-325, 320, 322, 322-323, 323-324, 326
src/pages/HomeAdministrator.vue 0% 0% 0% 0% 135-137, 139-143, 145-146, 148, 150, 152, 155-158, 156, 156-157, 160-162, 161, 161, 164-166, 165, 165, 168-170, 172, 183-193, 184, 184, 187-189, 188, 192, 199-201, 211-228, 212, 214, 214, 217, 220-226, 221, 223-225, 224, 231-308, 314-318, 315-317, 324-332, 325-331, 326, 328-330, 329, 338-342, 339-341, 340, 349-368, 350-353, 355-360, 357, 359, 361-365, 362, 364, 367, 2-3, 5-6, 1, 14-15, 17, 20-22, 41-42, 73, 90, 1-18, 1-25, 1-44, 49
Generated in workflow #242
github-actions[bot] commented 1 month ago

Visit the preview URL for this PR (updated for commit 04f7c69):

https://roar-staging--pr782-ref-318-query-compos-y63fmfz2.web.app

(expires Fri, 13 Sep 2024 21:57:51 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2631e9c58fd0104ecbfddd72a62245ddac467460

cypress[bot] commented 1 month ago

roar-dashboard-e2e    Run #5958

Run Properties:  status check passed Passed #5958  •  git commit 04f7c6989e: E2E Tests for PR 782 "Migrate Administrator homepage to composable TanStack quer...
Project roar-dashboard-e2e
Branch Review ref/318/query-composables-home-administrator
Run status status check passed Passed #5958
Run duration 04m 19s
Commit git commit 04f7c6989e: E2E Tests for PR 782 "Migrate Administrator homepage to composable TanStack quer...
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 32
View all changes introduced in this branch ↗︎