Skip to content

Commit

Permalink
frontend: load all dayResponsibles in one request per period Dashboar…
Browse files Browse the repository at this point in the history
…d.vue

By loading the days in one request per period which embed the dayResponsibles.
When loading the dayResponsibles directly, there was still
a request per day for the dayResponsibles.
This makes the loading of Dashboard.vue faster.
It also may reduce the e2e test failures of the firefox tests due to:
"Request aborted" errors after the test is finished.
(The test did not wait for the dayResponsibles to be loaded and then
aborted the load which lead to the requests being aborted.)
  • Loading branch information
BacLuc committed Nov 20, 2023
1 parent 8800bc8 commit 1be70aa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frontend/src/views/camp/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,13 @@ export default {
const { categories, periods, collaborators, progressLabels } =
await loadAndProcessCollections(this.camp())
await Promise.all(
this.camp()
.periods()
.items.map((period) => period._meta.self)
.map((periodHref) => this.api.get().days({ period: periodHref }))
)
const queryFilters = processRouteQuery(this.$route.query)
const { period, responsible, category, progressLabel } = {
...this.filter,
Expand Down

0 comments on commit 1be70aa

Please sign in to comment.