mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
some tweaks into PickAddressType
This commit is contained in:
@@ -267,6 +267,9 @@ export default {
|
||||
title: { create: 'add_an_address_title', edit: 'edit_address' },
|
||||
openPanesInModal: true,
|
||||
stickyActions: false,
|
||||
// show a message when no address.
|
||||
// if set to undefined, the value will be equivalent to false if stickyActions is false, true otherwise.
|
||||
showMessageWhenNoAddress: undefined,
|
||||
useDate: {
|
||||
validFrom: false,
|
||||
validTo: false
|
||||
|
@@ -15,7 +15,7 @@
|
||||
<span v-if="forceRedirect">{{ $t('wait_redirection') }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="noAddressWithStickyActions" class="mt-5">
|
||||
<div v-if="showMessageWhenNoAddress" class="mt-5">
|
||||
<p class="chill-no-data-statement">
|
||||
{{ $t('not_yet_address') }}
|
||||
</p>
|
||||
@@ -50,8 +50,8 @@ export default {
|
||||
},
|
||||
props: [
|
||||
'context',
|
||||
'options',
|
||||
'defaultz',
|
||||
'options',
|
||||
'flag',
|
||||
'entity',
|
||||
'errorMsg',
|
||||
@@ -91,7 +91,11 @@ export default {
|
||||
forceRedirect() {
|
||||
return (!(this.context.backUrl === null || typeof this.context.backUrl === 'undefined'));
|
||||
},
|
||||
noAddressWithStickyActions() {
|
||||
showMessageWhenNoAddress() {
|
||||
let showMessageWhenNoAddress = this.options.showMessageWhenNoAddress === undefined ? this.defaultz.showMessageWhenNoAddress : this.options.showMessageWhenNoAddress;
|
||||
if (showMessageWhenNoAddress === true || showMessageWhenNoAddress === false) {
|
||||
return !this.context.edit && !this.address.id && showMessageWhenNoAddress;
|
||||
}
|
||||
return !this.context.edit && !this.address.id && this.options.stickyActions;
|
||||
}
|
||||
}
|
||||
|
@@ -14,8 +14,6 @@ inputs.forEach(el => {
|
||||
addressId = el.value,
|
||||
uniqid = el.dataset.inputAddress,
|
||||
container = document.querySelector('div[data-input-address-container="' + uniqid + '"]'),
|
||||
currentTarget = el,
|
||||
i = 0,
|
||||
isEdit = addressId !== '',
|
||||
addressIdInt = addressId !== '' ? parseInt(addressId) : null
|
||||
;
|
||||
@@ -23,6 +21,7 @@ inputs.forEach(el => {
|
||||
if (container === null) {
|
||||
throw Error("no container");
|
||||
}
|
||||
console.log('useValidFrom', el.dataset.useValidFrom === '1');
|
||||
|
||||
const app = createApp({
|
||||
template: `<app v-bind:addAddress="this.addAddress" @address-created="associateToInput"></app>`,
|
||||
@@ -43,11 +42,11 @@ inputs.forEach(el => {
|
||||
/// null value take default component value defined in AddAddress data()
|
||||
button: {
|
||||
text: {
|
||||
create: null,
|
||||
edit: null,
|
||||
create: el.dataset.buttonTextCreate || null,
|
||||
edit: el.dataset.buttonTextUpdate || null,
|
||||
},
|
||||
size: null,
|
||||
displayText: false
|
||||
displayText: true
|
||||
},
|
||||
|
||||
/// Modal title text if create or edit address (trans chain, see i18n)
|
||||
@@ -61,11 +60,12 @@ inputs.forEach(el => {
|
||||
|
||||
/// Display actions buttons of panes in a sticky-form-button navbar
|
||||
stickyActions: false,
|
||||
showMessageWhenNoAddress: true,
|
||||
|
||||
/// Use Date fields
|
||||
useDate: {
|
||||
validFrom: el.dataset.useValidFrom === 'true', //boolean, default: false
|
||||
validTo: el.dataset.useValidTo === 'true' //boolean, default: false
|
||||
validFrom: el.dataset.useValidFrom === '1' || false, //boolean, default: false
|
||||
validTo: el.dataset.useValidTo === '1' || false, //boolean, default: false
|
||||
},
|
||||
|
||||
/// Don't display show renderbox Address: showPane display only a button
|
||||
@@ -76,7 +76,6 @@ inputs.forEach(el => {
|
||||
},
|
||||
methods: {
|
||||
associateToInput(payload) {
|
||||
console.log(payload);
|
||||
el.value = payload.addressId;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user