fix: linting + small fixes
This commit is contained in:
parent
5facb54290
commit
0f1009ba43
6 changed files with 150 additions and 169 deletions
|
@ -1,27 +1,23 @@
|
|||
<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";
|
||||
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 props = defineProps<{
|
||||
group: object;
|
||||
assignmentId: number;
|
||||
classId: string;
|
||||
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
|
||||
);
|
||||
const { t } = useI18n();
|
||||
const submissionsQuery = useAssignmentSubmissionsQuery(
|
||||
() => props.classId,
|
||||
() => props.assignmentId,
|
||||
() => props.group.originalGroupNo,
|
||||
() => true,
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue