mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-29 13:36:13 +00:00
prepare dispatch
This commit is contained in:
parent
3748b4fbf4
commit
020759180b
@ -149,15 +149,15 @@ export default {
|
|||||||
addInSocialIssuesList(value) {
|
addInSocialIssuesList(value) {
|
||||||
console.log('addInSocialIssuesList', value);
|
console.log('addInSocialIssuesList', value);
|
||||||
this.$store.commit('addSocialIssueInList', value);
|
this.$store.commit('addSocialIssueInList', value);
|
||||||
this.$store.commit('addSocialIssueSelected', value);
|
|
||||||
this.$store.commit('removeSocialIssueInOther', value);
|
this.$store.commit('removeSocialIssueInOther', value);
|
||||||
|
this.$store.dispatch('addSocialIssueSelected', value);
|
||||||
this.updateActionsList();
|
this.updateActionsList();
|
||||||
},
|
},
|
||||||
/* Update value for selected issues checkboxes
|
/* Update value for selected issues checkboxes
|
||||||
*/
|
*/
|
||||||
updateSelectedIssue(value) {
|
updateSelectedIssue(value) {
|
||||||
console.log('updateSelectedIssue', value);
|
console.log('updateSelectedIssue', value);
|
||||||
this.$store.commit('updateSocialIssuesSelected', value);
|
this.$store.dispatch('updateSocialIssuesSelected', value);
|
||||||
this.updateActionsList();
|
this.updateActionsList();
|
||||||
},
|
},
|
||||||
/* Add socialActions concerned: reset actions list, then loop on each issue selected
|
/* Add socialActions concerned: reset actions list, then loop on each issue selected
|
||||||
@ -185,8 +185,13 @@ export default {
|
|||||||
resolve();
|
resolve();
|
||||||
}));
|
}));
|
||||||
}, this);
|
}, this);
|
||||||
|
},
|
||||||
|
/* Update value for selected actions checkboxes
|
||||||
|
*/
|
||||||
|
updateSelectedAction(value) {
|
||||||
|
console.log('updateSelectedAction', value);
|
||||||
|
this.$store.dispatch('updateSocialActionsSelected', value);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -4,6 +4,20 @@ import { createStore } from 'vuex';
|
|||||||
const debug = process.env.NODE_ENV !== 'production';
|
const debug = process.env.NODE_ENV !== 'production';
|
||||||
//console.log('window.activity', window.activity);
|
//console.log('window.activity', window.activity);
|
||||||
|
|
||||||
|
const addIdToValue = (string, id) => {
|
||||||
|
let array = string ? string.split(',') : [];
|
||||||
|
array.push(id.toString());
|
||||||
|
let str = array.join();
|
||||||
|
return str;
|
||||||
|
};
|
||||||
|
|
||||||
|
const removeIdFromValue = (string, id) => {
|
||||||
|
let array = string.split(',');
|
||||||
|
array = array.filter(el => el !== id.toString());
|
||||||
|
let str = array.join();
|
||||||
|
return str;
|
||||||
|
};
|
||||||
|
|
||||||
const store = createStore({
|
const store = createStore({
|
||||||
strict: debug,
|
strict: debug,
|
||||||
state: {
|
state: {
|
||||||
@ -22,9 +36,9 @@ const store = createStore({
|
|||||||
console.log('add selected issue', issue.id);
|
console.log('add selected issue', issue.id);
|
||||||
state.activity.socialIssues.push(issue);
|
state.activity.socialIssues.push(issue);
|
||||||
},
|
},
|
||||||
updateSocialIssuesSelected(state, issue) {
|
updateSocialIssuesSelected(state, issues) {
|
||||||
console.log('update selected issues');
|
console.log('update selected issues', issues);
|
||||||
state.activity.socialIssues = issue;
|
state.activity.socialIssues = issues;
|
||||||
},
|
},
|
||||||
updateSocialIssuesOther(state, payload) {
|
updateSocialIssuesOther(state, payload) {
|
||||||
console.log('update other issues');
|
console.log('update other issues');
|
||||||
@ -42,9 +56,9 @@ const store = createStore({
|
|||||||
console.log('add list action', action.id);
|
console.log('add list action', action.id);
|
||||||
state.socialActionsList.push(action);
|
state.socialActionsList.push(action);
|
||||||
},
|
},
|
||||||
addSocialActionSelected(state, action) {
|
updateSocialActionsSelected(state, actions) {
|
||||||
console.log('add selected action', action.id);
|
console.log('update selected actions', actions);
|
||||||
state.activity.socialActions.push(action);
|
state.activity.socialActions = actions;
|
||||||
},
|
},
|
||||||
filterList(state, list) {
|
filterList(state, list) {
|
||||||
const filterList = (list) => {
|
const filterList = (list) => {
|
||||||
@ -96,16 +110,17 @@ const store = createStore({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
addSocialIssueSelected({ commit }, issue) {
|
||||||
|
commit('addSocialIssueSelected', issue);
|
||||||
|
},
|
||||||
|
updateSocialIssuesSelected({ commit }, payload) {
|
||||||
|
commit('updateSocialIssuesSelected', payload);
|
||||||
|
},
|
||||||
|
updateSocialActionsSelected({ commit }, payload) {
|
||||||
|
commit('updateSocialActionsSelected', payload);
|
||||||
|
},
|
||||||
addPersonsInvolved({ commit }, payload) {
|
addPersonsInvolved({ commit }, payload) {
|
||||||
//console.log('### action addPersonsInvolved', payload.result.type);
|
//console.log('### action addPersonsInvolved', payload.result.type);
|
||||||
|
|
||||||
const addIdToValue = (string, id) => {
|
|
||||||
let array = string ? string.split(',') : [];
|
|
||||||
array.push(id.toString());
|
|
||||||
let str = array.join();
|
|
||||||
return str;
|
|
||||||
};
|
|
||||||
|
|
||||||
switch (payload.result.type) {
|
switch (payload.result.type) {
|
||||||
case 'person':
|
case 'person':
|
||||||
let aPersons = document.getElementById("chill_activitybundle_activity_persons");
|
let aPersons = document.getElementById("chill_activitybundle_activity_persons");
|
||||||
@ -124,14 +139,6 @@ const store = createStore({
|
|||||||
},
|
},
|
||||||
removePersonInvolved({ commit }, payload) {
|
removePersonInvolved({ commit }, payload) {
|
||||||
//console.log('### action removePersonInvolved', payload);
|
//console.log('### action removePersonInvolved', payload);
|
||||||
|
|
||||||
const removeIdFromValue = (string, id) => {
|
|
||||||
let array = string.split(',');
|
|
||||||
array = array.filter(el => el !== id.toString());
|
|
||||||
let str = array.join();
|
|
||||||
return str;
|
|
||||||
};
|
|
||||||
|
|
||||||
switch (payload.type) {
|
switch (payload.type) {
|
||||||
case 'person':
|
case 'person':
|
||||||
let aPersons = document.getElementById("chill_activitybundle_activity_persons");
|
let aPersons = document.getElementById("chill_activitybundle_activity_persons");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user