mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-02 14:07:43 +00:00
add person: increase z-index of toast and wait for validation before closing modal
This commit is contained in:
parent
7af4c3434e
commit
db65134743
@ -418,3 +418,8 @@ span.item-key {
|
|||||||
background-color: #0000000a;
|
background-color: #0000000a;
|
||||||
//text-decoration: dotted underline;
|
//text-decoration: dotted underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// increase toast message z-index (above all modals)
|
||||||
|
div.v-toast {
|
||||||
|
z-index: 10000!important;
|
||||||
|
}
|
@ -90,7 +90,7 @@ export default {
|
|||||||
OnTheFlyThirdparty,
|
OnTheFlyThirdparty,
|
||||||
OnTheFlyCreate
|
OnTheFlyCreate
|
||||||
},
|
},
|
||||||
props: ['type', 'id', 'action', 'buttonText', 'displayBadge', 'parent'],
|
props: ['type', 'id', 'action', 'buttonText', 'displayBadge', 'parent', 'canCloseModal'],
|
||||||
emits: ['saveFormOnTheFly'],
|
emits: ['saveFormOnTheFly'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -162,7 +162,20 @@ export default {
|
|||||||
return 'entity-' + this.type + ' badge-' + this.type;
|
return 'entity-' + this.type + ' badge-' + this.type;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
canCloseModal: {
|
||||||
|
handler: function(val, oldVal) {
|
||||||
|
if (val) {
|
||||||
|
this.closeModal();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
closeModal() {
|
||||||
|
this.modal.showModal = false;
|
||||||
|
},
|
||||||
openModal() {
|
openModal() {
|
||||||
//console.log('## OPEN ON THE FLY MODAL');
|
//console.log('## OPEN ON THE FLY MODAL');
|
||||||
//console.log('## type:', this.type, ', action:', this.action);
|
//console.log('## type:', this.type, ', action:', this.action);
|
||||||
@ -200,8 +213,6 @@ export default {
|
|||||||
|
|
||||||
// pass datas to parent
|
// pass datas to parent
|
||||||
this.$emit('saveFormOnTheFly', { type: type, data: data });
|
this.$emit('saveFormOnTheFly', { type: type, data: data });
|
||||||
|
|
||||||
this.modal.showModal = false;
|
|
||||||
},
|
},
|
||||||
buildLocation(id, type) {
|
buildLocation(id, type) {
|
||||||
if (type === 'person') {
|
if (type === 'person') {
|
||||||
|
@ -66,9 +66,10 @@
|
|||||||
<div class="create-button">
|
<div class="create-button">
|
||||||
<on-the-fly
|
<on-the-fly
|
||||||
v-if="query.length >= 3"
|
v-if="query.length >= 3"
|
||||||
v-bind:buttonText="$t('onthefly.create.button', {q: query})"
|
:buttonText="$t('onthefly.create.button', {q: query})"
|
||||||
action="create"
|
action="create"
|
||||||
@saveFormOnTheFly="saveFormOnTheFly">
|
@saveFormOnTheFly="saveFormOnTheFly"
|
||||||
|
:canCloseModal="canCloseOnTheFlyModal">
|
||||||
</on-the-fly>
|
</on-the-fly>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -119,7 +120,8 @@ export default {
|
|||||||
suggested: [],
|
suggested: [],
|
||||||
selected: [],
|
selected: [],
|
||||||
priorSuggestion: {}
|
priorSuggestion: {}
|
||||||
}
|
},
|
||||||
|
canCloseOnTheFlyModal: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -269,6 +271,7 @@ export default {
|
|||||||
makeFetch('POST', '/api/1.0/person/person.json', data)
|
makeFetch('POST', '/api/1.0/person/person.json', data)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.newPriorSuggestion(response);
|
this.newPriorSuggestion(response);
|
||||||
|
this.canCloseOnTheFlyModal = true;
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
if (error.name === 'ValidationException') {
|
if (error.name === 'ValidationException') {
|
||||||
@ -284,6 +287,7 @@ export default {
|
|||||||
makeFetch('POST', '/api/1.0/thirdparty/thirdparty.json', data)
|
makeFetch('POST', '/api/1.0/thirdparty/thirdparty.json', data)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.newPriorSuggestion(response);
|
this.newPriorSuggestion(response);
|
||||||
|
this.canCloseOnTheFlyModal = true;
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
if (error.name === 'ValidationException') {
|
if (error.name === 'ValidationException') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user