household member editor: fix show other household warning + wording

This commit is contained in:
nobohan 2021-12-13 14:16:01 +01:00
parent 13faf6fe5a
commit f2c724726a
3 changed files with 12 additions and 8 deletions

View File

@ -33,7 +33,7 @@ const fetchHouseholdSuggestionByAccompanyingPeriod = (personId) => {
throw Error ({m: 'Error while fetching household suggestion', status: response.status});
}).then(data => Promise.resolve(data.results))
.catch(e => console.err(e));
.catch(e => console.error(e));
;
};

View File

@ -23,7 +23,8 @@
<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') }}
{{ 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>
@ -78,9 +79,13 @@ export default {
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
);
if (this.$store.state.household) {
return this.$store.state.concerned.filter(c =>
c.person.current_household_id !== null && c.person.current_household_id !== this.$store.state.household.id
)
} else {
return [];
}
}
},
data() {

View File

@ -46,9 +46,8 @@ const appMessages = {
move_to: "Déplacer vers",
persons_leaving: "Usagers quittant leurs ménages",
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"
persons_with_household: "Les usagers suivants sont associés à ces ménages:",
already_belongs_to_household: "est associé au ménage"
},
positioning: {
persons_to_positionnate: 'Usagers à positionner',