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

This commit is contained in:
2022-05-06 10:21:13 +02:00
403 changed files with 2662 additions and 41292 deletions

View File

@@ -628,6 +628,10 @@ export default {
newAddress = Object.assign(newAddress, {
'addressReference': this.entity.selected.address.addressReference
});
} else {
newAddress = Object.assign(newAddress, {
'addressReference': null
});
}
if (this.validFrom) {

View File

@@ -8,12 +8,15 @@ import L from 'leaflet';
import markerIconPng from 'leaflet/dist/images/marker-icon.png'
import 'leaflet/dist/leaflet.css';
let map;
let marker;
export default {
name: 'AddressMap',
props: ['entity'],
data() {
return {
map: null,
marker: null
}
},
computed: {
center() {
return this.entity.selected.addressMap.center;
@@ -21,30 +24,33 @@ export default {
},
methods:{
init() {
map = L.map('address_map').setView([46.67059, -1.42683], 12);
this.map = L.map('address_map').setView([46.67059, -1.42683], 12);
map.scrollWheelZoom.disable();
this.map.scrollWheelZoom.disable();
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
}).addTo(this.map);
const markerIcon = L.icon({
iconUrl: markerIconPng,
iconAnchor: [12, 41],
});
marker = L.marker([48.8589, 2.3469], {icon: markerIcon}).addTo(map);
this.marker = L.marker([48.8589, 2.3469], {icon: markerIcon});
this.marker.addTo(this.map);
},
update() {
//console.log('update map with : ', this.address.addressMap.center)
marker.setLatLng(this.entity.addressMap.center);
map.setView(this.entity.addressMap.center, 15);
//console.log('update map with : ', this.entity.addressMap.center)
if (this.marker && this.entity.addressMap.center) {
this.marker.setLatLng(this.entity.addressMap.center);
this.map.setView(this.entity.addressMap.center, 15);
}
}
},
mounted(){
this.init()
this.init();
this.update();
}
}
</script>

View File

@@ -119,7 +119,7 @@ export default {
},
listenInputSearch(query) {
//console.log('listenInputSearch', query, this.isAddressSelectorOpen);
if (!this.entity.selected.writeNew.postcode) {
if (!this.entity.selected.writeNew.postcode && 'id' in this.entity.selected.city) {
if (query.length > 2) {
this.isLoading = true;
searchReferenceAddresses(query, this.entity.selected.city).then(

View File

@@ -106,6 +106,9 @@ export default {
this.$emit('getReferenceAddresses', this.value);
if (this.value.center) {
this.updateMapCenter(this.value.center);
if (this.value.center.coordinates) {
this.entity.selected.postcode.coordinates = this.value.center.coordinates;
}
}
}
},

View File

@@ -25,14 +25,14 @@
{{ $t('my_accompanying_courses.tab') }}
</a>
</li>
<li class="nav-item">
<!-- <li class="nav-item">
<a class="nav-link"
:class="{'active': activeTab === 'MyWorks'}"
@click="selectTab('MyWorks')">
{{ $t('my_works.tab') }}
<tab-counter :count="state.works.count"></tab-counter>
</a>
</li>
</li> -->
<li class="nav-item">
<a class="nav-link"
:class="{'active': activeTab === 'MyEvaluations'}"
@@ -135,7 +135,7 @@ export default {
for (const m of [
'MyNotifications',
'MyAccompanyingCourses',
'MyWorks',
// 'MyWorks',
'MyEvaluations',
'MyTasks',
'MyWorkflows',

View File

@@ -1,3 +1,4 @@
// CURRENTLY NOT IN USE
<template>
<div class="accompanying_course_work">
<div class="alert alert-light">{{ $t('my_works.description') }}</div>

View File

@@ -15,11 +15,11 @@ const appMessages = {
description_warning: "Liste des tâches auxquelles je suis assigné et dont la date d'échéance est dépassée.",
},
my_accompanying_courses: {
tab: "Mes parcours",
description: "Liste des parcours d'accompagnement que l'on vient de m'attribuer.",
tab: "Mes nouveaux parcours",
description: "Liste des parcours d'accompagnement que l'on vient de m'attribuer depuis moins de 15 jours.",
},
my_notifications: {
tab: "Mes notifications",
tab: "Mes nouvelles notifications",
description: "Liste des notifications reçues et non lues.",
},
my_workflows: {

View File

@@ -13,7 +13,7 @@ const isEmpty = (obj) => {
const store = createStore({
strict: debug,
state: {
works: {},
// works: {},
evaluations: {},
tasks: {
warning: {},
@@ -26,9 +26,9 @@ const store = createStore({
loading: false
},
getters: {
isWorksLoaded(state) {
return !isEmpty(state.works);
},
// isWorksLoaded(state) {
// return !isEmpty(state.works);
// },
isEvaluationsLoaded(state) {
return !isEmpty(state.evaluations);
},
@@ -49,7 +49,7 @@ const store = createStore({
},
counter(state) {
return {
works: state.works.count,
// works: state.works.count,
evaluations: state.evaluations.count,
tasksWarning: state.tasks.warning.count,
tasksAlert: state.tasks.alert.count,
@@ -60,10 +60,10 @@ const store = createStore({
}
},
mutations: {
addWorks(state, works) {
//console.log('addWorks', works);
state.works = works;
},
// addWorks(state, works) {
// //console.log('addWorks', works);
// state.works = works;
// },
addEvaluations(state, evaluations) {
//console.log('addEvaluations', evaluations);
state.evaluations = evaluations;
@@ -99,22 +99,22 @@ const store = createStore({
switch (tab) {
case 'MyCustoms':
break;
case 'MyWorks':
if (!getters.isWorksLoaded) {
commit('setLoading', true);
const url = `/api/1.0/person/accompanying-period/work/my-near-end${'?'+ param}`;
makeFetch('GET', url)
.then((response) => {
commit('addWorks', response);
commit('setLoading', false);
})
.catch((error) => {
commit('catchError', error);
throw error;
})
;
}
break;
// case 'MyWorks':
// if (!getters.isWorksLoaded) {
// commit('setLoading', true);
// const url = `/api/1.0/person/accompanying-period/work/my-near-end${'?'+ param}`;
// makeFetch('GET', url)
// .then((response) => {
// commit('addWorks', response);
// commit('setLoading', false);
// })
// .catch((error) => {
// commit('catchError', error);
// throw error;
// })
// ;
// }
// break;
case 'MyEvaluations':
if (!getters.isEvaluationsLoaded) {
commit('setLoading', true);

View File

@@ -66,9 +66,18 @@ export default {
translatedListOfTypes() {
let trans = [];
this.types.forEach(t => {
trans.push(appMessages.fr.pick_entity[t].toLowerCase());
if (this.$props.multiple) {
trans.push(appMessages.fr.pick_entity[t].toLowerCase());
} else {
trans.push(appMessages.fr.pick_entity[t + '_one'].toLowerCase());
}
})
return appMessages.fr.pick_entity.modal_title + trans.join(', ');
if (this.$props.multiple) {
return appMessages.fr.pick_entity.modal_title + trans.join(', ');
} else {
return appMessages.fr.pick_entity.modal_title_one + trans.join(', ');
}
}
},
methods: {
@@ -79,15 +88,10 @@ export default {
);
this.$refs.addPersons.resetSearch(); // to cast child method
modal.showModal = false;
console.log(this.picked)
},
removeEntity(entity) {
console.log('remove entity', entity);
this.$emit('removeEntity', entity);
}
},
mounted() {
console.log(this.picked);
}
}
</script>

View File

@@ -11,6 +11,10 @@ const appMessages = {
user: 'Utilisateurs',
person: 'Usagers',
thirdparty: 'Tiers',
modal_title_one: 'Indiquer un ',
user_one: 'Utilisateur',
thirdparty_one: 'Tiers',
person_one: 'Usager',
}
}
}