mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
Merge branch '327_pinned_comment' into issue321_layout_improvements_actionForm
This commit is contained in:
@@ -20,10 +20,10 @@
|
||||
tag-name="textarea">
|
||||
</ckeditor>
|
||||
|
||||
<div v-if="initialComment" class="metadata">
|
||||
<div v-if="pinnedComment" class="metadata">
|
||||
{{ $t('comment.created_by', [
|
||||
initialComment.creator.text,
|
||||
$d(initialComment.createdAt.datetime, 'long')
|
||||
pinnedComment.creator.text,
|
||||
$d(pinnedComment.createdAt.datetime, 'long')
|
||||
]) }}
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<li>
|
||||
<button type="submit" class="btn btn-save">{{ $t('action.save') }}</button>
|
||||
</li>
|
||||
<li v-if="initialComment !== null">
|
||||
<li v-if="pinnedComment !== null">
|
||||
<a class="btn btn-delete"
|
||||
@click="removeComment">
|
||||
{{ $t('action.delete') }}
|
||||
@@ -66,15 +66,15 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
initialComment() {
|
||||
return this.$store.state.accompanyingCourse.initialComment;
|
||||
pinnedComment() {
|
||||
return this.$store.state.accompanyingCourse.pinnedComment;
|
||||
},
|
||||
content: {
|
||||
set(value) {
|
||||
this.formdata.content = value;
|
||||
},
|
||||
get() {
|
||||
return (this.initialComment)? this.initialComment.content : {};
|
||||
return (this.pinnedComment)? this.pinnedComment.content : {};
|
||||
}
|
||||
},
|
||||
errors() {
|
||||
@@ -107,7 +107,7 @@ export default {
|
||||
/*
|
||||
* TODO
|
||||
* - [x] delete button in ul record_actions, but not in form
|
||||
* - [ ] display updatedAt => initialComment fetch PATCH content changes MUST NOT change object id !!
|
||||
* - [ ] display updatedAt => pinnedComment fetch PATCH content changes MUST NOT change object id !!
|
||||
*/
|
||||
</script>
|
||||
|
||||
|
@@ -132,10 +132,6 @@ const appMessages = {
|
||||
sure_description: "Une fois le changement confirmé, il ne sera plus possible de le remettre à l'état de brouillon !",
|
||||
ok: "Confirmer le parcours"
|
||||
},
|
||||
action: {
|
||||
choose_other_social_issue: "Veuillez choisir un autre problématique",
|
||||
cancel: "Annuler",
|
||||
},
|
||||
// catch errors
|
||||
'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.",
|
||||
'Error while retriving AccompanyingPeriod Course.': "Erreur du serveur lors du chargement du parcours d'accompagnement.",
|
||||
|
@@ -163,7 +163,7 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
||||
},
|
||||
postFirstComment(state, comment) {
|
||||
//console.log('### mutation: postFirstComment', comment);
|
||||
state.accompanyingCourse.initialComment = comment;
|
||||
state.accompanyingCourse.pinnedComment = comment;
|
||||
},
|
||||
updateSocialIssues(state, value) {
|
||||
console.log('updateSocialIssues', value);
|
||||
@@ -565,11 +565,11 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
||||
},
|
||||
postFirstComment({ commit }, payload) {
|
||||
const url = `/api/1.0/person/accompanying-course/${id}.json`
|
||||
const body = { type: "accompanying_period", initialComment: payload }
|
||||
const body = { type: "accompanying_period", pinnedComment: payload }
|
||||
|
||||
return makeFetch('PATCH', url, body)
|
||||
.then((response) => {
|
||||
commit('postFirstComment', response.initialComment);
|
||||
commit('postFirstComment', response.pinnedComment);
|
||||
})
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
|
@@ -8,10 +8,10 @@
|
||||
<div id="picking">
|
||||
<p>{{ $t('pick_social_issue_linked_with_action') }}</p>
|
||||
<div v-for="si in socialIssues">
|
||||
<input type="radio" checked v-bind:value="si.id" name="socialIssue" v-model="socialIssuePicked"><span class="badge bg-chill-l-gray text-dark">{{ si.text }}</span>
|
||||
<input type="radio" v-bind:value="si.id" name="socialIssue" v-model="socialIssuePicked"><span class="badge bg-chill-l-gray text-dark">{{ si.text }}</span>
|
||||
</div>
|
||||
<div class="my-3">
|
||||
<div class="col-8">
|
||||
<div class="col-11">
|
||||
<vue-multiselect
|
||||
name="otherIssues"
|
||||
label="text"
|
||||
@@ -27,7 +27,7 @@
|
||||
:allow-empty="true"
|
||||
:show-labels="false"
|
||||
:loading="issueIsLoading"
|
||||
:placeholder="$t('action.choose_other_social_issue')"
|
||||
:placeholder="$t('choose_other_social_issue')"
|
||||
:options="socialIssuesOther"
|
||||
@select="addIssueInList">
|
||||
</vue-multiselect>
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div v-if="hasSocialIssuePicked">
|
||||
<h2>{{ $t('pick_an_action') }}</h2>
|
||||
<div class="col-8">
|
||||
<div class="col-11">
|
||||
<vue-multiselect
|
||||
v-model="socialActionPicked"
|
||||
label="text"
|
||||
@@ -77,7 +77,7 @@
|
||||
<p>{{ $t('form_has_errors') }}</p>
|
||||
|
||||
<ul>
|
||||
<li v-for="e in errors">
|
||||
<li v-for="e in errors" :key="e.id">
|
||||
{{ e }}
|
||||
</li>
|
||||
</ul>
|
||||
@@ -120,10 +120,11 @@ const i18n = {
|
||||
endDate: "Date de fin",
|
||||
form_has_errors: "Le formulaire comporte des erreurs",
|
||||
pick_social_issue: "Choisir une problématique sociale",
|
||||
pick_other_social_issue: "Veuillez choisir un autre problématique",
|
||||
pick_an_action: "Choisir une action d'accompagnement",
|
||||
pick_social_issue_linked_with_action: "Indiquez la problématique sociale liée à l'action d'accompagnement",
|
||||
persons_involved: "Usagers concernés",
|
||||
|
||||
choose_other_social_issue: "Veuillez choisir un autre problématique",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,12 +179,10 @@ export default {
|
||||
personsPicked: {
|
||||
get() {
|
||||
let s = this.$store.state.personsPicked.map(p => p.id);
|
||||
// console.log('persons picked', s);
|
||||
|
||||
return s;
|
||||
},
|
||||
set(v) {
|
||||
// console.log('persons picked', v);
|
||||
this.$store.commit('setPersonsPickedIds', v);
|
||||
}
|
||||
},
|
||||
@@ -226,6 +225,11 @@ export default {
|
||||
this.$store.commit('setEndDate', ISOToDate(value));
|
||||
}
|
||||
},
|
||||
setSocialIssue: {
|
||||
set() {
|
||||
this.$store.dispatch('setSocialIssue', socialIssues[socialIssues.length - 1])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,4 +284,4 @@ span.badge {
|
||||
grid-area: confirm;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@@ -31,7 +31,6 @@ const store = createStore({
|
||||
return null !== state.socialActionPicked;
|
||||
},
|
||||
hasSocialIssuePicked(state) {
|
||||
console.log(state.socialIssuePicked);
|
||||
return null !== state.socialIssuePicked;
|
||||
},
|
||||
isLoadingSocialActions(state) {
|
||||
@@ -74,36 +73,27 @@ const store = createStore({
|
||||
},
|
||||
mutations: {
|
||||
setSocialActionsReachables(state, actions) {
|
||||
// console.log('set social action reachables');
|
||||
// console.log(actions);
|
||||
|
||||
state.socialActionsReachables = actions;
|
||||
},
|
||||
setSocialAction(state, socialAction) {
|
||||
// console.log('socialAction', socialAction);
|
||||
state.socialActionPicked = socialAction;
|
||||
},
|
||||
setSocialIssue(state, socialIssueId) {
|
||||
// console.log('set social issue', socialIssueId);
|
||||
if (socialIssueId === null) {
|
||||
state.socialIssuePicked = null;
|
||||
} else {
|
||||
let mapped = state.socialIssues
|
||||
.find(e => e.id === socialIssueId);
|
||||
state.socialIssuePicked = mapped;
|
||||
// console.log('social issue setted', state.socialIssuePicked);
|
||||
}
|
||||
},
|
||||
addIssueInList(state, issue) {
|
||||
//console.log('add issue list', issue.id);
|
||||
state.socialIssues.push(issue);
|
||||
},
|
||||
updateIssuesOther(state, payload) {
|
||||
//console.log('update issues other');
|
||||
state.socialIssuesOther = payload;
|
||||
},
|
||||
removeIssueInOther(state, issue) {
|
||||
//console.log('remove issue other', issue.id);
|
||||
state.socialIssuesOther = state.socialIssuesOther.filter(
|
||||
(i) => i.id !== issue.id
|
||||
);
|
||||
@@ -124,12 +114,12 @@ const store = createStore({
|
||||
state.endDate = date;
|
||||
},
|
||||
setPersonsPickedIds(state, ids) {
|
||||
console.log('persons ids', ids);
|
||||
|
||||
state.personsPicked = state.personsReachables
|
||||
.filter(p => ids.includes(p.id))
|
||||
},
|
||||
addErrors(state, { errors, cancel_posting }) {
|
||||
console.log('add errors', errors);
|
||||
|
||||
state.errors = errors;
|
||||
if (cancel_posting) {
|
||||
state.isPostingWork = false;
|
||||
@@ -138,8 +128,6 @@ const store = createStore({
|
||||
},
|
||||
actions: {
|
||||
pickSocialIssue({ commit }, socialIssueId) {
|
||||
console.log('pick social issue');
|
||||
|
||||
commit('setIsLoadingSocialActions', true);
|
||||
commit('setSocialAction', null);
|
||||
commit('setSocialActionsReachables', []);
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
<ul class="record_actions">
|
||||
<li v-if="!hasHouseholdAddress && !isHouseholdForceAddress">
|
||||
<button class="btn" @click="markNoAddress">
|
||||
<button class="btn btn-misc" @click="markNoAddress">
|
||||
{{ $t('household_members_editor.household_address.mark_no_address') }}
|
||||
</button>
|
||||
</li>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
|
||||
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
|
||||
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n';
|
||||
import { ontheflyMessages } from 'ChillMainAssets/vuejs/OnTheFly/i18n';
|
||||
import { addressMessages } from 'ChillMainAssets/vuejs/Address/i18n';
|
||||
|
||||
const appMessages = {
|
||||
fr: {
|
||||
@@ -84,7 +85,7 @@ const appMessages = {
|
||||
}
|
||||
};
|
||||
|
||||
Object.assign(appMessages.fr, personMessages.fr);
|
||||
Object.assign(appMessages.fr, personMessages.fr, addressMessages.fr, ontheflyMessages.fr);
|
||||
|
||||
export {
|
||||
appMessages
|
||||
|
@@ -9,6 +9,7 @@ const visMessages = {
|
||||
both: 'neutre, non binaire',
|
||||
woman: 'féminin',
|
||||
man: 'masculin',
|
||||
undefined: "genre non précisé",
|
||||
years: 'ans',
|
||||
click_to_expand: 'cliquez pour étendre',
|
||||
add_relationship_link: "Créer un lien de filiation",
|
||||
|
@@ -153,7 +153,7 @@ const getGender = (gender) => {
|
||||
case 'man':
|
||||
return visMessages.fr.visgraph.man
|
||||
default:
|
||||
throw 'gender undefined'
|
||||
return visMessages.fr.visgraph.undefined
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,6 @@ const personMessages = {
|
||||
neuter: "Neutre, non binaire",
|
||||
undefined: "Non renseigné"
|
||||
}
|
||||
|
||||
},
|
||||
error_only_one_person: "Une seule personne peut être sélectionnée !"
|
||||
}
|
||||
|
Reference in New Issue
Block a user