diff --git a/src/components/map-layers/SidebarLayers.vue b/src/components/map-layers/SidebarLayers.vue index dace42eff5f205a37bc614755fcb71dde1d1253d..950f41b95854e32a2bdaae7099eaacbb6d5701c4 100644 --- a/src/components/map-layers/SidebarLayers.vue +++ b/src/components/map-layers/SidebarLayers.vue @@ -220,13 +220,20 @@ export default { initSortable() { this.baseMaps.forEach((basemap) => { - new Sortable(document.getElementById(`list-${basemap.id}`), { - animation: 150, - handle: ".layer-handle-sort", // The element that is active to drag - ghostClass: "blue-background-class", - dragClass: "white-opacity-background-class", - onEnd: this.onlayerMove.bind(this), - }); + let element=document.getElementById(`list-${basemap.id}`); + if(element) { + new Sortable(element, { + animation: 150, + handle: ".layer-handle-sort", // The element that is active to drag + ghostClass: "blue-background-class", + dragClass: "white-opacity-background-class", + onEnd: this.onlayerMove.bind(this), + }); + } + else{ + console.error(`list-${basemap.id} not found in dom`) + } + }); }, // Check if there are changes in the basemaps settings. Changes are detected if: diff --git a/src/views/feature/Feature_detail.vue b/src/views/feature/Feature_detail.vue index 62c585a0ecf9abd67bb2251ed13a33c881bd381c..a3fbb4e11cb27b4adb3ed9b5307de2365ba9a57d 100644 --- a/src/views/feature/Feature_detail.vue +++ b/src/views/feature/Feature_detail.vue @@ -445,7 +445,6 @@ export default { return status ? status.name : ""; }, }, - filters: { formatDate(value) { let date = new Date(value); @@ -685,8 +684,13 @@ export default { mounted() { this.$store.commit("DISPLAY_LOADER", "Recherche du signalement"); if (!this.project) { - this.$store - .dispatch("GET_PROJECT_INFO", this.$route.params.slug) + // Chargements des features et infos projet en cas d'arrivée directe sur la page ou de refresh + axios.all([ + this.$store + .dispatch("GET_PROJECT_INFO", this.$route.params.slug), + this.$store.dispatch('feature/GET_PROJECT_FEATURES', { + project_slug: this.$route.params.slug + })]) .then(() => { this.$store.commit("DISCARD_LOADER"); this.initMap(); diff --git a/src/views/feature/Feature_list.vue b/src/views/feature/Feature_list.vue index 37a7eda3f61ef00a0f33bd9ca992e697ca116a44..81110a2b7acc25a9efb3837fc9f72130d5feb1dc 100644 --- a/src/views/feature/Feature_list.vue +++ b/src/views/feature/Feature_list.vue @@ -375,11 +375,13 @@ export default { this.zoom = this.$route.query.zoom || ""; this.lat = this.$route.query.lat || ""; this.lng = this.$route.query.lng || ""; + var mapDefaultViewCenter = this.$store.state.configuration.DEFAULT_MAP_VIEW.center; var mapDefaultViewZoom = this.$store.state.configuration.DEFAULT_MAP_VIEW.zoom; + this.map = mapUtil.createMap(this.$refs.map, { zoom: this.zoom, lat: this.lat, @@ -467,14 +469,23 @@ export default { }, }, - created() { - if (!this.project) { - this.$store.dispatch("GET_PROJECT_INFO", this.$route.params.slug); - } - }, mounted() { - this.initMap(); + if (!this.project) { + // Chargements des features et infos projet en cas d'arrivée directe sur la page ou de refresh + axios.all([ + this.$store.dispatch("GET_PROJECT_INFO", this.$route.params.slug), + this.$store.dispatch('feature/GET_PROJECT_FEATURES', { + project_slug: this.$route.params.slug + })]) + .then(() => { + this.initMap(); + }); + } + else { + this.initMap(); + } + }, destroyed() { diff --git a/src/views/project/Project_detail.vue b/src/views/project/Project_detail.vue index a25fec89a57c9d557b45dd77fb7fbe59e9b8b7a3..2e7066dd2d7090c0176df277e063a6f34fb0cc60 100644 --- a/src/views/project/Project_detail.vue +++ b/src/views/project/Project_detail.vue @@ -395,7 +395,7 @@ > <div class="content"> <div> - <router-link :to="item.related_feature.feature_url" + <router-link :to="getRouteUrl(item.related_feature.feature_url)" >"{{ item.comment }}"</router-link > </div> @@ -605,7 +605,9 @@ export default { refreshId() { return "?ver=" + Math.random(); }, - + getRouteUrl(url){ + return '/'+url.replace(this.$store.state.configuration.BASE_URL,''); // remove duplicate /geocontrib + }, isOffline() { return navigator.onLine === false; }, diff --git a/src/views/project/Project_members.vue b/src/views/project/Project_members.vue index 9745e86761b7abf5739873cc8b6f764e6117dcd8..aea8f4b1340c1ea3ed81f8ee426985195632eb74 100644 --- a/src/views/project/Project_members.vue +++ b/src/views/project/Project_members.vue @@ -290,7 +290,7 @@ export default { // todo: move function to a service return axios .get( - `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/utilisateurs` + `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/utilisateurs/` ) .then((response) => response.data) .catch((error) => {