person can be added to filiation graph and relationship created

This commit is contained in:
Julie Lenaerts 2022-03-22 15:49:25 +01:00
parent c7caa2ba76
commit 8d5c66dc40
2 changed files with 22 additions and 19 deletions

View File

@ -180,24 +180,6 @@ export default {
}
}
},
methods: {
addNewPersons({ selected, modal }) {
console.log('@@@ CLICK button addNewPersons', selected);
// selected.forEach(function(item) {
// this.$store.dispatch('addPerson', item)
// .catch(({name, violations}) => {
// if (name === 'ValidationException' || name === 'AccessException') {
// violations.forEach((violation) => this.$toast.open({message: violation}));
// } else {
// this.$toast.open({message: violations})
// }
// });
// }, this
// );
// this.$refs.addPersons.resetSearch(); // to cast child method
// modal.showModal = false;
},
},
computed: {
...mapGetters(['nodes', 'edges',
// not used 'isInWhitelist', 'isHouseholdLoading', 'isCourseLoaded', 'isRelationshipLoaded', 'isPersonLoaded', 'isExcludedNode', 'countLinksByNode', 'getParticipationsByCourse', 'getMembersByHousehold', 'getPersonsGroup',
@ -278,7 +260,22 @@ export default {
this.link = document.getElementById('exportCanvasBtn')
},
methods: {
addNewPersons({ selected, modal }) {
// console.log('@@@ CLICK button addNewPersons', selected);
selected.forEach(function(item) {
this.$store.dispatch('addPerson', item.result)
.catch(({name, violations}) => {
if (name === 'ValidationException' || name === 'AccessException') {
violations.forEach((violation) => this.$toast.open({message: violation}));
} else {
this.$toast.open({message: violations})
}
});
}, this
);
this.$refs.addPersons.resetSearch(); // to cast child method
modal.showModal = false;
},
initGraph() {
this.container = document.getElementById('visgraph')
// Instanciate vis objects in separate window variables, see vis-network.js

View File

@ -1,5 +1,11 @@
const visMessages = {
fr: {
add_persons: {
title: "Ajouter des usagers",
suggested_counter: "Pas de résultats | 1 résultat | {count} résultats",
selected_counter: " 1 sélectionné | {count} sélectionnés",
search_some_persons: "Rechercher des personnes..",
},
visgraph: {
Course: 'Parcours',
Household: 'Ménage',