fix: linting + small fixes
This commit is contained in:
parent
5facb54290
commit
0f1009ba43
6 changed files with 150 additions and 169 deletions
|
@ -1,26 +1,22 @@
|
|||
<script setup lang="ts">
|
||||
import type {Language} from "@/data-objects/language.ts";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import UsingQueryResult from "@/components/UsingQueryResult.vue";
|
||||
import { useAssignmentSubmissionsQuery } from "@/queries/assignments.ts";
|
||||
import type { SubmissionsResponse } from "@/controllers/submissions.ts";
|
||||
|
||||
const props = defineProps<{
|
||||
lpHruid: string,
|
||||
group: object;
|
||||
assignmentId: number;
|
||||
classId: string;
|
||||
language: Language;
|
||||
goToGroupSubmissionLink: (groupNo: number) => void;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
// Call the submissions query
|
||||
const submissionsQuery = useAssignmentSubmissionsQuery(
|
||||
() => props.classId,
|
||||
() => props.assignmentId,
|
||||
() => props.group.originalGroupNo, // Using the classId for both class and group-related data
|
||||
() => true
|
||||
() => props.group.originalGroupNo,
|
||||
() => true,
|
||||
);
|
||||
</script>
|
||||
|
||||
|
@ -30,11 +26,12 @@ const submissionsQuery = useAssignmentSubmissionsQuery(
|
|||
v-slot="{ data }: { data: SubmissionsResponse }"
|
||||
>
|
||||
<v-btn
|
||||
:color="(data.submissions.length > 0) ? 'green' : 'red'"
|
||||
:color="data.submissions.length > 0 ? 'green' : 'red'"
|
||||
variant="text"
|
||||
:to="(data.submissions.length > 0) ? goToGroupSubmissionLink(props.group.groupNo) : undefined"
|
||||
:to="data.submissions.length > 0 ? goToGroupSubmissionLink(props.group.groupNo) : undefined"
|
||||
:disabled="data.submissions.length === 0"
|
||||
>
|
||||
{{ (data.submissions.length > 0) ? t("see-submission") : t("no-submission")}}
|
||||
{{ data.submissions.length > 0 ? t("see-submission") : t("no-submission") }}
|
||||
</v-btn>
|
||||
</using-query-result>
|
||||
</template>
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
const route = useRoute();
|
||||
const classId = ref<string>(route.params.classId as string);
|
||||
const assignmentId = ref(Number(route.params.id));
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import {ref, computed, type Ref, watchEffect} from "vue";
|
||||
import { ref, computed, watchEffect } from "vue";
|
||||
import auth from "@/services/auth/auth-service.ts";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useAssignmentQuery } from "@/queries/assignments.ts";
|
||||
|
@ -10,7 +10,6 @@ import {ref, computed, type Ref, watchEffect} from "vue";
|
|||
import { useGroupsQuery } from "@/queries/groups.ts";
|
||||
import { useGetLearningPathQuery } from "@/queries/learning-paths.ts";
|
||||
import type { Language } from "@/data-objects/language.ts";
|
||||
import type { GroupDTO } from "@dwengo-1/common/interfaces/group";
|
||||
import { calculateProgress } from "@/utils/assignment-utils.ts";
|
||||
|
||||
const props = defineProps<{
|
||||
|
@ -46,12 +45,9 @@ import {calculateProgress} from "@/utils/assignment-utils.ts";
|
|||
...group,
|
||||
groupNo: index + 1, // Renumbered index
|
||||
}))
|
||||
.find((group) =>
|
||||
group.members?.some((m) => m.username === username.value),
|
||||
);
|
||||
.find((group) => group.members?.some((m) => m.username === username.value));
|
||||
});
|
||||
|
||||
|
||||
watchEffect(() => {
|
||||
learningPath.value = assignmentQueryResult.data.value?.assignment?.learningPath;
|
||||
lang.value = assignmentQueryResult.data.value?.assignment?.language as Language;
|
||||
|
@ -147,7 +143,6 @@ watchEffect(() => {
|
|||
</v-progress-linear>
|
||||
</using-query-result>
|
||||
</v-card-text>
|
||||
|
||||
</v-card-text>
|
||||
|
||||
<v-card-text class="group-section">
|
||||
|
@ -171,11 +166,6 @@ watchEffect(() => {
|
|||
<style scoped>
|
||||
@import "@/assets/assignment.css";
|
||||
|
||||
.progress-label {
|
||||
font-weight: bold;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
width: 40%;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ watchEffect(() => {
|
|||
lang.value = assignmentQueryResult.data.value?.assignment?.language as Language;
|
||||
});
|
||||
|
||||
|
||||
const allGroups = computed(() => {
|
||||
const groups = groupsQueryResult.data.value?.groups;
|
||||
|
||||
|
@ -51,12 +50,10 @@ const allGroups = computed(() => {
|
|||
groupNo: index + 1, // New group number that will be used
|
||||
name: `${t("group")} ${index + 1}`,
|
||||
members: group.members,
|
||||
submitted: false, // TODO: fetch from submission
|
||||
originalGroupNo: group.groupNumber, // Keep original number if needed
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
const dialog = ref(false);
|
||||
const selectedGroup = ref({});
|
||||
|
||||
|
@ -99,7 +96,6 @@ function goToGroupSubmissionLink(groupNo: number): string | undefined {
|
|||
|
||||
return `/learningPath/${lp.hruid}/${lp.language}/${lp.startNode.learningobjectHruid}?forGroup=${groupNo}&assignmentNo=${props.assignmentId}&classId=${props.classId}`;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -220,8 +216,7 @@ function goToGroupSubmissionLink(groupNo: number): string | undefined {
|
|||
color="primary"
|
||||
@click="dialog = false"
|
||||
>Close
|
||||
</v-btn
|
||||
>
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue