mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch 'issue344_vue_multiselect_i18n' into 'master'
Issue344 vue multiselect i18n See merge request Chill-Projet/chill-bundles!278
This commit is contained in:
commit
01d51da7e1
@ -11,8 +11,8 @@ and this project adheres to
|
||||
## Unreleased
|
||||
|
||||
<!-- write down unreleased development here -->
|
||||
* vuejs: translate in French all multiselect widgets
|
||||
* [address] define address lines according postal standards for France and Belgium (default) and change AddressRender, chill_entity_render_box and AddressRenderBox.vue
|
||||
|
||||
* [household] change translations (champs-libres/departement-de-la-vendee/accent-suivi-developpement#109)
|
||||
* [household] add address i18n in household component (champs-libres/departement-de-la-vendee/accent-suivi-developpement#158)
|
||||
* [household] add on the fly i18n in household component
|
||||
@ -25,7 +25,6 @@ and this project adheres to
|
||||
* [accompanyingCourse] Add a delete action and delete buttons to delete a accompanying course when step = DRAFT (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/64)
|
||||
* [accompanyingCourse] Add a administrative location in the accompanying course, set the user current location as default, allow to select a location in a select field and do not allow to confirm the accompanying course if location is empty.
|
||||
* [accompanyingCourse] Add the administrative location in the available variables for document generation
|
||||
|
||||
* AddAddress: optimize loading: wait for the user finish typing;
|
||||
* UserPicker: fix bug with deprecated role
|
||||
* docgen: add base context + tests
|
||||
|
@ -12,7 +12,7 @@
|
||||
</div>
|
||||
<div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0">
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li v-for="p in suggestedEntities" @click="addSuggestedEntity(p)">
|
||||
<li v-for="(p, i) in suggestedEntities" @click="addSuggestedEntity(p)" :key="`suggestedEntities-${i}`">
|
||||
<span>{{ p.text }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -15,13 +15,15 @@
|
||||
:searchable="true"
|
||||
:placeholder="$t('activity.choose_location')"
|
||||
:custom-label="customLabel"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
:options="availableLocations"
|
||||
group-values="locations"
|
||||
group-label="locationGroup"
|
||||
v-model="location"
|
||||
>
|
||||
</VueMultiselect>
|
||||
|
||||
<new-location v-bind:locations="locations"></new-location>
|
||||
</div>
|
||||
</div>
|
||||
@ -32,7 +34,6 @@
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
import VueMultiselect from "vue-multiselect";
|
||||
import NewLocation from "./Location/NewLocation.vue";
|
||||
import { getLocations, getLocationTypeByDefaultFor, getUserCurrentLocation } from "../api.js";
|
||||
|
||||
export default {
|
||||
name: "Location",
|
||||
|
@ -9,9 +9,9 @@
|
||||
|
||||
<check-social-issue
|
||||
v-for="issue in socialIssuesList"
|
||||
v-bind:key="issue.id"
|
||||
v-bind:issue="issue"
|
||||
v-bind:selection="socialIssuesSelected"
|
||||
:key="issue.id"
|
||||
:issue="issue"
|
||||
:selection="socialIssuesSelected"
|
||||
@updateSelected="updateIssuesSelected">
|
||||
</check-social-issue>
|
||||
|
||||
@ -21,18 +21,18 @@
|
||||
label="text"
|
||||
track-by="id"
|
||||
open-direction="bottom"
|
||||
v-bind:close-on-select="true"
|
||||
v-bind:preserve-search="false"
|
||||
v-bind:reset-after="true"
|
||||
v-bind:hide-selected="true"
|
||||
v-bind:taggable="false"
|
||||
v-bind:multiple="false"
|
||||
v-bind:searchable="true"
|
||||
v-bind:allow-empty="true"
|
||||
v-bind:show-labels="false"
|
||||
v-bind:loading="issueIsLoading"
|
||||
v-bind:placeholder="$t('activity.choose_other_social_issue')"
|
||||
v-bind:options="socialIssuesOther"
|
||||
:close-on-select="true"
|
||||
:preserve-search="false"
|
||||
:reset-after="true"
|
||||
:hide-selected="true"
|
||||
:taggable="false"
|
||||
:multiple="false"
|
||||
:searchable="true"
|
||||
:allow-empty="true"
|
||||
:show-labels="false"
|
||||
:loading="issueIsLoading"
|
||||
:placeholder="$t('activity.choose_other_social_issue')"
|
||||
:options="socialIssuesOther"
|
||||
@select="addIssueInList">
|
||||
</VueMultiselect>
|
||||
</div>
|
||||
@ -58,9 +58,9 @@
|
||||
<check-social-action
|
||||
v-if="socialIssuesSelected.length || socialActionsSelected.length"
|
||||
v-for="action in socialActionsList"
|
||||
v-bind:key="action.id"
|
||||
v-bind:action="action"
|
||||
v-bind:selection="socialActionsSelected"
|
||||
:key="action.id"
|
||||
:action="action"
|
||||
:selection="socialActionsSelected"
|
||||
@updateSelected="updateActionsSelected">
|
||||
</check-social-action>
|
||||
</template>
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
|
||||
import { multiSelectMessages } from 'ChillMainAssets/vuejs/_js/i18n'
|
||||
|
||||
const activityMessages = {
|
||||
fr: {
|
||||
@ -33,12 +34,11 @@ const activityMessages = {
|
||||
},
|
||||
create_address: 'Créer une adresse',
|
||||
edit_address: "Modifier l'adresse"
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(activityMessages.fr, personMessages.fr);
|
||||
Object.assign(activityMessages.fr, personMessages.fr, multiSelectMessages.fr);
|
||||
|
||||
export {
|
||||
activityMessages
|
||||
|
@ -13,6 +13,9 @@
|
||||
:close-on-select="false"
|
||||
:allow-empty="true"
|
||||
:model-value="value"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
@select="selectUsers"
|
||||
@remove="unSelectUsers"
|
||||
@close="coloriseSelectedValues"
|
||||
|
@ -1,13 +1,17 @@
|
||||
import { multiSelectMessages } from 'ChillMainAssets/vuejs/_js/i18n'
|
||||
|
||||
const calendarUserSelectorMessages = {
|
||||
fr: {
|
||||
choose_your_calendar_user: "Afficher les plages de disponibilités",
|
||||
select_user: "Sélectionnez des calendriers",
|
||||
show_my_calendar: "Afficher mon calendrier",
|
||||
show_weekends: "Afficher les week-ends"
|
||||
}
|
||||
};
|
||||
fr: {
|
||||
choose_your_calendar_user: "Afficher les plages de disponibilités",
|
||||
select_user: "Sélectionnez des calendriers",
|
||||
show_my_calendar: "Afficher mon calendrier",
|
||||
show_weekends: "Afficher les week-ends"
|
||||
}
|
||||
};
|
||||
|
||||
export {
|
||||
calendarUserSelectorMessages
|
||||
};
|
||||
Object.assign(calendarUserSelectorMessages.fr, multiSelectMessages.fr);
|
||||
|
||||
export {
|
||||
calendarUserSelectorMessages
|
||||
};
|
||||
|
@ -6,8 +6,9 @@
|
||||
v-model="value"
|
||||
:placeholder="$t('select_address')"
|
||||
:tag-placeholder="$t('create_address')"
|
||||
:select-label="$t('press_enter_to_select')"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('create_address')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
@search-change="listenInputSearch"
|
||||
ref="addressSelector"
|
||||
@select="selectAddress"
|
||||
|
@ -12,8 +12,9 @@
|
||||
label="value"
|
||||
:custom-label="transName"
|
||||
:placeholder="$t('select_city')"
|
||||
:select-label="$t('press_enter_to_select')"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('create_postal_code')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
:taggable="true"
|
||||
:multiple="false"
|
||||
@tag="addPostcode"
|
||||
|
@ -5,12 +5,13 @@
|
||||
id="countrySelect"
|
||||
label="name"
|
||||
track-by="id"
|
||||
v-bind:custom-label="transName"
|
||||
v-bind:placeholder="$t('select_country')"
|
||||
v-bind:options="sortedCountries"
|
||||
:custom-label="transName"
|
||||
:placeholder="$t('select_country')"
|
||||
:options="sortedCountries"
|
||||
v-model="value"
|
||||
:select-label="$t('press_enter_to_select')"
|
||||
:deselect-label="$t('press_enter_to_remove')"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
@select="selectCountry">
|
||||
</VueMultiselect>
|
||||
</div>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<h4 class="h3">{{ $t('address_suggestions') }}</h4>
|
||||
|
||||
<div class="flex-table AddressSuggestionList">
|
||||
<div v-for="a in context.suggestions" class="item-bloc">
|
||||
<div v-for="(a, i) in context.suggestions" class="item-bloc" :key="`suggestions-${i}`">
|
||||
<div class="float-button bottom">
|
||||
<div class="box">
|
||||
<div class="action">
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { multiSelectMessages } from 'ChillMainAssets/vuejs/_js/i18n'
|
||||
|
||||
const addressMessages = {
|
||||
fr: {
|
||||
press_enter_to_select: 'Appuyer sur Entrée pour sélectionner',
|
||||
press_enter_to_remove: 'Appuyer sur Entrée pour désélectionner',
|
||||
add_an_address_title: 'Créer une adresse',
|
||||
edit_an_address_title: 'Modifier une adresse',
|
||||
create_a_new_address: 'Créer une nouvelle adresse',
|
||||
@ -48,6 +48,8 @@ const addressMessages = {
|
||||
}
|
||||
};
|
||||
|
||||
Object.assign(addressMessages.fr, multiSelectMessages.fr);
|
||||
|
||||
export {
|
||||
addressMessages
|
||||
};
|
||||
|
@ -84,3 +84,17 @@ const _createI18n = (appMessages) => {
|
||||
};
|
||||
|
||||
export { _createI18n }
|
||||
|
||||
export const multiSelectMessages = {
|
||||
fr: {
|
||||
multiselect: {
|
||||
placeholder: 'Choisir',
|
||||
tag_placeholder: 'Créer un nouvel élément',
|
||||
select_label: 'Appuyer sur "Entrée" pour sélectionner',
|
||||
deselect_label: 'Appuyer sur "Entrée" pour désélectionner',
|
||||
select_group_label: 'Appuyer sur "Entrée" pour sélectionner ce groupe',
|
||||
deselect_group_label: 'Appuyer sur "Entrée" pour désélectionner ce groupe',
|
||||
selected_label: 'Sélectionné'
|
||||
}
|
||||
}
|
||||
};
|
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<span v-for="h in personsByHousehold()" :class="{ 'household': householdExists(h.id), 'no-household': !householdExists(h.id) }">
|
||||
<span v-for="h in personsByHousehold()" :class="{ 'household': householdExists(h.id), 'no-household': !householdExists(h.id) }" :key="h.id">
|
||||
<a v-if="householdExists(h.id)" :href="householdLink(h.id)">
|
||||
<i class="fa fa-home fa-fw text-light" :title="$t('persons_associated.show_household_number', { id: h.id })"></i>
|
||||
</a>
|
||||
<span v-for="person in h.persons" class="me-1">
|
||||
<span v-for="person in h.persons" class="me-1" :key="person.id">
|
||||
<on-the-fly :type="person.type" :id="person.id" :buttonText="person.text" :displayBadge="'true' === 'true'" action="show"></on-the-fly>
|
||||
</span>
|
||||
</span>
|
||||
|
@ -4,7 +4,7 @@
|
||||
{{ $t('courselocation.title') }}
|
||||
</h2>
|
||||
|
||||
<div v-for="error in displayErrors" class="alert alert-danger my-2">
|
||||
<div v-for="error in displayErrors" class="alert alert-danger my-2" :key="error">
|
||||
{{ error }}
|
||||
</div>
|
||||
|
||||
|
@ -17,6 +17,9 @@
|
||||
:placeholder="$t('origin.placeholder')"
|
||||
v-model="value"
|
||||
:options="options"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
@select="updateOrigin">
|
||||
</VueMultiselect>
|
||||
</div>
|
||||
|
@ -11,17 +11,20 @@
|
||||
name="selectReferrer"
|
||||
label="text"
|
||||
track-by="id"
|
||||
v-bind:multiple="false"
|
||||
v-bind:searchable="true"
|
||||
v-bind:placeholder="$t('referrer.placeholder')"
|
||||
:multiple="false"
|
||||
:searchable="true"
|
||||
:placeholder="$t('referrer.placeholder')"
|
||||
v-model="value"
|
||||
v-bind:options="users"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
@select="updateReferrer">
|
||||
</VueMultiselect>
|
||||
|
||||
<template v-if="referrersSuggested.length > 0">
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li v-for="u in referrersSuggested" @click="updateReferrer(u)">
|
||||
<li v-for="(u, i) in referrersSuggested" @click="updateReferrer(u)" :key="`referrer-${i}`">
|
||||
<span>
|
||||
<user-render-box-badge :user="u"></user-render-box-badge>
|
||||
</span>
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
<div id="picking">
|
||||
<p>{{ $t('pick_social_issue_linked_with_action') }}</p>
|
||||
<div v-for="si in socialIssues">
|
||||
<div v-for="si in socialIssues" :key="si.id">
|
||||
<input type="radio" v-bind:value="si.id" name="socialIssue" v-model="socialIssuePicked"><span class="badge bg-chill-l-gray text-dark">{{ si.text }}</span>
|
||||
</div>
|
||||
<div class="my-3">
|
||||
|
@ -2,6 +2,7 @@
|
||||
<ol class="breadcrumb">
|
||||
<li
|
||||
v-for="s in steps"
|
||||
:key="s"
|
||||
class="breadcrumb-item" :class="{ active: step === s }"
|
||||
>
|
||||
{{ $t('household_members_editor.app.steps.'+s) }}
|
||||
|
@ -9,7 +9,7 @@
|
||||
<div v-else>
|
||||
<p>
|
||||
{{ $t('household_members_editor.concerned.persons_will_be_moved') }} :
|
||||
<span v-for="c in concerned" :key=c.person.id>
|
||||
<span v-for="c in concerned" :key="c.person.id">
|
||||
<person-render-box render="badge" :options="{addLink: false}" :person="c.person"></person-render-box>
|
||||
<button class="btn" @click="removePerson(c.person)" v-if="c.allowRemove" style="padding-left:0;">
|
||||
<span class="fa-stack fa-lg" :title="$t('household_members_editor.concerned.remove_concerned')">
|
||||
@ -21,7 +21,7 @@
|
||||
</p>
|
||||
<div class="alert alert-info" v-if="concernedPersonsWithHouseholds.length > 0">
|
||||
<p>{{ $t('household_members_editor.concerned.persons_with_household') }}</p>
|
||||
<ul v-for="c in concernedPersonsWithHouseholds" :key=c.person.id>
|
||||
<ul v-for="c in concernedPersonsWithHouseholds" :key="c.person.id">
|
||||
<li>
|
||||
{{ c.person.text }}
|
||||
{{ $t('household_members_editor.concerned.already_belongs_to_household') }}
|
||||
|
@ -8,10 +8,10 @@
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li v-for="(msg, index) in warnings" class="warning">
|
||||
<li v-for="(msg, i) in warnings" class="warning" :key="i">
|
||||
{{ $t(msg.m, msg.a) }}
|
||||
</li>
|
||||
<li v-for="msg in errors" class="error">
|
||||
<li v-for="(msg, i) in errors" class="error" :key="i">
|
||||
{{ msg }}
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -39,7 +39,7 @@
|
||||
aria-labelledby="heading_household_suggestions" data-bs-parent="#householdSuggestions">
|
||||
<div v-if="showHouseholdSuggestion">
|
||||
<div class="flex-table householdSuggestionList">
|
||||
<div v-for="s in getSuggestions" class="item-bloc">
|
||||
<div v-for="(s, i) in getSuggestions" class="item-bloc" :key="`householdSuggestions-${i}`">
|
||||
<household-render-box :household="s.household"></household-render-box>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
|
@ -24,7 +24,8 @@
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-for="position in positions"
|
||||
v-for="(position, i) in positions"
|
||||
:key="`position-${i}`"
|
||||
class="position"
|
||||
>
|
||||
<button
|
||||
|
@ -23,7 +23,7 @@
|
||||
<div class="my-4 legend">
|
||||
<h3>{{ $t('visgraph.Legend') }}</h3>
|
||||
<div class="list-group">
|
||||
<label class="list-group-item" v-for="layer in legendLayers">
|
||||
<label class="list-group-item" v-for="(layer, i) in legendLayers" :key="`layer-${i}`">
|
||||
<input
|
||||
class="form-check-input me-1"
|
||||
type="checkbox"
|
||||
|
Loading…
x
Reference in New Issue
Block a user