Fix UI errors

This commit is contained in:
Christian Cueni 2023-01-30 13:22:30 +01:00
parent 013b3cf3b8
commit bd3388714e
12 changed files with 24 additions and 42 deletions

View File

@ -64,7 +64,7 @@ const showNavigationBorder = computed(() => {
@exit="circleStore.closeLearningContent(props.learningContent)" @exit="circleStore.closeLearningContent(props.learningContent)"
@next="circleStore.continueFromLearningContent(props.learningContent)" @next="circleStore.continueFromLearningContent(props.learningContent)"
> >
<div class="content"> <div>
<component <component
:is="component" :is="component"
:value="block.value" :value="block.value"

View File

@ -29,11 +29,11 @@ defineEmits(["next", "exit"]);
<div class="absolute top-0 bottom-0 w-full bg-white"> <div class="absolute top-0 bottom-0 w-full bg-white">
<div class="h-content overflow-y-scroll"> <div class="h-content overflow-y-scroll">
<header <header
class="absolute flex h-12 w-full items-center justify-between bg-white px-4 py-4 lg:px-8" class="relative flex h-12 w-full items-center justify-between bg-white px-4 py-4 lg:h-16 lg:px-8"
> >
<button <button
type="button" type="button"
class="absolute right-4 top-4 h-8 w-8 cursor-pointer" class="absolute right-2 top-2 h-8 w-8 cursor-pointer lg:right-4 lg:top-4"
data-cy="close-learning-content" data-cy="close-learning-content"
@click="$emit('exit')" @click="$emit('exit')"
> >
@ -50,7 +50,7 @@ defineEmits(["next", "exit"]);
<LearningContentBadge <LearningContentBadge
v-if="learningContentBlock && learningContentBlock.type" v-if="learningContentBlock && learningContentBlock.type"
:learning-content-type="learningContentBlock.type" :learning-content-type="learningContentBlock.type"
class="mr-2" class="mr-2 hidden lg:flex"
/> />
<h1 class="hidden text-base font-normal lg:inline-block" data-cy="ln-title"> <h1 class="hidden text-base font-normal lg:inline-block" data-cy="ln-title">
{{ title }} {{ title }}
@ -58,7 +58,7 @@ defineEmits(["next", "exit"]);
</div> </div>
<button <button
type="button" type="button"
class="btn-blue flex items-center" class="btn-blue btn-large-icon"
data-cy="complete-and-continue" data-cy="complete-and-continue"
@click="$emit('next')" @click="$emit('next')"
> >

View File

@ -18,7 +18,7 @@ defineEmits(["back", "continue"]);
<template> <template>
<div> <div>
<nav class="mt-16 flex lg:justify-between"> <nav class="mt-16 mb-4 flex">
<button <button
v-if="showBackButton" v-if="showBackButton"
class="btn-secondary mr-2 flex items-center" class="btn-secondary mr-2 flex items-center"

View File

@ -101,6 +101,9 @@ function handleBack() {
</div> </div>
</div> </div>
<LearningContentNavigation <LearningContentNavigation
:show-next-button="
questions.length > 1 && state.questionIndex + 1 < questions.length
"
:show-back-button="showBackButton" :show-back-button="showBackButton"
:question-index="state.questionIndex" :question-index="state.questionIndex"
:max-question-index="questions.length" :max-question-index="questions.length"

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="container-medium"> <div class="container-medium">
<div class="mt-4 lg:mt-12"> <div class="lg:mt-8">
<p class="text-large my-4">{{ value.description }}</p> <p class="text-large my-4">{{ value.description }}</p>
</div> </div>
</div> </div>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="container-medium"> <div class="container-medium">
<div class="mt-4 lg:mt-12"> <div class="lg:mt-8">
<p class="text-large my-4">{{ value.description }}</p> <p class="text-large my-4">{{ value.description }}</p>
<div class="resource-text" v-html="value.text"></div> <div class="resource-text" v-html="value.text"></div>
</div> </div>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="container-medium"> <div class="container-medium">
<div class="mt-4 lg:mt-12"> <div class="lg:mt-12">
<FeedbackForm :page="content" /> <FeedbackForm :page="content" />
</div> </div>
</div> </div>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="container-medium"> <div class="container-medium">
<div class="mt-4 lg:mt-12"> <div class="lg:mt-8">
<h1>{{ content.title }}</h1> <h1>{{ content.title }}</h1>
<p class="text-large my-4 lg:my-8">{{ value.description }}</p> <p class="text-large my-4 lg:my-8">{{ value.description }}</p>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="container-medium"> <div class="container-medium">
<div class="mt-4 lg:mt-12"> <div class="lg:mt-8">
<p class="text-large my-4">{{ value.description }}</p> <p class="text-large my-4">{{ value.description }}</p>
<h1>{{ content.title }}</h1> <h1>{{ content.title }}</h1>
</div> </div>

View File

@ -162,32 +162,7 @@ export const useCircleStore = defineStore({
continueFromLearningContent(currentLearningContent: LearningContent) { continueFromLearningContent(currentLearningContent: LearningContent) {
if (currentLearningContent) { if (currentLearningContent) {
this.markCompletion(currentLearningContent, "success"); this.markCompletion(currentLearningContent, "success");
this.closeLearningContent(currentLearningContent);
const nextLearningContent = currentLearningContent.nextLearningContent;
const currentParent = currentLearningContent.parentLearningUnit;
const nextParent = nextLearningContent?.parentLearningUnit;
if (
currentParent &&
currentParent.id &&
currentParent.id !== nextParent?.id &&
currentParent.children.length > 0
) {
// go to self evaluation
this.openSelfEvaluation(currentParent);
} else if (currentLearningContent.nextLearningContent) {
if (
currentLearningContent.parentLearningUnit &&
currentLearningContent.parentLearningUnit.id ===
nextLearningContent?.parentLearningUnit?.id
) {
this.openLearningContent(currentLearningContent.nextLearningContent);
} else {
this.closeLearningContent(currentLearningContent);
}
} else {
this.closeLearningContent(currentLearningContent);
}
} else { } else {
log.error("currentLearningContent is undefined"); log.error("currentLearningContent is undefined");
} }

View File

@ -122,6 +122,10 @@ svg {
hover:text-gray-700 hover:text-gray-700
disabled:cursor-not-allowed disabled:opacity-50; disabled:cursor-not-allowed disabled:opacity-50;
} }
.btn-large-icon {
@apply flex items-center px-6 py-3 text-xl font-bold;
}
} }
@layer utilities { @layer utilities {

View File

@ -8,13 +8,13 @@ class FeedbackFactory(DjangoModelFactory):
class Meta: class Meta:
model = FeedbackResponse model = FeedbackResponse
satisfaction = FuzzyInteger(1, 4) satisfaction = FuzzyInteger(2, 4)
goal_attainment = FuzzyInteger(1, 4) goal_attainment = FuzzyInteger(3, 4)
proficiency = FuzzyChoice([20, 40, 60, 80]) proficiency = FuzzyChoice([20, 40, 60, 80])
received_materials = FuzzyChoice([True, False]) received_materials = FuzzyChoice([True, False])
materials_rating = FuzzyInteger(1, 4) materials_rating = FuzzyInteger(2, 4)
instructor_competence = FuzzyInteger(1, 4) instructor_competence = FuzzyInteger(3, 4)
instructor_respect = FuzzyInteger(1, 4) instructor_respect = FuzzyInteger(3, 4)
instructor_open_feedback = FuzzyChoice( instructor_open_feedback = FuzzyChoice(
[ [
"Alles gut, manchmal etwas langfädig", "Alles gut, manchmal etwas langfädig",