diff --git a/src/views/feature/Feature_detail.vue b/src/views/feature/Feature_detail.vue index e69a936c8d90a3c5275f39d7502d6898329e4388..b31ae747f01c276f33016dda3ff41ec61096753f 100644 --- a/src/views/feature/Feature_detail.vue +++ b/src/views/feature/Feature_detail.vue @@ -39,7 +39,7 @@ </router-link> <!-- (permissions && permissions.can_delete_feature) || --> <a - v-if="isFeatureCreator" + v-if="isFeatureCreator || permissions.is_project_super_contributor" @click="isCanceling = true" id="feature-delete" class="ui button button-hover-red" diff --git a/src/views/feature/Feature_list.vue b/src/views/feature/Feature_list.vue index 8d9c18f1600793b2ec2605cea3bd0901ca894515..b86b137acf5366c17f40509a440b35c175c9e64f 100644 --- a/src/views/feature/Feature_list.vue +++ b/src/views/feature/Feature_list.vue @@ -303,15 +303,18 @@ export default { this.modalAllDeleteOpen = !this.modalAllDeleteOpen; }, - deleteFeature(feature) { - const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}features/${feature.feature_id}/?project__slug=${this.project.slug}`; + deleteFeature(feature_id) { + const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}features/${feature_id}/?project__slug=${this.project.slug}`; axios .delete(url, {}) .then(() => { if (!this.modalAllDeleteOpen) { this.$store .dispatch("feature/GET_PROJECT_FEATURES", this.project.slug) - .then(() => this.getFeaturesAsGeojson()); + .then(() => { + this.getNloadGeojsonFeatures(); + this.checkedFeatures.splice(feature_id) + }); } }) .catch(() => { @@ -323,7 +326,7 @@ export default { let feature = {}; this.checkedFeatures.forEach((feature_id) => { feature = { feature_id: feature_id }; - this.deleteFeature(feature); + this.deleteFeature(feature.feature_id); }); this.modalAllDelete(); }, @@ -376,7 +379,7 @@ export default { }); // --------- End sidebar events ---------- - this.getFeaturesAsGeojson(); + this.getNloadGeojsonFeatures(); setTimeout( function () { @@ -394,7 +397,7 @@ export default { ); }, - getFeaturesAsGeojson() { + getNloadGeojsonFeatures() { const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/feature/?output=geojson`; this.$store.commit( "DISPLAY_LOADER",