From f01a86f92252131b41b381fe4e8267a4247f8f85 Mon Sep 17 00:00:00 2001
From: Julian Leucker <leuckerj@gmail.com>
Date: Wed, 6 Nov 2024 12:33:16 +0100
Subject: [PATCH] Fix linking inbetween statistical views

---
 .../statistics/StatisticsForGroupTab.vue      |  7 +++++++
 .../statistics/StatisticsForPersonCard.vue    | 21 +++++++------------
 .../statistics/StatisticsForPersonPage.vue    |  4 +++-
 3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForGroupTab.vue b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForGroupTab.vue
index c23084c3b..f97e7b7f6 100644
--- a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForGroupTab.vue
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForGroupTab.vue
@@ -64,6 +64,13 @@
       <secondary-action-button
         i18n-key="alsijil.personal_notes.statistics.person_view_details"
         icon-text="mdi-open-in-new"
+        :to="{
+          name: 'alsijil.coursebook_statistics',
+          params: {
+            personId: item.person.id,
+            schoolTermId: schoolTerm.id,
+          },
+        }"
       />
     </template>
   </c-r-u-d-list>
diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonCard.vue b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonCard.vue
index ebcb00af0..130b4c9b1 100644
--- a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonCard.vue
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonCard.vue
@@ -11,7 +11,13 @@
         :icon="true"
         icon-text="mdi-open-in-new"
         i18n-key=""
-        @click="switchToOwnPage"
+        :to="{
+          name: 'alsijil.coursebook_statistics',
+          params: {
+            personId: person.id,
+            schoolTermId: schoolTerm.id,
+          },
+        }"
       />
     </v-card-title>
     <v-card-title v-else>
@@ -92,19 +98,6 @@ export default {
       },
     },
   },
-  methods: {
-    switchToOwnPage() {
-      this.$router.push({
-        name: "alsijil.coursebook_statistics",
-        params: {
-          personId: this.person.id,
-          schoolTermId: this.schoolTerm.id,
-        },
-        // TODO: Add where we came from as get parameter if
-        //       meeting decided that own page.
-      });
-    },
-  },
   computed: {
     gridTemplateAreas() {
       return this.compact
diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonPage.vue b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonPage.vue
index 92f85cbd4..b372e3917 100644
--- a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonPage.vue
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/StatisticsForPersonPage.vue
@@ -1,5 +1,7 @@
 <template>
-  <fullscreen-dialog-page>
+  <fullscreen-dialog-page
+    :fallback-url="{ name: 'core.personById', props: { id: personId } }"
+  >
     <div class="d-flex" style="gap: 4em">
       <!-- TODO: header (close, title, print) -->
       <!-- TODO: flex-grow-1 does a little & flex-shrink-1 does nothing -->
-- 
GitLab