WIP: Align widgets [skip ci]

This commit is contained in:
Christian Cueni 2024-04-09 16:34:27 +02:00
parent 2865328a8e
commit 14474d1799
6 changed files with 34 additions and 17 deletions

View File

@ -24,14 +24,14 @@ const progress = computed(() => ({
<div class="flex items-center"> <div class="flex items-center">
<i18next :translation="$t('a.NUMBER Elemente abgeschlossen')"> <i18next :translation="$t('a.NUMBER Elemente abgeschlossen')">
<template #NUMBER> <template #NUMBER>
<span class="mr-3 text-4xl font-bold">{{ totalAssignments }}</span> <span class="mr-3 text-xl font-bold">{{ totalAssignments }}</span>
</template> </template>
</i18next> </i18next>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<i18next :translation="$t('a.xOfY Punkten erreicht')"> <i18next :translation="$t('a.xOfY Punkten erreicht')">
<template #xOfY> <template #xOfY>
<span class="mr-3 text-4xl font-bold"> <span class="mr-3 text-xl font-bold">
{{ {{
$t("a.VALUE von MAXIMUM", { $t("a.VALUE von MAXIMUM", {
VALUE: props.achievedPointsCount, VALUE: props.achievedPointsCount,

View File

@ -28,8 +28,8 @@ onMounted(async () => {
</script> </script>
<template> <template>
<div v-if="assignment" class="mb-14 space-y-8"> <div v-if="assignment">
<div class="flex flex-col space-y-7 bg-white p-6"> <div class="w-[395px]">
<AssignmentProgressSummaryBox <AssignmentProgressSummaryBox
:total-assignments="assignment.total_count" :total-assignments="assignment.total_count"
:achieved-points-count="assignment.points_achieved_count" :achieved-points-count="assignment.points_achieved_count"

View File

@ -24,7 +24,7 @@ onMounted(async () => {
</script> </script>
<template> <template>
<div v-if="competence"> <div v-if="competence" class="w-[395px]">
<CompetenceSummaryBox <CompetenceSummaryBox
:fail-count="competence.fail_count" :fail-count="competence.fail_count"
:success-count="competence.success_count" :success-count="competence.success_count"

View File

@ -13,11 +13,11 @@ defineProps<{
<template #title>{{ $t("a.Selbsteinschätzungen") }}</template> <template #title>{{ $t("a.Selbsteinschätzungen") }}</template>
<template #content> <template #content>
<div class="flex items-center"> <div class="flex items-center">
<it-icon-smiley-happy class="mr-4 h-12 w-12"></it-icon-smiley-happy> <it-icon-smiley-happy class="mr-4 h-[28px] w-[28px]"></it-icon-smiley-happy>
<i18next :translation="$t('a.{NUMBER} Das kann ich')"> <i18next :translation="$t('a.{NUMBER} Das kann ich')">
<template #NUMBER> <template #NUMBER>
<span <span
class="mr-3 text-4xl font-bold" class="mr-3 text-2xl font-bold"
data-cy="dashboard.stats.competence.success" data-cy="dashboard.stats.competence.success"
> >
{{ successCount }} {{ successCount }}
@ -26,11 +26,13 @@ defineProps<{
</i18next> </i18next>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<it-icon-smiley-thinking class="mr-4 h-12 w-12"></it-icon-smiley-thinking> <it-icon-smiley-thinking
class="mr-4 h-[28px] w-[28px]"
></it-icon-smiley-thinking>
<i18next :translation="$t('a.{NUMBER} Das will ich nochmals anschauen')"> <i18next :translation="$t('a.{NUMBER} Das will ich nochmals anschauen')">
<template #NUMBER> <template #NUMBER>
<span <span
class="mr-3 text-4xl font-bold" class="mr-3 text-2xl font-bold"
data-cy="dashboard.stats.competence.fail" data-cy="dashboard.stats.competence.fail"
> >
{{ failCount }} {{ failCount }}

View File

@ -81,7 +81,7 @@ function hasActionButton(): boolean {
courseConfig.session_to_continue_id && courseConfig.session_to_continue_id &&
courseSlug courseSlug
" "
class="border-b border-gray-300 pb-8" class="border-b border-gray-300 pb-8 last:border-0"
> >
<LearningPathDiagram <LearningPathDiagram
:key="courseSlug" :key="courseSlug"
@ -90,19 +90,22 @@ function hasActionButton(): boolean {
diagram-type="horizontal" diagram-type="horizontal"
></LearningPathDiagram> ></LearningPathDiagram>
</div> </div>
<div v-if="numberOfProgressWidgets" class="flex flex-col flex-wrap"> <div
<CompetenceSummary v-if="numberOfProgressWidgets"
v-if="hasWidget('CompetenceWidget')" class="flex flex-col flex-wrap gap-x-[60px] border-b border-gray-300 pb-8 last:border-0 md:flex-row"
:course-slug="courseSlug" >
:session-to-continue-id="courseConfig.session_to_continue_id"
:course-id="courseConfig.course_id"
></CompetenceSummary>
<AssignmentSummary <AssignmentSummary
v-if="hasWidget('CompetenceCertificateWidget')" v-if="hasWidget('CompetenceCertificateWidget')"
:course-slug="courseSlug" :course-slug="courseSlug"
:session-to-continue-id="courseConfig.session_to_continue_id" :session-to-continue-id="courseConfig.session_to_continue_id"
:course-id="courseConfig.course_id" :course-id="courseConfig.course_id"
/> />
<CompetenceSummary
v-if="hasWidget('CompetenceWidget')"
:course-slug="courseSlug"
:session-to-continue-id="courseConfig.session_to_continue_id"
:course-id="courseConfig.course_id"
></CompetenceSummary>
</div> </div>
<div v-if="numberOfMentorWidgets > 0" class="flex flex-col flex-wrap md:flex-row"> <div v-if="numberOfMentorWidgets > 0" class="flex flex-col flex-wrap md:flex-row">
<MentorOpenTasksCount <MentorOpenTasksCount

View File

@ -65,11 +65,13 @@ function newDashboardConfigForId(id: string) {
@update:model-value="dashboardStore.switchAndLoadDashboardConfig" @update:model-value="dashboardStore.switchAndLoadDashboardConfig"
></ItDropdownSelect> ></ItDropdownSelect>
</div> </div>
<!-- new way of dashboard -->
<ul> <ul>
<li v-for="config in dashboardStore.dashboardConfigs" :key="config.id"> <li v-for="config in dashboardStore.dashboardConfigs" :key="config.id">
<CoursePanel :course-config="newDashboardConfigForId(config.id)" /> <CoursePanel :course-config="newDashboardConfigForId(config.id)" />
</li> </li>
</ul> </ul>
<!-- end of new way of dashboard -->
<!-- keep until we unify the dashboard --> <!-- keep until we unify the dashboard -->
<CoursePanel <CoursePanel
v-if=" v-if="
@ -80,10 +82,20 @@ function newDashboardConfigForId(id: string) {
newDashboardConfigForId(dashboardStore.currentDashboardConfig.id) newDashboardConfigForId(dashboardStore.currentDashboardConfig.id)
" "
/> />
<CoursePanel
v-else-if="
dashboardStore.currentDashboardConfig.dashboard_type ===
'PROGRESS_DASHBOARD'
"
:course-config="
newDashboardConfigForId(dashboardStore.currentDashboardConfig.id)
"
/>
<component <component
:is="boards[dashboardStore.currentDashboardConfig.dashboard_type].main" :is="boards[dashboardStore.currentDashboardConfig.dashboard_type].main"
v-else v-else
></component> ></component>
<!-- end of old way of dashboard -->
</div> </div>
</main> </main>
<aside class="m-8 lg:order-1 lg:w-[343px]"> <aside class="m-8 lg:order-1 lg:w-[343px]">