mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-29 10:05:03 +00:00
Apply prettier rules
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
<sticky-nav />
|
||||
|
||||
<h1 v-if="accompanyingCourse.step === 'DRAFT'">
|
||||
{{ $t('course.title.draft') }}
|
||||
{{ $t("course.title.draft") }}
|
||||
</h1>
|
||||
<h1 v-else>
|
||||
{{ $t('course.title.active') }}
|
||||
{{ $t("course.title.active") }}
|
||||
</h1>
|
||||
|
||||
<persons-associated />
|
||||
@@ -30,110 +30,107 @@
|
||||
</div> -->
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import Banner from './components/Banner.vue';
|
||||
import StickyNav from './components/StickyNav.vue';
|
||||
import OriginDemand from './components/OriginDemand.vue';
|
||||
import AdminLocation from './components/AdminLocation.vue';
|
||||
import PersonsAssociated from './components/PersonsAssociated.vue';
|
||||
import Requestor from './components/Requestor.vue';
|
||||
import SocialIssue from './components/SocialIssue.vue';
|
||||
import CourseLocation from './components/CourseLocation.vue';
|
||||
import Scopes from './components/Scopes.vue';
|
||||
import Referrer from './components/Referrer.vue';
|
||||
import Resources from './components/Resources.vue';
|
||||
import Comment from './components/Comment.vue';
|
||||
import Confirm from './components/Confirm.vue';
|
||||
import StartDate from './components/StartDate.vue';
|
||||
import { mapState } from "vuex";
|
||||
import Banner from "./components/Banner.vue";
|
||||
import StickyNav from "./components/StickyNav.vue";
|
||||
import OriginDemand from "./components/OriginDemand.vue";
|
||||
import AdminLocation from "./components/AdminLocation.vue";
|
||||
import PersonsAssociated from "./components/PersonsAssociated.vue";
|
||||
import Requestor from "./components/Requestor.vue";
|
||||
import SocialIssue from "./components/SocialIssue.vue";
|
||||
import CourseLocation from "./components/CourseLocation.vue";
|
||||
import Scopes from "./components/Scopes.vue";
|
||||
import Referrer from "./components/Referrer.vue";
|
||||
import Resources from "./components/Resources.vue";
|
||||
import Comment from "./components/Comment.vue";
|
||||
import Confirm from "./components/Confirm.vue";
|
||||
import StartDate from "./components/StartDate.vue";
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
Banner,
|
||||
StickyNav,
|
||||
OriginDemand,
|
||||
AdminLocation,
|
||||
PersonsAssociated,
|
||||
Requestor,
|
||||
SocialIssue,
|
||||
CourseLocation,
|
||||
Scopes,
|
||||
Referrer,
|
||||
Resources,
|
||||
Comment,
|
||||
Confirm,
|
||||
StartDate
|
||||
},
|
||||
computed: {
|
||||
...mapState([
|
||||
'accompanyingCourse',
|
||||
'addressContext'
|
||||
]),
|
||||
}
|
||||
name: "App",
|
||||
components: {
|
||||
Banner,
|
||||
StickyNav,
|
||||
OriginDemand,
|
||||
AdminLocation,
|
||||
PersonsAssociated,
|
||||
Requestor,
|
||||
SocialIssue,
|
||||
CourseLocation,
|
||||
Scopes,
|
||||
Referrer,
|
||||
Resources,
|
||||
Comment,
|
||||
Confirm,
|
||||
StartDate,
|
||||
},
|
||||
computed: {
|
||||
...mapState(["accompanyingCourse", "addressContext"]),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import 'ChillMainAssets/module/bootstrap/shared';
|
||||
$chill-accourse-context: #718596;
|
||||
@import "ChillMainAssets/module/bootstrap/shared";
|
||||
$chill-accourse-context: #718596;
|
||||
|
||||
div#accompanying-course {
|
||||
div.vue-component {
|
||||
h2 {
|
||||
margin: 1em 0.7em;
|
||||
position: relative;
|
||||
&:before {
|
||||
position: absolute;
|
||||
content: "\f142"; //ellipsis-v
|
||||
font-family: "ForkAwesome";
|
||||
color: tint-color($chill-accourse-context, 10%);
|
||||
left: -22px;
|
||||
top: 4px;
|
||||
}
|
||||
a[id^="section"] {
|
||||
position: absolute;
|
||||
top: -2.5em; // reference for stickNav
|
||||
}
|
||||
}
|
||||
padding: 0em 0em;
|
||||
margin: 1em 0;
|
||||
border-radius: 5px;
|
||||
border: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
border-left: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
border-right: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
dd {
|
||||
margin-left: 1em;
|
||||
}
|
||||
& > div {
|
||||
margin: 1em 3em 0;
|
||||
|
||||
&.flex-table,
|
||||
&.flex-bloc {
|
||||
margin: 1em 0 0;
|
||||
}
|
||||
&.alert.to-confirm {
|
||||
margin: 1em 0 0;
|
||||
padding: 1em 3em;
|
||||
}
|
||||
}
|
||||
|
||||
div.flex-table {
|
||||
div.item-row {
|
||||
div.item-col:first-child {
|
||||
flex-basis: 33%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.errors {
|
||||
//display: flex;
|
||||
//position: sticky;
|
||||
//bottom: 0.3em;
|
||||
//z-index: 1000;
|
||||
margin: 1em 0;
|
||||
padding: 1em;
|
||||
border-radius: 0;
|
||||
}
|
||||
div#accompanying-course {
|
||||
div.vue-component {
|
||||
h2 {
|
||||
margin: 1em 0.7em;
|
||||
position: relative;
|
||||
&:before {
|
||||
position: absolute;
|
||||
content: "\f142"; //ellipsis-v
|
||||
font-family: "ForkAwesome";
|
||||
color: tint-color($chill-accourse-context, 10%);
|
||||
left: -22px;
|
||||
top: 4px;
|
||||
}
|
||||
}
|
||||
a[id^="section"] {
|
||||
position: absolute;
|
||||
top: -2.5em; // reference for stickNav
|
||||
}
|
||||
}
|
||||
padding: 0em 0em;
|
||||
margin: 1em 0;
|
||||
border-radius: 5px;
|
||||
border: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
border-left: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
border-right: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
dd {
|
||||
margin-left: 1em;
|
||||
}
|
||||
& > div {
|
||||
margin: 1em 3em 0;
|
||||
|
||||
&.flex-table,
|
||||
&.flex-bloc {
|
||||
margin: 1em 0 0;
|
||||
}
|
||||
&.alert.to-confirm {
|
||||
margin: 1em 0 0;
|
||||
padding: 1em 3em;
|
||||
}
|
||||
}
|
||||
|
||||
div.flex-table {
|
||||
div.item-row {
|
||||
div.item-col:first-child {
|
||||
flex-basis: 33%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.errors {
|
||||
//display: flex;
|
||||
//position: sticky;
|
||||
//bottom: 0.3em;
|
||||
//z-index: 1000;
|
||||
margin: 1em 0;
|
||||
padding: 1em;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,52 +1,73 @@
|
||||
import { fetchResults } from 'ChillMainAssets/lib/api/apiMethods.ts';
|
||||
import { fetchResults } from "ChillMainAssets/lib/api/apiMethods.ts";
|
||||
|
||||
/*
|
||||
* Endpoint v.2 chill_api_single_accompanying_course__entity
|
||||
* method GET/HEAD, get AccompanyingCourse Instance
|
||||
*
|
||||
* @id integer - id of accompanyingCourse
|
||||
*/
|
||||
* Endpoint v.2 chill_api_single_accompanying_course__entity
|
||||
* method GET/HEAD, get AccompanyingCourse Instance
|
||||
*
|
||||
* @id integer - id of accompanyingCourse
|
||||
*/
|
||||
const getAccompanyingCourse = (id) => {
|
||||
const url = `/api/1.0/person/accompanying-course/${id}.json`;
|
||||
return fetch(url)
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw { msg: 'Error while retriving AccompanyingPeriod Course.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
|
||||
});
|
||||
const url = `/api/1.0/person/accompanying-course/${id}.json`;
|
||||
return fetch(url).then((response) => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
}
|
||||
throw {
|
||||
msg: "Error while retriving AccompanyingPeriod Course.",
|
||||
sta: response.status,
|
||||
txt: response.statusText,
|
||||
err: new Error(),
|
||||
body: response.body,
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
const getUsers = () => fetchResults('/api/1.0/main/user.json');
|
||||
const getUsers = () => fetchResults("/api/1.0/main/user.json");
|
||||
|
||||
const getReferrersSuggested = (course) => {
|
||||
const url = `/api/1.0/person/accompanying-course/${course.id}/referrers-suggested.json`;
|
||||
return fetchResults(url);
|
||||
}
|
||||
const url = `/api/1.0/person/accompanying-course/${course.id}/referrers-suggested.json`;
|
||||
return fetchResults(url);
|
||||
};
|
||||
|
||||
const getUserJobs = () => fetchResults('/api/1.0/main/user-job.json');
|
||||
const getUserJobs = () => fetchResults("/api/1.0/main/user-job.json");
|
||||
|
||||
const getSocialIssues = () => {
|
||||
const url = `/api/1.0/person/social-work/social-issue.json`;
|
||||
return fetch(url)
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw { msg: 'Error while retriving Social Issues.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
|
||||
});
|
||||
const url = `/api/1.0/person/social-work/social-issue.json`;
|
||||
return fetch(url).then((response) => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
}
|
||||
throw {
|
||||
msg: "Error while retriving Social Issues.",
|
||||
sta: response.status,
|
||||
txt: response.statusText,
|
||||
err: new Error(),
|
||||
body: response.body,
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
const whoami = () => {
|
||||
const url = `/api/1.0/main/whoami.json`;
|
||||
return fetch(url)
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw { msg: 'Error while getting whoami.', sta: response.status, txt: response.statusText, err: new Error(), body: response.body };
|
||||
});
|
||||
const url = `/api/1.0/main/whoami.json`;
|
||||
return fetch(url).then((response) => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
}
|
||||
throw {
|
||||
msg: "Error while getting whoami.",
|
||||
sta: response.status,
|
||||
txt: response.statusText,
|
||||
err: new Error(),
|
||||
body: response.body,
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
export {
|
||||
whoami,
|
||||
getSocialIssues,
|
||||
getAccompanyingCourse,
|
||||
getUsers,
|
||||
getReferrersSuggested,
|
||||
getUserJobs
|
||||
whoami,
|
||||
getSocialIssues,
|
||||
getAccompanyingCourse,
|
||||
getUsers,
|
||||
getReferrersSuggested,
|
||||
getUserJobs,
|
||||
};
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-40" />{{ $t('admin_location.title') }}</h2>
|
||||
<h2><a id="section-40" />{{ $t("admin_location.title") }}</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="selectAdminLocation">
|
||||
{{ $t('admin_location.title') }}
|
||||
{{ $t("admin_location.title") }}
|
||||
</label>
|
||||
|
||||
<VueMultiselect
|
||||
@@ -26,78 +26,79 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!isAdminLocationValid"
|
||||
class="alert alert-warning to-confirm"
|
||||
>
|
||||
{{ $t('admin_location.not_valid') }}
|
||||
<div v-if="!isAdminLocationValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("admin_location.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueMultiselect from 'vue-multiselect';
|
||||
import { fetchResults } from 'ChillMainAssets/lib/api/apiMethods';
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import VueMultiselect from "vue-multiselect";
|
||||
import { fetchResults } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
name: 'AdminLocation',
|
||||
components: { VueMultiselect },
|
||||
data() {
|
||||
return {
|
||||
options: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
value: state => state.accompanyingCourse.administrativeLocation,
|
||||
}),
|
||||
...mapGetters([
|
||||
'isAdminLocationValid'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
fetchResults(`/api/1.0/main/location.json`)
|
||||
.then(response => {
|
||||
let uniqueLocationTypeId = [...new Set(response.map(o => o.locationType.id))];
|
||||
let results = [];
|
||||
for (let id of uniqueLocationTypeId) {
|
||||
results.push({
|
||||
locationCategories: response.filter(o => o.locationType.id === id)[0].locationType.title.fr,
|
||||
locations: response.filter(o => o.locationType.id === id)
|
||||
})
|
||||
}
|
||||
this.options = results;
|
||||
})
|
||||
},
|
||||
updateAdminLocation(value) {
|
||||
this.$store.dispatch('updateAdminLocation', value)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
},
|
||||
customLabel(value) {
|
||||
return value.locationType
|
||||
? value.name
|
||||
? `${value.name} (${value.locationType.title.fr})`
|
||||
: value.locationType.title.fr
|
||||
: '';
|
||||
},
|
||||
}
|
||||
}
|
||||
name: "AdminLocation",
|
||||
components: { VueMultiselect },
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
value: (state) => state.accompanyingCourse.administrativeLocation,
|
||||
}),
|
||||
...mapGetters(["isAdminLocationValid"]),
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
fetchResults(`/api/1.0/main/location.json`).then((response) => {
|
||||
let uniqueLocationTypeId = [
|
||||
...new Set(response.map((o) => o.locationType.id)),
|
||||
];
|
||||
let results = [];
|
||||
for (let id of uniqueLocationTypeId) {
|
||||
results.push({
|
||||
locationCategories: response.filter(
|
||||
(o) => o.locationType.id === id,
|
||||
)[0].locationType.title.fr,
|
||||
locations: response.filter((o) => o.locationType.id === id),
|
||||
});
|
||||
}
|
||||
this.options = results;
|
||||
});
|
||||
},
|
||||
updateAdminLocation(value) {
|
||||
this.$store
|
||||
.dispatch("updateAdminLocation", value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
customLabel(value) {
|
||||
return value.locationType
|
||||
? value.name
|
||||
? `${value.name} (${value.locationType.title.fr})`
|
||||
: value.locationType.title.fr
|
||||
: "";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
||||
<style lang="css" scoped>
|
||||
label {
|
||||
display: none;
|
||||
}
|
||||
label {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
@@ -9,11 +9,15 @@
|
||||
class="text-md-end d-md-block"
|
||||
>
|
||||
<span class="badge bg-secondary">
|
||||
{{ $t('course.step.draft') }}
|
||||
{{ $t("course.step.draft") }}
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
v-else-if="accompanyingCourse.step === 'CONFIRMED' || accompanyingCourse.step === 'CONFIRMED_INACTIVE_SHORT' || accompanyingCourse.step === 'CONFIRMED_INACTIVE_LONG'"
|
||||
v-else-if="
|
||||
accompanyingCourse.step === 'CONFIRMED' ||
|
||||
accompanyingCourse.step === 'CONFIRMED_INACTIVE_SHORT' ||
|
||||
accompanyingCourse.step === 'CONFIRMED_INACTIVE_LONG'
|
||||
"
|
||||
class="text-md-end"
|
||||
>
|
||||
<span
|
||||
@@ -21,7 +25,7 @@
|
||||
class="d-md-block mb-md-3"
|
||||
>
|
||||
<span class="badge bg-primary">
|
||||
{{ $t('course.step.active') }}
|
||||
{{ $t("course.step.active") }}
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
@@ -29,7 +33,7 @@
|
||||
class="d-md-block mb-md-3"
|
||||
>
|
||||
<span class="badge bg-chill-yellow text-primary">
|
||||
{{ $t('course.step.inactive_short') }}
|
||||
{{ $t("course.step.inactive_short") }}
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
@@ -37,45 +41,40 @@
|
||||
class="d-md-block mb-md-3"
|
||||
>
|
||||
<span class="badge bg-chill-pink">
|
||||
{{ $t('course.step.inactive_long') }}
|
||||
{{ $t("course.step.inactive_long") }}
|
||||
</span>
|
||||
</span>
|
||||
<span class="d-md-block">
|
||||
<span class="d-md-block ms-3 ms-md-0">
|
||||
<i>{{ $t('course.open_at') }}{{ $d(accompanyingCourse.openingDate.datetime, 'text') }}</i>
|
||||
<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"
|
||||
>
|
||||
<span class="item-key">{{ $t('course.referrer') }}:</span>
|
||||
<span v-if="accompanyingCourse.user" class="d-md-block ms-3 ms-md-0">
|
||||
<span class="item-key">{{ $t("course.referrer") }}:</span>
|
||||
<b>{{ accompanyingCourse.user.text }}</b>
|
||||
<template v-if="accompanyingCourse.user.isAbsent">
|
||||
|
||||
<span
|
||||
class="badge bg-danger rounded-pill"
|
||||
title="Absent"
|
||||
>A</span>
|
||||
|
||||
<span class="badge bg-danger rounded-pill" title="Absent">A</span>
|
||||
</template>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
v-else
|
||||
class="text-md-end d-md-block"
|
||||
>
|
||||
<span v-else class="text-md-end d-md-block">
|
||||
<span class="badge bg-danger">
|
||||
{{ $t('course.step.closed') }}
|
||||
{{ $t("course.step.closed") }}
|
||||
</span>
|
||||
<span class="d-md-block">
|
||||
<span class="d-md-block ms-3 ms-md-0">
|
||||
<i>{{ $d(accompanyingCourse.openingDate.datetime, 'text') }} - {{ $d(accompanyingCourse.closingDate.datetime, 'text') }}</i>
|
||||
<i
|
||||
>{{ $d(accompanyingCourse.openingDate.datetime, "text") }} -
|
||||
{{ $d(accompanyingCourse.closingDate.datetime, "text") }}</i
|
||||
>
|
||||
</span>
|
||||
<span
|
||||
v-if="accompanyingCourse.user"
|
||||
class="d-md-block ms-3 ms-md-0"
|
||||
>
|
||||
<span class="item-key">{{ $t('course.referrer') }}:</span> <b>{{ accompanyingCourse.user.text }}</b>
|
||||
<span v-if="accompanyingCourse.user" class="d-md-block ms-3 ms-md-0">
|
||||
<span class="item-key">{{ $t("course.referrer") }}:</span>
|
||||
<b>{{ accompanyingCourse.user.text }}</b>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
@@ -95,35 +94,35 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ToggleFlags from './Banner/ToggleFlags';
|
||||
import SocialIssue from './Banner/SocialIssue.vue';
|
||||
import PersonsAssociated from './Banner/PersonsAssociated.vue';
|
||||
import ToggleFlags from "./Banner/ToggleFlags";
|
||||
import SocialIssue from "./Banner/SocialIssue.vue";
|
||||
import PersonsAssociated from "./Banner/PersonsAssociated.vue";
|
||||
|
||||
export default {
|
||||
name: 'Banner',
|
||||
components: {
|
||||
ToggleFlags,
|
||||
SocialIssue,
|
||||
PersonsAssociated,
|
||||
},
|
||||
computed: {
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse
|
||||
}
|
||||
}
|
||||
}
|
||||
name: "Banner",
|
||||
components: {
|
||||
ToggleFlags,
|
||||
SocialIssue,
|
||||
PersonsAssociated,
|
||||
},
|
||||
computed: {
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
div#banner-flags,
|
||||
div#banner-status {
|
||||
.badge {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
div#banner-status {
|
||||
span.badge {
|
||||
font-size: 90%;
|
||||
}
|
||||
}
|
||||
div#banner-flags,
|
||||
div#banner-status {
|
||||
.badge {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
div#banner-status {
|
||||
span.badge {
|
||||
font-size: 90%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,23 +1,19 @@
|
||||
<template>
|
||||
<span
|
||||
v-for="h in personsByHousehold()"
|
||||
:class="{ 'household': householdExists(h.id), 'no-household': !householdExists(h.id) }"
|
||||
:class="{
|
||||
household: householdExists(h.id),
|
||||
'no-household': !householdExists(h.id),
|
||||
}"
|
||||
:key="h.id"
|
||||
>
|
||||
<a
|
||||
v-if="householdExists(h.id)"
|
||||
:href="householdLink(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 })"
|
||||
/>
|
||||
</a>
|
||||
<span
|
||||
v-for="person in h.persons"
|
||||
class="me-1"
|
||||
:key="person.id"
|
||||
>
|
||||
<span v-for="person in h.persons" class="me-1" :key="person.id">
|
||||
<on-the-fly
|
||||
:type="person.type"
|
||||
:id="person.id"
|
||||
@@ -30,64 +26,67 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly'
|
||||
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() {
|
||||
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 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`
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
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>
|
||||
|
@@ -4,19 +4,19 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "SocialIssues",
|
||||
props: ['issue']
|
||||
}
|
||||
name: "SocialIssues",
|
||||
props: ["issue"],
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import 'ChillMainAssets/module/bootstrap/shared';
|
||||
@import 'ChillPersonAssets/chill/scss/mixins';
|
||||
@import 'ChillMainAssets/chill/scss/chill_variables';
|
||||
@import "ChillMainAssets/module/bootstrap/shared";
|
||||
@import "ChillPersonAssets/chill/scss/mixins";
|
||||
@import "ChillMainAssets/chill/scss/chill_variables";
|
||||
span.badge {
|
||||
@include badge_social($social-issue-color);
|
||||
font-size: 95%;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 1em;
|
||||
@include badge_social($social-issue-color);
|
||||
font-size: 95%;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 1em;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<div class="text-md-end">
|
||||
<span class="d-block d-sm-inline-block mb-md-2">
|
||||
<a
|
||||
@click="toggleIntensity"
|
||||
class="flag-toggle"
|
||||
>
|
||||
<span :class="{ 'on': !isRegular }">{{ $t('course.occasional') }}</span>
|
||||
<a @click="toggleIntensity" class="flag-toggle">
|
||||
<span :class="{ on: !isRegular }">{{ $t("course.occasional") }}</span>
|
||||
<i
|
||||
class="fa"
|
||||
:class="{ 'fa-toggle-on': isRegular, 'fa-toggle-on fa-flip-horizontal': !isRegular }"
|
||||
:class="{
|
||||
'fa-toggle-on': isRegular,
|
||||
'fa-toggle-on fa-flip-horizontal': !isRegular,
|
||||
}"
|
||||
/>
|
||||
<span :class="{ 'on': isRegular }">{{ $t('course.regular') }}</span>
|
||||
<span :class="{ on: isRegular }">{{ $t("course.regular") }}</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
@@ -20,111 +20,123 @@
|
||||
:class="{ 'bg-danger': isEmergency, 'bg-secondary': !isEmergency }"
|
||||
@click="toggleEmergency"
|
||||
>
|
||||
{{ $t('course.emergency') }}
|
||||
{{ $t("course.emergency") }}
|
||||
</button>
|
||||
<button
|
||||
class="badge rounded-pill"
|
||||
:class="{ 'bg-danger': isConfidential, 'bg-secondary': !isConfidential }"
|
||||
:class="{
|
||||
'bg-danger': isConfidential,
|
||||
'bg-secondary': !isConfidential,
|
||||
}"
|
||||
@click="toggleConfidential"
|
||||
>
|
||||
{{ $t('course.confidential') }}
|
||||
{{ $t("course.confidential") }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "ToggleFlags",
|
||||
computed: {
|
||||
...mapState({
|
||||
intensity: state => state.accompanyingCourse.intensity,
|
||||
emergency: state => state.accompanyingCourse.emergency,
|
||||
confidential: state => state.accompanyingCourse.confidential,
|
||||
permissions: state => state.permissions,
|
||||
}),
|
||||
isRegular() {
|
||||
return (this.intensity === 'regular') ? true : false;
|
||||
},
|
||||
isEmergency() {
|
||||
return (this.emergency) ? true : false;
|
||||
},
|
||||
isConfidential() {
|
||||
return (this.confidential) ? true : false;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toggleIntensity() {
|
||||
let value;
|
||||
switch (this.intensity) {
|
||||
case "occasional":
|
||||
value = "regular";
|
||||
break;
|
||||
case "regular":
|
||||
value = "occasional";
|
||||
break;
|
||||
default:
|
||||
//temporaire (modif backend)
|
||||
value = "occasional";
|
||||
}
|
||||
this.$store.dispatch('toggleIntensity', value)
|
||||
.catch(({name}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
this.$toast.open({message: this.$t('Only the referrer can toggle the intensity of an accompanying course')})
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
},
|
||||
toggleEmergency() {
|
||||
this.$store.dispatch('toggleEmergency', (!this.isEmergency))
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
},
|
||||
toggleConfidential() {
|
||||
this.$store.dispatch('toggleConfidential')
|
||||
.catch(({name}) => {
|
||||
console.log(name);
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
this.$toast.open({message: this.$t('Only the referrer can toggle the confidentiality of an accompanying course')})
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
name: "ToggleFlags",
|
||||
computed: {
|
||||
...mapState({
|
||||
intensity: (state) => state.accompanyingCourse.intensity,
|
||||
emergency: (state) => state.accompanyingCourse.emergency,
|
||||
confidential: (state) => state.accompanyingCourse.confidential,
|
||||
permissions: (state) => state.permissions,
|
||||
}),
|
||||
isRegular() {
|
||||
return this.intensity === "regular" ? true : false;
|
||||
},
|
||||
isEmergency() {
|
||||
return this.emergency ? true : false;
|
||||
},
|
||||
isConfidential() {
|
||||
return this.confidential ? true : false;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toggleIntensity() {
|
||||
let value;
|
||||
switch (this.intensity) {
|
||||
case "occasional":
|
||||
value = "regular";
|
||||
break;
|
||||
case "regular":
|
||||
value = "occasional";
|
||||
break;
|
||||
default:
|
||||
//temporaire (modif backend)
|
||||
value = "occasional";
|
||||
}
|
||||
this.$store.dispatch("toggleIntensity", value).catch(({ name }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
this.$toast.open({
|
||||
message: this.$t(
|
||||
"Only the referrer can toggle the intensity of an accompanying course",
|
||||
),
|
||||
});
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
toggleEmergency() {
|
||||
this.$store
|
||||
.dispatch("toggleEmergency", !this.isEmergency)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
toggleConfidential() {
|
||||
this.$store.dispatch("toggleConfidential").catch(({ name }) => {
|
||||
console.log(name);
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
this.$toast.open({
|
||||
message: this.$t(
|
||||
"Only the referrer can toggle the confidentiality of an accompanying course",
|
||||
),
|
||||
});
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
a.flag-toggle {
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
border-radius: 20px;
|
||||
}
|
||||
i {
|
||||
margin: auto 0.4em;
|
||||
}
|
||||
span.on {
|
||||
font-weight: bolder;
|
||||
}
|
||||
}
|
||||
button.badge {
|
||||
&.bg-secondary {
|
||||
opacity: 0.5;
|
||||
&:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
a.flag-toggle {
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
border-radius: 20px;
|
||||
}
|
||||
i {
|
||||
margin: auto 0.4em;
|
||||
}
|
||||
span.on {
|
||||
font-weight: bolder;
|
||||
}
|
||||
}
|
||||
button.badge {
|
||||
&.bg-secondary {
|
||||
opacity: 0.5;
|
||||
&:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -17,19 +17,16 @@
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t('courselocation.sure') }}
|
||||
{{ $t("courselocation.sure") }}
|
||||
</h2>
|
||||
</template>
|
||||
<template #body>
|
||||
<address-render-box :address="person.current_household_address" />
|
||||
<p>{{ $t('courselocation.sure_description') }}</p>
|
||||
<p>{{ $t("courselocation.sure_description") }}</p>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button
|
||||
class="btn btn-danger"
|
||||
@click="assignAddress"
|
||||
>
|
||||
{{ $t('courselocation.ok') }}
|
||||
<button class="btn btn-danger" @click="assignAddress">
|
||||
{{ $t("courselocation.ok") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
@@ -37,51 +34,54 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||
import { mapState } from "vuex";
|
||||
import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
||||
import AddressRenderBox from "ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue";
|
||||
|
||||
export default {
|
||||
name: "ButtonLocation",
|
||||
components: {
|
||||
AddressRenderBox,
|
||||
Modal,
|
||||
},
|
||||
props: ['person'],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
context: state => state.addressContext
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
assignAddress() {
|
||||
//console.log('assignAddress id', this.person.current_household_address);
|
||||
let payload = {
|
||||
target: this.context.target.name,
|
||||
targetId: this.context.target.id,
|
||||
locationStatusTo: 'person',
|
||||
personId: this.person.id
|
||||
};
|
||||
this.$store.dispatch('updateLocation', payload)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
|
||||
window.location.assign('#section-20');
|
||||
this.modal.showModal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
name: "ButtonLocation",
|
||||
components: {
|
||||
AddressRenderBox,
|
||||
Modal,
|
||||
},
|
||||
props: ["person"],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md",
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
context: (state) => state.addressContext,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
assignAddress() {
|
||||
//console.log('assignAddress id', this.person.current_household_address);
|
||||
let payload = {
|
||||
target: this.context.target.name,
|
||||
targetId: this.context.target.id,
|
||||
locationStatusTo: "person",
|
||||
personId: this.person.id,
|
||||
};
|
||||
this.$store
|
||||
.dispatch("updateLocation", payload)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
|
||||
window.location.assign("#section-20");
|
||||
this.modal.showModal = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-100" />{{ $t('comment.title') }}</h2>
|
||||
<h2><a id="section-100" />{{ $t("comment.title") }}</h2>
|
||||
|
||||
<!--div class="error flash_message" v-if="errors.length > 0">
|
||||
{{ errors[0] }}
|
||||
@@ -9,10 +9,9 @@
|
||||
|
||||
<div>
|
||||
<form @submit.prevent="submitform">
|
||||
<label
|
||||
class="col-form-label"
|
||||
for="content"
|
||||
>{{ $t('comment.label') }}</label>
|
||||
<label class="col-form-label" for="content">{{
|
||||
$t("comment.label")
|
||||
}}</label>
|
||||
|
||||
<ckeditor
|
||||
name="content"
|
||||
@@ -24,13 +23,17 @@
|
||||
|
||||
<div class="sub-comment">
|
||||
<div
|
||||
v-if="pinnedComment !== null && typeof pinnedComment.creator !== 'undefined'"
|
||||
v-if="
|
||||
pinnedComment !== null &&
|
||||
typeof pinnedComment.creator !== 'undefined'
|
||||
"
|
||||
class="metadata"
|
||||
>
|
||||
{{ $t('comment.created_by', [
|
||||
pinnedComment.creator.text,
|
||||
$d(pinnedComment.updatedAt.datetime, 'long')
|
||||
])
|
||||
{{
|
||||
$t("comment.created_by", [
|
||||
pinnedComment.creator.text,
|
||||
$d(pinnedComment.updatedAt.datetime, "long"),
|
||||
])
|
||||
}}
|
||||
</div>
|
||||
<div class="loading">
|
||||
@@ -45,11 +48,8 @@
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li v-if="pinnedComment !== null">
|
||||
<a
|
||||
class="btn btn-delete"
|
||||
@click="removeComment"
|
||||
>
|
||||
{{ $t('action.delete') }}
|
||||
<a class="btn btn-delete" @click="removeComment">
|
||||
{{ $t("action.delete") }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -60,101 +60,117 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CKEditor from '@ckeditor/ckeditor5-vue';
|
||||
import CKEditor from "@ckeditor/ckeditor5-vue";
|
||||
import ClassicEditor from "../../../../../../ChillMainBundle/Resources/public/module/ckeditor5/editor_config";
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "Comment",
|
||||
components: {
|
||||
ckeditor: CKEditor.component,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
editor: ClassicEditor,
|
||||
loading: false,
|
||||
lastRecordedContent: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
pinnedComment: state => state.accompanyingCourse.pinnedComment,
|
||||
}),
|
||||
content: {
|
||||
set(value) {
|
||||
console.log('new comment value', value);
|
||||
console.log('previous value', this.lastRecordedContent);
|
||||
this.lastRecordedContent = value;
|
||||
name: "Comment",
|
||||
components: {
|
||||
ckeditor: CKEditor.component,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
editor: ClassicEditor,
|
||||
loading: false,
|
||||
lastRecordedContent: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
pinnedComment: (state) => state.accompanyingCourse.pinnedComment,
|
||||
}),
|
||||
content: {
|
||||
set(value) {
|
||||
console.log("new comment value", value);
|
||||
console.log("previous value", this.lastRecordedContent);
|
||||
this.lastRecordedContent = value;
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('performing test on ', value);
|
||||
if (this.lastRecordedContent === value) {
|
||||
this.loading = true;
|
||||
if (value !== '') {
|
||||
this.$store.dispatch('updatePinnedComment', value)
|
||||
.then(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.$store.state.accompanyingCourse.pinnedComment !== null) {
|
||||
this.$store.dispatch('removePinnedComment', {id: this.pinnedComment.id})
|
||||
.then(() => {
|
||||
this.loading = false;
|
||||
this.lastRecoredContent = null;
|
||||
})
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 3000);
|
||||
|
||||
},
|
||||
get() {
|
||||
return this.pinnedComment ? this.pinnedComment.content : '';
|
||||
}
|
||||
setTimeout(() => {
|
||||
console.log("performing test on ", value);
|
||||
if (this.lastRecordedContent === value) {
|
||||
this.loading = true;
|
||||
if (value !== "") {
|
||||
this.$store
|
||||
.dispatch("updatePinnedComment", value)
|
||||
.then(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.$store.state.accompanyingCourse.pinnedComment !== null) {
|
||||
this.$store
|
||||
.dispatch("removePinnedComment", {
|
||||
id: this.pinnedComment.id,
|
||||
})
|
||||
.then(() => {
|
||||
this.loading = false;
|
||||
this.lastRecoredContent = null;
|
||||
})
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 3000);
|
||||
},
|
||||
errors() {
|
||||
return this.$store.state.errorMsg;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
removeComment() {
|
||||
this.$store.dispatch('removePinnedComment', {id: this.pinnedComment.id})
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
get() {
|
||||
return this.pinnedComment ? this.pinnedComment.content : "";
|
||||
},
|
||||
},
|
||||
errors() {
|
||||
return this.$store.state.errorMsg;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
removeComment() {
|
||||
this.$store
|
||||
.dispatch("removePinnedComment", { id: this.pinnedComment.id })
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
div.ck-editor.ck-reset {
|
||||
margin: 0.6em 0;
|
||||
margin: 0.6em 0;
|
||||
}
|
||||
div.sub-comment {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
div.loading {
|
||||
margin-right: 6px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
div.loading {
|
||||
margin-right: 6px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -2,19 +2,16 @@
|
||||
<div class="vue-component">
|
||||
<h2>
|
||||
<a id="section-110" />
|
||||
{{ $t('confirm.title') }}
|
||||
{{ $t("confirm.title") }}
|
||||
</h2>
|
||||
<div>
|
||||
<p v-html="$t('confirm.text_draft', [$t('course.step.draft')])" />
|
||||
|
||||
<div v-if="!isValidToBeConfirmed">
|
||||
<div class="alert alert-warning">
|
||||
{{ $t('confirm.alert_validation') }}
|
||||
{{ $t("confirm.alert_validation") }}
|
||||
<ul class="mt-2">
|
||||
<li
|
||||
v-for="k in validationKeys"
|
||||
:key="k"
|
||||
>
|
||||
<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" />
|
||||
@@ -24,19 +21,13 @@
|
||||
</div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-save"
|
||||
disabled
|
||||
>
|
||||
{{ $t('confirm.ok') }}
|
||||
<button class="btn btn-save" disabled>
|
||||
{{ $t("confirm.ok") }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
class="btn btn-delete"
|
||||
:href="deleteLink"
|
||||
>
|
||||
{{ $t('confirm.delete') }}
|
||||
<a class="btn btn-delete" :href="deleteLink">
|
||||
{{ $t("confirm.delete") }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -46,19 +37,13 @@
|
||||
<p v-html="$t('confirm.text_active', [$t('course.step.active')])" />
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-save"
|
||||
@click="modal.showModal = true"
|
||||
>
|
||||
{{ $t('confirm.ok') }}
|
||||
<button class="btn btn-save" @click="modal.showModal = true">
|
||||
{{ $t("confirm.ok") }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
class="btn btn-delete"
|
||||
:href="deleteLink"
|
||||
>
|
||||
{{ $t('confirm.delete') }}
|
||||
<a class="btn btn-delete" :href="deleteLink">
|
||||
{{ $t("confirm.delete") }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -73,35 +58,37 @@
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t('confirm.sure') }}
|
||||
{{ $t("confirm.sure") }}
|
||||
</h2>
|
||||
</template>
|
||||
<template #body>
|
||||
<p>{{ $t('confirm.sure_description') }}</p>
|
||||
<p>{{ $t("confirm.sure_description") }}</p>
|
||||
<div v-if="accompanyingCourse.user === null">
|
||||
<div v-if="usersSuggestedFilteredByJob.length === 0">
|
||||
<p class="alert alert-warning">
|
||||
{{ $t('confirm.no_suggested_referrer') }}
|
||||
{{ $t("confirm.no_suggested_referrer") }}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
v-if="usersSuggestedFilteredByJob.length === 1"
|
||||
class="alert alert-info"
|
||||
>
|
||||
<p>{{ $t('confirm.one_suggested_referrer') }}:</p>
|
||||
<p>{{ $t("confirm.one_suggested_referrer") }}:</p>
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li>
|
||||
<user-render-box-badge :user="usersSuggestedFilteredByJob[0]" />
|
||||
<user-render-box-badge
|
||||
:user="usersSuggestedFilteredByJob[0]"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
<p>{{ $t('confirm.choose_suggested_referrer') }}</p>
|
||||
<p>{{ $t("confirm.choose_suggested_referrer") }}</p>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-save mr-5"
|
||||
@click="chooseSuggestedReferrer"
|
||||
>
|
||||
{{ $t('confirm.choose_button') }}
|
||||
{{ $t("confirm.choose_button") }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
@@ -109,7 +96,7 @@
|
||||
class="btn btn-secondary"
|
||||
@click="doNotChooseSuggestedReferrer"
|
||||
>
|
||||
{{ $t('confirm.do_not_choose_button') }}
|
||||
{{ $t("confirm.do_not_choose_button") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -122,7 +109,7 @@
|
||||
:disabled="disableConfirm"
|
||||
@click="confirmCourse"
|
||||
>
|
||||
{{ $t('confirm.ok') }}
|
||||
{{ $t("confirm.ok") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
@@ -131,103 +118,111 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters, mapState} from "vuex";
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||
import { mapGetters, mapState } from "vuex";
|
||||
import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
||||
import UserRenderBoxBadge from "ChillMainAssets/vuejs/_components/Entity/UserRenderBoxBadge";
|
||||
|
||||
export default {
|
||||
name: "Confirm",
|
||||
components: {
|
||||
Modal,
|
||||
UserRenderBoxBadge
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md"
|
||||
},
|
||||
notValidMessages: {
|
||||
participation: {
|
||||
msg: 'confirm.participation_not_valid',
|
||||
anchor: '#section-10'
|
||||
},
|
||||
location: {
|
||||
msg: 'confirm.location_not_valid',
|
||||
anchor: '#section-20'
|
||||
},
|
||||
origin: {
|
||||
msg: 'confirm.origin_not_valid',
|
||||
anchor: '#section-30'
|
||||
},
|
||||
adminLocation: {
|
||||
msg: 'confirm.adminLocation_not_valid',
|
||||
anchor: '#section-40'
|
||||
},
|
||||
socialIssue: {
|
||||
msg: 'confirm.socialIssue_not_valid',
|
||||
anchor: '#section-60'
|
||||
},
|
||||
scopes: {
|
||||
msg: 'confirm.set_a_scope',
|
||||
anchor: '#section-70'
|
||||
},
|
||||
job: {
|
||||
msg: 'confirm.job_not_valid',
|
||||
anchor: '#section-80'
|
||||
},
|
||||
},
|
||||
clickedDoNotChooseReferrer: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
accompanyingCourse: state => state.accompanyingCourse,
|
||||
}),
|
||||
...mapGetters([
|
||||
'isParticipationValid',
|
||||
'isSocialIssueValid',
|
||||
'isOriginValid',
|
||||
'isAdminLocationValid',
|
||||
'isLocationValid',
|
||||
'isJobValid',
|
||||
'validationKeys',
|
||||
'isValidToBeConfirmed',
|
||||
'usersSuggestedFilteredByJob',
|
||||
]),
|
||||
deleteLink() {
|
||||
return `/fr/parcours/${this.accompanyingCourse.id}/delete`; //TODO locale
|
||||
name: "Confirm",
|
||||
components: {
|
||||
Modal,
|
||||
UserRenderBoxBadge,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md",
|
||||
},
|
||||
disableConfirm() {
|
||||
return (this.accompanyingCourse.user === null
|
||||
&& this.usersSuggestedFilteredByJob.length === 1
|
||||
&& this.clickedDoNotChooseReferrer === false);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
confirmCourse() {
|
||||
this.$store.dispatch('confirmAccompanyingCourse')
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
notValidMessages: {
|
||||
participation: {
|
||||
msg: "confirm.participation_not_valid",
|
||||
anchor: "#section-10",
|
||||
},
|
||||
location: {
|
||||
msg: "confirm.location_not_valid",
|
||||
anchor: "#section-20",
|
||||
},
|
||||
origin: {
|
||||
msg: "confirm.origin_not_valid",
|
||||
anchor: "#section-30",
|
||||
},
|
||||
adminLocation: {
|
||||
msg: "confirm.adminLocation_not_valid",
|
||||
anchor: "#section-40",
|
||||
},
|
||||
socialIssue: {
|
||||
msg: "confirm.socialIssue_not_valid",
|
||||
anchor: "#section-60",
|
||||
},
|
||||
scopes: {
|
||||
msg: "confirm.set_a_scope",
|
||||
anchor: "#section-70",
|
||||
},
|
||||
job: {
|
||||
msg: "confirm.job_not_valid",
|
||||
anchor: "#section-80",
|
||||
},
|
||||
},
|
||||
chooseSuggestedReferrer() {
|
||||
this.$store.dispatch('updateReferrer', this.usersSuggestedFilteredByJob[0])
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
},
|
||||
doNotChooseSuggestedReferrer() {
|
||||
this.clickedDoNotChooseReferrer = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
clickedDoNotChooseReferrer: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
accompanyingCourse: (state) => state.accompanyingCourse,
|
||||
}),
|
||||
...mapGetters([
|
||||
"isParticipationValid",
|
||||
"isSocialIssueValid",
|
||||
"isOriginValid",
|
||||
"isAdminLocationValid",
|
||||
"isLocationValid",
|
||||
"isJobValid",
|
||||
"validationKeys",
|
||||
"isValidToBeConfirmed",
|
||||
"usersSuggestedFilteredByJob",
|
||||
]),
|
||||
deleteLink() {
|
||||
return `/fr/parcours/${this.accompanyingCourse.id}/delete`; //TODO locale
|
||||
},
|
||||
disableConfirm() {
|
||||
return (
|
||||
this.accompanyingCourse.user === null &&
|
||||
this.usersSuggestedFilteredByJob.length === 1 &&
|
||||
this.clickedDoNotChooseReferrer === false
|
||||
);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
confirmCourse() {
|
||||
this.$store
|
||||
.dispatch("confirmAccompanyingCourse")
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseSuggestedReferrer() {
|
||||
this.$store
|
||||
.dispatch("updateReferrer", this.usersSuggestedFilteredByJob[0])
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
doNotChooseSuggestedReferrer() {
|
||||
this.clickedDoNotChooseReferrer = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<div class="vue-component">
|
||||
<h2>
|
||||
<a id="section-20" />
|
||||
{{ $t('courselocation.title') }}
|
||||
{{ $t("courselocation.title") }}
|
||||
</h2>
|
||||
|
||||
<div
|
||||
@@ -15,34 +15,27 @@
|
||||
|
||||
<div v-if="hasNoLocation">
|
||||
<label class="chill-no-data-statement">
|
||||
{{ $t('courselocation.no_address') }}
|
||||
{{ $t("courselocation.no_address") }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="flex-table"
|
||||
v-if="accompanyingCourse.location"
|
||||
>
|
||||
<div class="flex-table" v-if="accompanyingCourse.location">
|
||||
<div class="item-bloc">
|
||||
<address-render-box
|
||||
:address="accompanyingCourse.location"
|
||||
/>
|
||||
<address-render-box :address="accompanyingCourse.location" />
|
||||
|
||||
<div
|
||||
v-if="isPersonLocation"
|
||||
class="alert alert-secondary separator"
|
||||
>
|
||||
<div v-if="isPersonLocation" class="alert alert-secondary separator">
|
||||
<label class="col-form-label">
|
||||
{{ $t('courselocation.person_locator', [ accompanyingCourse.personLocation.text ]) }}
|
||||
{{
|
||||
$t("courselocation.person_locator", [
|
||||
accompanyingCourse.personLocation.text,
|
||||
])
|
||||
}}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="isTemporaryAddress"
|
||||
class="alert alert-warning separator"
|
||||
>
|
||||
<div v-if="isTemporaryAddress" class="alert alert-warning separator">
|
||||
<p>
|
||||
{{ $t('courselocation.temporary_address_must_be_changed') }}
|
||||
{{ $t("courselocation.temporary_address_must_be_changed") }}
|
||||
<i class="fa fa-fw fa-map-marker" />
|
||||
</p>
|
||||
</div>
|
||||
@@ -56,7 +49,11 @@
|
||||
<i class="fa fa-warning fa-2x" />
|
||||
<div>
|
||||
<p>
|
||||
{{ $t('courselocation.associate_at_least_one_person_with_one_household_with_address') }}
|
||||
{{
|
||||
$t(
|
||||
"courselocation.associate_at_least_one_person_with_one_household_with_address",
|
||||
)
|
||||
}}
|
||||
<a href="#section-10">
|
||||
<i class="fa fa-level-up fa-fw" />
|
||||
</a>
|
||||
@@ -79,178 +76,183 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!isLocationValid"
|
||||
class="alert alert-warning to-confirm"
|
||||
>
|
||||
{{ $t('courselocation.not_valid') }}
|
||||
<div v-if="!isLocationValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("courselocation.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters, mapState} from "vuex";
|
||||
import AddAddress from 'ChillMainAssets/vuejs/Address/components/AddAddress.vue';
|
||||
import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue';
|
||||
import { mapGetters, mapState } from "vuex";
|
||||
import AddAddress from "ChillMainAssets/vuejs/Address/components/AddAddress.vue";
|
||||
import AddressRenderBox from "ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue";
|
||||
|
||||
export default {
|
||||
name: "CourseLocation",
|
||||
components: {
|
||||
AddAddress,
|
||||
AddressRenderBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addAddress: {
|
||||
options: {
|
||||
button: {
|
||||
text: {
|
||||
create: 'courselocation.add_temporary_address',
|
||||
edit: 'courselocation.edit_temporary_address'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
create: 'courselocation.add_temporary_address',
|
||||
edit: 'courselocation.edit_temporary_address'
|
||||
},
|
||||
onlyButton: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
accompanyingCourse: state => state.accompanyingCourse,
|
||||
context: state => state.addressContext
|
||||
}),
|
||||
...mapGetters([
|
||||
'isLocationValid'
|
||||
]),
|
||||
options() {
|
||||
return this.addAddress.options;
|
||||
},
|
||||
key() {
|
||||
return (this.context.edit) ? 'address_' + this.context.addressId
|
||||
: this.accompanyingCourse.type + '_' + this.accompanyingCourse.id ;
|
||||
},
|
||||
isTemporaryAddress() {
|
||||
return this.accompanyingCourse.locationStatus === 'address';
|
||||
},
|
||||
isPersonLocation() {
|
||||
return this.accompanyingCourse.locationStatus === 'person';
|
||||
},
|
||||
hasNoLocation() {
|
||||
return this.accompanyingCourse.locationStatus === 'none';
|
||||
},
|
||||
currentParticipations() {
|
||||
return this.accompanyingCourse.participations.filter(p => p.enddate !== null);
|
||||
},
|
||||
hasNoPersonLocation() {
|
||||
|
||||
let addressInParticipations_ = []
|
||||
this.currentParticipations.forEach(p => {
|
||||
addressInParticipations_.push(this.checkHouseholdAddressForParticipation(p));
|
||||
});
|
||||
|
||||
const booleanReducer = (previousValue, currentValue) => previousValue || currentValue;
|
||||
|
||||
let addressInParticipations = (addressInParticipations_.length > 0) ?
|
||||
addressInParticipations_.reduce(booleanReducer) : false;
|
||||
|
||||
//console.log(addressInParticipations_, addressInParticipations);
|
||||
return (
|
||||
this.accompanyingCourse.step !== 'DRAFT'
|
||||
&& this.isTemporaryAddress
|
||||
&& !addressInParticipations
|
||||
)
|
||||
;
|
||||
},
|
||||
isContextEdit() {
|
||||
return this.context.edit;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkHouseholdAddressForParticipation(participation) {
|
||||
if (participation.person.current_household_id === null) {
|
||||
return false;
|
||||
}
|
||||
return participation.person.current_household_address !== null;
|
||||
},
|
||||
initAddressContext() {
|
||||
let context = {
|
||||
target: {
|
||||
name: this.accompanyingCourse.type,
|
||||
id: this.accompanyingCourse.id
|
||||
name: "CourseLocation",
|
||||
components: {
|
||||
AddAddress,
|
||||
AddressRenderBox,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addAddress: {
|
||||
options: {
|
||||
button: {
|
||||
text: {
|
||||
create: "courselocation.add_temporary_address",
|
||||
edit: "courselocation.edit_temporary_address",
|
||||
},
|
||||
edit: false,
|
||||
addressId: null,
|
||||
defaults: window.addaddress
|
||||
}
|
||||
if (this.accompanyingCourse.location) {
|
||||
context['edit'] = true;
|
||||
context['addressId'] = this.accompanyingCourse.location.address_id
|
||||
}
|
||||
this.$store.commit('setAddressContext', context);
|
||||
},
|
||||
title: {
|
||||
create: "courselocation.add_temporary_address",
|
||||
edit: "courselocation.edit_temporary_address",
|
||||
},
|
||||
onlyButton: true,
|
||||
},
|
||||
},
|
||||
displayErrors() {
|
||||
return this.$refs.addAddress.errorMsg;
|
||||
},
|
||||
submitTemporaryAddress(payload) {
|
||||
//console.log('@@@ click on Submit Temporary Address Button', payload);
|
||||
payload['locationStatusTo'] = 'address'; // <== temporary, not none, not person
|
||||
this.$store.dispatch('updateLocation', payload)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
accompanyingCourse: (state) => state.accompanyingCourse,
|
||||
context: (state) => state.addressContext,
|
||||
}),
|
||||
...mapGetters(["isLocationValid"]),
|
||||
options() {
|
||||
return this.addAddress.options;
|
||||
},
|
||||
key() {
|
||||
return this.context.edit
|
||||
? "address_" + this.context.addressId
|
||||
: this.accompanyingCourse.type + "_" + this.accompanyingCourse.id;
|
||||
},
|
||||
isTemporaryAddress() {
|
||||
return this.accompanyingCourse.locationStatus === "address";
|
||||
},
|
||||
isPersonLocation() {
|
||||
return this.accompanyingCourse.locationStatus === "person";
|
||||
},
|
||||
hasNoLocation() {
|
||||
return this.accompanyingCourse.locationStatus === "none";
|
||||
},
|
||||
currentParticipations() {
|
||||
return this.accompanyingCourse.participations.filter(
|
||||
(p) => p.enddate !== null,
|
||||
);
|
||||
},
|
||||
hasNoPersonLocation() {
|
||||
let addressInParticipations_ = [];
|
||||
this.currentParticipations.forEach((p) => {
|
||||
addressInParticipations_.push(
|
||||
this.checkHouseholdAddressForParticipation(p),
|
||||
);
|
||||
});
|
||||
|
||||
this.$store.commit('setEditContextTrue', payload);
|
||||
const booleanReducer = (previousValue, currentValue) =>
|
||||
previousValue || currentValue;
|
||||
|
||||
let addressInParticipations =
|
||||
addressInParticipations_.length > 0
|
||||
? addressInParticipations_.reduce(booleanReducer)
|
||||
: false;
|
||||
|
||||
//console.log(addressInParticipations_, addressInParticipations);
|
||||
return (
|
||||
this.accompanyingCourse.step !== "DRAFT" &&
|
||||
this.isTemporaryAddress &&
|
||||
!addressInParticipations
|
||||
);
|
||||
},
|
||||
isContextEdit() {
|
||||
return this.context.edit;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
checkHouseholdAddressForParticipation(participation) {
|
||||
if (participation.person.current_household_id === null) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initAddressContext();
|
||||
return participation.person.current_household_address !== null;
|
||||
},
|
||||
initAddressContext() {
|
||||
let context = {
|
||||
target: {
|
||||
name: this.accompanyingCourse.type,
|
||||
id: this.accompanyingCourse.id,
|
||||
},
|
||||
edit: false,
|
||||
addressId: null,
|
||||
defaults: window.addaddress,
|
||||
};
|
||||
if (this.accompanyingCourse.location) {
|
||||
context["edit"] = true;
|
||||
context["addressId"] = this.accompanyingCourse.location.address_id;
|
||||
}
|
||||
this.$store.commit("setAddressContext", context);
|
||||
},
|
||||
displayErrors() {
|
||||
return this.$refs.addAddress.errorMsg;
|
||||
},
|
||||
submitTemporaryAddress(payload) {
|
||||
//console.log('@@@ click on Submit Temporary Address Button', payload);
|
||||
payload["locationStatusTo"] = "address"; // <== temporary, not none, not person
|
||||
this.$store
|
||||
.dispatch("updateLocation", payload)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
|
||||
//console.log('ac.locationStatus', this.accompanyingCourse.locationStatus);
|
||||
//console.log('ac.location (temporary location)', this.accompanyingCourse.location);
|
||||
//console.log('ac.personLocation', this.accompanyingCourse.personLocation);
|
||||
}
|
||||
}
|
||||
this.$store.commit("setEditContextTrue", payload);
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initAddressContext();
|
||||
|
||||
//console.log('ac.locationStatus', this.accompanyingCourse.locationStatus);
|
||||
//console.log('ac.location (temporary location)', this.accompanyingCourse.location);
|
||||
//console.log('ac.personLocation', this.accompanyingCourse.personLocation);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
div#accompanying-course {
|
||||
div.vue-component {
|
||||
& > div.alert.no-person-location {
|
||||
margin: 1px 0 0;
|
||||
div.vue-component {
|
||||
& > div.alert.no-person-location {
|
||||
margin: 1px 0 0;
|
||||
}
|
||||
div.no-person-location {
|
||||
padding-top: 1.5em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
& > i {
|
||||
flex-basis: 1.5em;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
padding-top: 0.2em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
div.no-person-location {
|
||||
padding-top: 1.5em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
& > i {
|
||||
flex-basis: 1.5em; flex-grow: 0; flex-shrink: 0;
|
||||
padding-top: 0.2em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
& > div {
|
||||
flex-basis: auto;
|
||||
div.action {
|
||||
button.btn-update {
|
||||
margin-right: 2em;
|
||||
}
|
||||
}
|
||||
}
|
||||
& > div {
|
||||
flex-basis: auto;
|
||||
div.action {
|
||||
button.btn-update {
|
||||
margin-right: 2em;
|
||||
}
|
||||
}
|
||||
}
|
||||
div.flex-table {
|
||||
div.item-bloc {
|
||||
div.alert {
|
||||
margin: 0 -0.9em -1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
div.flex-table {
|
||||
div.item-bloc {
|
||||
div.alert {
|
||||
margin: 0 -0.9em -1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-30" />{{ $t('origin.title') }}</h2>
|
||||
<h2><a id="section-30" />{{ $t("origin.title") }}</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="selectOrigin">
|
||||
{{ $t('origin.title') }}
|
||||
{{ $t("origin.title") }}
|
||||
</label>
|
||||
|
||||
<VueMultiselect
|
||||
@@ -24,72 +24,70 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!isOriginValid"
|
||||
class="alert alert-warning to-confirm"
|
||||
>
|
||||
{{ $t('origin.not_valid') }}
|
||||
<div v-if="!isOriginValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("origin.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueMultiselect from 'vue-multiselect';
|
||||
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import VueMultiselect from "vue-multiselect";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
name: 'OriginDemand',
|
||||
components: { VueMultiselect },
|
||||
data() {
|
||||
return {
|
||||
options: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
value: state => state.accompanyingCourse.origin,
|
||||
}),
|
||||
...mapGetters([
|
||||
'isOriginValid'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
const url = `/api/1.0/person/accompanying-period/origin.json`;
|
||||
makeFetch('GET', url)
|
||||
.then(response => {
|
||||
this.options = response.results;
|
||||
return response;
|
||||
})
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
this.$toast.open({message: error.txt})
|
||||
})
|
||||
},
|
||||
updateOrigin(value) {
|
||||
this.$store.dispatch('updateOrigin', value)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
},
|
||||
transText ({ text }) {
|
||||
return text.fr;
|
||||
},
|
||||
}
|
||||
}
|
||||
name: "OriginDemand",
|
||||
components: { VueMultiselect },
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
value: (state) => state.accompanyingCourse.origin,
|
||||
}),
|
||||
...mapGetters(["isOriginValid"]),
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
const url = `/api/1.0/person/accompanying-period/origin.json`;
|
||||
makeFetch("GET", url)
|
||||
.then((response) => {
|
||||
this.options = response.results;
|
||||
return response;
|
||||
})
|
||||
.catch((error) => {
|
||||
commit("catchError", error);
|
||||
this.$toast.open({ message: error.txt });
|
||||
});
|
||||
},
|
||||
updateOrigin(value) {
|
||||
this.$store
|
||||
.dispatch("updateOrigin", value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
transText({ text }) {
|
||||
return text.fr;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
||||
<style lang="css" scoped>
|
||||
label {
|
||||
display: none;
|
||||
}
|
||||
label {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,12 +1,16 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-10" />{{ $t('persons_associated.title') }}</h2>
|
||||
<h2><a id="section-10" />{{ $t("persons_associated.title") }}</h2>
|
||||
|
||||
<div v-if="currentParticipations.length > 0">
|
||||
<label class="col-form-label">{{ $tc('persons_associated.counter', counter) }}</label>
|
||||
<label class="col-form-label">{{
|
||||
$tc("persons_associated.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
<div v-else>
|
||||
<label class="chill-no-data-statement">{{ $tc('persons_associated.counter', counter) }}</label>
|
||||
<label class="chill-no-data-statement">{{
|
||||
$tc("persons_associated.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -14,22 +18,16 @@
|
||||
class="alert alert-warning no-household"
|
||||
>
|
||||
<i class="fa fa-warning fa-2x" />
|
||||
<form
|
||||
method="GET"
|
||||
action="/fr/person/household/members/editor"
|
||||
>
|
||||
<form method="GET" action="/fr/person/household/members/editor">
|
||||
<div class="float-button bottom">
|
||||
<div class="box">
|
||||
<div class="action">
|
||||
<button
|
||||
class="btn btn-update"
|
||||
type="submit"
|
||||
>
|
||||
{{ $t('persons_associated.update_household') }}
|
||||
<button class="btn btn-update" type="submit">
|
||||
{{ $t("persons_associated.update_household") }}
|
||||
</button>
|
||||
</div>
|
||||
<p class="mb-3">
|
||||
{{ $t('persons_associated.person_without_household_warning') }}
|
||||
{{ $t("persons_associated.person_without_household_warning") }}
|
||||
</p>
|
||||
<div
|
||||
class="form-check"
|
||||
@@ -43,26 +41,18 @@
|
||||
checked="checked"
|
||||
:id="p.person.id"
|
||||
:value="p.person.id"
|
||||
>
|
||||
/>
|
||||
<label class="form-check-label">
|
||||
<person-text :person="p.person" />
|
||||
</label>
|
||||
</div>
|
||||
<input
|
||||
type="hidden"
|
||||
name="expand_suggestions"
|
||||
value="true"
|
||||
>
|
||||
<input
|
||||
type="hidden"
|
||||
name="returnPath"
|
||||
:value="getReturnPath"
|
||||
>
|
||||
<input type="hidden" name="expand_suggestions" value="true" />
|
||||
<input type="hidden" name="returnPath" :value="getReturnPath" />
|
||||
<input
|
||||
type="hidden"
|
||||
name="accompanying_period_id"
|
||||
:value="courseId"
|
||||
>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -107,155 +97,170 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!isParticipationValid"
|
||||
class="alert alert-warning to-confirm"
|
||||
>
|
||||
{{ $t('persons_associated.participation_not_valid') }}
|
||||
<div v-if="!isParticipationValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("persons_associated.participation_not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters, mapState} from 'vuex';
|
||||
import { mapGetters, mapState } from "vuex";
|
||||
import ParticipationItem from "./PersonsAssociated/ParticipationItem.vue";
|
||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
||||
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
||||
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue";
|
||||
import PersonText from "ChillPersonAssets/vuejs/_components/Entity/PersonText.vue";
|
||||
|
||||
export default {
|
||||
name: 'PersonsAssociated',
|
||||
components: {
|
||||
ParticipationItem,
|
||||
AddPersons,
|
||||
PersonText
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: 'persons_associated',
|
||||
options: {
|
||||
type: ['person'],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
name: "PersonsAssociated",
|
||||
components: {
|
||||
ParticipationItem,
|
||||
AddPersons,
|
||||
PersonText,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "persons_associated",
|
||||
options: {
|
||||
type: ["person"],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
courseId: (state) => state.accompanyingCourse.id,
|
||||
participations: (state) => state.accompanyingCourse.participations,
|
||||
suggestedPersons: (state) =>
|
||||
[
|
||||
state.accompanyingCourse.requestor,
|
||||
...state.accompanyingCourse.resources.map((r) => r.resource),
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
.filter((e) => e.type === "person")
|
||||
.filter(
|
||||
(p) =>
|
||||
!state.accompanyingCourse.participations
|
||||
.filter((pa) => pa.endDate === null)
|
||||
.map((pa) => pa.person.id)
|
||||
.includes(p.id),
|
||||
)
|
||||
// filter persons appearing twice in requestor and resources
|
||||
.filter((e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i + 1) {
|
||||
if (i < index && e.id === suggested[i].id) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
courseId: state => state.accompanyingCourse.id,
|
||||
participations: state => state.accompanyingCourse.participations,
|
||||
suggestedPersons: state => [
|
||||
state.accompanyingCourse.requestor,
|
||||
...state.accompanyingCourse.resources.map(r => r.resource)
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
.filter((e) => e.type === 'person')
|
||||
.filter(
|
||||
(p) => !state.accompanyingCourse.participations.filter(pa => pa.endDate === null).map((pa) => pa.person.id).includes(p.id)
|
||||
)
|
||||
// filter persons appearing twice in requestor and resources
|
||||
.filter(
|
||||
(e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i+1) {
|
||||
if (i < index && e.id === suggested[i].id) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}),
|
||||
}),
|
||||
...mapGetters(["isParticipationValid"]),
|
||||
currentParticipations() {
|
||||
return this.participations.filter((p) => p.endDate === null);
|
||||
},
|
||||
counter() {
|
||||
return this.currentParticipations.length;
|
||||
},
|
||||
participationWithoutHousehold() {
|
||||
return this.currentParticipations.filter(
|
||||
(p) => p.person.current_household_id === null,
|
||||
);
|
||||
},
|
||||
getReturnPath() {
|
||||
return (
|
||||
window.location.pathname + window.location.search + window.location.hash
|
||||
);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
removeParticipation(item) {
|
||||
this.$store
|
||||
.dispatch("removeParticipation", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
closeParticipation(item) {
|
||||
this.$store
|
||||
.dispatch("closeParticipation", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
selected.forEach(function (item) {
|
||||
this.$store
|
||||
.dispatch("addParticipation", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
)
|
||||
}),
|
||||
...mapGetters([
|
||||
'isParticipationValid'
|
||||
]),
|
||||
currentParticipations() {
|
||||
return this.participations.filter(p => p.endDate === null)
|
||||
},
|
||||
counter() {
|
||||
return this.currentParticipations.length;
|
||||
},
|
||||
participationWithoutHousehold() {
|
||||
return this.currentParticipations.filter(p => p.person.current_household_id === null);
|
||||
},
|
||||
getReturnPath() {
|
||||
return window.location.pathname + window.location.search + window.location.hash;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
removeParticipation(item) {
|
||||
this.$store.dispatch('removeParticipation', item)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
},
|
||||
closeParticipation(item) {
|
||||
this.$store.dispatch('closeParticipation', item)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
selected.forEach(function(item) {
|
||||
this.$store.dispatch('addParticipation', item)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
}, this
|
||||
);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
addSuggestedPerson(person) {
|
||||
this.$store.dispatch('addParticipation', { result: person, type: 'person' })
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
||||
}, this);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
addSuggestedPerson(person) {
|
||||
this.$store
|
||||
.dispatch("addParticipation", { result: person, type: "person" })
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
div#accompanying-course {
|
||||
div.vue-component {
|
||||
& > div.alert.no-household {
|
||||
margin: 0 0 -1em;
|
||||
div.vue-component {
|
||||
& > div.alert.no-household {
|
||||
margin: 0 0 -1em;
|
||||
}
|
||||
div.no-household {
|
||||
padding-bottom: 1.5em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
& > i {
|
||||
flex-basis: 1.5em;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
padding-top: 0.2em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
div.no-household {
|
||||
padding-bottom: 1.5em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
& > i {
|
||||
flex-basis: 1.5em; flex-grow: 0; flex-shrink: 0;
|
||||
padding-top: 0.2em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
& > form {
|
||||
flex-basis: auto;
|
||||
div.action {
|
||||
button.btn-update {
|
||||
margin-right: 2em;
|
||||
}
|
||||
}
|
||||
}
|
||||
& > form {
|
||||
flex-basis: auto;
|
||||
div.action {
|
||||
button.btn-update {
|
||||
margin-right: 2em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -2,15 +2,15 @@
|
||||
<person-render-box
|
||||
render="bloc"
|
||||
:options="{
|
||||
addInfo : true,
|
||||
addId : false,
|
||||
addInfo: true,
|
||||
addId: false,
|
||||
addEntity: false,
|
||||
addLink: false,
|
||||
addHouseholdLink: false,
|
||||
addAltNames: true,
|
||||
addAge : true,
|
||||
hLevel : 3,
|
||||
isConfidential : false,
|
||||
addAge: true,
|
||||
hLevel: 3,
|
||||
isConfidential: false,
|
||||
isMultiline: true,
|
||||
}"
|
||||
:person="participation.person"
|
||||
@@ -20,14 +20,21 @@
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
<button-location
|
||||
v-if="hasCurrentHouseholdAddress && !isPersonLocatingCourse(participation.person)"
|
||||
v-if="
|
||||
hasCurrentHouseholdAddress &&
|
||||
!isPersonLocatingCourse(participation.person)
|
||||
"
|
||||
:person="participation.person"
|
||||
/>
|
||||
<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 })"
|
||||
:title="
|
||||
$t('persons_associated.show_household_number', {
|
||||
id: participation.person.current_household_id,
|
||||
})
|
||||
"
|
||||
>
|
||||
<i class="fa fa-fw fa-home" />
|
||||
</a>
|
||||
@@ -61,7 +68,6 @@
|
||||
</template>
|
||||
</person-render-box>
|
||||
|
||||
|
||||
<teleport to="body">
|
||||
<modal
|
||||
v-if="modal.showModal"
|
||||
@@ -70,18 +76,18 @@
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t('persons_associated.sure') }}
|
||||
{{ $t("persons_associated.sure") }}
|
||||
</h2>
|
||||
</template>
|
||||
<template #body>
|
||||
<p>{{ $t('persons_associated.sure_description') }}</p>
|
||||
<p>{{ $t("persons_associated.sure_description") }}</p>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button
|
||||
class="btn btn-danger"
|
||||
@click.prevent="$emit('close', participation)"
|
||||
>
|
||||
{{ $t('persons_associated.ok') }}
|
||||
{{ $t("persons_associated.ok") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
@@ -89,112 +95,141 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
|
||||
import ButtonLocation from '../ButtonLocation.vue';
|
||||
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
||||
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue";
|
||||
import ButtonLocation from "../ButtonLocation.vue";
|
||||
import PersonRenderBox from "ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue";
|
||||
import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
|
||||
export default {
|
||||
name: 'ParticipationItem',
|
||||
components: {
|
||||
OnTheFly,
|
||||
ButtonLocation,
|
||||
PersonRenderBox,
|
||||
Modal
|
||||
},
|
||||
props: ['participation'],
|
||||
emits: ['remove', 'close'],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md"
|
||||
},
|
||||
PersonRenderBox: {
|
||||
participation: 'participation',
|
||||
options: {
|
||||
addInfo: false,
|
||||
addId: true,
|
||||
addAge: false,
|
||||
hLevel: 1
|
||||
name: "ParticipationItem",
|
||||
components: {
|
||||
OnTheFly,
|
||||
ButtonLocation,
|
||||
PersonRenderBox,
|
||||
Modal,
|
||||
},
|
||||
props: ["participation"],
|
||||
emits: ["remove", "close"],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md",
|
||||
},
|
||||
PersonRenderBox: {
|
||||
participation: "participation",
|
||||
options: {
|
||||
addInfo: false,
|
||||
addId: true,
|
||||
addAge: false,
|
||||
hLevel: 1,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
hasCurrentHouseholdAddress() {
|
||||
if (
|
||||
!this.participation.endDate &&
|
||||
this.participation.person.current_household_address !== null
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
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: {
|
||||
isPersonLocatingCourse(person) {
|
||||
return this.$store.getters.isPersonLocatingCourse(person);
|
||||
},
|
||||
saveFormOnTheFly(payload) {
|
||||
console.log(
|
||||
"saveFormOnTheFly: type",
|
||||
payload.type,
|
||||
", data",
|
||||
payload.data,
|
||||
);
|
||||
payload.target = "participation";
|
||||
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === "person") {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) {
|
||||
body.birthdate = payload.data.birthdate;
|
||||
}
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = {
|
||||
id: payload.data.gender.id,
|
||||
type: payload.data.gender.type,
|
||||
};
|
||||
if (payload.data.civility !== null) {
|
||||
body.civility = {
|
||||
id: payload.data.civility.id,
|
||||
type: payload.data.civility.type,
|
||||
};
|
||||
}
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/person/person/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addPerson", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
},
|
||||
});
|
||||
} else if (payload.type === "thirdparty") {
|
||||
body.name = payload.data.text;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.phonenumber;
|
||||
body.address = { id: payload.data.address.address_id };
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addThirdparty", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
hasCurrentHouseholdAddress() {
|
||||
if ( !this.participation.endDate
|
||||
&& this.participation.person.current_household_address !== null ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
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: {
|
||||
isPersonLocatingCourse(person) {
|
||||
return this.$store.getters.isPersonLocatingCourse(person);
|
||||
},
|
||||
saveFormOnTheFly(payload) {
|
||||
console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
|
||||
payload.target = 'participation';
|
||||
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === 'person') {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) { body.birthdate = payload.data.birthdate; }
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = {id: payload.data.gender.id, type: payload.data.gender.type };
|
||||
if (payload.data.civility !== null) { body.civility = {id: payload.data.civility.id, type: payload.data.civility.type }; }
|
||||
|
||||
makeFetch('PATCH', `/api/1.0/person/person/${payload.data.id}.json`, body)
|
||||
.then(response => {
|
||||
this.$store.dispatch('addPerson', { target: payload.target, body: response });
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === 'ValidationException') {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
}
|
||||
})
|
||||
}
|
||||
else if (payload.type === 'thirdparty') {
|
||||
body.name = payload.data.text;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.phonenumber;
|
||||
body.address = { id: payload.data.address.address_id };
|
||||
|
||||
makeFetch('PATCH', `/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`, body)
|
||||
.then(response => {
|
||||
this.$store.dispatch('addThirdparty', { target: payload.target, body: response })
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === 'ValidationException') {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-80" />{{ $t('referrer.title') }}</h2>
|
||||
<h2><a id="section-80" />{{ $t("referrer.title") }}</h2>
|
||||
|
||||
<teleport to="body">
|
||||
<modal
|
||||
@@ -10,33 +10,31 @@
|
||||
>
|
||||
<template #header>
|
||||
<h3 class="modal-title">
|
||||
{{ $t('confirm.title') }}
|
||||
{{ $t("confirm.title") }}
|
||||
</h3>
|
||||
</template>
|
||||
|
||||
<template #body-head>
|
||||
<div class="modal-body">
|
||||
<p v-html="$t('confirm.sure_referrer', { referrer: this.value.text })" />
|
||||
<p
|
||||
v-html="
|
||||
$t('confirm.sure_referrer', { referrer: this.value.text })
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<button
|
||||
class="btn btn-save"
|
||||
@click.prevent="this.confirmReferrer"
|
||||
>
|
||||
{{ $t('confirm.ok_referrer') }}
|
||||
<button class="btn btn-save" @click.prevent="this.confirmReferrer">
|
||||
{{ $t("confirm.ok_referrer") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
|
||||
<div>
|
||||
<label
|
||||
class="col-form-label"
|
||||
for="selectJob"
|
||||
>
|
||||
{{ $t('job.label') }}
|
||||
<label class="col-form-label" for="selectJob">
|
||||
{{ $t("job.label") }}
|
||||
</label>
|
||||
|
||||
<VueMultiselect
|
||||
@@ -54,11 +52,8 @@
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
/>
|
||||
|
||||
<label
|
||||
class="col-form-label"
|
||||
for="selectReferrer"
|
||||
>
|
||||
{{ $t('referrer.label') }}
|
||||
<label class="col-form-label" for="selectReferrer">
|
||||
{{ $t("referrer.label") }}
|
||||
</label>
|
||||
|
||||
<VueMultiselect
|
||||
@@ -101,55 +96,57 @@
|
||||
name="button"
|
||||
@click="assignMe"
|
||||
>
|
||||
{{ $t('referrer.assign_me') }}
|
||||
{{ $t("referrer.assign_me") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!isJobValid"
|
||||
class="alert alert-warning to-confirm"
|
||||
>
|
||||
{{ $t('job.not_valid') }}
|
||||
<div v-if="!isJobValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("job.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueMultiselect from 'vue-multiselect';
|
||||
import {makeFetch} from 'ChillMainAssets/lib/api/apiMethods';
|
||||
import {mapState, mapGetters} from 'vuex';
|
||||
import VueMultiselect from "vue-multiselect";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
import UserRenderBoxBadge from "ChillMainAssets/vuejs/_components/Entity/UserRenderBoxBadge";
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||
import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
||||
|
||||
export default {
|
||||
name: "Referrer",
|
||||
components: {
|
||||
UserRenderBoxBadge,
|
||||
VueMultiselect,
|
||||
Modal
|
||||
Modal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jobs: [],
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-scrollable modal-xl"
|
||||
modalDialogClass: "modal-dialog-scrollable modal-xl",
|
||||
},
|
||||
value: this.$store.state.accompanyingCourse.user,
|
||||
confirmed: false
|
||||
}
|
||||
confirmed: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
valueJob: state => state.accompanyingCourse.job,
|
||||
valueJob: (state) => state.accompanyingCourse.job,
|
||||
}),
|
||||
...mapGetters(['isJobValid', 'usersSuggestedFilteredByJob']),
|
||||
...mapGetters(["isJobValid", "usersSuggestedFilteredByJob"]),
|
||||
users: function () {
|
||||
let users = this.$store.getters.usersFilteredByJob;
|
||||
// ensure that the selected user is in the list. add it if necessary
|
||||
if (this.$store.state.accompanyingCourse.user !== null && users.find(u => this.$store.state.accompanyingCourse.user.id === u.id) === undefined) {
|
||||
if (
|
||||
this.$store.state.accompanyingCourse.user !== null &&
|
||||
users.find(
|
||||
(u) => this.$store.state.accompanyingCourse.user.id === u.id,
|
||||
) === undefined
|
||||
) {
|
||||
users.push(this.$store.state.accompanyingCourse.user);
|
||||
}
|
||||
return users;
|
||||
@@ -159,15 +156,18 @@ export default {
|
||||
return this.$store.state.accompanyingCourse.job;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.dispatch('updateJob', value)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
}
|
||||
this.$store
|
||||
.dispatch("updateJob", value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
@@ -179,57 +179,62 @@ export default {
|
||||
this.toggleModal();
|
||||
},
|
||||
getJobs() {
|
||||
const url = '/api/1.0/main/user-job.json';
|
||||
makeFetch('GET', url)
|
||||
.then(response => {
|
||||
this.jobs = response.results;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toast.open({message: error.txt})
|
||||
})
|
||||
const url = "/api/1.0/main/user-job.json";
|
||||
makeFetch("GET", url)
|
||||
.then((response) => {
|
||||
this.jobs = response.results;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toast.open({ message: error.txt });
|
||||
});
|
||||
},
|
||||
customJobLabel(value) {
|
||||
return value.label.fr;
|
||||
},
|
||||
assignMe() {
|
||||
const url = `/api/1.0/main/whoami.json`;
|
||||
makeFetch('GET', url)
|
||||
.then(user => {
|
||||
// this.value = user
|
||||
this.updateReferrer(user);
|
||||
})
|
||||
makeFetch("GET", url).then((user) => {
|
||||
// this.value = user
|
||||
this.updateReferrer(user);
|
||||
});
|
||||
},
|
||||
toggleModal() {
|
||||
this.modal.showModal = !this.modal.showModal;
|
||||
},
|
||||
confirmReferrer() {
|
||||
this.$store.dispatch('updateReferrer', this.value)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
this.toggleModal()
|
||||
this.$store
|
||||
.dispatch("updateReferrer", this.value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
this.toggleModal();
|
||||
},
|
||||
removeReferrer() {
|
||||
console.log('remove option')
|
||||
this.$store.dispatch('updateReferrer', null)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
console.log("remove option");
|
||||
this.$store
|
||||
.dispatch("updateReferrer", null)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
cancelChange() {
|
||||
this.value = this.$store.state.accompanyingCourse.user
|
||||
this.toggleModal()
|
||||
}
|
||||
}
|
||||
}
|
||||
this.value = this.$store.state.accompanyingCourse.user;
|
||||
this.toggleModal();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
||||
|
@@ -1,18 +1,11 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-50" />{{ $t('requestor.title') }}</h2>
|
||||
<h2><a id="section-50" />{{ $t("requestor.title") }}</h2>
|
||||
|
||||
<div
|
||||
v-if="accompanyingCourse.requestor && isAnonymous"
|
||||
class="flex-table"
|
||||
>
|
||||
<div v-if="accompanyingCourse.requestor && isAnonymous" class="flex-table">
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
v-model="requestorIsAnonymous"
|
||||
class="me-2"
|
||||
>
|
||||
{{ $t('requestor.is_anonymous') }}
|
||||
<input type="checkbox" v-model="requestorIsAnonymous" class="me-2" />
|
||||
{{ $t("requestor.is_anonymous") }}
|
||||
</label>
|
||||
<confidential v-if="accompanyingCourse.requestor.type === 'thirdparty'">
|
||||
<template #confidential-content>
|
||||
@@ -25,7 +18,7 @@
|
||||
addInfo: false,
|
||||
hLevel: 3,
|
||||
isMultiline: true,
|
||||
isConfidential: true
|
||||
isConfidential: true,
|
||||
}"
|
||||
>
|
||||
<template #record-actions>
|
||||
@@ -100,7 +93,7 @@
|
||||
:title="$t('action.remove')"
|
||||
@click="removeRequestor"
|
||||
>
|
||||
{{ $t('action.remove') }}
|
||||
{{ $t("action.remove") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -111,12 +104,8 @@
|
||||
class="flex-table"
|
||||
>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
v-model="requestorIsAnonymous"
|
||||
class="me-2"
|
||||
>
|
||||
{{ $t('requestor.is_anonymous') }}
|
||||
<input type="checkbox" v-model="requestorIsAnonymous" class="me-2" />
|
||||
{{ $t("requestor.is_anonymous") }}
|
||||
</label>
|
||||
|
||||
<third-party-render-box
|
||||
@@ -129,7 +118,7 @@
|
||||
addInfo: false,
|
||||
hLevel: 3,
|
||||
isMultiline: true,
|
||||
isConfidential: true
|
||||
isConfidential: true,
|
||||
}"
|
||||
>
|
||||
<template #record-actions>
|
||||
@@ -166,7 +155,7 @@
|
||||
addInfo: true,
|
||||
hLevel: 3,
|
||||
isMultiline: true,
|
||||
isConfidential: false
|
||||
isConfidential: false,
|
||||
}"
|
||||
>
|
||||
<template #record-actions>
|
||||
@@ -198,27 +187,30 @@
|
||||
:title="$t('action.remove')"
|
||||
@click="removeRequestor"
|
||||
>
|
||||
{{ $t('action.remove') }}
|
||||
{{ $t("action.remove") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<label class="chill-no-data-statement">{{ $t('requestor.counter') }}</label>
|
||||
<label class="chill-no-data-statement">{{
|
||||
$t("requestor.counter")
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div v-if="accompanyingCourse.requestor === null && suggestedEntities.length > 0">
|
||||
<div
|
||||
v-if="
|
||||
accompanyingCourse.requestor === null && suggestedEntities.length > 0
|
||||
"
|
||||
>
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li
|
||||
v-for="p in suggestedEntities"
|
||||
:key="uniqueId(p)"
|
||||
@click="addSuggestedEntity(p)"
|
||||
>
|
||||
<person-text
|
||||
v-if="p.type === 'person'"
|
||||
:person="p"
|
||||
/>
|
||||
<person-text v-if="p.type === 'person'" :person="p" />
|
||||
<span v-else>{{ p.text }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -245,183 +237,217 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
||||
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
|
||||
import PersonRenderBox from '../../_components/Entity/PersonRenderBox.vue';
|
||||
import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue';
|
||||
import Confidential from 'ChillMainAssets/vuejs/_components/Confidential.vue';
|
||||
import { mapState } from 'vuex';
|
||||
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
||||
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
||||
|
||||
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue";
|
||||
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue";
|
||||
import PersonRenderBox from "../../_components/Entity/PersonRenderBox.vue";
|
||||
import ThirdPartyRenderBox from "ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue";
|
||||
import Confidential from "ChillMainAssets/vuejs/_components/Confidential.vue";
|
||||
import { mapState } from "vuex";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import PersonText from "ChillPersonAssets/vuejs/_components/Entity/PersonText.vue";
|
||||
|
||||
export default {
|
||||
name: 'Requestor',
|
||||
components: {
|
||||
AddPersons,
|
||||
OnTheFly,
|
||||
PersonRenderBox,
|
||||
ThirdPartyRenderBox,
|
||||
Confidential,
|
||||
PersonText
|
||||
},
|
||||
props: ['isAnonymous'],
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: 'requestor',
|
||||
options: {
|
||||
type: ['person', 'thirdparty'],
|
||||
priority: null,
|
||||
uniq: true,
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
suggestedEntities: state => {
|
||||
return [
|
||||
...state.accompanyingCourse.participations.filter((p) => p.endDate === null).map((p) => p.person),
|
||||
...state.accompanyingCourse.resources.map(r => r.resource)
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
// filter for same entity appearing twice
|
||||
.filter((e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i+1) {
|
||||
if (i < index && e.id === suggested[i].id && e.type === suggested[i].type) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
}
|
||||
}),
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse
|
||||
name: "Requestor",
|
||||
components: {
|
||||
AddPersons,
|
||||
OnTheFly,
|
||||
PersonRenderBox,
|
||||
ThirdPartyRenderBox,
|
||||
Confidential,
|
||||
PersonText,
|
||||
},
|
||||
props: ["isAnonymous"],
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "requestor",
|
||||
options: {
|
||||
type: ["person", "thirdparty"],
|
||||
priority: null,
|
||||
uniq: true,
|
||||
},
|
||||
},
|
||||
requestorIsAnonymous: {
|
||||
set(value) {
|
||||
this.$store.dispatch('requestorIsAnonymous', value);
|
||||
},
|
||||
get() {
|
||||
return this.$store.state.accompanyingCourse.requestorAnonymous;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
removeRequestor() {
|
||||
//console.log('@@ CLICK remove requestor: item');
|
||||
this.$store.dispatch('removeRequestor')
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
//console.log('@@@ CLICK button addNewPersons', selected);
|
||||
this.$store.dispatch('addRequestor', selected.shift())
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
suggestedEntities: (state) => {
|
||||
return (
|
||||
[
|
||||
...state.accompanyingCourse.participations
|
||||
.filter((p) => p.endDate === null)
|
||||
.map((p) => p.person),
|
||||
...state.accompanyingCourse.resources.map((r) => r.resource),
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
// filter for same entity appearing twice
|
||||
.filter((e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i + 1) {
|
||||
if (
|
||||
i < index &&
|
||||
e.id === suggested[i].id &&
|
||||
e.type === suggested[i].type
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
saveFormOnTheFly(payload) {
|
||||
console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
|
||||
payload.target = 'requestor';
|
||||
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === 'person') {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) { body.birthdate = payload.data.birthdate; }
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = payload.data.gender;
|
||||
|
||||
makeFetch('PATCH', `/api/1.0/person/person/${payload.data.id}.json`, body)
|
||||
.then(response => {
|
||||
this.$store.dispatch('addPerson', { target: payload.target, body: response })
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === 'ValidationException') {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
}
|
||||
})
|
||||
}
|
||||
else if (payload.type === 'thirdparty') {
|
||||
body.name = payload.data.text;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.phonenumber;
|
||||
if (payload.data.address) {
|
||||
body.address = { id: payload.data.address.address_id };
|
||||
}
|
||||
|
||||
makeFetch('PATCH', `/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`, body)
|
||||
.then(response => {
|
||||
this.$store.dispatch('addThirdparty', { target: payload.target, body: response })
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === 'ValidationException') {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
addSuggestedEntity(e) {
|
||||
this.$store.dispatch('addRequestor', { result: e, type: e.type })
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
return true;
|
||||
})
|
||||
);
|
||||
},
|
||||
uniqueId(e) {
|
||||
return `${e.type}-${e.id}`;
|
||||
}),
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse;
|
||||
},
|
||||
requestorIsAnonymous: {
|
||||
set(value) {
|
||||
this.$store.dispatch("requestorIsAnonymous", value);
|
||||
},
|
||||
get() {
|
||||
return this.$store.state.accompanyingCourse.requestorAnonymous;
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
removeRequestor() {
|
||||
//console.log('@@ CLICK remove requestor: item');
|
||||
this.$store.dispatch("removeRequestor").catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
//console.log('@@@ CLICK button addNewPersons', selected);
|
||||
this.$store
|
||||
.dispatch("addRequestor", selected.shift())
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
saveFormOnTheFly(payload) {
|
||||
console.log(
|
||||
"saveFormOnTheFly: type",
|
||||
payload.type,
|
||||
", data",
|
||||
payload.data,
|
||||
);
|
||||
payload.target = "requestor";
|
||||
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === "person") {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) {
|
||||
body.birthdate = payload.data.birthdate;
|
||||
}
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = payload.data.gender;
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/person/person/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addPerson", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
} else if (payload.type === "thirdparty") {
|
||||
body.name = payload.data.text;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.phonenumber;
|
||||
if (payload.data.address) {
|
||||
body.address = { id: payload.data.address.address_id };
|
||||
}
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addThirdparty", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
addSuggestedEntity(e) {
|
||||
this.$store
|
||||
.dispatch("addRequestor", { result: e, type: e.type })
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
uniqueId(e) {
|
||||
return `${e.type}-${e.id}`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
div.flex-table {
|
||||
margin: 1em 0 0 !important;
|
||||
& > label,
|
||||
& > ul.record_actions {
|
||||
margin: 1em 3em 0 !important;
|
||||
}
|
||||
div.item-bloc {
|
||||
background-color: white !important;
|
||||
margin-top: 1em;
|
||||
}
|
||||
margin: 1em 0 0 !important;
|
||||
& > label,
|
||||
& > ul.record_actions {
|
||||
margin: 1em 3em 0 !important;
|
||||
}
|
||||
div.item-bloc {
|
||||
background-color: white !important;
|
||||
margin-top: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.confidential {
|
||||
display: block;
|
||||
margin-right: 0px !important;
|
||||
display: block;
|
||||
margin-right: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,12 +1,16 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-90" />{{ $t('resources.title') }}</h2>
|
||||
<h2><a id="section-90" />{{ $t("resources.title") }}</h2>
|
||||
|
||||
<div v-if="resources.length > 0">
|
||||
<label class="col-form-label">{{ $tc('resources.counter', counter) }}</label>
|
||||
<label class="col-form-label">{{
|
||||
$tc("resources.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
<div v-else>
|
||||
<label class="chill-no-data-statement">{{ $tc('resources.counter', counter) }}</label>
|
||||
<label class="chill-no-data-statement">{{
|
||||
$tc("resources.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="flex-table mb-3">
|
||||
@@ -25,10 +29,7 @@
|
||||
:key="uniqueId(p)"
|
||||
@click="addSuggestedEntity(p)"
|
||||
>
|
||||
<person-text
|
||||
v-if="p.type === 'person'"
|
||||
:person="p"
|
||||
/>
|
||||
<person-text v-if="p.type === 'person'" :person="p" />
|
||||
<span v-else>{{ p.text }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -54,115 +55,123 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
||||
import ResourceItem from './Resources/ResourceItem.vue';
|
||||
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
||||
|
||||
import { mapState } from "vuex";
|
||||
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue";
|
||||
import ResourceItem from "./Resources/ResourceItem.vue";
|
||||
import PersonText from "ChillPersonAssets/vuejs/_components/Entity/PersonText.vue";
|
||||
|
||||
export default {
|
||||
name: 'Resources',
|
||||
components: {
|
||||
AddPersons,
|
||||
ResourceItem,
|
||||
PersonText
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: 'resources',
|
||||
options: {
|
||||
type: ['person', 'thirdparty'],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
name: "Resources",
|
||||
components: {
|
||||
AddPersons,
|
||||
ResourceItem,
|
||||
PersonText,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "resources",
|
||||
options: {
|
||||
type: ["person", "thirdparty"],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: mapState({
|
||||
resources: (state) => state.accompanyingCourse.resources,
|
||||
counter: (state) => state.accompanyingCourse.resources.length,
|
||||
suggestedEntities: (state) =>
|
||||
[
|
||||
state.accompanyingCourse.requestor,
|
||||
...state.accompanyingCourse.participations
|
||||
.filter((p) => p.endDate === null)
|
||||
.map((p) => p.person),
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
.filter((e) => {
|
||||
if (e.type === "person") {
|
||||
return !state.accompanyingCourse.resources
|
||||
.filter((r) => r.resource.type === "person")
|
||||
.map((r) => r.resource.id)
|
||||
.includes(e.id);
|
||||
}
|
||||
if (e.type === "thirdparty") {
|
||||
return !state.accompanyingCourse.resources
|
||||
.filter((r) => r.resource.type === "thirdparty")
|
||||
.map((r) => r.resource.id)
|
||||
.includes(e.id);
|
||||
}
|
||||
})
|
||||
// filter persons appearing twice in requestor and resources
|
||||
.filter((e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i + 1) {
|
||||
if (i < index && e.id === suggested[i].id) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: mapState({
|
||||
resources: state => state.accompanyingCourse.resources,
|
||||
counter: state => state.accompanyingCourse.resources.length,
|
||||
suggestedEntities: state => [
|
||||
state.accompanyingCourse.requestor,
|
||||
...state.accompanyingCourse.participations.filter((p) => p.endDate === null).map((p) => p.person),
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
.filter(
|
||||
(e) => {
|
||||
if (e.type === 'person') {
|
||||
return !state.accompanyingCourse.resources
|
||||
.filter((r) => r.resource.type === 'person')
|
||||
.map((r) => r.resource.id).includes(e.id)
|
||||
}
|
||||
if (e.type === 'thirdparty') {
|
||||
return !state.accompanyingCourse.resources
|
||||
.filter((r) => r.resource.type === 'thirdparty')
|
||||
.map((r) => r.resource.id).includes(e.id)
|
||||
}
|
||||
}
|
||||
)
|
||||
// filter persons appearing twice in requestor and resources
|
||||
.filter(
|
||||
(e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i+1) {
|
||||
if (i < index && e.id === suggested[i].id) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}),
|
||||
}),
|
||||
methods: {
|
||||
removeResource(item) {
|
||||
//console.log('@@ CLICK remove resource: item', item);
|
||||
this.$store
|
||||
.dispatch("removeResource", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
//console.log('@@@ CLICK button addNewPersons', selected);
|
||||
selected.forEach(function (item) {
|
||||
this.$store
|
||||
.dispatch("addResource", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: violations });
|
||||
}
|
||||
)
|
||||
}),
|
||||
methods: {
|
||||
removeResource(item) {
|
||||
//console.log('@@ CLICK remove resource: item', item);
|
||||
this.$store.dispatch('removeResource', item)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
//console.log('@@@ CLICK button addNewPersons', selected);
|
||||
selected.forEach(function(item) {
|
||||
this.$store.dispatch('addResource', item)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: violations})
|
||||
}
|
||||
});
|
||||
}, this
|
||||
);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
addSuggestedEntity(e) {
|
||||
this.$store.dispatch('addResource', { result: e, type: e.type})
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
})
|
||||
},
|
||||
uniqueId(e) {
|
||||
return `${e.type}-${e.id}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}, this);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
addSuggestedEntity(e) {
|
||||
this.$store
|
||||
.dispatch("addResource", { result: e, type: e.type })
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
uniqueId(e) {
|
||||
return `${e.type}-${e.id}`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
div.flex-bloc {
|
||||
div.item-bloc {
|
||||
flex-basis: 50%;
|
||||
}
|
||||
div.item-bloc {
|
||||
flex-basis: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -4,14 +4,14 @@
|
||||
v-if="resource.resource.type === 'person'"
|
||||
:person="resource.resource"
|
||||
:options="{
|
||||
addInfo : true,
|
||||
addId : false,
|
||||
addInfo: true,
|
||||
addId: false,
|
||||
addEntity: true,
|
||||
addLink: false,
|
||||
addAltNames: true,
|
||||
addAge : false,
|
||||
hLevel : 3,
|
||||
isConfidential : true
|
||||
addAge: false,
|
||||
hLevel: 3,
|
||||
isConfidential: true,
|
||||
}"
|
||||
>
|
||||
<template #end-bloc>
|
||||
@@ -57,11 +57,11 @@
|
||||
v-if="resource.resource.type === 'thirdparty'"
|
||||
:thirdparty="resource.resource"
|
||||
:options="{
|
||||
addLink : false,
|
||||
addId : false,
|
||||
addLink: false,
|
||||
addId: false,
|
||||
addEntity: true,
|
||||
addInfo: false,
|
||||
hLevel: 3
|
||||
hLevel: 3,
|
||||
}"
|
||||
>
|
||||
<template #end-bloc>
|
||||
@@ -105,108 +105,136 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
|
||||
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
|
||||
import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue';
|
||||
import WriteComment from './WriteComment';
|
||||
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
||||
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue";
|
||||
import PersonRenderBox from "ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue";
|
||||
import ThirdPartyRenderBox from "ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue";
|
||||
import WriteComment from "./WriteComment";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
|
||||
export default {
|
||||
name: 'ResourceItem',
|
||||
components: {
|
||||
OnTheFly,
|
||||
PersonRenderBox,
|
||||
ThirdPartyRenderBox,
|
||||
WriteComment
|
||||
},
|
||||
props: ['resource'],
|
||||
emits: ['remove'],
|
||||
computed: {
|
||||
parent() {
|
||||
return {
|
||||
'type': this.resource.type,
|
||||
'id': this.resource.id,
|
||||
'comment': this.resource.comment,
|
||||
'parent': {
|
||||
'type': this.$store.state.accompanyingCourse.type,
|
||||
'id': this.$store.state.accompanyingCourse.id
|
||||
}
|
||||
}
|
||||
},
|
||||
hasCurrentHouseholdAddress() {
|
||||
if ( this.resource.resource.current_household_address !== null ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
name: "ResourceItem",
|
||||
components: {
|
||||
OnTheFly,
|
||||
PersonRenderBox,
|
||||
ThirdPartyRenderBox,
|
||||
WriteComment,
|
||||
},
|
||||
props: ["resource"],
|
||||
emits: ["remove"],
|
||||
computed: {
|
||||
parent() {
|
||||
return {
|
||||
type: this.resource.type,
|
||||
id: this.resource.id,
|
||||
comment: this.resource.comment,
|
||||
parent: {
|
||||
type: this.$store.state.accompanyingCourse.type,
|
||||
id: this.$store.state.accompanyingCourse.id,
|
||||
},
|
||||
};
|
||||
},
|
||||
hasCurrentHouseholdAddress() {
|
||||
if (this.resource.resource.current_household_address !== null) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
saveFormOnTheFly(payload) {
|
||||
// console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
|
||||
payload.target = 'resource';
|
||||
return false;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
saveFormOnTheFly(payload) {
|
||||
// console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
|
||||
payload.target = "resource";
|
||||
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === 'person') {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) { body.birthdate = payload.data.birthdate; }
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = {id: payload.data.gender.id, type: payload.data.gender.type };
|
||||
if (payload.data.civility !== null) { body.civility = {id: payload.data.civility.id, type: payload.data.civility.type}; }
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === "person") {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) {
|
||||
body.birthdate = payload.data.birthdate;
|
||||
}
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = {
|
||||
id: payload.data.gender.id,
|
||||
type: payload.data.gender.type,
|
||||
};
|
||||
if (payload.data.civility !== null) {
|
||||
body.civility = {
|
||||
id: payload.data.civility.id,
|
||||
type: payload.data.civility.type,
|
||||
};
|
||||
}
|
||||
|
||||
makeFetch('PATCH', `/api/1.0/person/person/${payload.data.id}.json`, body)
|
||||
.then(response => {
|
||||
this.$store.dispatch('addPerson', { target: payload.target, body: response })
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === 'ValidationException') {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
}
|
||||
})
|
||||
}
|
||||
else if (payload.type === 'thirdparty') {
|
||||
// console.log('data', payload.data)
|
||||
body.firstname = payload.data.firstname;
|
||||
body.name = payload.data.name;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.address = payload.data.address ? { id: payload.data.address.address_id } : null;
|
||||
if (null !== payload.data.civility) {
|
||||
body.civility = {type: 'chill_main_civility', id: payload.data.civility.id};
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/person/person/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addPerson", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
if (null !== payload.data.profession) {
|
||||
body.profession = payload.data.profession;
|
||||
}
|
||||
// console.log('body', body);
|
||||
});
|
||||
} else if (payload.type === "thirdparty") {
|
||||
// console.log('data', payload.data)
|
||||
body.firstname = payload.data.firstname;
|
||||
body.name = payload.data.name;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.address = payload.data.address
|
||||
? { id: payload.data.address.address_id }
|
||||
: null;
|
||||
if (null !== payload.data.civility) {
|
||||
body.civility = {
|
||||
type: "chill_main_civility",
|
||||
id: payload.data.civility.id,
|
||||
};
|
||||
}
|
||||
if (null !== payload.data.profession) {
|
||||
body.profession = payload.data.profession;
|
||||
}
|
||||
// console.log('body', body);
|
||||
|
||||
makeFetch('PATCH', `/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`, body)
|
||||
.then(response => {
|
||||
this.$store.dispatch('addThirdparty', { target: payload.target, body: response })
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === 'ValidationException') {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
updateComment(resource) {
|
||||
console.log('updateComment', resource);
|
||||
this.$store.commit('updateResource', resource);
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addThirdparty", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
updateComment(resource) {
|
||||
console.log("updateComment", resource);
|
||||
this.$store.commit("updateResource", resource);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
class="btn btn-sm btn-misc change-icon"
|
||||
:title="$t('write_comment')"
|
||||
@click="openModal"
|
||||
><i class="fa fa-pencil-square-o" />
|
||||
><i class="fa fa-pencil-square-o" />
|
||||
</a>
|
||||
|
||||
<teleport to="body">
|
||||
@@ -14,7 +14,7 @@
|
||||
>
|
||||
<template #header>
|
||||
<h3 class="modal-title">
|
||||
{{ $t('write_comment_about', { 'r': resource.resource.text }) }}
|
||||
{{ $t("write_comment_about", { r: resource.resource.text }) }}
|
||||
</h3>
|
||||
</template>
|
||||
<template #body>
|
||||
@@ -27,11 +27,8 @@
|
||||
/>
|
||||
</template>
|
||||
<template #footer>
|
||||
<a
|
||||
class="btn btn-save"
|
||||
@click="saveAction"
|
||||
>
|
||||
{{ $t('action.save') }}
|
||||
<a class="btn btn-save" @click="saveAction">
|
||||
{{ $t("action.save") }}
|
||||
</a>
|
||||
</template>
|
||||
</modal>
|
||||
@@ -39,79 +36,76 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue';
|
||||
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import CKEditor from '@ckeditor/ckeditor5-vue';
|
||||
import CKEditor from "@ckeditor/ckeditor5-vue";
|
||||
import ClassicEditor from "ChillMainAssets/module/ckeditor5/editor_config";
|
||||
|
||||
export default {
|
||||
name: "WriteComment",
|
||||
components: {
|
||||
Modal,
|
||||
ckeditor: CKEditor.component,
|
||||
},
|
||||
props: ['resource'],
|
||||
emits: ['updateComment'],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-scrollable modal-xl"
|
||||
},
|
||||
editor: ClassicEditor,
|
||||
formdata: {
|
||||
content: this.resource.comment
|
||||
}
|
||||
}
|
||||
},
|
||||
i18n: {
|
||||
messages: {
|
||||
fr: {
|
||||
write_comment: "Écrire un commentaire",
|
||||
write_comment_about: "Écrire un commentaire à propos de {r}",
|
||||
comment_placeholder: "Commencez à écrire..."
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
content: {
|
||||
set(value) {
|
||||
this.formdata.content = value;
|
||||
},
|
||||
get() {
|
||||
return this.formdata.content;
|
||||
}
|
||||
name: "WriteComment",
|
||||
components: {
|
||||
Modal,
|
||||
ckeditor: CKEditor.component,
|
||||
},
|
||||
props: ["resource"],
|
||||
emits: ["updateComment"],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-scrollable modal-xl",
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
openModal() {
|
||||
//console.log('write comment for', this.resource.resource.type, this.resource.resource.id);
|
||||
this.modal.showModal = true;
|
||||
editor: ClassicEditor,
|
||||
formdata: {
|
||||
content: this.resource.comment,
|
||||
},
|
||||
saveAction() {
|
||||
//console.log('save comment', this.resource.id, this.formdata.content);
|
||||
this.patchResource(this.resource.id, this.formdata.content);
|
||||
};
|
||||
},
|
||||
i18n: {
|
||||
messages: {
|
||||
fr: {
|
||||
write_comment: "Écrire un commentaire",
|
||||
write_comment_about: "Écrire un commentaire à propos de {r}",
|
||||
comment_placeholder: "Commencez à écrire...",
|
||||
},
|
||||
patchResource(id, comment) {
|
||||
let url = `/api/1.0/person/accompanying-period/resource/${id}.json`,
|
||||
body = {
|
||||
"type": "accompanying_period_resource",
|
||||
"comment": comment
|
||||
}
|
||||
;
|
||||
makeFetch('PATCH', url, body)
|
||||
.then(r => {
|
||||
let resource = {
|
||||
'type': 'accompanying_period_resource',
|
||||
'id': r.id,
|
||||
'comment': r.comment,
|
||||
'resource': r.resource
|
||||
}
|
||||
this.$emit('updateComment', resource);
|
||||
this.modal.showModal = false;
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
content: {
|
||||
set(value) {
|
||||
this.formdata.content = value;
|
||||
},
|
||||
get() {
|
||||
return this.formdata.content;
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
openModal() {
|
||||
//console.log('write comment for', this.resource.resource.type, this.resource.resource.id);
|
||||
this.modal.showModal = true;
|
||||
},
|
||||
saveAction() {
|
||||
//console.log('save comment', this.resource.id, this.formdata.content);
|
||||
this.patchResource(this.resource.id, this.formdata.content);
|
||||
},
|
||||
patchResource(id, comment) {
|
||||
let url = `/api/1.0/person/accompanying-period/resource/${id}.json`,
|
||||
body = {
|
||||
type: "accompanying_period_resource",
|
||||
comment: comment,
|
||||
};
|
||||
makeFetch("PATCH", url, body).then((r) => {
|
||||
let resource = {
|
||||
type: "accompanying_period_resource",
|
||||
id: r.id,
|
||||
comment: r.comment,
|
||||
resource: r.resource,
|
||||
};
|
||||
this.$emit("updateComment", resource);
|
||||
this.modal.showModal = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,72 +1,58 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-70" />{{ $t('scopes.title') }}</h2>
|
||||
<h2><a id="section-70" />{{ $t("scopes.title") }}</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<div
|
||||
class="form-check"
|
||||
v-for="s in scopes"
|
||||
:key="s.id"
|
||||
>
|
||||
<div class="form-check" v-for="s in scopes" :key="s.id">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
v-model="checkedScopes"
|
||||
:value="s"
|
||||
>
|
||||
/>
|
||||
<label class="form-check-label">
|
||||
{{ s.name.fr }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!isScopeValid"
|
||||
class="alert alert-warning to-confirm"
|
||||
>
|
||||
{{ $t('scopes.add_at_least_one') }}
|
||||
<div v-if="!isScopeValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("scopes.add_at_least_one") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "Scopes",
|
||||
computed: {
|
||||
...mapState([
|
||||
'scopes',
|
||||
'scopesAtStart'
|
||||
]),
|
||||
...mapGetters([
|
||||
'isScopeValid'
|
||||
]),
|
||||
...mapState(["scopes", "scopesAtStart"]),
|
||||
...mapGetters(["isScopeValid"]),
|
||||
checkedScopes: {
|
||||
get: function() {
|
||||
get: function () {
|
||||
return this.$store.state.accompanyingCourse.scopes;
|
||||
},
|
||||
set: function(v) {
|
||||
this.$store.dispatch('setScopes', v)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
set: function (v) {
|
||||
this.$store.dispatch("setScopes", v).catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
restore() {
|
||||
console.log('restore');
|
||||
}
|
||||
console.log("restore");
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-60" />{{ $t('social_issue.title') }}</h2>
|
||||
<h2><a id="section-60" />{{ $t("social_issue.title") }}</h2>
|
||||
|
||||
<div class="my-4">
|
||||
<!--label for="field">{{ $t('social_issue.label') }}</label
|
||||
@@ -21,100 +21,95 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!isSocialIssueValid"
|
||||
class="alert alert-warning to-confirm"
|
||||
>
|
||||
{{ $t('social_issue.not_valid') }}
|
||||
<div v-if="!isSocialIssueValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("social_issue.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueMultiselect from 'vue-multiselect';
|
||||
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
||||
import {mapGetters, mapState} from 'vuex';
|
||||
import VueMultiselect from "vue-multiselect";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { mapGetters, mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "SocialIssue",
|
||||
components: { VueMultiselect },
|
||||
data() {
|
||||
return {
|
||||
options: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
value: state => state.accompanyingCourse.socialIssues,
|
||||
}),
|
||||
...mapGetters([
|
||||
'isSocialIssueValid'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
const url = `/api/1.0/person/social-work/social-issue.json`;
|
||||
makeFetch('GET', url)
|
||||
.then(response => {
|
||||
this.options = response.results;
|
||||
return response;
|
||||
})
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
this.$toast.open({message: error.txt})
|
||||
})
|
||||
},
|
||||
updateSocialIssues(value) {
|
||||
this.$store.dispatch('updateSocialIssues', this.transformValue(value))
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
});
|
||||
},
|
||||
transformValue(updated) {
|
||||
let stored = this.value;
|
||||
let added = updated.filter(x => stored.indexOf(x) === -1).shift();
|
||||
let removed = stored.filter(x => updated.indexOf(x) === -1).shift();
|
||||
let method = (typeof removed === 'undefined') ? 'POST' : 'DELETE';
|
||||
let changed = (typeof removed === 'undefined') ? added : removed;
|
||||
let body = { type: "social_issue", id: changed.id };
|
||||
let payload = updated;
|
||||
return { payload, body, method };
|
||||
}
|
||||
}
|
||||
}
|
||||
name: "SocialIssue",
|
||||
components: { VueMultiselect },
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
value: (state) => state.accompanyingCourse.socialIssues,
|
||||
}),
|
||||
...mapGetters(["isSocialIssueValid"]),
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
const url = `/api/1.0/person/social-work/social-issue.json`;
|
||||
makeFetch("GET", url)
|
||||
.then((response) => {
|
||||
this.options = response.results;
|
||||
return response;
|
||||
})
|
||||
.catch((error) => {
|
||||
commit("catchError", error);
|
||||
this.$toast.open({ message: error.txt });
|
||||
});
|
||||
},
|
||||
updateSocialIssues(value) {
|
||||
this.$store
|
||||
.dispatch("updateSocialIssues", this.transformValue(value))
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
transformValue(updated) {
|
||||
let stored = this.value;
|
||||
let added = updated.filter((x) => stored.indexOf(x) === -1).shift();
|
||||
let removed = stored.filter((x) => updated.indexOf(x) === -1).shift();
|
||||
let method = typeof removed === "undefined" ? "POST" : "DELETE";
|
||||
let changed = typeof removed === "undefined" ? added : removed;
|
||||
let body = { type: "social_issue", id: changed.id };
|
||||
let payload = updated;
|
||||
return { payload, body, method };
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
||||
|
||||
<style lang="scss">
|
||||
@import 'ChillMainAssets/module/bootstrap/shared';
|
||||
@import 'ChillPersonAssets/chill/scss/mixins';
|
||||
@import 'ChillMainAssets/chill/scss/chill_variables';
|
||||
@import "ChillMainAssets/module/bootstrap/shared";
|
||||
@import "ChillPersonAssets/chill/scss/mixins";
|
||||
@import "ChillMainAssets/chill/scss/chill_variables";
|
||||
div#accompanying-course {
|
||||
span.multiselect__tag {
|
||||
@include badge_social($social-issue-color);
|
||||
background: $chill-l-gray;
|
||||
color: $dark;
|
||||
}
|
||||
span.multiselect__option--highlight {
|
||||
span.multiselect__tag {
|
||||
@include badge_social($social-issue-color);
|
||||
background: $chill-l-gray;
|
||||
color: $dark;
|
||||
}
|
||||
span.multiselect__option--highlight {
|
||||
&::after {
|
||||
background: $green;
|
||||
}
|
||||
&.multiselect__option--selected {
|
||||
&::after {
|
||||
background: $green;
|
||||
background: $red;
|
||||
}
|
||||
&.multiselect__option--selected {
|
||||
&::after {
|
||||
background: $red;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<div class="vue-component">
|
||||
<h2>
|
||||
<a id="section-110" />
|
||||
{{ $t('startdate.change') }}
|
||||
{{ $t("startdate.change") }}
|
||||
</h2>
|
||||
<div>
|
||||
<div class="mb-3 row">
|
||||
@@ -12,7 +12,7 @@
|
||||
type="date"
|
||||
id="startDate"
|
||||
v-model="startDateInput"
|
||||
>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -20,55 +20,60 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { dateToISO, ISOToDatetime} from 'ChillMainAssets/chill/js/date';
|
||||
import { mapState } from 'vuex';
|
||||
import { dateToISO, ISOToDatetime } from "ChillMainAssets/chill/js/date";
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: 'StartDate',
|
||||
data() {
|
||||
return {
|
||||
lastRecordedDate: null
|
||||
}
|
||||
name: "StartDate",
|
||||
data() {
|
||||
return {
|
||||
lastRecordedDate: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
startDate: (state) =>
|
||||
dateToISO(ISOToDatetime(state.accompanyingCourse.openingDate.datetime)),
|
||||
}),
|
||||
startDateInput: {
|
||||
get() {
|
||||
return this.startDate;
|
||||
},
|
||||
set(value) {
|
||||
this.lastRecordedDate = value;
|
||||
|
||||
setTimeout(() => {
|
||||
console.log("timeout finished");
|
||||
if (this.lastRecordedDate === value) {
|
||||
console.log("last recorded", this.lastRecordedDate, "value", value);
|
||||
this.$store
|
||||
.dispatch("updateStartDate", value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 3000);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
startDate: state => dateToISO(ISOToDatetime(state.accompanyingCourse.openingDate.datetime))
|
||||
}),
|
||||
startDateInput: {
|
||||
get() {
|
||||
return this.startDate;
|
||||
},
|
||||
set(value) {
|
||||
this.lastRecordedDate = value;
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('timeout finished')
|
||||
if (this.lastRecordedDate === value) {
|
||||
console.log('last recorded', this.lastRecordedDate, 'value', value)
|
||||
this.$store.dispatch('updateStartDate', value)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'})
|
||||
}
|
||||
})
|
||||
}
|
||||
}, 3000)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.date-update {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
&-btn {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
&-btn {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -2,198 +2,194 @@
|
||||
<teleport to="#content">
|
||||
<div id="navmap">
|
||||
<nav>
|
||||
<a
|
||||
class="top"
|
||||
href="#top"
|
||||
>
|
||||
<a class="top" href="#top">
|
||||
<i class="fa fa-fw fa-square" />
|
||||
<span>{{ $t('nav.top') }}</span>
|
||||
<span>{{ $t("nav.top") }}</span>
|
||||
</a>
|
||||
<item
|
||||
v-for="item of items"
|
||||
:key="item.key"
|
||||
:item="item"
|
||||
:step="step"
|
||||
/>
|
||||
<item v-for="item of items" :key="item.key" :item="item" :step="step" />
|
||||
</nav>
|
||||
</div>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Item from './StickyNav/Item.vue';
|
||||
import Item from "./StickyNav/Item.vue";
|
||||
|
||||
export default {
|
||||
name: "StickyNav",
|
||||
components: {
|
||||
Item
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
header: document.querySelector("header nav.navbar"),
|
||||
bannerName: document.querySelector("#header-accompanying_course-name"),
|
||||
bannerDetails: document.querySelector("#header-accompanying_course-details"),
|
||||
container: null,
|
||||
heightSum: null,
|
||||
stickyNav: null,
|
||||
limit: 25,
|
||||
anchors: null,
|
||||
items: [],
|
||||
name: "StickyNav",
|
||||
components: {
|
||||
Item,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
header: document.querySelector("header nav.navbar"),
|
||||
bannerName: document.querySelector("#header-accompanying_course-name"),
|
||||
bannerDetails: document.querySelector(
|
||||
"#header-accompanying_course-details",
|
||||
),
|
||||
container: null,
|
||||
heightSum: null,
|
||||
stickyNav: null,
|
||||
limit: 25,
|
||||
anchors: null,
|
||||
items: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse;
|
||||
},
|
||||
step() {
|
||||
return this.accompanyingCourse.step;
|
||||
},
|
||||
top() {
|
||||
return parseInt(
|
||||
window
|
||||
.getComputedStyle(this.stickyNav)
|
||||
.getPropertyValue("top")
|
||||
.slice(0, -2),
|
||||
);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.ready();
|
||||
window.addEventListener("scroll", this.handleScroll);
|
||||
},
|
||||
unmounted() {
|
||||
window.removeEventListener("scroll", this.handleScroll);
|
||||
},
|
||||
methods: {
|
||||
ready() {
|
||||
// load datas DOM when mounted ready
|
||||
this.container = document.querySelector("#content");
|
||||
this.stickyNav = document.querySelector("#navmap");
|
||||
this.anchors = document.querySelectorAll("h2 a[id^='section']");
|
||||
this.initItemsMap();
|
||||
|
||||
// TODO resizeObserver not supports IE !
|
||||
// Listen when elements change size, then recalculate heightSum and initItemsMap
|
||||
const resizeObserver = new ResizeObserver(() => {
|
||||
this.refreshPos();
|
||||
});
|
||||
|
||||
resizeObserver.observe(this.header);
|
||||
resizeObserver.observe(this.bannerName);
|
||||
resizeObserver.observe(this.bannerDetails);
|
||||
resizeObserver.observe(this.container);
|
||||
},
|
||||
initItemsMap() {
|
||||
this.anchors.forEach((anchor) => {
|
||||
this.items.push({
|
||||
pos: null,
|
||||
active: false,
|
||||
key: parseInt(anchor.id.slice(8).slice(0, -1)),
|
||||
id: "#" + anchor.id,
|
||||
});
|
||||
});
|
||||
},
|
||||
refreshPos() {
|
||||
//console.log('refreshPos');
|
||||
this.heightSum =
|
||||
this.header.offsetHeight +
|
||||
this.bannerName.offsetHeight +
|
||||
this.bannerDetails.offsetHeight;
|
||||
|
||||
this.anchors.forEach((anchor, i) => {
|
||||
this.items[i].pos = this.findPos(anchor)["y"];
|
||||
});
|
||||
},
|
||||
findPos(element) {
|
||||
let posX = 0,
|
||||
posY = 0;
|
||||
do {
|
||||
posX += element.offsetLeft;
|
||||
posY += element.offsetTop;
|
||||
element = element.offsetParent;
|
||||
} while (element != null);
|
||||
|
||||
let pos = [];
|
||||
pos["x"] = posX;
|
||||
pos["y"] = posY;
|
||||
|
||||
return pos;
|
||||
},
|
||||
handleScroll(event) {
|
||||
let pos = this.findPos(this.stickyNav);
|
||||
let top = this.heightSum + this.top - window.scrollY;
|
||||
//console.log(window.scrollY);
|
||||
|
||||
if (top > this.limit) {
|
||||
this.stickyNav.style.position = "absolute";
|
||||
this.stickyNav.style.left = "10px";
|
||||
} else {
|
||||
this.stickyNav.style.position = "fixed";
|
||||
this.stickyNav.style.left = pos["x"] + "px";
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse;
|
||||
},
|
||||
step() {
|
||||
return this.accompanyingCourse.step;
|
||||
},
|
||||
top() {
|
||||
return parseInt(window.getComputedStyle(this.stickyNav).getPropertyValue('top').slice(0, -2));
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.ready();
|
||||
window.addEventListener('scroll', this.handleScroll);
|
||||
},
|
||||
unmounted() {
|
||||
window.removeEventListener('scroll', this.handleScroll);
|
||||
},
|
||||
methods: {
|
||||
ready() {
|
||||
|
||||
// load datas DOM when mounted ready
|
||||
this.container = document.querySelector("#content");
|
||||
this.stickyNav = document.querySelector('#navmap');
|
||||
this.anchors = document.querySelectorAll("h2 a[id^='section']");
|
||||
this.initItemsMap();
|
||||
this.switchActive();
|
||||
},
|
||||
switchActive() {
|
||||
this.items.forEach((item, i) => {
|
||||
let next = this.items[i + 1] ? this.items[i + 1].pos : "100000";
|
||||
item.active =
|
||||
(window.scrollY >= item.pos) & (window.scrollY < next) ? true : false;
|
||||
}, this);
|
||||
|
||||
// TODO resizeObserver not supports IE !
|
||||
// Listen when elements change size, then recalculate heightSum and initItemsMap
|
||||
const resizeObserver = new ResizeObserver(() => {
|
||||
this.refreshPos();
|
||||
});
|
||||
|
||||
resizeObserver.observe(this.header);
|
||||
resizeObserver.observe(this.bannerName);
|
||||
resizeObserver.observe(this.bannerDetails);
|
||||
resizeObserver.observe(this.container);
|
||||
},
|
||||
initItemsMap() {
|
||||
|
||||
this.anchors.forEach(anchor => {
|
||||
this.items.push({
|
||||
pos: null,
|
||||
active: false,
|
||||
key: parseInt(anchor.id.slice(8).slice(0, -1)),
|
||||
id: '#' + anchor.id
|
||||
})
|
||||
});
|
||||
},
|
||||
refreshPos() {
|
||||
|
||||
//console.log('refreshPos');
|
||||
this.heightSum = this.header.offsetHeight + this.bannerName.offsetHeight + this.bannerDetails.offsetHeight;
|
||||
|
||||
this.anchors.forEach((anchor, i) => {
|
||||
this.items[i].pos = this.findPos(anchor)['y'];
|
||||
});
|
||||
},
|
||||
findPos(element) {
|
||||
|
||||
let posX = 0, posY = 0;
|
||||
do {
|
||||
posX += element.offsetLeft;
|
||||
posY += element.offsetTop;
|
||||
element = element.offsetParent;
|
||||
}
|
||||
while( element != null );
|
||||
|
||||
let pos = [];
|
||||
pos['x'] = posX;
|
||||
pos['y'] = posY;
|
||||
|
||||
return pos;
|
||||
},
|
||||
handleScroll(event) {
|
||||
|
||||
let pos = this.findPos(this.stickyNav);
|
||||
let top = this.heightSum + this.top - window.scrollY;
|
||||
//console.log(window.scrollY);
|
||||
|
||||
if (top > this.limit) {
|
||||
this.stickyNav.style.position = 'absolute';
|
||||
this.stickyNav.style.left = '10px';
|
||||
} else {
|
||||
this.stickyNav.style.position = 'fixed';
|
||||
this.stickyNav.style.left = pos['x'] + 'px';
|
||||
}
|
||||
|
||||
this.switchActive();
|
||||
},
|
||||
switchActive() {
|
||||
|
||||
this.items.forEach((item, i) => {
|
||||
let next = (this.items[i+1]) ? this.items[i+1].pos : '100000';
|
||||
item.active =
|
||||
(window.scrollY >= item.pos & window.scrollY < next) ? true : false;
|
||||
}, this);
|
||||
|
||||
// last item never switch active because scroll reach bottom of page
|
||||
if (document.body.scrollHeight == window.scrollY + window.innerHeight) {
|
||||
this.items[this.items.length-1].active = true;
|
||||
this.items[this.items.length-2].active = false;
|
||||
} else {
|
||||
this.items[this.items.length-1].active = false;
|
||||
}
|
||||
// last item never switch active because scroll reach bottom of page
|
||||
if (document.body.scrollHeight == window.scrollY + window.innerHeight) {
|
||||
this.items[this.items.length - 1].active = true;
|
||||
this.items[this.items.length - 2].active = false;
|
||||
} else {
|
||||
this.items[this.items.length - 1].active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
div#content {
|
||||
position: relative;
|
||||
position: relative;
|
||||
|
||||
div#navmap {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: 10px; //-10%;
|
||||
nav {
|
||||
font-size: small;
|
||||
a {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: -3px;
|
||||
color: #71859669;
|
||||
text-decoration: none;
|
||||
&.top {
|
||||
color: #718596;
|
||||
}
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
&:hover,
|
||||
&.active {
|
||||
span {
|
||||
display: inline;
|
||||
padding-left: 8px;
|
||||
}
|
||||
}
|
||||
&:hover {
|
||||
color: #718596b5;
|
||||
}
|
||||
&.active {
|
||||
color: #e2793d; //orange
|
||||
//color: #eec84a; //jaune
|
||||
}
|
||||
}
|
||||
div#navmap {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: 10px; //-10%;
|
||||
nav {
|
||||
font-size: small;
|
||||
a {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: -3px;
|
||||
color: #71859669;
|
||||
text-decoration: none;
|
||||
&.top {
|
||||
color: #718596;
|
||||
}
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
&:hover,
|
||||
&.active {
|
||||
span {
|
||||
display: inline;
|
||||
padding-left: 8px;
|
||||
}
|
||||
}
|
||||
&:hover {
|
||||
color: #718596b5;
|
||||
}
|
||||
&.active {
|
||||
color: #e2793d; //orange
|
||||
//color: #eec84a; //jaune
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 768px) {
|
||||
div#navmap {
|
||||
display: none;
|
||||
}
|
||||
div#navmap {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,17 +1,9 @@
|
||||
<template>
|
||||
<a
|
||||
v-if="item.key <= 8"
|
||||
:href="item.id"
|
||||
:class="{ 'active': isActive }"
|
||||
>
|
||||
<a v-if="item.key <= 8" :href="item.id" :class="{ active: isActive }">
|
||||
<i class="fa fa-fw fa-square" />
|
||||
<span>{{ item.key }}</span>
|
||||
</a>
|
||||
<a
|
||||
v-else-if="step === 'DRAFT'"
|
||||
:href="item.id"
|
||||
:class="{ 'active': isActive }"
|
||||
>
|
||||
<a v-else-if="step === 'DRAFT'" :href="item.id" :class="{ active: isActive }">
|
||||
<i class="fa fa-fw fa-square" />
|
||||
<span>{{ item.key }}</span>
|
||||
</a>
|
||||
@@ -19,12 +11,12 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Item",
|
||||
props: ['item', 'step'],
|
||||
computed: {
|
||||
isActive() {
|
||||
return this.item.active;
|
||||
}
|
||||
}
|
||||
}
|
||||
name: "Item",
|
||||
props: ["item", "step"],
|
||||
computed: {
|
||||
isActive() {
|
||||
return this.item.active;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,77 +1,118 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2>Tests</h2>
|
||||
|
||||
|
||||
<!-- Modal -->
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-create"
|
||||
@click="modal1.showModal = true"
|
||||
>
|
||||
{{ $t('action.show_modal') }}
|
||||
<button class="btn btn-create" @click="modal1.showModal = true">
|
||||
{{ $t("action.show_modal") }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-create"
|
||||
@click="modal2.showModal = true"
|
||||
>
|
||||
<button class="btn btn-create" @click="modal2.showModal = true">
|
||||
Ouvrir une seconde modale
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<teleport to="body">
|
||||
<modal
|
||||
v-if="modal1.showModal"
|
||||
:modal-dialog-class="modal1.modalDialogClass"
|
||||
@close="modal1.showModal = false"
|
||||
>
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
Le titre de ma modale
|
||||
</h2>
|
||||
<h2 class="modal-title">Le titre de ma modale</h2>
|
||||
</template>
|
||||
<template #body>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus luctus facilisis suscipit. Cras pulvinar, purus sagittis pulvinar porta, enim ex posuere lacus, in pulvinar lectus magna in odio. Nullam iaculis congue lorem ac suscipit. Proin ut rutrum augue. Ut vehicula risus nec hendrerit ullamcorper. Ut volutpat eu mi eget viverra. Morbi dictum placerat suscipit. </p>
|
||||
<p>Quisque non erat tincidunt, lacinia justo ut, pulvinar nisl. Nunc id enim ut sem pretium interdum consectetur eu quam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Etiam posuere erat eget augue finibus luctus. Maecenas auctor, tortor non luctus ultrices, neque neque porttitor ex, nec lacinia lorem ligula et elit. Sed tempor nulla vitae lorem sollicitudin dictum. Vestibulum nec arcu eget elit pulvinar pretium. Phasellus facilisis metus sed diam luctus, feugiat scelerisque velit dignissim.</p>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus luctus facilisis suscipit. Cras pulvinar, purus sagittis pulvinar porta, enim ex posuere lacus, in pulvinar lectus magna in odio. Nullam iaculis congue lorem ac suscipit. Proin ut rutrum augue. Ut vehicula risus nec hendrerit ullamcorper. Ut volutpat eu mi eget viverra. Morbi dictum placerat suscipit. </p>
|
||||
<p>Quisque non erat tincidunt, lacinia justo ut, pulvinar nisl. Nunc id enim ut sem pretium interdum consectetur eu quam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Etiam posuere erat eget augue finibus luctus. Maecenas auctor, tortor non luctus ultrices, neque neque porttitor ex, nec lacinia lorem ligula et elit. Sed tempor nulla vitae lorem sollicitudin dictum. Vestibulum nec arcu eget elit pulvinar pretium. Phasellus facilisis metus sed diam luctus, feugiat scelerisque velit dignissim.</p>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus luctus facilisis suscipit. Cras pulvinar, purus sagittis pulvinar porta, enim ex posuere lacus, in pulvinar lectus magna in odio. Nullam iaculis congue lorem ac suscipit. Proin ut rutrum augue. Ut vehicula risus nec hendrerit ullamcorper. Ut volutpat eu mi eget viverra. Morbi dictum placerat suscipit. </p>
|
||||
<p>Quisque non erat tincidunt, lacinia justo ut, pulvinar nisl. Nunc id enim ut sem pretium interdum consectetur eu quam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Etiam posuere erat eget augue finibus luctus. Maecenas auctor, tortor non luctus ultrices, neque neque porttitor ex, nec lacinia lorem ligula et elit. Sed tempor nulla vitae lorem sollicitudin dictum. Vestibulum nec arcu eget elit pulvinar pretium. Phasellus facilisis metus sed diam luctus, feugiat scelerisque velit dignissim.</p>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus
|
||||
luctus facilisis suscipit. Cras pulvinar, purus sagittis pulvinar
|
||||
porta, enim ex posuere lacus, in pulvinar lectus magna in odio.
|
||||
Nullam iaculis congue lorem ac suscipit. Proin ut rutrum augue. Ut
|
||||
vehicula risus nec hendrerit ullamcorper. Ut volutpat eu mi eget
|
||||
viverra. Morbi dictum placerat suscipit.
|
||||
</p>
|
||||
<p>
|
||||
Quisque non erat tincidunt, lacinia justo ut, pulvinar nisl. Nunc id
|
||||
enim ut sem pretium interdum consectetur eu quam. Vestibulum ante
|
||||
ipsum primis in faucibus orci luctus et ultrices posuere cubilia
|
||||
curae; Etiam posuere erat eget augue finibus luctus. Maecenas
|
||||
auctor, tortor non luctus ultrices, neque neque porttitor ex, nec
|
||||
lacinia lorem ligula et elit. Sed tempor nulla vitae lorem
|
||||
sollicitudin dictum. Vestibulum nec arcu eget elit pulvinar pretium.
|
||||
Phasellus facilisis metus sed diam luctus, feugiat scelerisque velit
|
||||
dignissim.
|
||||
</p>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus
|
||||
luctus facilisis suscipit. Cras pulvinar, purus sagittis pulvinar
|
||||
porta, enim ex posuere lacus, in pulvinar lectus magna in odio.
|
||||
Nullam iaculis congue lorem ac suscipit. Proin ut rutrum augue. Ut
|
||||
vehicula risus nec hendrerit ullamcorper. Ut volutpat eu mi eget
|
||||
viverra. Morbi dictum placerat suscipit.
|
||||
</p>
|
||||
<p>
|
||||
Quisque non erat tincidunt, lacinia justo ut, pulvinar nisl. Nunc id
|
||||
enim ut sem pretium interdum consectetur eu quam. Vestibulum ante
|
||||
ipsum primis in faucibus orci luctus et ultrices posuere cubilia
|
||||
curae; Etiam posuere erat eget augue finibus luctus. Maecenas
|
||||
auctor, tortor non luctus ultrices, neque neque porttitor ex, nec
|
||||
lacinia lorem ligula et elit. Sed tempor nulla vitae lorem
|
||||
sollicitudin dictum. Vestibulum nec arcu eget elit pulvinar pretium.
|
||||
Phasellus facilisis metus sed diam luctus, feugiat scelerisque velit
|
||||
dignissim.
|
||||
</p>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus
|
||||
luctus facilisis suscipit. Cras pulvinar, purus sagittis pulvinar
|
||||
porta, enim ex posuere lacus, in pulvinar lectus magna in odio.
|
||||
Nullam iaculis congue lorem ac suscipit. Proin ut rutrum augue. Ut
|
||||
vehicula risus nec hendrerit ullamcorper. Ut volutpat eu mi eget
|
||||
viverra. Morbi dictum placerat suscipit.
|
||||
</p>
|
||||
<p>
|
||||
Quisque non erat tincidunt, lacinia justo ut, pulvinar nisl. Nunc id
|
||||
enim ut sem pretium interdum consectetur eu quam. Vestibulum ante
|
||||
ipsum primis in faucibus orci luctus et ultrices posuere cubilia
|
||||
curae; Etiam posuere erat eget augue finibus luctus. Maecenas
|
||||
auctor, tortor non luctus ultrices, neque neque porttitor ex, nec
|
||||
lacinia lorem ligula et elit. Sed tempor nulla vitae lorem
|
||||
sollicitudin dictum. Vestibulum nec arcu eget elit pulvinar pretium.
|
||||
Phasellus facilisis metus sed diam luctus, feugiat scelerisque velit
|
||||
dignissim.
|
||||
</p>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button
|
||||
class="btn btn-create"
|
||||
@click="modal1.showModal = false; modal2.showModal = true"
|
||||
@click="
|
||||
modal1.showModal = false;
|
||||
modal2.showModal = true;
|
||||
"
|
||||
>
|
||||
{{ $t('action.next') }}
|
||||
{{ $t("action.next") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
|
||||
|
||||
<teleport to="body">
|
||||
<modal
|
||||
v-if="modal2.showModal"
|
||||
:modal-dialog-class="modal2.modalDialogClass"
|
||||
@close="modal2.showModal = false"
|
||||
>
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
Une autre modale
|
||||
</h2>
|
||||
<h2 class="modal-title">Une autre modale</h2>
|
||||
</template>
|
||||
<template #body>
|
||||
<p>modal 2</p>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button
|
||||
class="btn btn-create"
|
||||
@click="modal2.showModal = false"
|
||||
>
|
||||
{{ $t('action.save') }}
|
||||
<button class="btn btn-create" @click="modal2.showModal = false">
|
||||
{{ $t("action.save") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
@@ -81,26 +122,25 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal'
|
||||
import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
||||
|
||||
export default {
|
||||
name: 'Test',
|
||||
components: {
|
||||
Modal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modal1: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-scrollable modal-xl" // modal-lg modal-md modal-sm
|
||||
},
|
||||
modal2: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-sm" // modal-lg modal-md modal-sm
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
}
|
||||
}
|
||||
name: "Test",
|
||||
components: {
|
||||
Modal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modal1: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-scrollable modal-xl", // modal-lg modal-md modal-sm
|
||||
},
|
||||
modal2: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-sm", // modal-lg modal-md modal-sm
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,59 +1,56 @@
|
||||
import { createApp } from 'vue'
|
||||
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n'
|
||||
import { appMessages } from './js/i18n'
|
||||
import { initPromise } from './store'
|
||||
import 'vue-toast-notification/dist/theme-sugar.css';
|
||||
import App from './App.vue';
|
||||
import Banner from './components/Banner.vue';
|
||||
import { createApp } from "vue";
|
||||
import { _createI18n } from "ChillMainAssets/vuejs/_js/i18n";
|
||||
import { appMessages } from "./js/i18n";
|
||||
import { initPromise } from "./store";
|
||||
import "vue-toast-notification/dist/theme-sugar.css";
|
||||
import App from "./App.vue";
|
||||
import Banner from "./components/Banner.vue";
|
||||
import ToastPlugin from "vue-toast-notification";
|
||||
|
||||
const root = window.vueRootComponent;
|
||||
|
||||
/*
|
||||
* Load all App component, for AccompanyingCourse edition page
|
||||
*/
|
||||
if (root === 'app') {
|
||||
initPromise(root).then(store => {
|
||||
* Load all App component, for AccompanyingCourse edition page
|
||||
*/
|
||||
if (root === "app") {
|
||||
initPromise(root).then((store) => {
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
const app = createApp({
|
||||
template: `<app></app>`,
|
||||
})
|
||||
const app = createApp({
|
||||
template: `<app></app>`,
|
||||
})
|
||||
.use(store)
|
||||
.use(i18n)
|
||||
.use(ToastPlugin, {
|
||||
position: "bottom-right",
|
||||
type: "error",
|
||||
duration: 5000,
|
||||
dismissible: true
|
||||
position: "bottom-right",
|
||||
type: "error",
|
||||
duration: 5000,
|
||||
dismissible: true,
|
||||
})
|
||||
.component('app', App)
|
||||
.mount('#accompanying-course')
|
||||
});
|
||||
.component("app", App)
|
||||
.mount("#accompanying-course");
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Load only Banner sub-component, for all others AccompanyingCourse page
|
||||
*/
|
||||
if (root === 'banner') {
|
||||
initPromise(root).then(store => {
|
||||
* Load only Banner sub-component, for all others AccompanyingCourse page
|
||||
*/
|
||||
if (root === "banner") {
|
||||
initPromise(root).then((store) => {
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
const app = createApp({
|
||||
template: `<banner></banner>`,
|
||||
})
|
||||
const app = createApp({
|
||||
template: `<banner></banner>`,
|
||||
})
|
||||
.use(store)
|
||||
.use(i18n)
|
||||
.use(ToastPlugin, {
|
||||
position: "bottom-right",
|
||||
type: "error",
|
||||
duration: 5000,
|
||||
dismissible: true
|
||||
position: "bottom-right",
|
||||
type: "error",
|
||||
duration: 5000,
|
||||
dismissible: true,
|
||||
})
|
||||
.component('banner', Banner)
|
||||
.mount('#banner-accompanying-course');
|
||||
});
|
||||
|
||||
.component("banner", Banner)
|
||||
.mount("#banner-accompanying-course");
|
||||
});
|
||||
}
|
||||
|
@@ -1,184 +1,217 @@
|
||||
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n';
|
||||
import { thirdpartyMessages } from 'ChillThirdPartyAssets/vuejs/_js/i18n';
|
||||
import { addressMessages } from 'ChillMainAssets/vuejs/Address/i18n';
|
||||
import { ontheflyMessages } from 'ChillMainAssets/vuejs/OnTheFly/i18n';
|
||||
import { personMessages } from "ChillPersonAssets/vuejs/_js/i18n";
|
||||
import { thirdpartyMessages } from "ChillThirdPartyAssets/vuejs/_js/i18n";
|
||||
import { addressMessages } from "ChillMainAssets/vuejs/Address/i18n";
|
||||
import { ontheflyMessages } from "ChillMainAssets/vuejs/OnTheFly/i18n";
|
||||
|
||||
const appMessages = {
|
||||
fr: {
|
||||
course: {
|
||||
id: "id",
|
||||
title: {
|
||||
draft: "Création d'un nouveau parcours",
|
||||
active: "Modification du parcours"
|
||||
},
|
||||
opening_date: "Date d'ouverture",
|
||||
closing_date: "Date de clôture",
|
||||
remark: "Commentaire",
|
||||
closing_motive: "Motif de clôture",
|
||||
user: "TMS",
|
||||
flags: "Indicateurs",
|
||||
status: "État",
|
||||
step: {
|
||||
draft: "Brouillon",
|
||||
active: "En file active",
|
||||
closed: "Cloturé",
|
||||
inactive_short: "Hors file active",
|
||||
inactive_long: "Pré-archivé",
|
||||
},
|
||||
open_at: "ouvert le ",
|
||||
by: "par ",
|
||||
referrer: "Référent",
|
||||
emergency: "urgent",
|
||||
confidential: "confidentiel",
|
||||
regular: "régulier",
|
||||
occasional: "ponctuel",
|
||||
absent: "Absent",
|
||||
fr: {
|
||||
course: {
|
||||
id: "id",
|
||||
title: {
|
||||
draft: "Création d'un nouveau parcours",
|
||||
active: "Modification du parcours",
|
||||
},
|
||||
origin: {
|
||||
title: "Origine de la demande",
|
||||
label: "Origine de la demande",
|
||||
placeholder: "Renseignez l'origine de la demande",
|
||||
not_valid: "Indiquez une origine à la demande",
|
||||
opening_date: "Date d'ouverture",
|
||||
closing_date: "Date de clôture",
|
||||
remark: "Commentaire",
|
||||
closing_motive: "Motif de clôture",
|
||||
user: "TMS",
|
||||
flags: "Indicateurs",
|
||||
status: "État",
|
||||
step: {
|
||||
draft: "Brouillon",
|
||||
active: "En file active",
|
||||
closed: "Cloturé",
|
||||
inactive_short: "Hors file active",
|
||||
inactive_long: "Pré-archivé",
|
||||
},
|
||||
admin_location: {
|
||||
title: "Localisation administrative",
|
||||
label: "Localisation administrative",
|
||||
placeholder: "Renseignez la localisation administrative",
|
||||
not_valid: "Indiquez une localisation administrative",
|
||||
},
|
||||
persons_associated: {
|
||||
title: "Usagers concernés",
|
||||
counter: "Il n'y a pas encore d'usagers | 1 usager | {count} usagers",
|
||||
firstname: "Prénom",
|
||||
lastname: "Nom",
|
||||
name: "Nom",
|
||||
startdate: "Date d'entrée",
|
||||
enddate: "Date de sortie",
|
||||
add_persons: "Ajouter des usagers",
|
||||
date_start_to_end: "Participation du {start} au {end}",
|
||||
leave_course: "L'usager quitte le parcours",
|
||||
sure: "Êtes-vous sûr ?",
|
||||
sure_description: "Une fois confirmé, il ne sera pas possible de faire marche arrière ! La sortie reste cependant consignée dans l'historique du parcours.",
|
||||
ok: "Oui, l'usager quitte le parcours",
|
||||
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. Veuillez les associer à un ménage dès que possible.",
|
||||
update_household: "Associer à un ménage",
|
||||
participation_not_valid: "Sélectionnez ou créez au minimum 1 usager",
|
||||
},
|
||||
requestor: {
|
||||
title: "Demandeur",
|
||||
add_requestor: "Ajouter un demandeur",
|
||||
is_anonymous: "Le demandeur est anonyme",
|
||||
counter: "Il n'y a pas encore de demandeur",
|
||||
type: "Type",
|
||||
person_id: "id",
|
||||
text: "Dénomination",
|
||||
firstName: "Prénom",
|
||||
lastName: "Nom",
|
||||
birthdate: "Date de naissance",
|
||||
center: "Centre",
|
||||
phonenumber: "Téléphone",
|
||||
mobilenumber: "Mobile",
|
||||
altNames: "Autres noms",
|
||||
address: "Adresse",
|
||||
location: "Localité",
|
||||
},
|
||||
social_issue: {
|
||||
title: "Problématiques sociales",
|
||||
label: "Choisir les problématiques sociales",
|
||||
not_valid: "Sélectionnez au minimum une problématique sociale",
|
||||
},
|
||||
courselocation: {
|
||||
title: "Localisation du parcours",
|
||||
add_temporary_address: "Ajouter une adresse temporaire",
|
||||
edit_temporary_address: "Modifier l'adresse temporaire",
|
||||
assign_course_address: "Désigner comme l'adresse du parcours",
|
||||
remove_button: "Enlever l'adresse",
|
||||
temporary_address_must_be_changed: "Cette adresse est temporaire. Le parcours devrait être localisé auprès d'un usager concerné.",
|
||||
associate_at_least_one_person_with_one_household_with_address: "Commencez d'abord par associer un membre du parcours à un ménage, et indiquez une adresse à ce ménage.",
|
||||
sure: "Êtes-vous sûr ?",
|
||||
sure_description: "Voulez-vous faire de cette adresse l'adresse du parcours ?",
|
||||
ok: "Désigner comme adresse du parcours",
|
||||
person_locator: "Parcours localisé auprès de {0}",
|
||||
not_valid: "Indiquez au minimum une localisation temporaire du parcours",
|
||||
no_address: "Il n'y a pas d'adresse associée au parcours"
|
||||
},
|
||||
scopes: {
|
||||
title: "Services concernés",
|
||||
add_at_least_one: "Indiquez au moins un service",
|
||||
},
|
||||
referrer: {
|
||||
title: "Référent du parcours",
|
||||
label: "Vous pouvez choisir un TMS ou vous assigner directement comme référent",
|
||||
placeholder: "Choisir un TMS",
|
||||
assign_me: "M'assigner comme référent",
|
||||
},
|
||||
resources: {
|
||||
title: "Interlocuteurs privilégiés",
|
||||
counter: "Il n'y a pas encore d'interlocuteur | 1 interlocuteur | {count} interlocuteurs",
|
||||
text: "Dénomination",
|
||||
description: "Description",
|
||||
add_resources: "Ajouter des interlocuteurs",
|
||||
},
|
||||
comment: {
|
||||
title: "Observations",
|
||||
label: "Ajout d'une note",
|
||||
content: "Rédigez une première note…",
|
||||
created_by: "créé par {0}, mis à jour le {1}"
|
||||
},
|
||||
confirm: {
|
||||
title: "Confirmation",
|
||||
text_draft: "Le parcours est actuellement à l'état de <b>{0}</b>.",
|
||||
text_active: "En validant cette étape, vous lui donnez le statut <b>{0}</b>.",
|
||||
alert_validation: "Certaines conditions ne sont pas remplies pour pouvoir confirmer le parcours :",
|
||||
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 à la demande",
|
||||
adminLocation_not_valid: "Indiquez une localisation administrative à la demande",
|
||||
job_not_valid: "Indiquez un métier du référent",
|
||||
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 !",
|
||||
sure_referrer: "Êtes-vous sûr de vouloir assigner ce parcours à <b>{referrer}</b>",
|
||||
ok: "Confirmer le parcours",
|
||||
delete: "Supprimer le parcours",
|
||||
ok_referrer: "Confirmer le référent",
|
||||
no_suggested_referrer: "Il n'y a aucun référent qui puisse être suggéré pour ce parcours. Vérifiez la localisation du parcours, les métiers et service indiqués. Si les données sont correctes, vous pouvez confirmer ce parcours.",
|
||||
one_suggested_referrer: "Un unique référent peut être suggéré pour ce parcours",
|
||||
choose_suggested_referrer: "Voulez-vous le désigner directement ?",
|
||||
choose_button: "Désigner",
|
||||
do_not_choose_button: "Ne pas désigner"
|
||||
},
|
||||
job: {
|
||||
label: "Métier",
|
||||
placeholder: "Choisir un métier",
|
||||
not_valid: "Sélectionnez un métier du référent"
|
||||
},
|
||||
startdate: {
|
||||
change: "Date d'ouverture",
|
||||
// update: "La nouvelle date d'ouverture a été enregistrée"
|
||||
},
|
||||
// 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.",
|
||||
'Error while confirming AccompanyingPeriod Course.': "Erreur du serveur lors de la confirmation du parcours d'accompagnement.",
|
||||
'Error while retriving Social Issues.': "Erreur du serveur lors du chargement des problématique sociales.",
|
||||
'Error while sending AccompanyingPeriod Course participation.': "Erreur du serveur lors de l'envoi des infos d'un usager.",
|
||||
'Error while sending AccompanyingPeriod Course requestor': "Erreur du serveur lors de l'envoi des infos du demandeur.",
|
||||
'Error while sending AccompanyingPeriod Course resource.': "Erreur du serveur lors de l'envoi des infos d'un interlocuteur privilégié.",
|
||||
'Error while updating SocialIssue.': "Erreur du serveur lors de la mise à jour d'une problématique sociale.",
|
||||
'Error while retriving users.': "Erreur du serveur lors du chargement de la liste des travailleurs.",
|
||||
'Error while getting whoami.': "Erreur du serveur lors de la requête 'qui suis-je ?'",
|
||||
'Error while retriving origin\'s list.': "Erreur du serveur lors du chargement de la liste des origines de la demande.",
|
||||
'Only the referrer can toggle the intensity of an accompanying course': "Seul le référent peut modifier l'intensité d'un parcours.",
|
||||
'Only the referrer can toggle the confidentiality of an accompanying course': "Seul le référent peut modifier la confidentialité d'un parcours."
|
||||
}
|
||||
open_at: "ouvert le ",
|
||||
by: "par ",
|
||||
referrer: "Référent",
|
||||
emergency: "urgent",
|
||||
confidential: "confidentiel",
|
||||
regular: "régulier",
|
||||
occasional: "ponctuel",
|
||||
absent: "Absent",
|
||||
},
|
||||
origin: {
|
||||
title: "Origine de la demande",
|
||||
label: "Origine de la demande",
|
||||
placeholder: "Renseignez l'origine de la demande",
|
||||
not_valid: "Indiquez une origine à la demande",
|
||||
},
|
||||
admin_location: {
|
||||
title: "Localisation administrative",
|
||||
label: "Localisation administrative",
|
||||
placeholder: "Renseignez la localisation administrative",
|
||||
not_valid: "Indiquez une localisation administrative",
|
||||
},
|
||||
persons_associated: {
|
||||
title: "Usagers concernés",
|
||||
counter: "Il n'y a pas encore d'usagers | 1 usager | {count} usagers",
|
||||
firstname: "Prénom",
|
||||
lastname: "Nom",
|
||||
name: "Nom",
|
||||
startdate: "Date d'entrée",
|
||||
enddate: "Date de sortie",
|
||||
add_persons: "Ajouter des usagers",
|
||||
date_start_to_end: "Participation du {start} au {end}",
|
||||
leave_course: "L'usager quitte le parcours",
|
||||
sure: "Êtes-vous sûr ?",
|
||||
sure_description:
|
||||
"Une fois confirmé, il ne sera pas possible de faire marche arrière ! La sortie reste cependant consignée dans l'historique du parcours.",
|
||||
ok: "Oui, l'usager quitte le parcours",
|
||||
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. Veuillez les associer à un ménage dès que possible.",
|
||||
update_household: "Associer à un ménage",
|
||||
participation_not_valid: "Sélectionnez ou créez au minimum 1 usager",
|
||||
},
|
||||
requestor: {
|
||||
title: "Demandeur",
|
||||
add_requestor: "Ajouter un demandeur",
|
||||
is_anonymous: "Le demandeur est anonyme",
|
||||
counter: "Il n'y a pas encore de demandeur",
|
||||
type: "Type",
|
||||
person_id: "id",
|
||||
text: "Dénomination",
|
||||
firstName: "Prénom",
|
||||
lastName: "Nom",
|
||||
birthdate: "Date de naissance",
|
||||
center: "Centre",
|
||||
phonenumber: "Téléphone",
|
||||
mobilenumber: "Mobile",
|
||||
altNames: "Autres noms",
|
||||
address: "Adresse",
|
||||
location: "Localité",
|
||||
},
|
||||
social_issue: {
|
||||
title: "Problématiques sociales",
|
||||
label: "Choisir les problématiques sociales",
|
||||
not_valid: "Sélectionnez au minimum une problématique sociale",
|
||||
},
|
||||
courselocation: {
|
||||
title: "Localisation du parcours",
|
||||
add_temporary_address: "Ajouter une adresse temporaire",
|
||||
edit_temporary_address: "Modifier l'adresse temporaire",
|
||||
assign_course_address: "Désigner comme l'adresse du parcours",
|
||||
remove_button: "Enlever l'adresse",
|
||||
temporary_address_must_be_changed:
|
||||
"Cette adresse est temporaire. Le parcours devrait être localisé auprès d'un usager concerné.",
|
||||
associate_at_least_one_person_with_one_household_with_address:
|
||||
"Commencez d'abord par associer un membre du parcours à un ménage, et indiquez une adresse à ce ménage.",
|
||||
sure: "Êtes-vous sûr ?",
|
||||
sure_description:
|
||||
"Voulez-vous faire de cette adresse l'adresse du parcours ?",
|
||||
ok: "Désigner comme adresse du parcours",
|
||||
person_locator: "Parcours localisé auprès de {0}",
|
||||
not_valid: "Indiquez au minimum une localisation temporaire du parcours",
|
||||
no_address: "Il n'y a pas d'adresse associée au parcours",
|
||||
},
|
||||
scopes: {
|
||||
title: "Services concernés",
|
||||
add_at_least_one: "Indiquez au moins un service",
|
||||
},
|
||||
referrer: {
|
||||
title: "Référent du parcours",
|
||||
label:
|
||||
"Vous pouvez choisir un TMS ou vous assigner directement comme référent",
|
||||
placeholder: "Choisir un TMS",
|
||||
assign_me: "M'assigner comme référent",
|
||||
},
|
||||
resources: {
|
||||
title: "Interlocuteurs privilégiés",
|
||||
counter:
|
||||
"Il n'y a pas encore d'interlocuteur | 1 interlocuteur | {count} interlocuteurs",
|
||||
text: "Dénomination",
|
||||
description: "Description",
|
||||
add_resources: "Ajouter des interlocuteurs",
|
||||
},
|
||||
comment: {
|
||||
title: "Observations",
|
||||
label: "Ajout d'une note",
|
||||
content: "Rédigez une première note…",
|
||||
created_by: "créé par {0}, mis à jour le {1}",
|
||||
},
|
||||
confirm: {
|
||||
title: "Confirmation",
|
||||
text_draft: "Le parcours est actuellement à l'état de <b>{0}</b>.",
|
||||
text_active:
|
||||
"En validant cette étape, vous lui donnez le statut <b>{0}</b>.",
|
||||
alert_validation:
|
||||
"Certaines conditions ne sont pas remplies pour pouvoir confirmer le parcours :",
|
||||
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 à la demande",
|
||||
adminLocation_not_valid:
|
||||
"Indiquez une localisation administrative à la demande",
|
||||
job_not_valid: "Indiquez un métier du référent",
|
||||
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 !",
|
||||
sure_referrer:
|
||||
"Êtes-vous sûr de vouloir assigner ce parcours à <b>{referrer}</b>",
|
||||
ok: "Confirmer le parcours",
|
||||
delete: "Supprimer le parcours",
|
||||
ok_referrer: "Confirmer le référent",
|
||||
no_suggested_referrer:
|
||||
"Il n'y a aucun référent qui puisse être suggéré pour ce parcours. Vérifiez la localisation du parcours, les métiers et service indiqués. Si les données sont correctes, vous pouvez confirmer ce parcours.",
|
||||
one_suggested_referrer:
|
||||
"Un unique référent peut être suggéré pour ce parcours",
|
||||
choose_suggested_referrer: "Voulez-vous le désigner directement ?",
|
||||
choose_button: "Désigner",
|
||||
do_not_choose_button: "Ne pas désigner",
|
||||
},
|
||||
job: {
|
||||
label: "Métier",
|
||||
placeholder: "Choisir un métier",
|
||||
not_valid: "Sélectionnez un métier du référent",
|
||||
},
|
||||
startdate: {
|
||||
change: "Date d'ouverture",
|
||||
// update: "La nouvelle date d'ouverture a été enregistrée"
|
||||
},
|
||||
// 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.",
|
||||
"Error while confirming AccompanyingPeriod Course.":
|
||||
"Erreur du serveur lors de la confirmation du parcours d'accompagnement.",
|
||||
"Error while retriving Social Issues.":
|
||||
"Erreur du serveur lors du chargement des problématique sociales.",
|
||||
"Error while sending AccompanyingPeriod Course participation.":
|
||||
"Erreur du serveur lors de l'envoi des infos d'un usager.",
|
||||
"Error while sending AccompanyingPeriod Course requestor":
|
||||
"Erreur du serveur lors de l'envoi des infos du demandeur.",
|
||||
"Error while sending AccompanyingPeriod Course resource.":
|
||||
"Erreur du serveur lors de l'envoi des infos d'un interlocuteur privilégié.",
|
||||
"Error while updating SocialIssue.":
|
||||
"Erreur du serveur lors de la mise à jour d'une problématique sociale.",
|
||||
"Error while retriving users.":
|
||||
"Erreur du serveur lors du chargement de la liste des travailleurs.",
|
||||
"Error while getting whoami.":
|
||||
"Erreur du serveur lors de la requête 'qui suis-je ?'",
|
||||
"Error while retriving origin's list.":
|
||||
"Erreur du serveur lors du chargement de la liste des origines de la demande.",
|
||||
"Only the referrer can toggle the intensity of an accompanying course":
|
||||
"Seul le référent peut modifier l'intensité d'un parcours.",
|
||||
"Only the referrer can toggle the confidentiality of an accompanying course":
|
||||
"Seul le référent peut modifier la confidentialité d'un parcours.",
|
||||
},
|
||||
};
|
||||
|
||||
Object.assign(appMessages.fr, personMessages.fr, thirdpartyMessages.fr, addressMessages.fr, ontheflyMessages.fr);
|
||||
Object.assign(
|
||||
appMessages.fr,
|
||||
personMessages.fr,
|
||||
thirdpartyMessages.fr,
|
||||
addressMessages.fr,
|
||||
ontheflyMessages.fr,
|
||||
);
|
||||
|
||||
export {
|
||||
appMessages
|
||||
};
|
||||
export { appMessages };
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user