From 3156706c2b6b8c8768fd9594e0aae3db25d9c2a9 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 9 Aug 2021 16:22:28 +0200 Subject: [PATCH] vue accompanyingcourse_work: prepare evaluations, + translations chains + styles border --- .../vuejs/AccompanyingCourseWorkEdit/App.vue | 187 ++++++++++++------ .../components/AddEvaluation.vue | 14 ++ .../components/AddResult.vue | 4 +- .../vuejs/AccompanyingCourseWorkEdit/store.js | 6 +- .../AccompanyingCourseWork/edit.html.twig | 4 +- 5 files changed, 149 insertions(+), 66 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index 47feed87e..4ab929c02 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -1,29 +1,34 @@ + + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddResult.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddResult.vue index 252b1d810..3c68dfd38 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddResult.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddResult.vue @@ -86,7 +86,7 @@ const i18n = { export default { name: "AddResult", - props: [ 'destination', 'goal' ], + props: [ 'destination', 'goal', 'availableResults' ], i18n, data() { return { @@ -136,7 +136,7 @@ export default { }, methods: { toggleSelect() { - this.isExpanded = !this.isExpanded; + this.isExpanded = !this.isExpanded; }, addResult(r) { console.log('addResult', r); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 603a2b218..8b7af4dc4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -20,6 +20,7 @@ const store = createStore({ resultsForAction: [], goalsForAction: [], resultsForGoal: [], + evaluationsForAction: [], personsPicked: window.accompanyingCourseWork.persons, personsReachables: window.accompanyingCourseWork.accompanyingPeriod.participations.filter(p => p.endDate == null) .map(p => p.person), @@ -45,6 +46,9 @@ const store = createStore({ return found === undefined ? [] : found.results; }, + hasEvaluationsForAction(state) { + return state.evaluationsForAction.length > 0; + }, hasHandlingThirdParty(state) { return state.handlingThirdParty !== null; }, @@ -259,7 +263,7 @@ const store = createStore({ errors = [] ; - console.log('action subitting', payload, url); + console.log('action submitting', payload, url); commit('setIsPosting', true); window.fetch(url, { diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/edit.html.twig index bb670d9d6..506d51d5e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/edit.html.twig @@ -6,9 +6,9 @@ {% block content %}
-

{{ block('title') }}

+

{{ block('title') }}

-
+
{% endblock %}