feat: assignment description en lp editen is mogelijk
This commit is contained in:
parent
f83d5b54c0
commit
cc31effd61
4 changed files with 353 additions and 290 deletions
37
frontend/src/components/GroupSubmissionStatus.vue
Normal file
37
frontend/src/components/GroupSubmissionStatus.vue
Normal file
|
@ -0,0 +1,37 @@
|
|||
<script setup lang="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<{
|
||||
group: object;
|
||||
assignmentId: number;
|
||||
classId: string;
|
||||
goToGroupSubmissionLink: (groupNo: number) => void;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const submissionsQuery = useAssignmentSubmissionsQuery(
|
||||
() => props.classId,
|
||||
() => props.assignmentId,
|
||||
() => props.group.originalGroupNo,
|
||||
() => true,
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<using-query-result
|
||||
:query-result="submissionsQuery"
|
||||
v-slot="{ data }: { data: SubmissionsResponse }"
|
||||
>
|
||||
<v-btn
|
||||
:color="data.submissions.length > 0 ? 'green' : 'red'"
|
||||
variant="text"
|
||||
:to="data.submissions.length > 0 ? goToGroupSubmissionLink(props.group.groupNo) : undefined"
|
||||
:disabled="data.submissions.length === 0"
|
||||
>
|
||||
{{ data.submissions.length > 0 ? t("submission") : t("noSubmissionsYet") }}
|
||||
</v-btn>
|
||||
</using-query-result>
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue