Mercurial > gemma
changeset 5408:901b70f9c6bd marking-single-beam
disable cuts or differences if surveytype is 'marking'
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 06 Jul 2021 15:47:44 +0200 |
parents | 850f5847d18a |
children | d668ccc7d12c |
files | client/src/components/fairway/BottleneckDialogue.vue |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/fairway/BottleneckDialogue.vue Tue Jul 06 15:26:20 2021 +0200 +++ b/client/src/components/fairway/BottleneckDialogue.vue Tue Jul 06 15:47:44 2021 +0200 @@ -103,6 +103,7 @@ <select v-model="additionalSurvey" class="form-control form-control-sm small" + :disabled="!areDifferecesAllowed" > <option :value="null">None</option> <option @@ -264,7 +265,7 @@ <button class="btn btn-info btn-sm w-100" @click="toggleCutTool" - :disabled="!selectedSurvey" + :disabled="!isCutAllowed" > <font-awesome-icon :icon="cutToolEnabled ? 'times' : 'plus'" /> {{ cutToolEnabled ? "Cancel" : "New" }} @@ -330,6 +331,7 @@ * * Author(s): * Markus Kottländer <markus.kottlaender@intevation.de> + * Thomas Junk <thomas.junk@intevation.de> */ import { mapState, mapGetters } from "vuex"; import Feature from "ol/Feature"; @@ -358,6 +360,15 @@ "surveys", "surveysLoading" ]), + selectedSurveyIsMarking() { + return this.selectedSurvey["survey_type"] === "marking"; + }, + areDifferecesAllowed() { + return !this.selectedSurveyIsMarking; + }, + isCutAllowed() { + return !this.selectedSurveyIsMarking && !!this.selectedSurvey; + }, isAllowedToDelete() { const userCountryCode = this.userCountries[this.user]; const bottleneck = this.bottlenecksList.find(