Commit d46e1cee authored by Kevin Robert's avatar Kevin Robert
Browse files

UNOTOPLYS-278 : divers correctifs d'affichages.

parent fc1a7301
......@@ -2,8 +2,8 @@
<div>
<autocomplete
:items="questions"
:label="$t('screen.item.conditions.answer.question.label')"
:helpText="$t('screen.item.conditions.answer.question.helpText')"
:label="$t('screen.item.conditions.answers.question.label')"
:helpText="$t('screen.item.conditions.answers.question.helpText')"
:value="selectedQuestionLabel"
@selected="selectQuestion"
/>
......
<template>
<autocomplete
:items="questions"
:label="$t('screen.item.conditions.answer.question.label')"
:helpText="$t('screen.item.conditions.answer.question.helpText')"
:label="$t('screen.item.conditions.answers.question.label')"
:helpText="$t('screen.item.conditions.answers.question.helpText')"
:value="selectedQuestionLabel"
@selected="selectQuestion"
/>
......
......@@ -43,10 +43,20 @@ export default class ItemConditions extends Vue {
document.removeEventListener('click', this.handleClickOutside);
}
/**
* Récupération des conditions affichables.
*/
public get conditionTypes() {
return ConditionTypes;
}
/**
* Vérification du type de condition pour savoir s'il est ajoutable.
*/
public isAddable(conditionType) {
return conditionType !== ConditionTypes.ADVANCED;
}
public handleClickOutside(event) {
if (!this.$el.contains(event.target)) {
this.displayAddCondition = false;
......
......@@ -40,7 +40,7 @@
</button>
<div class="relative">
<ul class="absolute pb-2 bottom-10 text-sm bg-white border rounded-md" id="pop0" v-show="displayAddCondition">
<li v-for="(type, key) in conditionTypes" :key="key">
<li v-for="(type, key) in conditionTypes" :key="key" v-if="isAddable(type)">
<button class="w-full px-4 py-1 text-left text-blue-600 hover:bg-blue-100 hover:text-blue-900" @click="addCondition(type)">
{{ $t(`screen.item.conditions.types.${type}`) }}
</button>
......
......@@ -75,7 +75,7 @@
"advanced": "Autre cas (saisie manuelle)",
"answers": "Réponses sélectionnées",
"hasAnswer": "Question répondue",
"notHasAnswer": "Question non répondue",
"hasNoAnswer": "Question non répondue",
"value": "Valeur d’une variable"
},
"advanced": {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment