feat: review model to retrieve all the questions with a single query

- update initial data
- add description field to the axe
This commit is contained in:
2022-11-02 11:16:17 +01:00
parent 075a508bb5
commit 3c4928ae61
20 changed files with 269 additions and 155 deletions

View File

@@ -6,15 +6,19 @@
<span class="part-number">{{ axeNumber }}</span>
<span>{{ title }}</span>
</h1>
<div v-if="description" class="description">{{ description }}</div>
<div class="icon">
<img :src="icon" width="200px" alt="" aria-hidden="true"/>
</div>
</header>
<section v-for="question in questions" :key="question._links.self.href" class="question">
<details>
<details v-if="question.description">
<summary> {{ question.label }}</summary>
<p>{{ question.description }}</p>
</details>
<div v-else class="title">
{{ question.label }}
</div>
<div class="rating">
<rating :color="color" :initial-value="getCurrentScore(question)" @rate="rate => onRate(rate, question)" />
</div>
@@ -36,6 +40,11 @@ export default class Quiz extends Vue {
})
private title!: string;
@Prop({
required: false
})
private description!: string;
@Prop({
required: true
})
@@ -132,15 +141,26 @@ $size: 31px;
margin: $small;
}
.description {
color: $gray_3;
font-weight: 400;
font-size: 0.875rem;
}
.question {
width: 100%;
}
.question details {
.question details,
.question .title {
margin-bottom: $x_small;
}
.question details summary {
.question details summary,
.question .title {
font-weight: 700;
font-size: $title-font-size;
}
.question details summary {
margin-bottom: $xxx_small;
}