Skip to content
Snippets Groups Projects
Commit 57249ffb authored by Julian's avatar Julian
Browse files

Display error if statistics are empty (should never occur)

parent 2e511a6c
No related branches found
No related tags found
1 merge request!361Resolve "Add statistics page for absences"
......@@ -24,12 +24,22 @@
{{ $t("alsijil.coursebook.statistics.title_plural") }}
</v-card-title>
<v-card-text>
<v-card-text
v-if="!$apollo.queries.statistics.loading && statistics == null"
>
<message-box type="error">
<div>{{ $t("generic_messages.error") }}</div>
<small>
{{ $t("error_code", { errorCode }) }}
</small>
</message-box>
</v-card-text>
<v-card-text v-else>
<div class="grid">
<statistics-absences-card
style="grid-area: absences"
:absence-reasons="statistics.absenceReasons"
:loading="$apollo.loading"
:loading="$apollo.queries.statistics.loading"
/>
<statistics-tardiness-card
style="grid-area: tardinesses"
......@@ -50,17 +60,20 @@
<script>
import personOverviewCardMixin from "aleksis.core/mixins/personOverviewCardMixin.js";
import BaseButton from "aleksis.core/components/generic/buttons/BaseButton.vue";
import MessageBox from "aleksis.core/components/generic/MessageBox.vue";
import StatisticsAbsencesCard from "./StatisticsAbsencesCard.vue";
import StatisticsTardinessCard from "./StatisticsTardinessCard.vue";
import StatisticsExtraMarksCard from "./StatisticsExtraMarksCard.vue";
import { statisticsByPerson } from "./statistics.graphql";
import errorCodes from "../../../errorCodes";
export default {
name: "StatisticsForPersonCard",
mixins: [personOverviewCardMixin],
components: {
BaseButton,
MessageBox,
StatisticsAbsencesCard,
StatisticsTardinessCard,
StatisticsExtraMarksCard,
......@@ -80,6 +93,7 @@ export default {
tardinessCount: 0,
extraMarks: [],
},
errorCode: errorCodes.statisticsEmpty,
};
},
apollo: {
......
/**
* Alsijil Error Codes.
*
* Schema:
* abb.
* a: A|C|D|P|S:
* Component inside Alsijil
* - Absences
* - Coursebook
* - Documentation
* - Personal Notes
* - Statistics
* bb: incrementing number
*/
export default {
statisticsEmpty: "ALSIJIL_S01",
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment