Skip to content

Commit

Permalink
fix show group
Browse files Browse the repository at this point in the history
  • Loading branch information
reyniersbram committed May 22, 2024
1 parent 4fd63ec commit 4895b32
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
{{ $d(project.deadline, "long") }}
</v-card-text>
<v-card-text>
<!--<h2 v-if="project.capacity > 1 && isInGroup " class="group"> {{ $t("project.group", { number: 1}) }}</h2> -->
<h2 v-if="project.capacity > 1 && !isLoading && group !== null" class="group">
{{ $t("project.group", { number: group?.num }) }}
</h2>
<h2 v-else-if="!isError" class="group">
{{ $t("project.no_group") }}
</h2>
<h2>{{ $t("subject.project.assignment") }}</h2>
<div
v-if="project.description && project.description.length <= assignmentLength"
Expand Down Expand Up @@ -67,15 +72,17 @@

<script setup lang="ts">
import type Project from "@/models/Project";
import { computed, ref } from "vue";
import { ref, toRefs } from "vue";
import { Quill } from "@vueup/vue-quill";
import { getUserGroups } from "@/services/group";
import { useProjectGroupQuery } from "@/queries/Group";

defineProps<{
const props = defineProps<{
selectedTab: number;
project: Project;
}>();

const { project } = toRefs(props);

const expanded = ref(false);
const assignmentLength = 100;

Expand All @@ -85,21 +92,7 @@ const renderQuillContent = (content: string) => {
return quill.root.innerHTML;
};

/*const { data: groups, isLoading, isError} = getUserGroups()
const projectGroup = ref()
const isInGroup = computed(() => {
if (!groups.value) return false;
return groups.value.some((groupelem) => {
if(groupelem.project_id === project.id){
projectGroup.value = groupelem;
return true;
}
return false;
});
});
*/
const { data: group, isLoading, isError } = useProjectGroupQuery(project.value.id);
</script>

<style scoped>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default {
group_button: "Join group",
needhelp_button: "Need help",
group: "Group {number}",
no_group: "Not yet in a group",
assignment: "Assignment:",
myProject: "My projects",
capacity_group: "Capacity: ",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default {
group_button: "Vind groep",
needhelp_button: "Hulp nodig",
group: "Groep {number}",
no_group: "Nog niet insgeschreven in een groep",
assignment: "Opdracht:",
myProject: "Mijn projecten",
capacity_group: "Capaciteit: ",
Expand Down

0 comments on commit 4895b32

Please sign in to comment.