From f737f3bfb8f038e0231e3237957398df1df31f15 Mon Sep 17 00:00:00 2001 From: BacLuc Date: Sat, 18 Nov 2023 14:02:52 +0100 Subject: [PATCH] frontend: load all dayResponsibles in one request in Dashboard.vue By loading the days in one request 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.) --- frontend/src/views/camp/Dashboard.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/views/camp/Dashboard.vue b/frontend/src/views/camp/Dashboard.vue index db7920d2936..f26201d081f 100644 --- a/frontend/src/views/camp/Dashboard.vue +++ b/frontend/src/views/camp/Dashboard.vue @@ -404,6 +404,11 @@ export default { const { categories, periods, collaborators, progressLabels } = await loadAndProcessCollections(this.camp()) + const periodHrefs = await this.camp() + .periods() + .items.map((period) => period._meta.self) + await this.api.get().days({ periods: periodHrefs }) + const queryFilters = processRouteQuery(this.$route.query) const { period, responsible, category, progressLabel } = { ...this.filter,