Display Mentees page for experts/supervisors

This commit is contained in:
Christian Cueni 2024-05-02 10:58:58 +02:00
parent c2a3e5c80e
commit 8c41d4ab03
3 changed files with 20 additions and 10 deletions

View File

@ -2,9 +2,10 @@
import { useLearningMentees } from "@/services/learningMentees";
import { useCurrentCourseSession } from "@/composables";
import { useCSRFFetch } from "@/fetchHelpers";
import { computed } from "vue";
const courseSession = useCurrentCourseSession();
const { summary, fetchData } = useLearningMentees(courseSession.value.id);
const { isLoading, summary, fetchData } = useLearningMentees(courseSession.value.id);
const removeMyMentee = async (menteeId: string) => {
await useCSRFFetch(
@ -12,6 +13,12 @@ const removeMyMentee = async (menteeId: string) => {
).delete();
fetchData();
};
const noMenteesText = computed(() =>
courseSession.value.course.configuration.is_uk
? "a.Aktuell begleitest du niemanden als Praxisbildner."
: "a.Aktuell begleitest du niemanden als Lernbegleitung."
);
</script>
<template>
@ -66,12 +73,12 @@ const removeMyMentee = async (menteeId: string) => {
</div>
</div>
</template>
<div v-else>
<h2 class="heading-2 py-6">{{ $t("a.Personen, die du begleitest") }}</h2>
<div class="flex items-center bg-white px-4 py-2">
<it-icon-info class="it-icon mr-2 h-6 w-6" />
{{ $t("a.Aktuell begleitest du niemanden als Lernbegleitung.") }}
</div>
</div>
<div v-if="!isLoading && !summary">
<h2 class="heading-2 py-6">{{ $t("a.Personen, die du begleitest") }}</h2>
<div class="flex items-center bg-white px-4 py-2">
<it-icon-info class="it-icon mr-2 h-6 w-6" />
{{ $t(noMenteesText) }}
</div>
</div>
</template>

View File

@ -10,8 +10,11 @@ const isMyMentorsVisible = computed(() =>
courseSession.value.actions.includes("learning-mentor::edit-mentors")
);
const isMyMenteesVisible = computed(() =>
courseSession.value.actions.includes("learning-mentor::guide-members")
const isMyMenteesVisible = computed(
() =>
courseSession.value.actions.includes("learning-mentor::guide-members") ||
courseSession.value.actions.includes("is_expert") ||
courseSession.value.actions.includes("is_supervisor")
);
</script>

View File

@ -24,7 +24,7 @@ export type DashboardPersonRoleType =
export type DashboardRoleKeyType =
| "Supervisor"
| "Expert"
| "Trainer"
| "Member"
| "MentorUK"
| "MentorVV";