feat: mentorCockpit -> learningMentees

This commit is contained in:
Livio Bieri 2024-03-11 17:05:21 +01:00
parent e88a9dae4d
commit 16e0aba504
8 changed files with 28 additions and 28 deletions

View File

@ -12,7 +12,7 @@ import { useMutation } from "@urql/vue";
import { UPSERT_ASSIGNMENT_COMPLETION_MUTATION } from "@/graphql/mutations";
import type { Assignment } from "@/types";
import DateEmbedding from "@/components/dueDates/DateEmbedding.vue";
import { useLearningMentors } from "@/composables";
import { useMyLearningMentors } from "@/composables";
import NoMentorInformationPanel from "@/components/mentor/NoMentorInformationPanel.vue";
const props = defineProps<{
@ -28,7 +28,7 @@ const upsertAssignmentCompletionMutation = useMutation(
UPSERT_ASSIGNMENT_COMPLETION_MUTATION
);
const learningMentors = useLearningMentors().learningMentors;
const learningMentors = useMyLearningMentors().learningMentors;
const selectedLearningMentor = ref();
const onSubmit = async () => {

View File

@ -466,7 +466,7 @@ export function useFileUpload() {
return { upload, error, loading, fileInfo };
}
export function useLearningMentors() {
export function useMyLearningMentors() {
const learningMentors = ref<LearningMentor[]>([]);
const currentCourseSessionId = useCurrentCourseSession().value.id;
const loading = ref(false);

View File

@ -1,6 +1,6 @@
<script setup lang="ts">
import type { Assignment } from "@/services/mentorCockpit";
import { useMentorCockpit } from "@/services/mentorCockpit";
import type { Assignment } from "@/services/learningMentees";
import { useLearningMentees } from "@/services/learningMentees";
import { useCurrentCourseSession } from "@/composables";
import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue";
import { computed, type Ref, ref } from "vue";
@ -11,8 +11,8 @@ import SelfAssignmentFeedbackAssignmentItem from "@/components/learningMentor/Se
const { t } = useTranslation();
const courseSession = useCurrentCourseSession();
const mentorCockpitStore = useMentorCockpit(courseSession.value.id);
const summary = mentorCockpitStore.summary;
const learningMentees = useLearningMentees(courseSession.value.id);
const summary = learningMentees.summary;
const statusFilterValue = ref({ name: t("Alle"), id: "_all" });
@ -73,7 +73,7 @@ const filteredAssignments: Ref<Assignment[]> = computed(() => {
<template v-for="item in filteredAssignments" :key="item.id">
<PraxisAssignmentItem
v-if="item.type === 'praxis_assignment'"
:circle-title="mentorCockpitStore.getCircleTitleById(item.circle_id)"
:circle-title="learningMentees.getCircleTitleById(item.circle_id)"
:pending-tasks="item.pending_evaluations"
:task-link="{
name: 'learningMentorPraxisAssignments',
@ -83,7 +83,7 @@ const filteredAssignments: Ref<Assignment[]> = computed(() => {
/>
<SelfAssignmentFeedbackAssignmentItem
v-else-if="item.type === 'self_evaluation_feedback'"
:circle-title="mentorCockpitStore.getCircleTitleById(item.circle_id)"
:circle-title="learningMentees.getCircleTitleById(item.circle_id)"
:pending-tasks="item.pending_evaluations"
:task-link="{
name: 'learningMentorSelfEvaluationFeedbackAssignments',

View File

@ -1,9 +1,9 @@
<script setup lang="ts">
import { useMentorCockpit } from "@/services/mentorCockpit";
import { useLearningMentees } from "@/services/learningMentees";
import { useCurrentCourseSession } from "@/composables";
const courseSession = useCurrentCourseSession();
const { summary } = useMentorCockpit(courseSession.value.id);
const { summary } = useLearningMentees(courseSession.value.id);
</script>
<template>

View File

@ -1,6 +1,6 @@
<script setup lang="ts">
import type { Assignment, Participant } from "@/services/mentorCockpit";
import { useMentorCockpit } from "@/services/mentorCockpit";
import type { Assignment, Participant } from "@/services/learningMentees";
import { useLearningMentees } from "@/services/learningMentees";
import { computed, onMounted, type Ref } from "vue";
import { useCurrentCourseSession } from "@/composables";
import log from "loglevel";
@ -10,10 +10,10 @@ const props = defineProps<{
}>();
const courseSession = useCurrentCourseSession();
const mentorCockpitStore = useMentorCockpit(courseSession.value.id);
const participants = computed(() => mentorCockpitStore.summary.value?.participants);
const learningMentees = useLearningMentees(courseSession.value.id);
const participants = computed(() => learningMentees.summary.value?.participants);
const praxisAssignment: Ref<Assignment | null> = computed(() =>
mentorCockpitStore.getAssignmentById(props.praxisAssignmentId)
learningMentees.getAssignmentById(props.praxisAssignmentId)
);
const getParticipantById = (id: string): Participant | null => {
@ -22,7 +22,7 @@ const getParticipantById = (id: string): Participant | null => {
onMounted(() => {
log.debug("MentorPraxisAssignment mounted");
mentorCockpitStore.fetchData();
learningMentees.fetchData();
});
</script>
@ -31,7 +31,7 @@ onMounted(() => {
<div class="p-6">
<h2 class="mb-2">{{ $t("a.Praxisauftrag") }}: {{ praxisAssignment.title }}</h2>
<span class="text-gray-800">
Circle «{{ mentorCockpitStore.getCircleTitleById(praxisAssignment.circle_id) }}»
Circle «{{ learningMentees.getCircleTitleById(praxisAssignment.circle_id) }}»
</span>
<template v-if="praxisAssignment.pending_evaluations > 0">
<div class="flex flex-row items-center space-x-2 pt-4">

View File

@ -1,6 +1,6 @@
<script setup lang="ts">
import type { Assignment, Participant } from "@/services/mentorCockpit";
import { useMentorCockpit } from "@/services/mentorCockpit";
import type { Assignment, Participant } from "@/services/learningMentees";
import { useLearningMentees } from "@/services/learningMentees";
import { computed, type Ref } from "vue";
import { useCurrentCourseSession } from "@/composables";
@ -9,15 +9,15 @@ const props = defineProps<{
}>();
const courseSession = useCurrentCourseSession();
const mentorCockpitStore = useMentorCockpit(courseSession.value.id);
const learningMentees = useLearningMentees(courseSession.value.id);
const selfEvaluationFeedback: Ref<Assignment | null> = computed(() =>
mentorCockpitStore.getAssignmentById(props.learningUnitId)
learningMentees.getAssignmentById(props.learningUnitId)
);
const getParticipantById = (id: string): Participant | null => {
if (mentorCockpitStore.summary.value?.participants) {
const found = mentorCockpitStore.summary.value.participants.find(
if (learningMentees.summary.value?.participants) {
const found = learningMentees.summary.value.participants.find(
(item) => item.id === id
);
return found || null;
@ -34,7 +34,7 @@ const getParticipantById = (id: string): Participant | null => {
</h2>
<span class="text-gray-800">
Circle «{{
mentorCockpitStore.getCircleTitleById(selfEvaluationFeedback.circle_id)
learningMentees.getCircleTitleById(selfEvaluationFeedback.circle_id)
}}»
</span>
<template v-if="selfEvaluationFeedback.pending_evaluations > 0">

View File

@ -1,6 +1,6 @@
<script setup lang="ts">
import type { LearningUnit, LearningUnitPerformanceCriteria } from "@/types";
import { useLearningMentors } from "@/composables";
import { useMyLearningMentors } from "@/composables";
import { computed, ref } from "vue";
import ItButton from "@/components/ui/ItButton.vue";
import NoMentorInformationPanel from "@/components/mentor/NoMentorInformationPanel.vue";
@ -24,7 +24,7 @@ const isStoredFeedbackLoading = computed(() => selfEvaluationFeedback.loading.va
const feedbackProvider = computed(() => storedFeedback.value?.feedback_provider_user);
// if no feedback is stored "current session" state management (mentor selection etc.)
const learningMentors = useLearningMentors();
const learningMentors = useMyLearningMentors();
const isMentorsLoading = computed(() => learningMentors.loading.value);
const mentors = computed(() => {

View File

@ -45,7 +45,7 @@ interface Summary {
assignments: Assignment[];
}
export const useMentorCockpit = (
export const useLearningMentees = (
courseSessionId: string | Ref<string> | (() => string)
) => {
const isLoading = ref(false);