style: fix linting issues met Prettier

This commit is contained in:
Lint Action 2025-04-21 06:30:38 +00:00
parent ef5c51b463
commit 11600b8be4
11 changed files with 578 additions and 541 deletions

View file

@ -1,51 +1,49 @@
<script setup lang="ts">
import {ref, defineProps, defineEmits} from 'vue';
import {useI18n} from 'vue-i18n';
import UsingQueryResult from "@/components/UsingQueryResult.vue";
import type {StudentsResponse} from "@/controllers/students.ts";
import {useClassStudentsQuery} from "@/queries/classes.ts";
import { ref, defineProps, defineEmits } from "vue";
import { useI18n } from "vue-i18n";
import UsingQueryResult from "@/components/UsingQueryResult.vue";
import type { StudentsResponse } from "@/controllers/students.ts";
import { useClassStudentsQuery } from "@/queries/classes.ts";
const props = defineProps<{
classId: string | undefined
groups: string[][],
}>();
const emit = defineEmits(['groupCreated']);
const {t} = useI18n();
const props = defineProps<{
classId: string | undefined;
groups: string[][];
}>();
const emit = defineEmits(["groupCreated"]);
const { t } = useI18n();
const selectedStudents = ref([]);
const selectedStudents = ref([]);
const studentQueryResult = useClassStudentsQuery(() => props.classId, true);
const studentQueryResult = useClassStudentsQuery(() => props.classId, true);
function filterStudents(data: StudentsResponse): { title: string, value: string }[] {
const students = data.students;
const studentsInGroups = props.groups.flat();
function filterStudents(data: StudentsResponse): { title: string; value: string }[] {
const students = data.students;
const studentsInGroups = props.groups.flat();
return students
?.map(st => ({
title: `${st.firstName} ${st.lastName}`,
value: st.username,
}))
.filter(student => !studentsInGroups.includes(student.value));
}
function createGroup(): void {
if (selectedStudents.value.length) {
// Extract only usernames (student.value)
const usernames = selectedStudents.value.map(student => student.value);
emit('groupCreated', usernames);
selectedStudents.value = []; // Reset selection after creating group
return students
?.map((st) => ({
title: `${st.firstName} ${st.lastName}`,
value: st.username,
}))
.filter((student) => !studentsInGroups.includes(student.value));
}
};
</script>
function createGroup(): void {
if (selectedStudents.value.length) {
// Extract only usernames (student.value)
const usernames = selectedStudents.value.map((student) => student.value);
emit("groupCreated", usernames);
selectedStudents.value = []; // Reset selection after creating group
}
}
</script>
<template>
<using-query-result
:query-result="studentQueryResult"
v-slot="{ data }: { data: StudentsResponse }"
>
<h3>{{ t('create-groups') }}</h3>
<h3>{{ t("create-groups") }}</h3>
<v-card-text>
<v-combobox
v-model="selectedStudents"
@ -62,14 +60,16 @@ function createGroup(): void {
append-inner-icon="mdi-magnify"
></v-combobox>
<v-btn @click="createGroup" color="primary" class="mt-2" size="small">
{{ t('create-group') }}
<v-btn
@click="createGroup"
color="primary"
class="mt-2"
size="small"
>
{{ t("create-group") }}
</v-btn>
</v-card-text>
</using-query-result>
</template>
<style scoped>
</style>
<style scoped></style>