mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 16:43:48 +00:00
rdv: add thirdParty in concerned persons (WIP)
This commit is contained in:
@@ -3,13 +3,6 @@ import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
|
||||
const appMessages = {
|
||||
fr: {
|
||||
activity: {
|
||||
//
|
||||
social_issues: "Problématiques sociales",
|
||||
choose_other_social_issue: "Ajouter une autre problématique sociale...",
|
||||
social_actions: "Actions d'accompagnement",
|
||||
select_first_a_social_issue: "Sélectionnez d'abord une problématique sociale",
|
||||
|
||||
//
|
||||
add_persons: "Ajouter des personnes concernées",
|
||||
bloc_persons: "Usagers",
|
||||
bloc_persons_associated: "Usagers du parcours",
|
||||
|
@@ -22,7 +22,9 @@ const removeIdFromValue = (string, id) => {
|
||||
const activity = {
|
||||
accompanyingPeriod: null,
|
||||
socialIssues: [],
|
||||
persons: []
|
||||
persons: [],
|
||||
professionals: [],
|
||||
invites: []
|
||||
}; // TODO: get this object from window.activity ?
|
||||
|
||||
const store = createStore({
|
||||
@@ -86,14 +88,12 @@ const store = createStore({
|
||||
// ConcernedGroups
|
||||
addPersonsInvolved(state, payload) {
|
||||
//console.log('### mutation addPersonsInvolved', payload.result.type);
|
||||
console.log(state)
|
||||
console.log(payload)
|
||||
switch (payload.result.type) {
|
||||
case 'person':
|
||||
state.activity.persons.push(payload.result);
|
||||
break;
|
||||
case 'thirdparty':
|
||||
state.activity.thirdParties.push(payload.result);
|
||||
state.activity.professionals.push(payload.result);
|
||||
break;
|
||||
case 'user':
|
||||
state.activity.users.push(payload.result);
|
||||
@@ -107,7 +107,7 @@ const store = createStore({
|
||||
state.activity.persons = state.activity.persons.filter(person => person !== payload);
|
||||
break;
|
||||
case 'thirdparty':
|
||||
state.activity.thirdParties = state.activity.thirdParties.filter(thirdparty => thirdparty !== payload);
|
||||
state.activity.professionals = state.activity.professionals.filter(thirdparty => thirdparty !== payload);
|
||||
break;
|
||||
case 'user':
|
||||
state.activity.users = state.activity.users.filter(user => user !== payload);
|
||||
@@ -138,18 +138,18 @@ const store = createStore({
|
||||
commit('updateActionsSelected', payload);
|
||||
},
|
||||
addPersonsInvolved({ commit }, payload) {
|
||||
//console.log('### action addPersonsInvolved', payload.result.type);
|
||||
console.log('### action addPersonsInvolved', payload.result.type);
|
||||
switch (payload.result.type) {
|
||||
case 'person':
|
||||
let aPersons = document.getElementById("chill_calendarbundle_calendar_persons");
|
||||
aPersons.value = addIdToValue(aPersons.value, payload.result.id);
|
||||
break;
|
||||
case 'thirdparty':
|
||||
let aThirdParties = document.getElementById("chill_calendarbundle_calendar_thirdParties");
|
||||
let aThirdParties = document.getElementById("chill_calendarbundle_calendar_professionals");
|
||||
aThirdParties.value = addIdToValue(aThirdParties.value, payload.result.id);
|
||||
break;
|
||||
case 'user':
|
||||
let aUsers = document.getElementById("chill_calendarbundle_calendar_users");
|
||||
let aUsers = document.getElementById("chill_calendarbundle_calendar_invites");
|
||||
aUsers.value = addIdToValue(aUsers.value, payload.result.id);
|
||||
break;
|
||||
};
|
||||
@@ -163,11 +163,11 @@ const store = createStore({
|
||||
aPersons.value = removeIdFromValue(aPersons.value, payload.id);
|
||||
break;
|
||||
case 'thirdparty':
|
||||
let aThirdParties = document.getElementById("chill_calendarbundle_calendar_thirdParties");
|
||||
let aThirdParties = document.getElementById("chill_calendarbundle_calendar_professionals");
|
||||
aThirdParties.value = removeIdFromValue(aThirdParties.value, payload.id);
|
||||
break;
|
||||
case 'user':
|
||||
let aUsers = document.getElementById("chill_calendarbundle_calendar_users");
|
||||
let aUsers = document.getElementById("chill_calendarbundle_calendar_invites");
|
||||
aUsers.value = removeIdFromValue(aUsers.value, payload.id);
|
||||
break;
|
||||
};
|
||||
|
Reference in New Issue
Block a user