comment all console.log

This commit is contained in:
Mathieu Jaumotte 2021-08-11 10:26:59 +02:00 committed by Marc Ducobu
parent 8d98a144fd
commit a1435314a0
4 changed files with 49 additions and 49 deletions

View File

@ -319,7 +319,7 @@ export default {
]), ]),
startDate: { startDate: {
get() { get() {
console.log('get start date', this.$store.state.startDate); //console.log('get start date', this.$store.state.startDate);
return dateToISO(this.$store.state.startDate); return dateToISO(this.$store.state.startDate);
}, },
set(v) { set(v) {
@ -328,7 +328,7 @@ export default {
}, },
endDate: { endDate: {
get() { get() {
console.log('get end date', this.$store.state.endDate); //console.log('get end date', this.$store.state.endDate);
return dateToISO(this.$store.state.endDate); return dateToISO(this.$store.state.endDate);
}, },
set(v) { set(v) {
@ -345,20 +345,20 @@ export default {
}, },
availableForCheckGoal() { availableForCheckGoal() {
let pickedIds = this.$store.state.goalsPicked.map(g => g.goal.id); let pickedIds = this.$store.state.goalsPicked.map(g => g.goal.id);
console.log('pickeds goals id', pickedIds); //console.log('pickeds goals id', pickedIds);
console.log(this.$store.state.goalsForAction); //console.log(this.$store.state.goalsForAction);
return this.$store.state.goalsForAction.filter(g => !pickedIds.includes(g.id)); return this.$store.state.goalsForAction.filter(g => !pickedIds.includes(g.id));
}, },
personsPicked: { personsPicked: {
get() { get() {
let s = this.$store.state.personsPicked.map(p => p.id); let s = this.$store.state.personsPicked.map(p => p.id);
console.log('persons picked', s); //console.log('persons picked', s);
return s; return s;
}, },
set(v) { set(v) {
console.log('persons picked', v); //console.log('persons picked', v);
this.$store.commit('setPersonsPickedIds', v); this.$store.commit('setPersonsPickedIds', v);
} }
}, },
@ -368,34 +368,34 @@ export default {
this.showAddObjective = !this.showAddObjective; this.showAddObjective = !this.showAddObjective;
}, },
addGoal(g) { addGoal(g) {
console.log('add Goal', g); //console.log('add Goal', g);
this.$store.commit('addGoal', g); this.$store.commit('addGoal', g);
}, },
removeGoal(g) { removeGoal(g) {
console.log('remove goal', g); //console.log('remove goal', g);
this.$store.commit('removeGoal', g); this.$store.commit('removeGoal', g);
}, },
toggleAddEvaluation() { toggleAddEvaluation() {
this.showAddEvaluation = !this.showAddEvaluation; this.showAddEvaluation = !this.showAddEvaluation;
}, },
setHandlingThirdParty({selected, modal}) { setHandlingThirdParty({selected, modal}) {
console.log('setHandlingThirdParty', selected); //console.log('setHandlingThirdParty', selected);
this.$store.commit('setHandlingThirdParty', selected.shift().result); this.$store.commit('setHandlingThirdParty', selected.shift().result);
this.$refs.handlingThirdPartyPicker.resetSearch(); this.$refs.handlingThirdPartyPicker.resetSearch();
modal.showModal = false; modal.showModal = false;
}, },
removeHandlingThirdParty() { removeHandlingThirdParty() {
console.log('removeHandlingThirdParty'); //console.log('removeHandlingThirdParty');
this.$store.commit('setHandlingThirdParty', null); this.$store.commit('setHandlingThirdParty', null);
}, },
addThirdParties({selected, modal}) { addThirdParties({selected, modal}) {
console.log('addThirdParties', selected); //console.log('addThirdParties', selected);
this.$store.commit('addThirdParties', selected.map(r => r.result)); this.$store.commit('addThirdParties', selected.map(r => r.result));
this.$refs.thirdPartyPicker.resetSearch(); this.$refs.thirdPartyPicker.resetSearch();
modal.showModal = false; modal.showModal = false;
}, },
removeThirdParty(t) { removeThirdParty(t) {
console.log('remove third party', t); //console.log('remove third party', t);
this.$store.commit('removeThirdParty', t); this.$store.commit('removeThirdParty', t);
}, },
submit() { submit() {

View File

@ -63,7 +63,7 @@ export default {
availableForCheckEvaluations() { availableForCheckEvaluations() {
let pickedIds = this.$store.state.evaluationsPicked.map(e => e.id); let pickedIds = this.$store.state.evaluationsPicked.map(e => e.id);
//console.log('picked ids', pickedIds); ////console.log('picked ids', pickedIds);
return this.$store.state.evaluationsForAction.filter(e => !pickedIds.includes(e.id)); return this.$store.state.evaluationsForAction.filter(e => !pickedIds.includes(e.id));
} }
@ -73,12 +73,12 @@ export default {
this.isExpanded = !this.isExpanded; this.isExpanded = !this.isExpanded;
}, },
addEvaluation(e) { addEvaluation(e) {
//console.log('addEvaluation', e); ////console.log('addEvaluation', e);
this.$store.commit('addEvaluationPicked', e); this.$store.commit('addEvaluationPicked', e);
return; return;
}, },
removeEvaluation(e) { removeEvaluation(e) {
//console.log('removeEvaluation', e); ////console.log('removeEvaluation', e);
this.$store.commit('removeEvaluationPicked', e); this.$store.commit('removeEvaluationPicked', e);
return; return;
} }

View File

@ -66,9 +66,9 @@ export default {
throw Error(`this.destination is not implemented: ${this.destination}`); throw Error(`this.destination is not implemented: ${this.destination}`);
}, },
pickedResults() { pickedResults() {
console.log('get checked'); //console.log('get checked');
console.log('this.destination', this.destination); //console.log('this.destination', this.destination);
console.log('this.goal', this.goal); //console.log('this.goal', this.goal);
if (this.destination === 'action') { if (this.destination === 'action') {
return this.$store.state.resultsPicked; return this.$store.state.resultsPicked;
} else if (this.destination === 'goal') { } else if (this.destination === 'goal') {
@ -78,16 +78,16 @@ export default {
throw Error(`this.destination is not implemented: ${this.destination}`); throw Error(`this.destination is not implemented: ${this.destination}`);
}, },
availableForCheckResults() { availableForCheckResults() {
console.log('availableForCheckResults'); //console.log('availableForCheckResults');
console.log('this.destination', this.destination); //console.log('this.destination', this.destination);
console.log('this.goal', this.goal); //console.log('this.goal', this.goal);
if (this.destination === 'action') { if (this.destination === 'action') {
let pickedIds = this.$store.state.resultsPicked.map(r => r.id); let pickedIds = this.$store.state.resultsPicked.map(r => r.id);
console.log('picked ids', pickedIds); //console.log('picked ids', pickedIds);
return this.$store.state.resultsForAction.filter(r => !pickedIds.includes(r.id)); return this.$store.state.resultsForAction.filter(r => !pickedIds.includes(r.id));
} else if (this.destination === 'goal') { } else if (this.destination === 'goal') {
console.log('results picked for goal', this.$store.getters.resultsPickedForGoal(this.goal)); //console.log('results picked for goal', this.$store.getters.resultsPickedForGoal(this.goal));
let pickedIds = this.$store.getters.resultsPickedForGoal(this.goal).map(r => r.id); let pickedIds = this.$store.getters.resultsPickedForGoal(this.goal).map(r => r.id);
return this.$store.getters.resultsForGoal(this.goal).filter(r => !pickedIds.includes(r.id)); return this.$store.getters.resultsForGoal(this.goal).filter(r => !pickedIds.includes(r.id));
@ -101,7 +101,7 @@ export default {
this.isExpanded = !this.isExpanded; this.isExpanded = !this.isExpanded;
}, },
addResult(r) { addResult(r) {
console.log('addResult', r); //console.log('addResult', r);
if (this.destination === 'action') { if (this.destination === 'action') {
this.$store.commit('addResultPicked', r); this.$store.commit('addResultPicked', r);
return; return;
@ -112,7 +112,7 @@ export default {
throw Error(`this.destination is not implemented: ${this.destination}`); throw Error(`this.destination is not implemented: ${this.destination}`);
}, },
removeResult(r) { removeResult(r) {
console.log('removeresult', r); //console.log('removeresult', r);
if (this.destination === 'action') { if (this.destination === 'action') {
this.$store.commit('removeResultPicked', r); this.$store.commit('removeResultPicked', r);
return; return;

View File

@ -5,7 +5,7 @@ import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js';
const debug = process.env.NODE_ENV !== 'production'; const debug = process.env.NODE_ENV !== 'production';
console.log(window.accompanyingCourseWork); //console.log(window.accompanyingCourseWork);
const store = createStore({ const store = createStore({
strict: debug, strict: debug,
@ -102,21 +102,21 @@ const store = createStore({
state.endDate = date; state.endDate = date;
}, },
setResultsForAction(state, results) { setResultsForAction(state, results) {
console.log('set results for action', results); //console.log('set results for action', results);
state.resultsForAction = results; state.resultsForAction = results;
}, },
setResultsForGoal(state, { goal, results }) { setResultsForGoal(state, { goal, results }) {
console.log('set results for goal', results); //console.log('set results for goal', results);
state.goalsForAction.push(goal); state.goalsForAction.push(goal);
for (let i in results) { for (let i in results) {
let r = results[i]; let r = results[i];
r.goalId = goal.id; r.goalId = goal.id;
console.log('adding result', r); //console.log('adding result', r);
state.resultsForGoal.push(r); state.resultsForGoal.push(r);
} }
}, },
setEvaluationsForAction(state, results) { setEvaluationsForAction(state, results) {
console.log('set evaluations for action', results); //console.log('set evaluations for action', results);
state.evaluationsForAction = results; state.evaluationsForAction = results;
}, },
addResultPicked(state, result) { addResultPicked(state, result) {
@ -139,10 +139,10 @@ const store = createStore({
}, },
addResultForGoalPicked(state, { goal, result}) { addResultForGoalPicked(state, { goal, result}) {
let found = state.goalsPicked.find(g => g.goal.id === goal.id); let found = state.goalsPicked.find(g => g.goal.id === goal.id);
console.log('adResultForGoalPicked'); //console.log('adResultForGoalPicked');
console.log('found', found); //console.log('found', found);
console.log('goal', goal); //console.log('goal', goal);
console.log('result', result); //console.log('result', result);
if (found === undefined) { if (found === undefined) {
return; return;
@ -160,7 +160,7 @@ const store = createStore({
found.results = found.results.filter(r => r.id !== result.id); found.results = found.results.filter(r => r.id !== result.id);
}, },
setPersonsPickedIds(state, ids) { setPersonsPickedIds(state, ids) {
console.log('persons ids', ids); //console.log('persons ids', ids);
state.personsPicked = state.personsReachables state.personsPicked = state.personsReachables
.filter(p => ids.includes(p.id)) .filter(p => ids.includes(p.id))
}, },
@ -171,11 +171,11 @@ const store = createStore({
state.handlingThirdParty = thirdParty; state.handlingThirdParty = thirdParty;
}, },
addThirdParties(state, thirdParties) { addThirdParties(state, thirdParties) {
console.log('addThirdParties', thirdParties); //console.log('addThirdParties', thirdParties);
// filter to remove existing thirdparties // filter to remove existing thirdparties
let ids = state.thirdParties.map(t => t.id); let ids = state.thirdParties.map(t => t.id);
let unexistings = thirdParties.filter(t => !ids.includes(t.id)); let unexistings = thirdParties.filter(t => !ids.includes(t.id));
console.log('unexisting third parties', unexistings); //console.log('unexisting third parties', unexistings);
for (let i in unexistings) { for (let i in unexistings) {
state.thirdParties.push(unexistings[i]); state.thirdParties.push(unexistings[i]);
} }
@ -185,7 +185,7 @@ const store = createStore({
.filter(t => t.id !== thirdParty.id); .filter(t => t.id !== thirdParty.id);
}, },
setErrors(state, errors) { setErrors(state, errors) {
console.log('handling errors', errors); //console.log('handling errors', errors);
state.errors = errors; state.errors = errors;
}, },
setIsPosting(state, st) { setIsPosting(state, st) {
@ -194,13 +194,13 @@ const store = createStore({
}, },
actions: { actions: {
getReachablesGoalsForAction({ getters, commit, dispatch }) { getReachablesGoalsForAction({ getters, commit, dispatch }) {
console.log('getReachablesGoalsForAction'); //console.log('getReachablesGoalsForAction');
let let
socialActionId = getters.socialAction.id, socialActionId = getters.socialAction.id,
url = `/api/1.0/person/social-work/goal/by-social-action/${socialActionId}.json` url = `/api/1.0/person/social-work/goal/by-social-action/${socialActionId}.json`
; ;
console.log(url); //console.log(url);
window window
.fetch( .fetch(
@ -219,12 +219,12 @@ const store = createStore({
}); });
}, },
getReachablesResultsForGoal({ commit }, goal) { getReachablesResultsForGoal({ commit }, goal) {
console.log('getReachablesResultsForGoal'); //console.log('getReachablesResultsForGoal');
let let
url = `/api/1.0/person/social-work/result/by-goal/${goal.id}.json` url = `/api/1.0/person/social-work/result/by-goal/${goal.id}.json`
; ;
console.log(url); //console.log(url);
window.fetch(url) window.fetch(url)
.then(response => { .then(response => {
@ -235,18 +235,18 @@ const store = createStore({
throw { m: 'Error while retriving results for goal', s: response.status, b: response.body }; throw { m: 'Error while retriving results for goal', s: response.status, b: response.body };
}) })
.then(data => { .then(data => {
console.log('data'); //console.log('data');
commit('setResultsForGoal', { goal, results: data.results }); commit('setResultsForGoal', { goal, results: data.results });
}); });
}, },
getReachablesResultsForAction({ getters, commit }) { getReachablesResultsForAction({ getters, commit }) {
console.log('getReachablesResultsForAction'); //console.log('getReachablesResultsForAction');
let let
socialActionId = getters.socialAction.id, socialActionId = getters.socialAction.id,
url = `/api/1.0/person/social-work/result/by-social-action/${socialActionId}.json` url = `/api/1.0/person/social-work/result/by-social-action/${socialActionId}.json`
; ;
console.log(url); //console.log(url);
window.fetch(url) window.fetch(url)
.then(response => { .then(response => {
@ -257,12 +257,12 @@ const store = createStore({
throw { m: 'Error while retriving results for social action', s: response.status, b: response.body }; throw { m: 'Error while retriving results for social action', s: response.status, b: response.body };
}) })
.then(data => { .then(data => {
console.log('data retrived', data); //console.log('data retrived', data);
commit('setResultsForAction', data.results); commit('setResultsForAction', data.results);
}); });
}, },
getReachablesEvaluationsForAction({ getters, commit }) { getReachablesEvaluationsForAction({ getters, commit }) {
console.log('getReachablesEvaluationsForAction'); //console.log('getReachablesEvaluationsForAction');
let let
socialActionId = getters.socialAction.id, socialActionId = getters.socialAction.id,
url = `/api/1.0/person/social-work/evaluation/by-social-action/${socialActionId}.json` url = `/api/1.0/person/social-work/evaluation/by-social-action/${socialActionId}.json`
@ -275,7 +275,7 @@ const store = createStore({
throw { m: 'Error while retriving evaluations for social action', s: response.status, b: response.body }; throw { m: 'Error while retriving evaluations for social action', s: response.status, b: response.body };
}) })
.then(data => { .then(data => {
console.log('data retrived', data); //console.log('data retrived', data);
commit('setEvaluationsForAction', data.results); commit('setEvaluationsForAction', data.results);
}); });
}, },
@ -286,7 +286,7 @@ const store = createStore({
errors = [] errors = []
; ;
console.log('action submitting', payload, url); //console.log('action submitting', payload, url);
commit('setIsPosting', true); commit('setIsPosting', true);
window.fetch(url, { window.fetch(url, {