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

View File

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

View File

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