mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-29 10:05:03 +00:00
Merge branch 'master' into ticket-app-master
# Conflicts: # .eslint-baseline.json # src/Bundle/ChillMainBundle/Entity/User.php # src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue # src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue # src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue # src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue # src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue # src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue # src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue # src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml
This commit is contained in:
@@ -12,22 +12,24 @@
|
||||
ref="showAddress"
|
||||
/>
|
||||
|
||||
<!-- step 1 -->
|
||||
<teleport to="body" v-if="inModal">
|
||||
<modal
|
||||
v-if="flag.suggestPane"
|
||||
modal-dialog-class="modal-dialog-scrollable modal-xl"
|
||||
@close="resetPane"
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t(getTextTitle) }}
|
||||
<span v-if="flag.loading" class="loading">
|
||||
<i class="fa fa-circle-o-notch fa-spin fa-fw" />
|
||||
<span class="sr-only">{{ $t("loading") }}</span>
|
||||
</span>
|
||||
</h2>
|
||||
</template>
|
||||
<!-- step 1 -->
|
||||
<teleport to="body" v-if="inModal">
|
||||
<modal
|
||||
v-if="flag.suggestPane"
|
||||
modal-dialog-class="modal-dialog-scrollable modal-xl"
|
||||
@close="resetPane"
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ trans(getTextTitle) }}
|
||||
<span v-if="flag.loading" class="loading">
|
||||
<i class="fa fa-circle-o-notch fa-spin fa-fw" />
|
||||
<span class="sr-only">{{
|
||||
trans(ADDRESS_LOADING)
|
||||
}}</span>
|
||||
</span>
|
||||
</h2>
|
||||
</template>
|
||||
|
||||
<template #body>
|
||||
<suggest-pane
|
||||
@@ -43,7 +45,7 @@
|
||||
|
||||
<template #footer>
|
||||
<button @click="openEditPane" class="btn btn-create">
|
||||
{{ $t("create_a_new_address") }}
|
||||
{{ trans(CREATE_A_NEW_ADDRESS) }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
@@ -62,13 +64,13 @@
|
||||
>
|
||||
<template #before v-if="!bypassFirstStep">
|
||||
<a class="btn btn-cancel" @click="resetPane">
|
||||
{{ $t("action.cancel") }}
|
||||
{{ trans(CANCEL) }}
|
||||
</a>
|
||||
</template>
|
||||
<template #action>
|
||||
<li>
|
||||
<button @click="openEditPane" class="btn btn-create">
|
||||
{{ $t("create_a_new_address") }}
|
||||
{{ trans(CREATE_A_NEW_ADDRESS) }}
|
||||
</button>
|
||||
</li>
|
||||
</template>
|
||||
@@ -85,10 +87,12 @@
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t(getTextTitle) }}
|
||||
{{ trans(getTextTitle) }}
|
||||
<span v-if="flag.loading" class="loading">
|
||||
<i class="fa fa-circle-o-notch fa-spin fa-fw" />
|
||||
<span class="sr-only">{{ $t("loading") }}</span>
|
||||
<span class="sr-only">{{
|
||||
trans(ADDRESS_LOADING)
|
||||
}}</span>
|
||||
</span>
|
||||
</h2>
|
||||
</template>
|
||||
@@ -108,17 +112,17 @@
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<!--<button class="btn btn-cancel change-icon" @click="resetPane">{{ $t('action.cancel') }}</button>-->
|
||||
<!--<button class="btn btn-cancel change-icon" @click="resetPane">{{ trans(CANCEL) }}</button>-->
|
||||
<button
|
||||
v-if="!this.context.edit && this.useDatePane"
|
||||
class="btn btn-update change-icon"
|
||||
@click="closeEditPane"
|
||||
>
|
||||
{{ $t("nav.next") }}
|
||||
{{ trans(NEXT) }}
|
||||
<i class="fa fa-fw fa-arrow-right" />
|
||||
</button>
|
||||
<button v-else class="btn btn-save" @click="closeEditPane">
|
||||
{{ $t("action.save") }}
|
||||
{{ trans(SAVE) }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
@@ -139,19 +143,19 @@
|
||||
>
|
||||
<template #before>
|
||||
<a class="btn btn-cancel" @click="resetPane">
|
||||
{{ $t("action.cancel") }}
|
||||
{{ trans(CANCEL) }}
|
||||
</a>
|
||||
</template>
|
||||
<template #action>
|
||||
<li v-if="!this.context.edit && this.useDatePane">
|
||||
<button class="btn btn-update change-icon" @click="closeEditPane">
|
||||
{{ $t("nav.next") }}
|
||||
{{ trans(NEXT) }}
|
||||
<i class="fa fa-fw fa-arrow-right" />
|
||||
</button>
|
||||
</li>
|
||||
<li v-else>
|
||||
<button class="btn btn-save" @click="closeEditPane">
|
||||
{{ $t("action.save") }}
|
||||
{{ trans(SAVE) }}
|
||||
</button>
|
||||
</li>
|
||||
</template>
|
||||
@@ -168,10 +172,12 @@
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t(getTextTitle) }}
|
||||
{{ trans(getTextTitle) }}
|
||||
<span v-if="flag.loading" class="loading">
|
||||
<i class="fa fa-circle-o-notch fa-spin fa-fw" />
|
||||
<span class="sr-only">{{ $t("loading") }}</span>
|
||||
<span class="sr-only">{{
|
||||
trans(ADDRESS_LOADING)
|
||||
}}</span>
|
||||
</span>
|
||||
</h2>
|
||||
</template>
|
||||
@@ -190,10 +196,10 @@
|
||||
<template #footer>
|
||||
<button class="btn btn-misc" @click="openEditPane">
|
||||
<i class="fa fa-fw fa-arrow-left" />
|
||||
{{ $t("nav.previous") }}
|
||||
{{ trans(PREVIOUS) }}
|
||||
</button>
|
||||
<button class="btn btn-save" @click="closeDatePane">
|
||||
{{ $t("action.save") }}
|
||||
{{ trans(SAVE) }}
|
||||
</button>
|
||||
<!-- -->
|
||||
</template>
|
||||
@@ -213,13 +219,13 @@
|
||||
<template #before>
|
||||
<button class="btn btn-misc" @click="openEditPane">
|
||||
<i class="fa fa-fw fa-arrow-left" />
|
||||
{{ $t("nav.previous") }}
|
||||
{{ trans(PREVIOUS) }}
|
||||
</button>
|
||||
</template>
|
||||
<template #action>
|
||||
<li>
|
||||
<button class="btn btn-save" @click="closeDatePane">
|
||||
{{ $t("action.save") }}
|
||||
{{ trans(SAVE) }}
|
||||
</button>
|
||||
</li>
|
||||
</template>
|
||||
@@ -241,9 +247,16 @@ import {
|
||||
postPostalCode,
|
||||
} from "../api";
|
||||
import {
|
||||
postAddressToPerson,
|
||||
postAddressToHousehold,
|
||||
} from "ChillPersonAssets/vuejs/_api/AddAddress.js";
|
||||
CREATE_A_NEW_ADDRESS,
|
||||
ADDRESS_LOADING,
|
||||
ACTIVITY_CREATE_ADDRESS,
|
||||
ACTIVITY_EDIT_ADDRESS,
|
||||
CANCEL,
|
||||
SAVE,
|
||||
PREVIOUS,
|
||||
NEXT,
|
||||
trans,
|
||||
} from "translator";
|
||||
import ShowPane from "./ShowPane.vue";
|
||||
import SuggestPane from "./SuggestPane.vue";
|
||||
import EditPane from "./EditPane.vue";
|
||||
@@ -251,7 +264,17 @@ import DatePane from "./DatePane.vue";
|
||||
|
||||
export default {
|
||||
name: "AddAddress",
|
||||
props: ["context", "options", "addressChangedCallback"],
|
||||
setup() {
|
||||
return {
|
||||
trans,
|
||||
CREATE_A_NEW_ADDRESS,
|
||||
ADDRESS_LOADING,
|
||||
CANCEL,
|
||||
SAVE,
|
||||
PREVIOUS,
|
||||
NEXT,
|
||||
};
|
||||
},props: ["context", "options", "addressChangedCallback"],
|
||||
components: {
|
||||
Modal,
|
||||
ShowPane,
|
||||
@@ -369,9 +392,11 @@ export default {
|
||||
typeof this.options.title !== "undefined" &&
|
||||
(this.options.title.edit !== null || this.options.title.create !== null)
|
||||
) {
|
||||
return this.context.edit
|
||||
? this.options.title.edit
|
||||
: this.options.title.create;
|
||||
console.log("this.options.title", this.options.title);
|
||||
|
||||
return this.context.edit
|
||||
? ACTIVITY_EDIT_ADDRESS
|
||||
: ACTIVITY_CREATE_ADDRESS;
|
||||
}
|
||||
return this.context.edit
|
||||
? this.defaultz.title.edit
|
||||
@@ -498,7 +523,7 @@ export default {
|
||||
getAddress(id)
|
||||
.then(
|
||||
(address) =>
|
||||
new Promise((resolve, reject) => {
|
||||
new Promise((resolve) => {
|
||||
this.entity.address = address;
|
||||
this.flag.loading = false;
|
||||
resolve();
|
||||
@@ -515,7 +540,7 @@ export default {
|
||||
fetchCountries()
|
||||
.then(
|
||||
(countries) =>
|
||||
new Promise((resolve, reject) => {
|
||||
new Promise((resolve) => {
|
||||
this.entity.loaded.countries = countries.results;
|
||||
if (this.flag.showPane === true) {
|
||||
this.closeShowPane();
|
||||
@@ -543,7 +568,7 @@ export default {
|
||||
fetchCities(country)
|
||||
.then(
|
||||
(cities) =>
|
||||
new Promise((resolve, reject) => {
|
||||
new Promise((resolve) => {
|
||||
this.entity.loaded.cities = cities.results.filter(
|
||||
(c) => c.origin !== 3,
|
||||
); // filter out user-defined cities
|
||||
@@ -562,7 +587,7 @@ export default {
|
||||
fetchReferenceAddresses(city)
|
||||
.then(
|
||||
(addresses) =>
|
||||
new Promise((resolve, reject) => {
|
||||
new Promise((resolve) => {
|
||||
this.entity.loaded.addresses = addresses.results;
|
||||
this.flag.loading = false;
|
||||
resolve();
|
||||
@@ -784,7 +809,7 @@ export default {
|
||||
return postAddress(payload)
|
||||
.then(
|
||||
(address) =>
|
||||
new Promise((resolve, reject) => {
|
||||
new Promise((resolve) => {
|
||||
this.entity.address = address;
|
||||
this.flag.loading = false;
|
||||
this.flag.success = true;
|
||||
@@ -833,7 +858,7 @@ export default {
|
||||
return patchAddress(payload.addressId, payload.newAddress)
|
||||
.then(
|
||||
(address) =>
|
||||
new Promise((resolve, reject) => {
|
||||
new Promise((resolve) => {
|
||||
this.entity.address = address;
|
||||
this.flag.loading = false;
|
||||
this.flag.success = true;
|
||||
|
Reference in New Issue
Block a user