commit
bc2536936c
|
|
@ -42,25 +42,21 @@ function hasWidget(widget: WidgetType) {
|
||||||
|
|
||||||
const actionButtonProps = computed<{ href: string; text: string; cyKey: string }>(
|
const actionButtonProps = computed<{ href: string; text: string; cyKey: string }>(
|
||||||
() => {
|
() => {
|
||||||
if (props.courseConfig?.role_key === "Member") {
|
if (props.courseConfig?.role_key === "Supervisor") {
|
||||||
return {
|
|
||||||
href: getLearningPathUrl(props.courseConfig?.course_slug),
|
|
||||||
text: "Weiter lernen",
|
|
||||||
cyKey: "progress-dashboard-continue-course-link",
|
|
||||||
};
|
|
||||||
} else if (props.courseConfig?.role_key === "Expert") {
|
|
||||||
return {
|
return {
|
||||||
href: getCockpitUrl(props.courseConfig?.course_slug),
|
href: getCockpitUrl(props.courseConfig?.course_slug),
|
||||||
text: "Cockpit anschauen",
|
text: "Cockpit anschauen",
|
||||||
cyKey: "cockpit-dashboard-link",
|
cyKey: "cockpit-dashboard-link",
|
||||||
};
|
};
|
||||||
} else if (props.courseConfig?.role_key === "Supervisor") {
|
}
|
||||||
|
if (props.courseConfig?.role_key === "Trainer") {
|
||||||
return {
|
return {
|
||||||
href: getCockpitUrl(props.courseConfig?.course_slug),
|
href: getCockpitUrl(props.courseConfig?.course_slug),
|
||||||
text: "Cockpit anschauen",
|
text: "Cockpit anschauen",
|
||||||
cyKey: "cockpit-dashboard-link",
|
cyKey: "cockpit-dashboard-link",
|
||||||
};
|
};
|
||||||
} else if (props.courseConfig?.role_key === "MentorVV") {
|
}
|
||||||
|
if (props.courseConfig?.role_key === "MentorVV") {
|
||||||
return {
|
return {
|
||||||
href: getLearningMentorUrl(props.courseConfig?.course_slug),
|
href: getLearningMentorUrl(props.courseConfig?.course_slug),
|
||||||
text: "a.Übersicht anschauen",
|
text: "a.Übersicht anschauen",
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ import {
|
||||||
getLearningPathUrl,
|
getLearningPathUrl,
|
||||||
getMediaCenterUrl,
|
getMediaCenterUrl,
|
||||||
} from "@/utils/utils";
|
} from "@/utils/utils";
|
||||||
import { useMentorTexts } from "@/composables";
|
|
||||||
|
|
||||||
log.debug("MainNavigationBar created");
|
log.debug("MainNavigationBar created");
|
||||||
|
|
||||||
|
|
@ -123,7 +122,11 @@ const hasLearningMentor = computed(() => {
|
||||||
return courseSession.actions.includes("learning-mentor");
|
return courseSession.actions.includes("learning-mentor");
|
||||||
});
|
});
|
||||||
|
|
||||||
const mentorTabTitle = useMentorTexts().mentorTabTitle;
|
const mentorTabTitle = computed(() =>
|
||||||
|
courseSessionsStore.currentCourseSession?.course.configuration.is_uk
|
||||||
|
? "a.Praxisbildner"
|
||||||
|
: "a.Lernbegleitung"
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ import {
|
||||||
getLearningPathUrl,
|
getLearningPathUrl,
|
||||||
getMediaCenterUrl,
|
getMediaCenterUrl,
|
||||||
} from "@/utils/utils";
|
} from "@/utils/utils";
|
||||||
import { useMentorTexts } from "@/composables";
|
import { computed } from "vue";
|
||||||
|
import { useCourseSessionsStore } from "@/stores/courseSessions";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
|
@ -31,6 +32,8 @@ defineProps<{
|
||||||
|
|
||||||
const emit = defineEmits(["closemodal", "logout"]);
|
const emit = defineEmits(["closemodal", "logout"]);
|
||||||
|
|
||||||
|
const courseSessionsStore = useCourseSessionsStore();
|
||||||
|
|
||||||
const clickLink = (to: string | undefined) => {
|
const clickLink = (to: string | undefined) => {
|
||||||
if (to) {
|
if (to) {
|
||||||
router.push(to);
|
router.push(to);
|
||||||
|
|
@ -38,7 +41,11 @@ const clickLink = (to: string | undefined) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const mentorTabTitle = useMentorTexts().mentorTabTitle;
|
const mentorTabTitle = computed(() =>
|
||||||
|
courseSessionsStore.currentCourseSession?.course.configuration.is_uk
|
||||||
|
? "a.Praxisbildner"
|
||||||
|
: "a.Lernbegleitung"
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,11 @@
|
||||||
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";
|
||||||
|
import LoadingSpinner from "@/components/ui/LoadingSpinner.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,65 +14,69 @@ 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>
|
||||||
<div v-if="summary">
|
<div v-if="isLoading" class="m-8 flex justify-center">
|
||||||
<template v-if="summary.participants.length > 0">
|
<LoadingSpinner />
|
||||||
<h2 class="heading-2 py-6">{{ $t("a.Personen, die du begleitest") }}</h2>
|
</div>
|
||||||
<div class="bg-white px-4 py-2">
|
<div v-else>
|
||||||
<div
|
<h2 class="heading-2 py-6">{{ $t("a.Personen, die du begleitest") }}</h2>
|
||||||
v-for="participant in summary.participants"
|
<div v-if="(summary?.participants?.length ?? 0) > 0" class="bg-white px-4 py-2">
|
||||||
:key="participant.id"
|
<div
|
||||||
data-cy="lm-my-mentee-list-item"
|
v-for="participant in summary?.participants ?? []"
|
||||||
class="flex flex-col items-start justify-between gap-4 border-b py-2 last:border-b-0 md:flex-row md:items-center md:gap-16"
|
:key="participant.id"
|
||||||
>
|
data-cy="lm-my-mentee-list-item"
|
||||||
<div class="flex items-center space-x-2">
|
class="flex flex-col items-start justify-between gap-4 border-b py-2 last:border-b-0 md:flex-row md:items-center md:gap-16"
|
||||||
<img
|
>
|
||||||
:alt="participant.last_name"
|
<div class="flex items-center space-x-2">
|
||||||
class="h-11 w-11 rounded-full"
|
<img
|
||||||
:src="
|
:alt="participant.last_name"
|
||||||
participant.avatar_url || '/static/avatars/myvbv-default-avatar.png'
|
class="h-11 w-11 rounded-full"
|
||||||
"
|
:src="participant.avatar_url || '/static/avatars/myvbv-default-avatar.png'"
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<div class="text-bold">
|
<div class="text-bold">
|
||||||
{{ participant.first_name }}
|
{{ participant.first_name }}
|
||||||
{{ participant.last_name }}
|
{{ participant.last_name }}
|
||||||
</div>
|
|
||||||
{{ participant.email }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{ participant.email }}
|
||||||
<div class="space-x-5">
|
|
||||||
<router-link
|
|
||||||
data-cy="lm-my-mentee-profile"
|
|
||||||
:to="{
|
|
||||||
name: 'profileLearningPath',
|
|
||||||
params: {
|
|
||||||
userId: participant.id,
|
|
||||||
courseSlug: courseSession.course.slug,
|
|
||||||
},
|
|
||||||
}"
|
|
||||||
class="underline"
|
|
||||||
>
|
|
||||||
{{ $t("cockpit.profileLink") }}
|
|
||||||
</router-link>
|
|
||||||
<button
|
|
||||||
class="underline"
|
|
||||||
data-cy="lm-my-mentee-remove"
|
|
||||||
@click="removeMyMentee(participant.id)"
|
|
||||||
>
|
|
||||||
{{ $t("a.Entfernen") }}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="space-x-5">
|
||||||
|
<router-link
|
||||||
|
data-cy="lm-my-mentee-profile"
|
||||||
|
:to="{
|
||||||
|
name: 'profileLearningPath',
|
||||||
|
params: {
|
||||||
|
userId: participant.id,
|
||||||
|
courseSlug: courseSession.course.slug,
|
||||||
|
},
|
||||||
|
}"
|
||||||
|
class="underline"
|
||||||
|
>
|
||||||
|
{{ $t("cockpit.profileLink") }}
|
||||||
|
</router-link>
|
||||||
|
<button
|
||||||
|
class="underline"
|
||||||
|
data-cy="lm-my-mentee-remove"
|
||||||
|
@click="removeMyMentee(participant.id)"
|
||||||
|
>
|
||||||
|
{{ $t("a.Entfernen") }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</div>
|
||||||
<div v-else>
|
<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">
|
<div class="flex items-center bg-white px-4 py-2">
|
||||||
<it-icon-info class="it-icon mr-2 h-6 w-6" />
|
<it-icon-info class="it-icon mr-2 h-6 w-6" />
|
||||||
{{ $t("a.Aktuell begleitest du niemanden als Lernbegleitung.") }}
|
{{ $t(noMenteesText) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useCurrentCourseSession, useMentorTexts } from "@/composables";
|
import { useCurrentCourseSession } from "@/composables";
|
||||||
import ItModal from "@/components/ui/ItModal.vue";
|
import ItModal from "@/components/ui/ItModal.vue";
|
||||||
import { computed, ref } from "vue";
|
import { computed, ref } from "vue";
|
||||||
import { useCSRFFetch } from "@/fetchHelpers";
|
import { useCSRFFetch } from "@/fetchHelpers";
|
||||||
|
|
@ -69,7 +69,23 @@ const inviteMentor = async () => {
|
||||||
inviteeEmail.value = "";
|
inviteeEmail.value = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
const { myLearningMentors, inviteLearningMentor, noLearningMentors } = useMentorTexts();
|
const myLearningMentors = computed(() =>
|
||||||
|
courseSession.value.course.configuration.is_uk
|
||||||
|
? "Meine Praxisbildner"
|
||||||
|
: "Meine Lernbegleiter"
|
||||||
|
);
|
||||||
|
|
||||||
|
const inviteLearningMentor = computed(() =>
|
||||||
|
courseSession.value.course.configuration.is_uk
|
||||||
|
? "Neuen Praxisbildner einladen"
|
||||||
|
: "a.Neue Lernbegleitung einladen"
|
||||||
|
);
|
||||||
|
|
||||||
|
const noLearningMentors = computed(() =>
|
||||||
|
courseSession.value.course.configuration.is_uk
|
||||||
|
? "a.Aktuell hast du noch keine Person als Praxisbildner eingeladen."
|
||||||
|
: "a.Aktuell hast du noch keine Person als Lernbegleitung eingeladen."
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,20 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useCurrentCourseSession, useMentorTexts } from "@/composables";
|
import { useCurrentCourseSession } from "@/composables";
|
||||||
|
import { computed } from "vue";
|
||||||
|
|
||||||
const currentCourseSession = useCurrentCourseSession();
|
const currentCourseSession = useCurrentCourseSession();
|
||||||
const { actionNoLearningMentors, inviteLearningMentorShort } = useMentorTexts();
|
|
||||||
|
const actionNoLearningMentors = computed(() =>
|
||||||
|
currentCourseSession.value.course.configuration.is_uk
|
||||||
|
? "a.Aktuell hast du noch keine Person als Praxisbildner eingeladen. Lade jetzt jemanden ein."
|
||||||
|
: "a.Aktuell hast du noch keine Person als Lernbegleitung eingeladen. Lade jetzt jemanden ein."
|
||||||
|
);
|
||||||
|
|
||||||
|
const inviteLearningMentorShort = computed(() =>
|
||||||
|
currentCourseSession.value.course.configuration.is_uk
|
||||||
|
? "Neuen Praxisbildner einladen"
|
||||||
|
: "a.Neue Lernbegleitung einladen"
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,9 @@ const previousRoute = getPreviousRoute();
|
||||||
|
|
||||||
const learningUnitHasFeedbackPage = computed(
|
const learningUnitHasFeedbackPage = computed(
|
||||||
() =>
|
() =>
|
||||||
courseSession.value.course.configuration.enable_learning_mentor && !isReadOnly.value
|
courseSession.value.course.configuration.enable_learning_mentor &&
|
||||||
|
!courseSession.value.course.configuration.is_uk &&
|
||||||
|
!isReadOnly.value
|
||||||
);
|
);
|
||||||
|
|
||||||
const currentQuestion = computed(() => questions.value[questionIndex.value]);
|
const currentQuestion = computed(() => questions.value[questionIndex.value]);
|
||||||
|
|
|
||||||
|
|
@ -630,48 +630,6 @@ export function useDashboardPersonsDueDates(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useMentorTexts() {
|
|
||||||
const texts = computed(() => {
|
|
||||||
try {
|
|
||||||
const is_uk =
|
|
||||||
useCourseSessionsStore().currentCourseSession?.course.configuration.is_uk;
|
|
||||||
const mentorTabTitle = is_uk ? "a.Praxisbildner" : "a.Lernbegleitung";
|
|
||||||
const myLearningMentors = is_uk ? "Meine Praxisbildner" : "Meine Lernbegleiter";
|
|
||||||
const inviteLearningMentor = is_uk
|
|
||||||
? "Neuen Praxisbildner einladen"
|
|
||||||
: "a.Neue Lernbegleitung einladen";
|
|
||||||
const inviteLearningMentorShort = is_uk
|
|
||||||
? "Praxisbildner einladen"
|
|
||||||
: "Lernbegleitung einladen";
|
|
||||||
const noLearningMentors = is_uk
|
|
||||||
? "a.Aktuell hast du noch keine Person als Praxisbildner eingeladen."
|
|
||||||
: "a.Aktuell hast du noch keine Person als Lernbegleitung eingeladen.";
|
|
||||||
const actionNoLearningMentors = is_uk
|
|
||||||
? "a.Aktuell hast du noch keine Person als Praxisbildner eingeladen. Lade jetzt jemanden ein."
|
|
||||||
: "a.Aktuell hast du noch keine Person als Lernbegleitung eingeladen. Lade jetzt jemanden ein.";
|
|
||||||
return {
|
|
||||||
mentorTabTitle,
|
|
||||||
myLearningMentors,
|
|
||||||
inviteLearningMentor,
|
|
||||||
inviteLearningMentorShort,
|
|
||||||
noLearningMentors,
|
|
||||||
actionNoLearningMentors,
|
|
||||||
};
|
|
||||||
} catch (e) {
|
|
||||||
return {
|
|
||||||
mentorTabTitle: "",
|
|
||||||
myLearningMentors: "",
|
|
||||||
inviteLearningMentor: "",
|
|
||||||
inviteLearningMentorShort: "",
|
|
||||||
noLearningMentors: "",
|
|
||||||
actionNoLearningMentors: "",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return { ...texts.value };
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useCourseCircleProgress(circles: Ref<CircleType[] | undefined>) {
|
export function useCourseCircleProgress(circles: Ref<CircleType[] | undefined>) {
|
||||||
const inProgressCirclesCount = computed(() => {
|
const inProgressCirclesCount = computed(() => {
|
||||||
if (circles.value?.length) {
|
if (circles.value?.length) {
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ export type DashboardPersonRoleType =
|
||||||
|
|
||||||
export type DashboardRoleKeyType =
|
export type DashboardRoleKeyType =
|
||||||
| "Supervisor"
|
| "Supervisor"
|
||||||
| "Expert"
|
| "Trainer"
|
||||||
| "Member"
|
| "Member"
|
||||||
| "MentorUK"
|
| "MentorUK"
|
||||||
| "MentorVV";
|
| "MentorVV";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue