Commit 94a8b88e authored by MARCO Jonathan's avatar MARCO Jonathan
Browse files

馃攢 Merge branch 'bugfix/review_list' into develop

parents 3df12d7d 2befc7af
Pipeline #62224 passed with stage
in 14 seconds
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: formbuilder plugin 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-21 16:34+0200\n"
"POT-Creation-Date: 2021-10-12 09:47+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -33,17 +33,17 @@ msgid "If you customize the color in Vuetify, you can define if your primary col
msgstr ""
#: ../../configuration/options.rst:27
#: ../../configuration/options.rst:55
#: ../../configuration/options.rst:56
msgid "option"
msgstr ""
#: ../../configuration/options.rst:27
#: ../../configuration/options.rst:55
#: ../../configuration/options.rst:56
msgid "type"
msgstr ""
#: ../../configuration/options.rst:27
#: ../../configuration/options.rst:55
#: ../../configuration/options.rst:56
msgid "default"
msgstr ""
......@@ -53,7 +53,7 @@ msgstr ""
#: ../../configuration/options.rst:29
#: ../../configuration/options.rst:31
#: ../../configuration/options.rst:57
#: ../../configuration/options.rst:58
msgid "boolean"
msgstr ""
......@@ -75,13 +75,17 @@ msgid "In the builder component you have a \"preview button\". This button displ
msgstr ""
#: ../../configuration/options.rst:38
msgid "The option ``previewIsSave`` set if this button save the form before the displaying or not."
msgid "The option ``previewIsSave`` set if this button saves the form before the displaying or not."
msgstr ""
#: ../../configuration/options.rst:57
#: ../../configuration/options.rst:39
msgid "The option ``hasPreviewButton`` defines if the button is displayed or not."
msgstr ""
#: ../../configuration/options.rst:58
msgid "previewIsSave"
msgstr ""
#: ../../configuration/options.rst:57
#: ../../configuration/options.rst:58
msgid "true"
msgstr ""
......@@ -35,7 +35,8 @@ Preview button action
---------------------
| In the builder component you have a "preview button". This button displays the form as if the user where using it.
| The option ``previewIsSave`` set if this button save the form before the displaying or not.
| The option ``previewIsSave`` set if this button saves the form before the displaying or not.
| The option ``hasPreviewButton`` defines if the button is displayed or not.
.. code-block:: javascript
......
......@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: formbuilder plugin 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-21 16:34+0200\n"
"POT-Creation-Date: 2021-10-12 09:47+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -37,65 +37,70 @@ msgid ""
"the font color is the white, or if the color is light, the font color is "
"the black."
msgstr ""
"Si vous personnalisez les couleurs de Vuetify, vous pouvez d茅finir si la couleur primaire "
"ou la couleur secondaire sont claire ou fonc茅e. Si la couleur est fonc茅e, "
"le text sera en blanc, et si la couleur est claire, le text sera "
"en noir."
"Si vous personnalisez les couleurs de Vuetify, vous pouvez d茅finir si la "
"couleur primaire ou la couleur secondaire sont claire ou fonc茅e. Si la "
"couleur est fonc茅e, le text sera en blanc, et si la couleur est claire, "
"le text sera en noir."
#: ../../configuration/options.rst:26 ../../configuration/options.rst:53
#: ../../configuration/options.rst:27 ../../configuration/options.rst:56
msgid "option"
msgstr ""
#: ../../configuration/options.rst:26 ../../configuration/options.rst:53
#: ../../configuration/options.rst:27 ../../configuration/options.rst:56
msgid "type"
msgstr ""
#: ../../configuration/options.rst:26 ../../configuration/options.rst:53
#: ../../configuration/options.rst:27 ../../configuration/options.rst:56
msgid "default"
msgstr "d茅faut"
#: ../../configuration/options.rst:28
#: ../../configuration/options.rst:29
msgid "primaryIsDark"
msgstr ""
#: ../../configuration/options.rst:28 ../../configuration/options.rst:30
#: ../../configuration/options.rst:55
#: ../../configuration/options.rst:29 ../../configuration/options.rst:31
#: ../../configuration/options.rst:58
msgid "boolean"
msgstr ""
#: ../../configuration/options.rst:28 ../../configuration/options.rst:30
#: ../../configuration/options.rst:29 ../../configuration/options.rst:31
msgid "false"
msgstr ""
#: ../../configuration/options.rst:30
#: ../../configuration/options.rst:31
msgid "secondaryIsDark"
msgstr ""
#: ../../configuration/options.rst:34
#: ../../configuration/options.rst:35
msgid "Preview button action"
msgstr "Bouton \"Pr茅visualisation\""
#: ../../configuration/options.rst:36
#: ../../configuration/options.rst:37
msgid ""
"In the builder component you have a \"preview button\". This button "
"displays the form as if the user where using it."
msgstr ""
"Dans l'interface de construction on retrouve un bouton de pr茅visualisation. Ce bouton "
"affiche le formulaire quand on clique dessus."
"Dans l'interface de construction on retrouve un bouton de "
"pr茅visualisation. Ce bouton affiche le formulaire quand on clique dessus."
#: ../../configuration/options.rst:37
#: ../../configuration/options.rst:38
msgid ""
"The option ``previewIsSave`` set if this button save the form before the "
"displaying or not."
"The option ``previewIsSave`` set if this button saves the form before the"
" displaying or not."
msgstr ""
"L'option ``previewIsSave`` modifie si ce bouton sauvegarde le formulaire "
"avant de l'afficher ou non."
#: ../../configuration/options.rst:39
msgid "The option ``hasPreviewButton`` defines if the button is displayed or not."
msgstr ""
"L'option ``previewIsSave`` modifie si ce bouton sauvegarde le formulaire avant "
"de l'afficher ou non."
"L'option ``hasPreviewButton`` modifie si ce bouton est affich茅 ou non."
#: ../../configuration/options.rst:55
#: ../../configuration/options.rst:58
msgid "previewIsSave"
msgstr ""
#: ../../configuration/options.rst:55
#: ../../configuration/options.rst:58
msgid "true"
msgstr ""
<template>
<div id="UsfActionButtonsContainer">
<v-tooltip bottom v-if="previewIsSave || !hasFields">
<template v-slot:activator="{on, attrs}">
<div v-on="on" :class="{save_disabled: !hasFields}">
<v-btn
v-bind="attrs"
outlined
block
small
tile
color="primary"
:disabled="!hasFields"
>
{{ _uct('builder.actionButtons.preview') }}
<v-icon right>mdi-tooltip-image</v-icon>
</v-btn>
</div>
</template>
<span v-if="hasFields">{{ _uct('builder.actionButtons.previewInfo') }}</span>
<span v-else>{{ _uct('builder.actionButtons.previewDisabled') }}</span>
</v-tooltip>
<div v-if="hasPreviewButton">
<v-tooltip bottom v-if="previewIsSave || !hasFields">
<template v-slot:activator="{on, attrs}">
<div v-on="on" :class="{save_disabled: !hasFields}">
<v-btn
v-bind="attrs"
outlined
block
small
tile
color="primary"
:disabled="!hasFields"
@click.stop="onPreview"
>
{{ _uct('builder.actionButtons.preview') }}
<v-icon right>mdi-tooltip-image</v-icon>
</v-btn>
</div>
</template>
<span v-if="hasFields">{{ _uct('builder.actionButtons.previewInfo') }}</span>
<span v-else>{{ _uct('builder.actionButtons.previewDisabled') }}</span>
</v-tooltip>
<v-btn
v-else
outlined
block
small
tile
color="primary"
@click.stop="onPreview"
>
{{ _uct('builder.actionButtons.preview') }}{{ !hasFields }}
<v-icon right>mdi-tooltip-image</v-icon>
</v-btn>
</div>
<v-btn
v-else
outlined
block
small
tile
color="primary"
@click.stop="$emit('preview', { fields: denormalizedFields, messages })"
>
{{ _uct('builder.actionButtons.preview') }}{{ !hasFields }}
<v-icon right>mdi-tooltip-image</v-icon>
</v-btn>
<v-btn
outlined
block
......@@ -93,19 +97,24 @@ export default Vue.extend({
]),
...mapState('form', ['messages']),
},
methods: {
onPreview() {
if (this.hasFields) {
this.$emit('preview', { fields: this.denormalizedFields, messages: this.messages });
}
},
},
});
</script>
<style lang="scss" scoped>
#UsfActionButtonsContainer {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 24px;
display: flex;
flex-direction: column;
@media all and (max-width: 1800px) {
display: flex;
flex-wrap: wrap;
grid-gap: 10px;
> div, > button {
margin-bottom: 15px;
}
.v-btn {
......
......@@ -23,9 +23,20 @@
<v-btn @click="onAddItem('||')" color="primary" outlined>OU</v-btn>
<v-btn @click="onAddItem('(')" color="primary" outlined>(</v-btn>
<v-btn @click="onAddItem(')')" color="primary" outlined>)</v-btn>
<v-btn @click="onEmptyConditions" color="primary" outlined>
<v-icon>mdi-delete-empty-outline</v-icon>
</v-btn>
<v-tooltip bottom>
<template v-slot:activator="{on, attrs}">
<v-btn
@click="onEmptyConditions"
color="primary"
outlined
v-on="on"
v-bind="attrs"
>
<v-icon>mdi-delete-empty-outline</v-icon>
</v-btn>
</template>
<span>{{ _uct('builder.tabs.conditional.emptyInformation') }}</span>
</v-tooltip>
<usf-tab-conditional-basic-select
:field="field"
......
......@@ -88,15 +88,19 @@ export default vue.extend({
},
},
data: (): ComponentData => ({
data: function (): ComponentData {
return {
itemLinked: null,
valueSelected: null,
operators: [
{ text: 'ET', value: '&&' },
{ text: 'OU', value: '||' },
// @ts-ignore
{ text: this._uct('builder.tabs.conditional.operators.and'), value: '&&' },
// @ts-ignore
{ text: this._uct('builder.tabs.conditional.operators.or'), value: '||' },
],
operatorSelected: null,
}),
}
},
computed: {
fieldIsSelectWithValue(): boolean {
......
......@@ -64,11 +64,18 @@ export default vue.extend({
switch (item.type) {
case 'field':
case 'token':
const field = this.getFieldById(item.id)
const field = this.getFieldById(item.id);
return `${field?.name || item.id}=${item.value}`;
case 'item':
return item.value;
switch (item.value) {
case '&&':
return this._uct('builder.tabs.conditional.operators.and');
case '||':
return this._uct('builder.tabs.conditional.operators.or');
default:
return item.value;
}
}
},
onDeleteItem(itemDeleted: FieldCondition): void {
......
<template>
<div>
<v-data-table
:items="locales"
:headers="headers"
dense
:no-data-text="_uct('builder.tabs.internationalization.dataTable.noTextMessage')"
:items="locales"
:headers="headers"
dense
:no-data-text="_uct('builder.tabs.internationalization.dataTable.noTextMessage')"
>
<template v-slot:top>
<div id="i18nDatatableHead">
......@@ -13,17 +13,17 @@
:label="_uct('builder.tabs.internationalization.dataTable.headers.fallback')"
@change="updateFallbackLocale"
/>
<v-spacer/>
<v-dialog v-model=showAddLocale width="600">
<v-spacer />
<v-dialog v-model=showAddLocale width="600" persistent>
<template v-slot:activator="{ on, attrs }">
<v-btn
tile
elevation="0"
color="primary"
:class="{ 'light-button': !primaryIsDark }"
outlined
v-bind="attrs"
v-on="on"
tile
elevation="0"
color="primary"
:class="{ 'light-button': !primaryIsDark }"
outlined
v-bind="attrs"
v-on="on"
>
{{ _uct('builder.tabs.internationalization.title') }}
</v-btn>
......@@ -42,15 +42,15 @@
<v-row class="flex-column">
<v-col>
<v-text-field
v-model="newLocale"
color="primary"
:label="_uct('builder.tabs.internationalization.localeName')"
placeholder="Ex: en"
v-model="newLocale"
color="primary"
:label="_uct('builder.tabs.internationalization.localeName')"
placeholder="Ex: en"
/>
</v-col>
<v-col>
<div class="help--container">
<v-switch v-model="isNewLocaleRtl" color="primary" label="RTL"/>
<v-switch v-model="isNewLocaleRtl" color="primary" label="RTL" />
<v-tooltip bottom>
<template v-slot:activator="{attrs, on}">
<v-icon v-on="on" v-bind="attrs">mdi-help-circle-outline</v-icon>
......@@ -63,13 +63,23 @@
</v-card-text>
<v-card-actions>
<v-spacer/>
<v-spacer />
<v-btn
tile
elevation="0"
color="primary"
:class="{ 'light-button': !primaryIsDark }"
@click="onAddLocale"
tile
elevation="0"
color="primary"
outlined
:class="{ 'light-button': !primaryIsDark }"
@click="onCancel"
>
{{ _uct('builder.duplicate.dialog.buttons.cancel') }}
</v-btn>
<v-btn
tile
elevation="0"
color="primary"
:class="{ 'light-button': !primaryIsDark }"
@click="onAddLocale"
>
{{ _uct('builder.tabs.internationalization.buttonAdd') }}
</v-btn>
......@@ -80,9 +90,9 @@
</template>
<template v-slot:item.rtl="{ item }">
<v-simple-checkbox
ripple
:value="item.rtl"
@input="updateRltStatusOfLocale({newStatus: $event, locale: item.locale})"
ripple
:value="item.rtl"
@input="updateRltStatusOfLocale({newStatus: $event, locale: item.locale})"
/>
</template>
<template v-slot:item.delete="{ item }">
......@@ -99,13 +109,13 @@
</template>
<script lang="ts">
import {mapGetters, mapActions} from 'vuex'
import { mapGetters, mapActions } from 'vuex';
import vue from 'vue';
export default vue.extend({
name: 'UsfTabInternationalizationForm',
data: function () {
data: function() {
return {
headers: [
{
......@@ -134,7 +144,7 @@ export default vue.extend({
newLocale: '',
isNewLocaleRtl: false,
showEditLocale: false,
}
};
},
computed: {
......@@ -153,13 +163,19 @@ export default vue.extend({
'updateRltStatusOfLocale',
]),
onAddLocale(): void {
this.addLocale({locale: this.newLocale, rtl: this.isNewLocaleRtl})
this.newLocale = ''
this.isNewLocaleRtl = false
this.showAddLocale = false
this.addLocale({ locale: this.newLocale, rtl: this.isNewLocaleRtl });
this.reset();
},
onCancel(): void {
this.reset();
},
reset(): void {
this.newLocale = '';
this.isNewLocaleRtl = false;
this.showAddLocale = false;
},
},
})
});
</script>
<style lang="scss" scoped>
......
<template>
<v-form
ref="form"
lazy-validation
@submit.prevent="submitForm"
>
<section>
<v-btn
@click="$emit('form-edition')"
color="primary"
v-if="isHybridForm && !autoCompletionIsActive"
@click="onActiveAutoCompletion"
v-if="isPreviewMode"
>
<span v-if="userIsConnected">{{ _uct('builder.renderer.autoCompletion.button') }}</span>
<span v-else>{{ _uct('builder.renderer.autoCompletion.connection') }}</span>
{{ _uct('renderer.edition.button')}}
</v-btn>
<usf-field
v-for="(field, index) in root"
:key="field.id"
:field-id="field"
:field-index="index"
/>
<v-btn
v-if="isSubmitButtonDisplayed"
block
:color="submitButtonColor"
:disabled="isSubmitButtonDisabled"
:type="submitButtonType"
<v-form
ref="form"
lazy-validation
@submit.prevent="submitForm"
>
{{ submitButtonText }}
</v-btn>
</v-form>
<v-btn
color="primary"
v-if="isHybridForm && !autoCompletionIsActive"
@click="onActiveAutoCompletion"
>
<span v-if="userIsConnected">{{ _uct('renderer.autoCompletion.button') }}</span>
<span v-else>{{ _uct('renderer.autoCompletion.connection') }}</span>
</v-btn>
<usf-field
v-for="(field, index) in root"
:key="field.id"
:field-id="field"
:field-index="index"
/>
<v-btn
v-if="isSubmitButtonDisplayed"
block
:color="submitButtonColor"
:disabled="isSubmitButtonDisabled"
:type="submitButtonType"
>
{{ submitButtonText }}
</v-btn>
</v-form>
</section>
</template>
<script lang="ts">
......@@ -49,6 +59,11 @@ export default Vue.extend({
},