From 533865c41afbe1637a6c60b51c602b3578e31337 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 11 Aug 2021 19:17:52 +0200 Subject: [PATCH] show evaluation details --- .../Resources/public/chill/chillmain.scss | 19 +++++ .../vuejs/AccompanyingCourseWorkEdit/App.vue | 10 ++- .../components/AddEvaluation.vue | 48 +++++++++-- .../components/FormEvaluation.vue | 81 ++++++++++--------- .../vuejs/AccompanyingCourseWorkEdit/store.js | 17 +++- 5 files changed, 128 insertions(+), 47 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss index bb98596a0..20ce571ac 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss @@ -265,6 +265,25 @@ table.table-bordered { } } +/// display definition list +// with dt and dd on same line + +dl.definition-inline { + dd { + display: inline; + margin: 0; + &:after{ + display: block; + content: ''; + } + } + dt{ + display: inline-block; + min-width: 200px; + } +} + + /// when there is no data .custom_field_no_data, .chill-no-data-statement { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index a97fb9da6..740d1e111 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -520,9 +520,13 @@ div#workEditor { } } - div.item-title { + .item-title { font-weight: bold; } + .item-details { + margin: 1em 2em; + font-size: 85%; + } ul.list-evaluations, ul.list-objectives, @@ -555,6 +559,10 @@ div#workEditor { &#persons { margin-top: 1.5em; } + + ul.record_actions { + margin-bottom: 0; + } } div#errors { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue index 455dc2adb..b9f470716 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue @@ -5,7 +5,41 @@ {{ e.evaluation.title.fr }}
- voit l'évaluation +
+ +
+ {{ $t('startDate') }} :
+
+ {{ e.startDate.datetime }}
+ +
+ {{ $t('endDate') }} :
+
+ {{ e.endDate.datetime }}
+ +
+ {{ $t('maxDate') }} :
+
+ {{ e.maxDate.datetime }}
+ +
+ {{ $t('warningInterval') }} :
+
+ {{ e.warningInterval }}
+ +
+ {{ $t('documents') }} :
+
+ {{ e.documents.length }}
+ +
+
+
+ {{ $t('comment') }} :
+
+ {{ e.comment }}
+ +
- +
  • @@ -33,6 +67,12 @@ const i18n = { no_evaluation_associated: "Aucune évaluation associée", add_an_evaluation: "Évaluations disponibles", evaluation_has_no_evaluation: "Aucune évaluation disponible", + startDate: "Date d'ouverture", + endDate: "Date de fin", + maxDate: "Date d'échéance", + warningInterval: "Rappel (jours)", + comment: "Note publique", + documents: "Documents", } } }; @@ -69,7 +109,3 @@ export default { } } - - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index b08560de6..57f5eb1de 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -3,8 +3,9 @@ +
    -
    + +
    - +
    - +
    +
    - +
    - +
    +
    +
    - @@ -68,12 +73,13 @@
    -
    + +
    @@ -91,7 +97,7 @@ const i18n = { evaluation_startdate: "Date d'ouverture", evaluation_enddate: "Date de fin", evaluation_maxdate: "Date d'échéance", - evaluation_warning_interval: "Date de rappel", + evaluation_warning_interval: "Rappel (jours)", evaluation_public_comment: "Note publique", evaluation_comment_placeholder: "Commencez à écrire ...", evaluation_generate_a_document: "Générer un document", @@ -114,13 +120,13 @@ export default { editor: ClassicEditor, evaluation: { status: null, - startdate: null, - enddate: null, - maxdate: null, + startDate: null, + endDate: null, + maxDate: null, warningInterval: null, - public_note: null, - templateDoc: null, - //addDocument: null + comment: null, + template: null, + //documents: null } } }, @@ -129,39 +135,40 @@ export default { get() { return this.evaluation.status; }, set(v) { this.evaluation.status = v; } }, - startdate: { - get() { return this.evaluation.startdate; }, - set(v) { this.evaluation.startdate = v; } + startDate: { + get() { return this.evaluation.startDate; }, + set(v) { this.evaluation.startDate = v; } }, - enddate: { - get() { return this.evaluation.enddate; }, - set(v) { this.evaluation.enddate = v; } + endDate: { + get() { return this.evaluation.endDate; }, + set(v) { this.evaluation.endDate = v; } }, - maxdate: { - get() { return this.evaluation.maxdate; }, - set(v) { this.evaluation.maxdate = v; } + maxDate: { + get() { return this.evaluation.maxDate; }, + set(v) { this.evaluation.maxDate = v; } }, warningInterval: { get() { return this.evaluation.warningInterval; }, set(v) { this.evaluation.warningInterval = v; } }, - public_note: { - get() { return this.evaluation.public_note; }, - set(v) { this.evaluation.public_note = v; } + comment: { + get() { return this.evaluation.comment; }, + set(v) { this.evaluation.comment = v; } }, - templateDoc: { - get() { return this.evaluation.templateDoc; }, - set(v) { this.evaluation.templateDoc = v; } + template: { + get() { return this.evaluation.template; }, + set(v) { this.evaluation.template = v; } }, /* - addDocument: { - get() { return this.evaluation.addDocument; }, - set(v) { this.evaluation.addDocument = v; } + documents: { + get() { return this.evaluation.documents; }, + set(v) { this.evaluation.documents = v; } } */ }, methods: { listAllStatus() { + console.log('load all status'); let url = `/api/`; fetch(url) .then(response => { @@ -179,7 +186,7 @@ export default { } }, mounted() { - this.listAllStatus(); + //this.listAllStatus(); } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index b85319408..d3267045f 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -90,6 +90,9 @@ const store = createStore({ } return o; + }), + accompanyingPeriodWorkEvaluations: state.evaluationsPicked.map(e => { + }) }; } @@ -118,6 +121,7 @@ const store = createStore({ setEvaluationsForAction(state, results) { //console.log('set evaluations for action', results); state.evaluationsForAction = results; + console.log('e4a', state.evaluationsForAction); }, addResultPicked(state, result) { state.resultsPicked.push(result); @@ -163,13 +167,19 @@ const store = createStore({ let e = { type: "accompanying_period_work_evaluation", evaluation: evaluation, - note: '', - results: [] + //startDate, + //endDate, + //maxDate, + //warningInterval + //comment, + //documents, } state.evaluationsPicked.push(e); + console.log('ep', state.evaluationsPicked); }, removeEvaluation(state, evaluation) { state.evaluationsPicked = state.evaluationsPicked.filter(e => e.id !== evaluation.id); + console.log('ep', state.evaluationsPicked); }, setPersonsPickedIds(state, ids) { //console.log('persons ids', ids); @@ -287,7 +297,6 @@ const store = createStore({ throw { m: 'Error while retriving evaluations for social action', s: response.status, b: response.body }; }) .then(data => { - //console.log('data retrived', data); commit('setEvaluationsForAction', data.results); }); }, @@ -335,6 +344,8 @@ const store = createStore({ dispatch('getReachablesResultsForAction'); dispatch('getReachablesGoalsForAction'); dispatch('getReachablesEvaluationsForAction'); + + console.log('ep', this.state.evaluationsPicked); }, } });