Merge remote-tracking branch 'origin/master' into issue603_add_closing_motive_course

This commit is contained in:
2022-05-27 21:57:19 +02:00
55 changed files with 953 additions and 144 deletions

View File

@@ -253,7 +253,6 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
state.accompanyingCourse.administrativeLocation = value;
},
updateReferrer(state, value) {
//console.log('value', value);
state.accompanyingCourse.user = value;
},
updateJob(state, value) {
@@ -775,9 +774,7 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
throw error;
})
},
updateReferrer({ commit }, payload) {
console.log('update referrer', payload);
console.log('payload !== null', payload !== null);
updateReferrer({ commit, state }, payload) {
const url = `/api/1.0/person/accompanying-course/${id}.json`;
let body = { type: "accompanying_period", user: null };
@@ -788,7 +785,10 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
return makeFetch('PATCH', url, body)
.then((response) => {
commit('updateReferrer', response.user);
commit('setFilteredReferrersSuggested');
if (null !== payload.user_job && payload.user_job !== state.accompanyingCourse.job) {
this.dispatch('updateJob', payload.user_job);
}
// commit('setFilteredReferrersSuggested'); // this mutation doesn't exist?
})
.catch((error) => {
commit('catchError', error);
@@ -799,6 +799,8 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
const url = `/api/1.0/person/accompanying-course/${id}.json`;
let body = { type: "accompanying_period", job: null };
console.log('update job', payload);
if (payload !== null) {
body = { type: "accompanying_period", job: { id: payload.id, type: payload.type } };
}

View File

@@ -24,6 +24,15 @@
<input v-model="endDate" type="date" class="form-control" />
</div>
<div id="privateComment" class="action-row">
<label class="col-form-label">{{ $t('private_comment') }}</label>
<ckeditor
v-model="privateComment"
:editor="editor"
tag-name="textarea"
></ckeditor>
</div>
<div id="comment" class="action-row">
<label class="col-form-label">{{ $t('comments') }}</label>
<ckeditor
@@ -33,6 +42,7 @@
></ckeditor>
</div>
<div id="objectives" class="action-row">
<div aria="hidden" class="title">
<div><h3>{{ $t('goals_title') }}</h3></div>
@@ -141,12 +151,12 @@
<ul class="list-unstyled">
<li v-for="p in personsReachables" :key="p.id">
<div class="form-check">
<input v-model="personsPicked" :value="p.id" type="checkbox" class="me-2 form-check-input" :id="'person_check'+p.id">
<label :for="'person_check'+p.id" class="form-check-label">
<person-text :person="p"></person-text>
</label>
</div>
<div class="form-check">
<input v-model="personsPicked" :value="p.id" type="checkbox" class="me-2 form-check-input" :id="'person_check'+p.id">
<label :for="'person_check'+p.id" class="form-check-label">
<person-text :person="p"></person-text>
</label>
</div>
</li>
</ul>
</div>
@@ -274,18 +284,18 @@
</div>
</div>
<ul class="record_actions sticky-form-buttons">
<li>
<list-workflow-modal
:workflows="this.work.workflows"
:allowCreate="true"
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
:relatedEntityId="this.work.id"
:workflowsAvailables="this.work.workflows_availables"
:preventDefaultMoveToGenerate="true"
@go-to-generate-workflow="goToGenerateWorkflow"
></list-workflow-modal>
</li>
<ul class="record_actions sticky-form-buttons">
<li>
<list-workflow-modal
:workflows="this.work.workflows"
:allowCreate="true"
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
:relatedEntityId="this.work.id"
:workflowsAvailables="this.work.workflows_availables"
:preventDefaultMoveToGenerate="true"
@go-to-generate-workflow="goToGenerateWorkflow"
></list-workflow-modal>
</li>
<li v-if="!isPosting">
<button class="btn btn-save" @click="submit">
@@ -355,7 +365,8 @@ const i18n = {
referrers: "Agents traitants",
no_referrers: "Aucun agent traitant",
choose_referrers: "Choisir des agents traitants",
remove_referrer: "Enlever l'agent"
remove_referrer: "Enlever l'agent",
private_comment: "Commentaire privé"
}
}
};
@@ -417,8 +428,8 @@ export default {
},
};
},
computed: {
...mapState([
computed: {
...mapState([
'work',
'resultsForAction',
'evaluationsForAction',
@@ -461,6 +472,14 @@ export default {
this.$store.commit('setNote', v);
}
},
privateComment: {
get() {
return this.$store.state.privateComment;
},
set(v) {
this.$store.commit('setPrivateComment', v);
}
},
availableForCheckGoal() {
let pickedIds = this.$store.state.goalsPicked.map(g => g.goal.id);
@@ -573,6 +592,7 @@ div#workEditor {
"title title"
"startDate endDate"
"comment comment"
"privateComment privateComment"
"objectives objectives"
"evaluations evaluations"
"persons persons"
@@ -589,6 +609,8 @@ div#workEditor {
grid-area: endDate; }
#comment {
grid-area: comment; }
#privateComment {
grid-area: privateComment; }
#objectives {
grid-area: objectives; }
#evaluations {

View File

@@ -17,6 +17,7 @@ const store = createStore({
endDate: window.accompanyingCourseWork.endDate !== null ?
dateToISO(new Date(window.accompanyingCourseWork.endDate.datetime)) : null,
note: window.accompanyingCourseWork.note,
privateComment: window.accompanyingCourseWork.privateComment,
goalsPicked: window.accompanyingCourseWork.goals,
goalsForAction: [],
resultsPicked: window.accompanyingCourseWork.results,
@@ -79,6 +80,7 @@ const store = createStore({
datetime: datetimeToISO(ISOToDate(state.endDate))
},
note: state.note,
privateComment: state.privateComment,
persons: state.personsPicked.map(p => ({id: p.id, type: p.type})),
handlingThierParty: state.handlingThirdParty === null ? null : {
id: state.handlingThirdParty.id,
@@ -297,6 +299,9 @@ const store = createStore({
setNote(state, note) {
state.note = note;
},
setPrivateComment(state, privateComment) {
state.privateComment = privateComment;
},
setHandlingThirdParty(state, thirdParty) {
state.handlingThirdParty = thirdParty;
},
@@ -454,6 +459,8 @@ const store = createStore({
;
commit('setIsPosting', true);
console.log('payload', payload);
return makeFetch('PUT', url, payload)
.then(data => {
if (typeof(callback) !== 'undefined') {

View File

@@ -305,7 +305,8 @@ export default {
if (this.listenPersonFlag === 'normal') {
if (person.folded === true) {
//console.log(' @@> expand mode event')
this.$store.commit('unfoldPerson', person)
this.$store.commit('unfoldPerson', person);
this.$store.dispatch('fetchInfoForPerson', person);
}
} else {
//console.log(' @@> create link mode event')

View File

@@ -252,7 +252,6 @@ const store = createStore({
if (!person.folded) {
return;
}
//console.log('unfoldPerson', person)
person.label = person._label
delete person._label
delete person.title

View File

@@ -5,7 +5,6 @@
{% block table_entities_thead_tr %}
<th>{{ 'Id'|trans }}</th>
<th>{{ 'Title'|trans }}</th>
<th>{{ 'Social actions'|trans }}</th>
<th>{{ 'goal.results'|trans }}</th>
<th>{{ 'goal.desactivationDate'|trans }}</th>
<th>&nbsp;</th>
@@ -17,11 +16,6 @@
<td>{{ entity.id }}</td>
<td>{{ entity.title|localize_translatable_string }}</td>
<td>
{% for sa in entity.socialActions %}
{{ sa.title|localize_translatable_string }}{% if not loop.last %},{% else %}.{% endif %}
{% endfor %}
</td>
<td>
{% for sa in entity.results %}
{{ sa.title|localize_translatable_string }}{% if not loop.last %},{% else %}.{% endif %}
{% endfor %}

View File

@@ -8,9 +8,20 @@
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block crud_content_form_rows %}
<div class="mb-3 row">
<label class="col-form-label col-sm-4 required" for="social_action_ordering">{{ 'Parent'|trans }}</label>
<div class="col-sm-8">{{ entity.parent|chill_entity_render_box }}</div>
</div>
<div class="mb-3 row">
<label class="col-form-label col-sm-4 required" for="social_action_ordering">{{ 'Social issue'|trans }}</label>
<div class="col-sm-8">{{ entity.issue|chill_entity_render_box }}</div>
</div>
{% for f in form %}
{% if f.vars.name == 'parent' or f.vars.name == 'issue' %}
{{ form_row(f, { 'attr':{'disabled':'disabled'}}) }}
{{ form_widget(f, { 'attr':{'hidden':'hidden'}}) }}
{% else %}
{{ form_row(f) }}
{% endif %}