diff --git a/src/views/project/Project_detail.vue b/src/views/project/Project_detail.vue index 499f0d8318865508666eeb70b1c8c0be5f7eda8c..379d52e9cb327bf886b4237077f70ea8edb0b506 100644 --- a/src/views/project/Project_detail.vue +++ b/src/views/project/Project_detail.vue @@ -345,15 +345,7 @@ </div> </div> <div class="seven wide column"> - <div - :class="{ active: mapLoading }" - class="ui inverted dimmer" - > - <div class="ui text loader"> - Chargement de a carte... - </div> - </div> - <div id="map" ref="map" /> + <div id="map" ref="map"></div> </div> </div> @@ -374,7 +366,7 @@ </div> <div class="ui relaxed list"> <div - v-for="(item, index) in features.slice(-5)" + v-for="(item, index) in features" :key="item.properties.title + index" class="item" > @@ -978,6 +970,49 @@ export default { }, }, + created() { + if (this.user) { + projectAPI + .getProjectSubscription({ projectSlug: this.$route.params.slug }) + .then((data) => (this.is_suscriber = data.is_suscriber)); + } + this.$store.commit("feature_type/SET_FEATURE_TYPES", []); //* empty feature_types remaining from previous project + }, + + mounted() { + this.GET_PROJECT_INFO(this.slug) + .then(() => { + this.projectInfoLoading = false; + setTimeout(this.initMap, 1000); + }) + .catch(() => { + this.projectInfoLoading = false; + }); + this.GET_PROJECT_FEATURES({ + project_slug: this.slug, + ordering: '-created_on', + limit: 5, + geojson: true + }) + .then(() => { + this.featuresLoading = false; + }) + .catch(() => { + this.featuresLoading = false; + }); + + if (this.message) { + this.tempMessage = this.message; + document + .getElementById("message") + .scrollIntoView({ block: "end", inline: "nearest" }); + setTimeout(() => (this.tempMessage = null), 5000); //* hide message after 5 seconds + } + }, + + destroyed() { + this.CLEAR_RELOAD_INTERVAL_ID(); + }, }; </script>