diff --git a/src/assets/js/map-util.js b/src/assets/js/map-util.js index 9e2ce68ce8348ce6196c83068f840af76d94a96e..3d948ff93327e48bb516b64e3f1487a161ff87bc 100644 --- a/src/assets/js/map-util.js +++ b/src/assets/js/map-util.js @@ -312,9 +312,7 @@ const mapUtil = { if(colorValue) { color=colorValue; } - } - console.log(featureType); let hiddenStyle=({ radius: 0, fillOpacity: 0.5, diff --git a/src/store/index.js b/src/store/index.js index 6f543f6d8a48b83ba0b027c7cf7c051f5c4a6a75..eea20cf397445f8aa14c8dcaec92552347a08168 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -274,13 +274,17 @@ export default new Vuex.Store({ }); }, - async GET_PROJECT_INFO({ state, commit, dispatch }, slug) { + async GET_PROJECT_INFO({ state, commit, dispatch }, slug, noFeatures) { commit("SET_PROJECT_SLUG", slug); let promises = [ dispatch("GET_PROJECT_LAST_MESSAGES", slug).then(response => response), dispatch("feature_type/GET_PROJECT_FEATURE_TYPES", slug).then(response => response), - dispatch("feature/GET_PROJECT_FEATURES", slug).then(response => response), ] + console.log(noFeatures) + if (!noFeatures) { + promises.push(dispatch("feature/GET_PROJECT_FEATURES", slug).then(response => response)) + } + console.log(promises) if (state.user) promises.push(dispatch("map/GET_BASEMAPS", slug).then(response => response)) const promiseResult = await Promise.all(promises) diff --git a/src/views/feature/Feature_list.vue b/src/views/feature/Feature_list.vue index ebf02bfd28af418be37580805bc418a2ae13fdf4..6190906d0f8f840a324e67679c09497d0e3c4f69 100644 --- a/src/views/feature/Feature_list.vue +++ b/src/views/feature/Feature_list.vue @@ -249,7 +249,7 @@ export default { computed: { ...mapGetters(["project", "permissions"]), ...mapState(["user"]), - ...mapState("feature", ["features", "checkedFeatures"]), + ...mapState("feature", ["checkedFeatures"]), ...mapState("feature_type", ["feature_types"]), baseMaps() { @@ -264,7 +264,6 @@ export default { ); } if (this.form.status.selected.value) { - console.log("filter by" + this.form.status.selected.value); results = results.filter( (el) => el.properties.status.value === this.form.status.selected.value ); @@ -355,7 +354,6 @@ export default { }, initMap() { - console.log(this); this.zoom = this.$route.query.zoom || ""; this.lat = this.$route.query.lat || ""; this.lng = this.$route.query.lng || ""; @@ -454,7 +452,7 @@ export default { created() { if (!this.project) { //this.$store.dispatch("GET_PROJECT_MESSAGES", this.$route.params.slug); - this.$store.dispatch("GET_PROJECT_INFO", this.$route.params.slug); + this.$store.dispatch("GET_PROJECT_INFO", this.$route.params.slug, "noFeatures"); } }, diff --git a/src/views/project/Project_edit.vue b/src/views/project/Project_edit.vue index 70862005c0a224ce231aeafccb58a170dbf9f825..8076625edbacd260d3c379e9d32f03da064026f4 100644 --- a/src/views/project/Project_edit.vue +++ b/src/views/project/Project_edit.vue @@ -459,14 +459,7 @@ export default { }); } }, - }, - - created() { - this.definePageType(); - console.log(this.action); - if (this.action === "create") { - this.thumbnailFileSrc = require("@/assets/img/default.png"); - } else if (this.action === "edit" || this.action === "create_from") { + fillProjectForm() { if (!this.project) { this.$store.dispatch("GET_PROJECT_INFO", this.$route.params.slug); } @@ -481,18 +474,28 @@ export default { this.form.is_project_type = false; } //* transform string values to objects for dropdowns display (could be in a computed) + this.form.access_level_pub_feature = { name: this.project.access_level_pub_feature, value: this.levelPermissions.find( - (el) => (el.name === this.project.access_level_pub_feature) + (el) => el.name === this.project.access_level_pub_feature ).value, }; this.form.access_level_arch_feature = { name: this.project.access_level_arch_feature, value: this.levelPermissions.find( - (el) => (el.name === this.project.access_level_arch_feature) + (el) => el.name === this.project.access_level_arch_feature ).value, }; + }, + }, + + created() { + this.definePageType(); + if (this.action === "create") { + this.thumbnailFileSrc = require("@/assets/img/default.png"); + } else if (this.action === "edit" || this.action === "create_from") { + this.fillProjectForm(); } }, };