mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
open confirmation modal when assigning person Location
This commit is contained in:
parent
29b5e700f6
commit
0abb4983f7
@ -1,19 +1,50 @@
|
||||
<template>
|
||||
<li>
|
||||
<button class="btn btn-sm btn-secondary"
|
||||
@click="assignAddress"
|
||||
@click="modal.showModal = true"
|
||||
:title="$t('courselocation.assign_course_address')">
|
||||
<i class="fa fa-map-marker"></i>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<teleport to="body">
|
||||
<modal v-if="modal.showModal" :modalDialogClass="modal.modalDialogClass" @close="modal.showModal = false">
|
||||
<template v-slot:header>
|
||||
<h2 class="modal-title">{{ $t('courselocation.sure') }}</h2>
|
||||
</template>
|
||||
<template v-slot:body>
|
||||
<show-address :address="person.current_household_address"></show-address>
|
||||
<p>{{ $t('courselocation.sure_description') }}</p>
|
||||
</template>
|
||||
<template v-slot:footer>
|
||||
<button class="btn btn-danger" @click="assignAddress">
|
||||
{{ $t('courselocation.ok') }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||
import ShowAddress from "ChillMainAssets/vuejs/Address/components/ShowAddress";
|
||||
|
||||
export default {
|
||||
name: "ButtonLocation",
|
||||
components: {
|
||||
ShowAddress,
|
||||
Modal,
|
||||
},
|
||||
props: ['person'],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
context: state => state.addressContext
|
||||
@ -29,6 +60,8 @@ export default {
|
||||
personId: this.person.id
|
||||
};
|
||||
this.$store.dispatch('updateLocation', payload);
|
||||
window.location.assign('#section-50');
|
||||
this.modal.showModal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,9 @@ const appMessages = {
|
||||
assign_course_address: "Désigner comme l'adresse du parcours",
|
||||
remove_button: "Enlever l'adresse",
|
||||
temporary_address_must_be_changed: "Cette addresse est temporaire et doit être remplacée par celle d'un usager de référence.",
|
||||
sure: "Êtes-vous sûr ?",
|
||||
sure_description: "Voulez-vous faire de cette adresse l'adresse du parcours ?",
|
||||
ok: "Désigner comme adresse du parcours",
|
||||
},
|
||||
referrer: {
|
||||
title: "Référent du parcours",
|
||||
|
Loading…
x
Reference in New Issue
Block a user