Fix competence data loading for profile user
This commit is contained in:
parent
b24dbc84c8
commit
d36a6e3693
|
|
@ -100,7 +100,9 @@ const getIconName = () => {
|
|||
{{ $t("a.mit Abzug") }}
|
||||
</div>
|
||||
<div
|
||||
v-if="assignment.completions[0] && !assignment.completions[0].evaluation_passed"
|
||||
v-if="
|
||||
assignment.completions[0] && !assignment.completions[0].evaluation_passed
|
||||
"
|
||||
class="my-2 rounded-md bg-error-red-200 px-2.5 py-0.5"
|
||||
>
|
||||
{{ $t("a.Nicht Bestanden") }}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ const certificatesQuery = useQuery({
|
|||
variables: {
|
||||
courseSlug: props.courseSlug,
|
||||
courseSessionId: courseSession.value.id,
|
||||
userIds: [user.id ?? user.id],
|
||||
userIds: [props.userId ?? user.id],
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const certificatesQuery = useQuery({
|
|||
variables: {
|
||||
courseSlug: props.courseSlug,
|
||||
courseSessionId: courseSession.value.id,
|
||||
userIds: [user.id ?? user.id],
|
||||
userIds: [props.userId ?? user.id],
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import log from "loglevel";
|
||||
import {
|
||||
COMPETENCE_NAVI_CERTIFICATE_QUERY,
|
||||
} from "@/graphql/queries";
|
||||
import { COMPETENCE_NAVI_CERTIFICATE_QUERY } from "@/graphql/queries";
|
||||
import { useQuery } from "@urql/vue";
|
||||
import { computed } from "vue";
|
||||
import type { CompetenceCertificate } from "@/types";
|
||||
|
|
@ -33,7 +31,7 @@ const certificatesQuery = useQuery({
|
|||
variables: {
|
||||
courseSlug: props.courseSlug,
|
||||
courseSessionId: courseSession.value.id,
|
||||
userIds: [user.id ?? user.id],
|
||||
userIds: user.id,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import log from "loglevel";
|
|||
import { computed, onMounted, ref } from "vue";
|
||||
import { type DashboardPersonType, fetchDashboardPersons } from "@/services/dashboard";
|
||||
import LoadingSpinner from "@/components/ui/LoadingSpinner.vue";
|
||||
import { useCurrentCourseSession } from "@/composables";
|
||||
import { COMPETENCE_NAVI_CERTIFICATE_QUERY } from "@/graphql/queries";
|
||||
import { graphqlClient } from "@/graphql/client";
|
||||
import type { CompetenceCertificateObjectType } from "@/gql/graphql";
|
||||
|
|
@ -21,8 +20,6 @@ const props = defineProps<{
|
|||
|
||||
log.debug("AgentCompetenceGradeDetailPage created", props);
|
||||
|
||||
const courseSession = useCurrentCourseSession();
|
||||
|
||||
const loading = ref(true);
|
||||
|
||||
const participants = ref<DashboardPersonType[]>([]);
|
||||
|
|
@ -76,21 +73,22 @@ const totalAverageGrade = computed(() => {
|
|||
false
|
||||
);
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
log.debug("AgentAssignmentDetailPage mounted", courseSession);
|
||||
log.debug("AgentAssignmentDetailPage mounted");
|
||||
|
||||
const personData = await fetchDashboardPersons("default");
|
||||
participants.value = personData?.filter((p) => {
|
||||
return p.course_sessions.find(
|
||||
(cs) => cs.id === courseSession.value.id && cs.my_role === "BERUFSBILDNER"
|
||||
(cs) => cs.id === props.courseSessionId && cs.my_role === "BERUFSBILDNER"
|
||||
);
|
||||
});
|
||||
|
||||
const res = await graphqlClient.query(COMPETENCE_NAVI_CERTIFICATE_QUERY, {
|
||||
courseSlug: props.courseSlug,
|
||||
courseSessionId: courseSession.value.id,
|
||||
courseSessionId: props.courseSessionId,
|
||||
userIds: participantUserIds.value,
|
||||
});
|
||||
|
||||
|
|
@ -111,7 +109,10 @@ onMounted(async () => {
|
|||
<LoadingSpinner />
|
||||
</div>
|
||||
<div v-else class="container-large flex flex-col space-y-8">
|
||||
<router-link class="btn-text inline-flex items-center pl-0" to="/">
|
||||
<router-link
|
||||
class="btn-text inline-flex items-center pl-0"
|
||||
:to="`/statistic/${props.agentRole}/${props.courseSlug}/competence-grade`"
|
||||
>
|
||||
<it-icon-arrow-left />
|
||||
<span>{{ $t("general.back") }}</span>
|
||||
</router-link>
|
||||
|
|
@ -162,7 +163,20 @@ onMounted(async () => {
|
|||
</div>
|
||||
|
||||
<div class="w-full flex-auto items-end md:w-1/4 md:text-end">
|
||||
Details anzeigen
|
||||
<router-link
|
||||
:to="{
|
||||
name: 'profileLearningPath',
|
||||
params: {
|
||||
userId: person.user_id,
|
||||
courseSlug: props.courseSlug,
|
||||
},
|
||||
query: { courseSessionId: props.courseSessionId },
|
||||
}"
|
||||
data-cy="person-learning-path-link"
|
||||
class="link w-full lg:text-right"
|
||||
>
|
||||
{{ $t("a.Profil anzeigen") }}
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ const courseSessionCompetenceAssignments = computed(() => {
|
|||
:data-cy="`entry-${entry.courseSessionId}`"
|
||||
class="flex flex-col justify-between gap-4 border-b p-2 last:border-b-0 md:flex-row md:items-center md:justify-between md:gap-16"
|
||||
>
|
||||
<div class="w-full flex-auto md:w-1/3">
|
||||
<div class="w-full flex-auto md:w-1/2">
|
||||
{{ entry.competenceCertificateTitle }}
|
||||
<br />
|
||||
{{ $t("a.Durchführung") }} «{{
|
||||
|
|
@ -152,7 +152,7 @@ const courseSessionCompetenceAssignments = computed(() => {
|
|||
}}»
|
||||
</div>
|
||||
|
||||
<div class="flex w-full flex-auto items-start md:w-1/3">
|
||||
<div class="flex w-full flex-auto items-start md:w-1/4">
|
||||
<div class="flex">
|
||||
<div>{{ $t("a.Durchschnittsnote") }}:</div>
|
||||
<div class="w-16 text-center">
|
||||
|
|
@ -161,7 +161,7 @@ const courseSessionCompetenceAssignments = computed(() => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex-auto items-end md:w-1/3 md:text-end">
|
||||
<div class="w-full flex-auto items-end md:w-1/4 md:text-end">
|
||||
<router-link
|
||||
class="underline"
|
||||
:to="`/statistic/${props.agentRole}/${props.courseSlug}/competence-grade/${entry.courseSessionId}/${entry.competenceCertificateId}`"
|
||||
|
|
|
|||
|
|
@ -220,9 +220,7 @@ fragment CoursePageFields on CoursePageInterface {{
|
|||
|
||||
# THEN
|
||||
self.assertResponseNoErrors(response)
|
||||
self.assertIsNone(
|
||||
response.json()["data"]["competence_certificate_list"]
|
||||
)
|
||||
self.assertIsNone(response.json()["data"]["competence_certificate_list"])
|
||||
|
||||
def test_member_userprofile_certificate_summary(self):
|
||||
self.client.force_login(self.member_one)
|
||||
|
|
|
|||
|
|
@ -530,7 +530,9 @@ def get_mentor_open_tasks_count(request, course_id: str):
|
|||
return Response(
|
||||
status=200,
|
||||
data={
|
||||
"open_task_count": _get_mentor_open_tasks_count(course_id, request.user) # noqa
|
||||
"open_task_count": _get_mentor_open_tasks_count(
|
||||
course_id, request.user
|
||||
) # noqa
|
||||
},
|
||||
)
|
||||
except PermissionDenied as e:
|
||||
|
|
|
|||
Loading…
Reference in New Issue