mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
household member editor: display when a concerned person already belongs to a household
This commit is contained in:
parent
da12aedb53
commit
13faf6fe5a
@ -9,7 +9,7 @@
|
|||||||
<div v-else>
|
<div v-else>
|
||||||
<p>
|
<p>
|
||||||
{{ $t('household_members_editor.concerned.persons_will_be_moved') }} :
|
{{ $t('household_members_editor.concerned.persons_will_be_moved') }} :
|
||||||
<span v-for="c in concerned">
|
<span v-for="c in concerned" :key=c.person.id>
|
||||||
<person-render-box render="badge" :options="{addLink: false}" :person="c.person"></person-render-box>
|
<person-render-box render="badge" :options="{addLink: false}" :person="c.person"></person-render-box>
|
||||||
<button class="btn" @click="removePerson(c.person)" v-if="c.allowRemove" style="padding-left:0;">
|
<button class="btn" @click="removePerson(c.person)" v-if="c.allowRemove" style="padding-left:0;">
|
||||||
<span class="fa-stack fa-lg" :title="$t('household_members_editor.concerned.remove_concerned')">
|
<span class="fa-stack fa-lg" :title="$t('household_members_editor.concerned.remove_concerned')">
|
||||||
@ -19,6 +19,16 @@
|
|||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
<div class="alert alert-info" v-if="concernedPersonsWithHouseholds.length > 0">
|
||||||
|
<p>{{ $t('household_members_editor.concerned.persons_with_household') }}</p>
|
||||||
|
<ul v-for="c in concernedPersonsWithHouseholds" :key=c.person.id>
|
||||||
|
<li>
|
||||||
|
{{ $t('household_members_editor.concerned.person') }} {{c.person.text}} {{$t('household_members_editor.concerned.already_belongs_to_household') }}
|
||||||
|
<a target="_blank" :href="this.makeHouseholdLink(c.person.current_household_id)">{{c.person.current_household_id}}</a>.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
@ -59,7 +69,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState([
|
...mapState([
|
||||||
'concerned'
|
'concerned', 'household'
|
||||||
]),
|
]),
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
'persons',
|
'persons',
|
||||||
@ -67,6 +77,11 @@ export default {
|
|||||||
noPerson () {
|
noPerson () {
|
||||||
return this.$store.getters.persons.length === 0;
|
return this.$store.getters.persons.length === 0;
|
||||||
},
|
},
|
||||||
|
concernedPersonsWithHouseholds () {
|
||||||
|
return this.$store.state.concerned.filter(c =>
|
||||||
|
c.person.current_household_id !== null && c.person.current_household_id !== this.$store.state.household.id
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -92,6 +107,9 @@ export default {
|
|||||||
console.log('remove person in concerned', person);
|
console.log('remove person in concerned', person);
|
||||||
this.$store.dispatch('removePerson', person);
|
this.$store.dispatch('removePerson', person);
|
||||||
},
|
},
|
||||||
|
makeHouseholdLink(id) {
|
||||||
|
return `/fr/person/household/${id}/summary`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -46,6 +46,9 @@ const appMessages = {
|
|||||||
move_to: "Déplacer vers",
|
move_to: "Déplacer vers",
|
||||||
persons_leaving: "Usagers quittant leurs ménages",
|
persons_leaving: "Usagers quittant leurs ménages",
|
||||||
no_person_in_position: "Aucun usager ne sera ajouté à cette position",
|
no_person_in_position: "Aucun usager ne sera ajouté à cette position",
|
||||||
|
persons_with_household: "Attention, usagers avec ménages",
|
||||||
|
person: "L'usager",
|
||||||
|
already_belongs_to_household: "appartient déjà au ménage"
|
||||||
},
|
},
|
||||||
positioning: {
|
positioning: {
|
||||||
persons_to_positionnate: 'Usagers à positionner',
|
persons_to_positionnate: 'Usagers à positionner',
|
||||||
|
@ -307,7 +307,7 @@ const store = createStore({
|
|||||||
comment: "",
|
comment: "",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.err("person already included");
|
console.error("person already included");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
markPosition(state, { person_id, position_id}) {
|
markPosition(state, { person_id, position_id}) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user