mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-08 06:19:42 +00:00
Merge conflicts in translations.yaml resolved.
# Conflicts: # src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml # src/Bundle/ChillMainBundle/translations/messages.fr.yml
This commit is contained in:
@@ -4,9 +4,9 @@ const fetchScopes = () => {
|
||||
return response.json();
|
||||
}
|
||||
}).then(data => {
|
||||
console.log(data);
|
||||
//console.log(data);
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(data);
|
||||
//console.log(data);
|
||||
resolve(data.results);
|
||||
});
|
||||
});
|
||||
|
@@ -53,32 +53,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Patch date
|
||||
* TO MOVE in DatePane
|
||||
addDateToAddressAndPostAddressTo(payload) {
|
||||
payload.body = {
|
||||
validFrom: {
|
||||
datetime: `${this.context.valid.from.toISOString().split('T')[0]}T00:00:00+0100`
|
||||
}
|
||||
};
|
||||
console.log('addDateToAddress', payload);
|
||||
|
||||
this.$refs.addAddress.flag.loading = true;
|
||||
return patchAddress(payload.addressId, payload.body)
|
||||
.then(address => new Promise((resolve, reject) => {
|
||||
this.context.valid.from = address.validFrom;
|
||||
resolve();
|
||||
})
|
||||
.then(this.postAddressTo(payload))
|
||||
)
|
||||
.catch((error) => {
|
||||
this.$refs.addAddress.errorMsg.push(error);
|
||||
this.$refs.addAddress.flag.loading = false;
|
||||
});
|
||||
},
|
||||
*/
|
||||
|
||||
/*
|
||||
* Post new created address to targetEntity
|
||||
*/
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/**
|
||||
* Endpoint chill_api_single_country__index
|
||||
* method GET, get Country Object
|
||||
* @returns {Promise} a promise containing all Country object
|
||||
@@ -14,7 +14,7 @@ const fetchCountries = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
/**
|
||||
* Endpoint chill_api_single_postal_code__index
|
||||
* method GET, get Country Object
|
||||
* @returns {Promise} a promise containing all Postal Code objects filtered with country
|
||||
@@ -29,7 +29,7 @@ const fetchCities = (country) => {
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
/**
|
||||
* Endpoint chill_api_single_address_reference__index
|
||||
* method GET, get AddressReference Object
|
||||
* @returns {Promise} a promise containing all AddressReference objects filtered with postal code
|
||||
@@ -44,7 +44,7 @@ const fetchReferenceAddresses = (postalCode) => {
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
/**
|
||||
* Endpoint chill_api_single_address_reference__index
|
||||
* method GET, get AddressReference Object
|
||||
* @returns {Promise} a promise containing all AddressReference objects filtered with postal code
|
||||
@@ -60,7 +60,7 @@ const fetchAddresses = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
/**
|
||||
* Endpoint chill_api_single_address__entity__create
|
||||
* method POST, post Address Object
|
||||
* @returns {Promise}
|
||||
@@ -81,8 +81,28 @@ const postAddress = (address) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param address
|
||||
* @returns {Promise<Response>}
|
||||
*/
|
||||
const duplicateAddress = (address) => {
|
||||
const url = `/api/1.0/main/address/${address.address_id}/duplicate.json`;
|
||||
return fetch(url, {
|
||||
'method': 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8'
|
||||
},
|
||||
}).then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
}
|
||||
throw Error('Error with request resource response');
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
/**
|
||||
* Endpoint chill_api_single_address__entity__create
|
||||
* method PATCH, patch Address Instance
|
||||
*
|
||||
@@ -142,6 +162,7 @@ const getAddress = (id) => {
|
||||
};
|
||||
|
||||
export {
|
||||
duplicateAddress,
|
||||
fetchCountries,
|
||||
fetchCities,
|
||||
fetchReferenceAddresses,
|
||||
|
@@ -1,17 +1,18 @@
|
||||
<template>
|
||||
<ul class="record_actions"
|
||||
<ul class="record_actions" v-if="!options.onlyButton"
|
||||
:class="{ 'sticky-form-buttons': isStickyForm }">
|
||||
|
||||
<li v-if="isStickyForm" class="cancel">
|
||||
<slot name="before"></slot>
|
||||
</li>
|
||||
|
||||
<slot name="action"></slot>
|
||||
|
||||
<li>
|
||||
<slot name="action"></slot>
|
||||
</li>
|
||||
<li v-if="isStickyForm">
|
||||
<slot name="after"></slot>
|
||||
</li>
|
||||
</ul>
|
||||
<slot v-else name="action"></slot>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -23,9 +24,6 @@ export default {
|
||||
return (typeof this.options.stickyActions !== 'undefined') ?
|
||||
this.options.stickyActions : this.defaultz.stickyActions;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@@ -34,6 +34,7 @@
|
||||
v-bind:defaultz="this.defaultz"
|
||||
v-bind:entity="this.entity"
|
||||
v-bind:flag="this.flag"
|
||||
@pick-address="this.pickAddress"
|
||||
ref="suggestAddress">
|
||||
</suggest-pane>
|
||||
</template>
|
||||
@@ -55,6 +56,7 @@
|
||||
v-bind:entity="this.entity"
|
||||
v-bind:flag="this.flag"
|
||||
v-bind:insideModal="false"
|
||||
@pick-address="this.pickAddress"
|
||||
ref="suggestAddress">
|
||||
|
||||
<template v-slot:before v-if="!bypassFirstStep">
|
||||
@@ -217,7 +219,16 @@
|
||||
|
||||
<script>
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||
import { getAddress, fetchCountries, fetchCities, fetchReferenceAddresses, patchAddress, postAddress, postPostalCode } from '../api';
|
||||
import {
|
||||
duplicateAddress,
|
||||
fetchCountries,
|
||||
fetchCities,
|
||||
fetchReferenceAddresses,
|
||||
getAddress,
|
||||
patchAddress,
|
||||
postAddress,
|
||||
postPostalCode,
|
||||
} from '../api';
|
||||
import { postAddressToPerson, postAddressToHousehold } from "ChillPersonAssets/vuejs/_api/AddAddress.js";
|
||||
import ShowPane from './ShowPane.vue';
|
||||
import SuggestPane from './SuggestPane.vue';
|
||||
@@ -234,6 +245,9 @@ export default {
|
||||
EditPane,
|
||||
DatePane
|
||||
},
|
||||
emits: {
|
||||
pickAddress: null
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
flag: {
|
||||
@@ -257,7 +271,7 @@ export default {
|
||||
validFrom: false,
|
||||
validTo: false
|
||||
},
|
||||
hideAddress: false
|
||||
onlyButton: false
|
||||
},
|
||||
entity: {
|
||||
address: {}, // <== loaded and returned
|
||||
@@ -299,18 +313,22 @@ export default {
|
||||
return (typeof this.options.openPanesInModal !== 'undefined') ?
|
||||
this.options.openPanesInModal : this.defaultz.openPanesInModal;
|
||||
},
|
||||
useDatePane() {
|
||||
let vFrom = (typeof this.options.useDate !== 'undefined'
|
||||
&& typeof this.options.useDate.validFrom !== 'undefined') ?
|
||||
this.options.useDate.validFrom : this.defaultz.useDate.validFrom ;
|
||||
let vTo = (typeof this.options.useDate !== 'undefined'
|
||||
&& typeof this.options.useDate.validTo !== 'undefined') ?
|
||||
validFrom() {
|
||||
return (typeof this.options.useDate !== 'undefined' && typeof this.options.useDate.validFrom !== 'undefined') ?
|
||||
this.options.useDate.validFrom : this.defaultz.useDate.validFrom;
|
||||
},
|
||||
validTo() {
|
||||
return (typeof this.options.useDate !== 'undefined' && typeof this.options.useDate.validTo !== 'undefined') ?
|
||||
this.options.useDate.validTo : this.defaultz.useDate.validTo ;
|
||||
return (vFrom || vTo) ? true : false;
|
||||
},
|
||||
useDatePane() {
|
||||
return (this.validFrom || this.validTo) ? true : false;
|
||||
},
|
||||
hasSuggestions() {
|
||||
// TODO
|
||||
//return addressSuggestions.length > 0
|
||||
if (typeof(this.context.suggestions) !== 'undefined') {
|
||||
console.log('hasSuggestions', this.context.suggestions);
|
||||
return this.context.suggestions.length > 0;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
displaySuggestions() {
|
||||
@@ -335,7 +353,9 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
|
||||
console.log('useDatePane', this.useDatePane);
|
||||
//console.log('validFrom', this.validFrom);
|
||||
//console.log('validTo', this.validTo);
|
||||
//console.log('useDatePane', this.useDatePane);
|
||||
|
||||
console.log('Mounted now !');
|
||||
if (this.context.edit) {
|
||||
@@ -566,6 +586,22 @@ export default {
|
||||
'point': this.entity.selected.address.point.coordinates
|
||||
});
|
||||
}
|
||||
if (this.validFrom) {
|
||||
console.log('add validFrom in fetch body', this.entity.selected.valid.from);
|
||||
newAddress = Object.assign(newAddress, {
|
||||
'validFrom': {
|
||||
datetime: `${this.entity.selected.valid.from.toISOString().split('T')[0]}T00:00:00+0100`
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.validTo && null !== this.entity.selected.valid.to) {
|
||||
console.log('add validTo in fetch body', this.entity.selected.valid.to);
|
||||
newAddress = Object.assign(newAddress, {
|
||||
'validTo': {
|
||||
datetime: `${this.entity.selected.valid.to.toISOString().split('T')[0]}T00:00:00+0100`
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.entity.selected.writeNew.postcode) {
|
||||
let newPostcode = this.entity.selected.postcode;
|
||||
newPostcode = Object.assign(newPostcode, {
|
||||
@@ -627,9 +663,12 @@ export default {
|
||||
this.flag.loading = false;
|
||||
this.flag.success = true;
|
||||
resolve({
|
||||
address,
|
||||
targetOrigin: this.context.target,
|
||||
// for "legacy" use:
|
||||
target: this.context.target.name,
|
||||
targetId: this.context.target.id,
|
||||
addressId: this.entity.address.address_id
|
||||
addressId: this.entity.address.address_id,
|
||||
}
|
||||
);
|
||||
}))
|
||||
@@ -675,6 +714,9 @@ export default {
|
||||
this.flag.loading = false;
|
||||
this.flag.success = true;
|
||||
return resolve({
|
||||
address,
|
||||
targetOrigin: this.context.target,
|
||||
// for "legacy" use:
|
||||
target: this.context.target.name,
|
||||
targetId: this.context.target.id,
|
||||
addressId: this.entity.address.address_id
|
||||
@@ -687,18 +729,28 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/*
|
||||
* Method just add closing pane to the callback method
|
||||
* (get out step1 show pane, submit button)
|
||||
closePaneAndCallbackSubmit(payload)
|
||||
{
|
||||
//this.initForm();
|
||||
//this.resetPane(); // because parent callback will cast afterLastPaneAction()
|
||||
console.log('will call parent callback method', payload);
|
||||
// callback props method from parent
|
||||
this.addressChangedCallback(payload);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param address the address selected
|
||||
*/
|
||||
pickAddress(address) {
|
||||
console.log('pickAddress', address);
|
||||
duplicateAddress(address).then(newAddress => {
|
||||
this.entity.address = newAddress;
|
||||
this.flag.loading = false;
|
||||
this.flag.success = true;
|
||||
let payload = {
|
||||
address: newAddress,
|
||||
targetOrigin: this.context.target,
|
||||
// for "legacy" use:
|
||||
target: this.context.target.name,
|
||||
targetId: this.context.target.id,
|
||||
addressId: this.entity.address.address_id
|
||||
};
|
||||
this.addressChangedCallback(payload);
|
||||
this.closeSuggestPane();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@@ -54,7 +54,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { dateToISO, ISOToDate, ISOToDatetime } from 'ChillMainAssets/chill/js/date.js';
|
||||
import { dateToISO, ISOToDate } from 'ChillMainAssets/chill/js/date.js';
|
||||
import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue';
|
||||
import ActionButtons from './ActionButtons.vue';
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<div v-if="!hideAddress">
|
||||
<div v-if="!onlyButton">
|
||||
<div class="loading">
|
||||
<i v-if="flag.loading" class="fa fa-circle-o-notch fa-spin fa-2x fa-fw"></i>
|
||||
<span class="sr-only">{{ $t('loading') }}</span>
|
||||
@@ -28,13 +28,11 @@
|
||||
:options="this.options"
|
||||
:defaultz="this.defaultz">
|
||||
<template v-slot:action>
|
||||
<li>
|
||||
<button @click.prevent="$emit('openEditPane')"
|
||||
class="btn" :class="getClassButton"
|
||||
type="button" name="button" :title="$t(getTextButton)">
|
||||
<span v-if="displayTextButton">{{ $t(getTextButton) }}</span>
|
||||
</button>
|
||||
</li>
|
||||
<button @click.prevent="$emit('openEditPane')"
|
||||
class="btn" :class="getClassButton"
|
||||
type="button" name="button" :title="$t(getTextButton)">
|
||||
<span v-if="displayTextButton">{{ $t(getTextButton) }}</span>
|
||||
</button>
|
||||
</template>
|
||||
</action-buttons>
|
||||
|
||||
@@ -86,9 +84,9 @@ export default {
|
||||
getSuccessText() {
|
||||
return (this.context.edit) ? 'address_edit_success' : 'address_new_success';
|
||||
},
|
||||
hideAddress() {
|
||||
return (typeof this.options.hideAddress !== 'undefined') ?
|
||||
this.options.hideAddress : this.defaultz.hideAddress;
|
||||
onlyButton() {
|
||||
return (typeof this.options.onlyButton !== 'undefined') ?
|
||||
this.options.onlyButton : this.defaultz.onlyButton;
|
||||
},
|
||||
forceRedirect() {
|
||||
return (!(this.context.backUrl === null || typeof this.context.backUrl === 'undefined'));
|
||||
|
@@ -10,13 +10,14 @@
|
||||
<h4 class="h3">{{ $t('address_suggestions') }}</h4>
|
||||
|
||||
<div class="flex-table AddressSuggestionList">
|
||||
<div class="item-bloc">
|
||||
<div v-for="a in context.suggestions" class="item-bloc">
|
||||
<div class="float-button bottom">
|
||||
<div class="box">
|
||||
<div class="action">
|
||||
<!-- QUESTION normal que ça vienne avant l'adresse ? pourquoi pas après avoir affiché le address-render-box ? -->
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="btn btn-sm btn-choose">
|
||||
<button class="btn btn-sm btn-choose" @click="this.pickAddress(a)">
|
||||
{{ $t('use_this_address') }}
|
||||
</button>
|
||||
</li>
|
||||
@@ -25,9 +26,7 @@
|
||||
<ul class="list-content fa-ul">
|
||||
<li>
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
<!--
|
||||
<address-render-box></address-render-box>
|
||||
-->
|
||||
<address-render-box :address="a"></address-render-box>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -68,9 +67,14 @@ export default {
|
||||
'flag',
|
||||
'entity',
|
||||
'errorMsg',
|
||||
'insideModal'
|
||||
'insideModal',
|
||||
],
|
||||
computed: {},
|
||||
methods: {}
|
||||
methods: {
|
||||
pickAddress(address) {
|
||||
console.log('pickAddress in suggest pane', address);
|
||||
this.$emit('pickAddress', address);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@@ -53,7 +53,7 @@ containers.forEach((container) => {
|
||||
},
|
||||
|
||||
/// Don't display show renderbox Address: showPane display only a button
|
||||
hideAddress: container.dataset.hideAddress === 'true' //boolean, default: false
|
||||
onlyButton: container.dataset.onlyButton === 'true' //boolean, default: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<on-the-fly
|
||||
:type="context.type"
|
||||
:id="context.id"
|
||||
:action="context.action"
|
||||
:buttonText="options.buttonText"
|
||||
:displayBadge="options.displayBadge === 'true'"
|
||||
@saveFormOnTheFly="saveFormOnTheFly">
|
||||
</on-the-fly>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OnTheFly from './components/OnTheFly.vue';
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
components: {
|
||||
OnTheFly
|
||||
},
|
||||
props: ['onTheFly'],
|
||||
computed: {
|
||||
context() {
|
||||
return this.onTheFly.context;
|
||||
},
|
||||
options() {
|
||||
return this.onTheFly.options;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
//console.log('OnTheFly mounted');
|
||||
//console.log('OnTheFly: data context', this.context);
|
||||
//console.log('OnTheFly: data options', this.options);
|
||||
},
|
||||
methods: {
|
||||
saveFormOnTheFly(payload) {
|
||||
console.log('saveFormOnTheFly', payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" :class="{ active: isActive('person') }">
|
||||
<label for="person">
|
||||
<input type="radio" name="person" v-model="radioType" value="person">
|
||||
<input type="radio" name="person" id="person" v-model="radioType" value="person">
|
||||
{{ $t('onthefly.create.person') }}
|
||||
</label>
|
||||
</a>
|
||||
@@ -11,7 +11,7 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" :class="{ active: isActive('thirdparty') }">
|
||||
<label for="thirdparty">
|
||||
<input type="radio" name="thirdparty" v-model="radioType" value="thirdparty">
|
||||
<input type="radio" name="thirdparty" id="thirdparty" v-model="radioType" value="thirdparty">
|
||||
{{ $t('onthefly.create.thirdparty') }}
|
||||
</label>
|
||||
</a>
|
||||
@@ -56,6 +56,7 @@ export default {
|
||||
radioType: {
|
||||
set(type) {
|
||||
this.type = type;
|
||||
console.log('## type:', type, ', action:', this.action);
|
||||
},
|
||||
get() {
|
||||
return this.type;
|
||||
@@ -71,7 +72,10 @@ export default {
|
||||
case 'person':
|
||||
return this.$refs.castPerson.$data.person;
|
||||
case 'thirdparty':
|
||||
return this.$refs.castThirdparty.$data.thirdparty;
|
||||
let data = this.$refs.castThirdparty.$data.thirdparty;
|
||||
data.name = data.text;
|
||||
data.address = { id: data.address.address_id }
|
||||
return data;
|
||||
default:
|
||||
throw Error('Invalid type of entity')
|
||||
}
|
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
|
||||
<a class="btn btn-sm" target="_blank"
|
||||
<a v-if="isDisplayBadge" @click="openModal">
|
||||
<span class="chill-entity" :class="badgeType">
|
||||
{{ buttonText }}
|
||||
</span>
|
||||
</a>
|
||||
<a v-else class="btn btn-sm" target="_blank"
|
||||
:class="classAction"
|
||||
:title="$t(titleAction)"
|
||||
@click="openModal">
|
||||
@@ -42,16 +47,16 @@
|
||||
</template>
|
||||
|
||||
<template v-slot:footer>
|
||||
<button v-if="action === 'show'"
|
||||
@click="goToLocation(id, type)"
|
||||
<a v-if="action === 'show'"
|
||||
:href="buildLocation(id, type)"
|
||||
:title="$t(titleMessage)"
|
||||
class="btn btn-show">{{ $t(buttonMessage) }}
|
||||
</button>
|
||||
<button v-else
|
||||
</a>
|
||||
<a v-else
|
||||
class="btn btn-save"
|
||||
@click="saveAction">
|
||||
{{ $t('action.save')}}
|
||||
</button>
|
||||
</a>
|
||||
</template>
|
||||
|
||||
</modal>
|
||||
@@ -61,7 +66,7 @@
|
||||
|
||||
<script>
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue';
|
||||
import OnTheFlyCreate from './OnTheFly/Create.vue';
|
||||
import OnTheFlyCreate from './Create.vue';
|
||||
import OnTheFlyPerson from 'ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue';
|
||||
import OnTheFlyThirdparty from 'ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue';
|
||||
|
||||
@@ -73,7 +78,7 @@ export default {
|
||||
OnTheFlyThirdparty,
|
||||
OnTheFlyCreate
|
||||
},
|
||||
props: ['type', 'id', 'action', 'buttonText'],
|
||||
props: ['type', 'id', 'action', 'buttonText', 'displayBadge'],
|
||||
emits: ['saveFormOnTheFly'],
|
||||
data() {
|
||||
return {
|
||||
@@ -123,17 +128,25 @@ export default {
|
||||
return 'action.redirect.' + this.type;
|
||||
}
|
||||
},
|
||||
buttonMessage(){
|
||||
buttonMessage() {
|
||||
switch (this.type){
|
||||
case 'person':
|
||||
return 'onthefly.show.file_' + this.type;
|
||||
case 'thirdparty':
|
||||
return 'onthefly.show.file_' + this.type;
|
||||
}
|
||||
},
|
||||
isDisplayBadge() {
|
||||
return (this.displayBadge === true && this.buttonText !== null);
|
||||
},
|
||||
badgeType() {
|
||||
return 'entity-' + this.type + ' badge-' + this.type;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openModal() {
|
||||
console.log('## OPEN ON THE FLY MODAL');
|
||||
console.log('## type:', this.type, ', action:', this.action);
|
||||
this.modal.showModal = true;
|
||||
this.$nextTick(function() {
|
||||
//this.$refs.search.focus();
|
||||
@@ -144,7 +157,6 @@ export default {
|
||||
},
|
||||
saveAction() {
|
||||
console.log('saveAction button: create/edit action with', this.type);
|
||||
|
||||
let
|
||||
type = this.type,
|
||||
data = {} ;
|
||||
@@ -159,10 +171,9 @@ export default {
|
||||
break;
|
||||
|
||||
default:
|
||||
if (typeof this.type === 'undefined') {
|
||||
if (typeof this.type === 'undefined') { // action=create
|
||||
type = this.$refs.castNew.radioType;
|
||||
data = this.$refs.castNew.castDataByType();
|
||||
|
||||
} else {
|
||||
throw 'error with object type';
|
||||
}
|
||||
@@ -173,11 +184,12 @@ export default {
|
||||
|
||||
this.modal.showModal = false;
|
||||
},
|
||||
goToLocation(id, type){
|
||||
if(type == 'person'){
|
||||
window.location = `../../person/${id}/general`
|
||||
} else if(type == 'thirdparty') {
|
||||
window.location = `../../thirdparty/thirdparty/${id}/show`
|
||||
buildLocation(id, type) {
|
||||
if (type === 'person') {
|
||||
// TODO i18n
|
||||
return `/fr/person/${id}/general`;
|
||||
} else if (type === 'thirdparty') {
|
||||
return `/fr/thirdparty/thirdparty/${id}/show`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -188,5 +200,4 @@ export default {
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
</style>
|
@@ -0,0 +1,24 @@
|
||||
const ontheflyMessages = {
|
||||
fr: {
|
||||
onthefly: {
|
||||
show: {
|
||||
person: "Détails de l'usager",
|
||||
thirdparty: "Détails du tiers",
|
||||
file_person: "Ouvrir la fiche de l'usager",
|
||||
file_thirdparty: "Voir le Tiers",
|
||||
},
|
||||
edit: {
|
||||
person: "Modifier un usager",
|
||||
thirdparty: "Modifier un tiers"
|
||||
},
|
||||
create: {
|
||||
button: "Créer \"{q}\"",
|
||||
title: "Création d'un nouvel usager ou d'un tiers professionnel",
|
||||
person: "un nouvel usager",
|
||||
thirdparty: "un nouveau tiers professionnel"
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { ontheflyMessages };
|
@@ -0,0 +1,35 @@
|
||||
import { createApp } from "vue";
|
||||
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n';
|
||||
import { ontheflyMessages } from './i18n.js';
|
||||
import App from "./App.vue";
|
||||
|
||||
const i18n = _createI18n( ontheflyMessages );
|
||||
|
||||
let containers = document.querySelectorAll('.onthefly-container');
|
||||
|
||||
containers.forEach((container) => {
|
||||
|
||||
const app = createApp({
|
||||
template: `<app :onTheFly="this.onTheFly" ></app>`,
|
||||
data() {
|
||||
return {
|
||||
onTheFly: {
|
||||
context: {
|
||||
action: container.dataset.action,
|
||||
type: container.dataset.targetName,
|
||||
id: parseInt(container.dataset.targetId),
|
||||
},
|
||||
options: {
|
||||
buttonText: container.dataset.buttonText || null,
|
||||
displayBadge: container.dataset.displayBadge || false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.use(i18n)
|
||||
.component('app', App)
|
||||
.mount(container);
|
||||
|
||||
//console.log('container dataset', container.dataset);
|
||||
});
|
@@ -53,24 +53,6 @@ const messages = {
|
||||
top: "Haut",
|
||||
bottom: "Bas",
|
||||
},
|
||||
onthefly: {
|
||||
show: {
|
||||
person: "Détails de l'usager",
|
||||
thirdparty: "Détails du tiers",
|
||||
file_person: "Ouvrir la fiche de l'usager",
|
||||
file_thirdparty: "Voir le Tiers",
|
||||
},
|
||||
edit: {
|
||||
person: "Modifier un usager",
|
||||
thirdparty: "Modifier un tiers"
|
||||
},
|
||||
create: {
|
||||
button: "Créer \"{q}\"",
|
||||
title: "Création d'un nouvel usager ou d'un tiers professionnel",
|
||||
person: "un nouvel usager",
|
||||
thirdparty: "un nouveau tiers professionnel"
|
||||
},
|
||||
},
|
||||
renderbox: {
|
||||
person: "Usager",
|
||||
birthday: {
|
||||
|
Reference in New Issue
Block a user