mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Merge remote-tracking branch 'origin/master' into issue296_internal_close_accourse
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<i>{{ $t('course.open_at') }}{{ $d(accompanyingCourse.openingDate.datetime, 'text') }}</i>
|
||||
</span>
|
||||
<span v-if="accompanyingCourse.user" class="d-md-block ms-3 ms-md-0">
|
||||
<abbr :title="$t('course.referrer')">{{ $t('course.referrer') }}:</abbr> <b>{{ accompanyingCourse.user.username }}</b>
|
||||
<span class="item-key">{{ $t('course.referrer') }}:</span> <b>{{ accompanyingCourse.user.username }}</b>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
@@ -34,13 +34,15 @@
|
||||
</teleport>
|
||||
|
||||
<teleport to="#header-accompanying_course-details #banner-social-issues">
|
||||
<div class="col-12">
|
||||
<social-issue
|
||||
v-for="issue in accompanyingCourse.socialIssues"
|
||||
v-bind:key="issue.id"
|
||||
v-bind:issue="issue">
|
||||
</social-issue>
|
||||
</div>
|
||||
<social-issue
|
||||
v-for="issue in accompanyingCourse.socialIssues"
|
||||
v-bind:key="issue.id"
|
||||
v-bind:issue="issue">
|
||||
</social-issue>
|
||||
</teleport>
|
||||
|
||||
<teleport to="#header-accompanying_course-details #banner-persons-associated">
|
||||
<persons-associated :accompanyingCourse="accompanyingCourse"></persons-associated>
|
||||
</teleport>
|
||||
|
||||
</template>
|
||||
@@ -48,12 +50,14 @@
|
||||
<script>
|
||||
import ToggleFlags from './Banner/ToggleFlags';
|
||||
import SocialIssue from './Banner/SocialIssue.vue';
|
||||
import PersonsAssociated from './Banner/PersonsAssociated.vue';
|
||||
|
||||
export default {
|
||||
name: 'Banner',
|
||||
components: {
|
||||
ToggleFlags,
|
||||
SocialIssue
|
||||
SocialIssue,
|
||||
PersonsAssociated
|
||||
},
|
||||
computed: {
|
||||
accompanyingCourse() {
|
||||
|
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<span v-for="h in personsByHousehold()" :class="{ 'household': householdExists(h.id), 'no-household': !householdExists(h.id) }">
|
||||
<a v-if="householdExists(h.id)" :href="householdLink(h.id)">
|
||||
<i class="fa fa-home fa-fw text-light" :title="$t('persons_associated.show_household_number', { id: h.id })"></i>
|
||||
</a>
|
||||
<span v-for="person in h.persons" class="me-1">
|
||||
<on-the-fly :type="person.type" :id="person.id" :buttonText="person.text" :displayBadge="'true' === 'true'" action="show"></on-the-fly>
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly'
|
||||
|
||||
export default {
|
||||
name: "PersonsAssociated",
|
||||
components: {
|
||||
OnTheFly
|
||||
},
|
||||
props: [ 'accompanyingCourse' ],
|
||||
computed: {
|
||||
participations() {
|
||||
return this.accompanyingCourse.participations.filter(p => p.endDate === null)
|
||||
},
|
||||
persons() {
|
||||
return this.participations.map(p => p.person)
|
||||
},
|
||||
resources() {
|
||||
return this.accompanyingCourse.resources
|
||||
},
|
||||
requestor() {
|
||||
return this.accompanyingCourse.requestor
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
uniq(array) {
|
||||
return [...new Set(array)]
|
||||
},
|
||||
personsByHousehold() {
|
||||
|
||||
let households = []
|
||||
this.persons.forEach(p => { households.push(p.current_household_id) })
|
||||
|
||||
let personsByHousehold = []
|
||||
this.uniq(households).forEach(h => {
|
||||
personsByHousehold.push({
|
||||
id: h !== null ? h : 0,
|
||||
persons: this.persons.filter(p => p.current_household_id === h)
|
||||
})
|
||||
})
|
||||
console.log(personsByHousehold)
|
||||
|
||||
|
||||
return personsByHousehold
|
||||
},
|
||||
householdExists(id) {
|
||||
return id !== 0
|
||||
},
|
||||
householdLink(id) {
|
||||
return `/fr/person/household/${id}/summary`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
span.household {
|
||||
display: inline-block;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.3);
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 10px;
|
||||
margin-right: 0.3em;
|
||||
padding: 5px;
|
||||
}
|
||||
</style>
|
@@ -10,7 +10,7 @@
|
||||
<div class="alert alert-warning">
|
||||
{{ $t('confirm.alert_validation') }}
|
||||
<ul class="mt-2">
|
||||
<li v-for="k in validationKeys">
|
||||
<li v-for="k in validationKeys" :key=k>
|
||||
{{ $t(notValidMessages[k].msg) }}
|
||||
<a :href="notValidMessages[k].anchor">
|
||||
<i class="fa fa-level-up fa-fw"></i>
|
||||
@@ -83,7 +83,11 @@ export default {
|
||||
},
|
||||
location: {
|
||||
msg: 'confirm.location_not_valid',
|
||||
anchor: '#section-20' //
|
||||
anchor: '#section-20'
|
||||
},
|
||||
origin: {
|
||||
msg: 'confirm.origin_not_valid',
|
||||
anchor: '#section-30'
|
||||
},
|
||||
socialIssue: {
|
||||
msg: 'confirm.socialIssue_not_valid',
|
||||
@@ -103,6 +107,7 @@ export default {
|
||||
...mapGetters([
|
||||
'isParticipationValid',
|
||||
'isSocialIssueValid',
|
||||
'isOriginValid',
|
||||
'isLocationValid',
|
||||
'validationKeys',
|
||||
'isValidToBeConfirmed'
|
||||
|
@@ -19,15 +19,18 @@
|
||||
:options="options"
|
||||
@select="updateOrigin">
|
||||
</VueMultiselect>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="!isOriginValid" class="alert alert-warning to-confirm">
|
||||
{{ $t('origin.not_valid') }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueMultiselect from 'vue-multiselect';
|
||||
import { getListOrigins } from '../api';
|
||||
import { mapState } from 'vuex';
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'OriginDemand',
|
||||
@@ -41,6 +44,9 @@ export default {
|
||||
...mapState({
|
||||
value: state => state.accompanyingCourse.origin,
|
||||
}),
|
||||
...mapGetters([
|
||||
'isOriginValid'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
|
@@ -5,7 +5,7 @@
|
||||
addId : false,
|
||||
addEntity: false,
|
||||
addLink: false,
|
||||
addHouseholdLink: true,
|
||||
addHouseholdLink: false,
|
||||
addAltNames: true,
|
||||
addAge : true,
|
||||
hLevel : 3,
|
||||
@@ -20,14 +20,15 @@
|
||||
v-if="hasCurrentHouseholdAddress"
|
||||
v-bind:person="participation.person">
|
||||
</button-location>
|
||||
<li v-if="participation.person.current_household_id">
|
||||
<a class="btn btn-sm btn-chill-beige"
|
||||
:href="getCurrentHouseholdUrl"
|
||||
:title="$t('persons_associated.show_household_number', { id: participation.person.current_household_id })">
|
||||
<i class="fa fa-fw fa-home"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li><on-the-fly :type="participation.person.type" :id="participation.person.id" action="show"></on-the-fly></li>
|
||||
<li><on-the-fly :type="participation.person.type" :id="participation.person.id" action="edit" @saveFormOnTheFly="saveFormOnTheFly"></on-the-fly></li>
|
||||
<!-- <li>
|
||||
<button class="btn btn-delete"
|
||||
:title="$t('action.delete')"
|
||||
@click.prevent="$emit('remove', participation)">
|
||||
</button>
|
||||
</li> -->
|
||||
<li>
|
||||
<button v-if="!participation.endDate"
|
||||
class="btn btn-sm btn-remove"
|
||||
@@ -100,6 +101,9 @@ export default {
|
||||
},
|
||||
getAccompanyingCourseReturnPath() {
|
||||
return `fr/parcours/${this.$store.state.accompanyingCourse.id}/edit#section-10`;
|
||||
},
|
||||
getCurrentHouseholdUrl() {
|
||||
return `/fr/person/household/${this.participation.person.current_household_id}/summary?returnPath=${this.getAccompanyingCourseReturnPath}`
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@@ -19,16 +19,16 @@
|
||||
@select="updateReferrer">
|
||||
</VueMultiselect>
|
||||
|
||||
|
||||
<template v-if="referrersSuggested.length > 0">
|
||||
<ul>
|
||||
<li v-for="u in referrersSuggested" @click="updateReferrer(u)">
|
||||
<user-render-box-badge :user="u"></user-render-box-badge>
|
||||
</li>
|
||||
<ul class="list-unstyled">
|
||||
<li v-for="u in referrersSuggested" @click="updateReferrer(u)">
|
||||
<span class="badge bg-primary" style="cursor: pointer">
|
||||
<i class="fa fa-plus fa-fw text-success"></i>
|
||||
<user-render-box-badge :user="u"></user-render-box-badge>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
@@ -35,6 +35,7 @@ const appMessages = {
|
||||
title: "Origine de la demande",
|
||||
label: "Origine de la demande",
|
||||
placeholder: "Renseignez l'origine de la demande",
|
||||
not_valid: "Indiquez une origine de la demande",
|
||||
},
|
||||
persons_associated: {
|
||||
title: "Usagers concernés",
|
||||
@@ -53,7 +54,7 @@ const appMessages = {
|
||||
show_household_number: "Voir le ménage (n° {id})",
|
||||
show_household: "Voir le ménage",
|
||||
person_without_household_warning: "Certaines usagers n'appartiennent actuellement à aucun ménage. Renseignez leur appartenance dès que possible.",
|
||||
update_household: "Modifier l'appartenance",
|
||||
update_household: "Renseigner l'appartenance",
|
||||
participation_not_valid: "Sélectionnez ou créez au minimum 1 usager",
|
||||
},
|
||||
requestor: {
|
||||
@@ -125,6 +126,7 @@ const appMessages = {
|
||||
participation_not_valid: "sélectionnez au minimum 1 usager",
|
||||
socialIssue_not_valid: "sélectionnez au minimum une problématique sociale",
|
||||
location_not_valid: "indiquez au minimum une localisation temporaire du parcours",
|
||||
origin_not_valid: "indiquez une origine de la demande",
|
||||
set_a_scope: "indiquez au moins un service",
|
||||
sure: "Êtes-vous sûr ?",
|
||||
sure_description: "Une fois le changement confirmé, il ne sera plus possible de le remettre à l'état de brouillon !",
|
||||
|
@@ -52,6 +52,9 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
||||
isSocialIssueValid(state) {
|
||||
return state.accompanyingCourse.socialIssues.length > 0;
|
||||
},
|
||||
isOriginValid(state) {
|
||||
return state.accompanyingCourse.origin !== null;
|
||||
},
|
||||
isLocationValid(state) {
|
||||
return state.accompanyingCourse.location !== null;
|
||||
},
|
||||
@@ -64,6 +67,7 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
||||
if (!getters.isParticipationValid) { keys.push('participation'); }
|
||||
if (!getters.isLocationValid) { keys.push('location'); }
|
||||
if (!getters.isSocialIssueValid) { keys.push('socialIssue'); }
|
||||
if (!getters.isOriginValid) { keys.push('origin'); }
|
||||
if (!getters.isScopeValid) { keys.push('scopes'); }
|
||||
//console.log('getter keys', keys);
|
||||
return keys;
|
||||
|
Reference in New Issue
Block a user