From 198d21531b2560b301e8d61b7501c1929e33cd6e Mon Sep 17 00:00:00 2001 From: Camille Blanchon <cblanchon@neogeo.fr> Date: Thu, 23 Dec 2021 11:20:49 +0100 Subject: [PATCH] Revert "Merge branch 'redmine-issues/12737' into 'develop'" This reverts merge request !223 --- src/views/project/Project_detail.vue | 116 +++++++++++---------------- 1 file changed, 48 insertions(+), 68 deletions(-) diff --git a/src/views/project/Project_detail.vue b/src/views/project/Project_detail.vue index 6427d261..37f31fe7 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" > @@ -651,9 +643,7 @@ export default { projectInfoLoading: true, featureTypeImporting: false, featuresLoading: true, - isFileSizeModalOpen: false, - mapLoading: true, - mapFeatures: null + isFileSizeModalOpen: false }; }, @@ -691,7 +681,7 @@ export default { watch: { map(newValue) { if (newValue && this.features && this.features.length) { - this.mapFeatures = mapUtil.addFeatures( + mapUtil.addFeatures( this.features, {}, true, @@ -703,7 +693,7 @@ export default { deep: true, handler(newValue, oldValue) { if (newValue && newValue.length && newValue !== oldValue && this.map) { - this.mapFeatures = mapUtil.addFeatures( + mapUtil.addFeatures( newValue, {}, true, @@ -713,15 +703,6 @@ export default { } }, - mapFeatures: { - deep: true, - handler(newValue, oldValue) { - if (newValue && newValue !== oldValue) { - this.mapLoading = false; - } - } - }, - feature_types: { deep: true, handler(newValue, oldValue) { @@ -750,50 +731,6 @@ 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: null, - 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(); - }, - methods: { ...mapMutations([ 'SET_RELOAD_INTERVAL_ID', @@ -1000,6 +937,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> -- GitLab