From 31ece0ae97a02ffa30fbc298e8e9c808086ee104 Mon Sep 17 00:00:00 2001 From: luisrodriguezgalvez <77997772+luisrodriguezgalvez@users.noreply.github.com> Date: Wed, 29 Apr 2026 18:58:41 +0200 Subject: [PATCH 1/6] various streamline user step navigation clickable layers only clickable within their own step, unable to confirm without region selection, landscape architecture selection without confirmation, only calculate uom if landscape architecture is selected --- src/components/LayerList.vue | 9 +++++++-- src/components/NumberInput.vue | 21 +++++++++++++++++++-- src/components/SubMenu.vue | 3 ++- src/config/workflow.json | 15 ++++++++++----- src/stores/map.js | 22 ++++++++++++++++------ 5 files changed, 54 insertions(+), 16 deletions(-) diff --git a/src/components/LayerList.vue b/src/components/LayerList.vue index f3ffee0..1a91964 100644 --- a/src/components/LayerList.vue +++ b/src/components/LayerList.vue @@ -32,7 +32,7 @@ diff --git a/src/components/NumberInput.vue b/src/components/NumberInput.vue index 2ac5a6d..d93c450 100644 --- a/src/components/NumberInput.vue +++ b/src/components/NumberInput.vue @@ -21,7 +21,7 @@ variant="tonal" color="primary" size="small" - :disabled="value == null || value < min || value > max" + :disabled="isCalcDisabled" :title="calcButtonTitle" @click="onCalcClick" /> @@ -47,6 +47,8 @@ defaultValue: { type: Number, default: 0 }, defaultValueSource: { type: String, default: null }, showCalcButton: { type: Boolean, default: false }, + requiresCalcCondition: { type: Boolean, default: false }, + calcConditionSource: { type: String, default: null }, calcButtonTitle: { type: String, default: 'Calculate' }, }) @@ -63,6 +65,21 @@ const value = ref(resolvedDefault.value) + const calcConditionMet = computed(() => { + if (!props.requiresCalcCondition) return true + if (!props.calcConditionSource) return false + const resolved = resolveInputValue(props.calcConditionSource, { + payload: { value: value.value }, + stores: { app: appStore, map: mapStore }, + }) + return resolved !== undefined && resolved !== null && resolved !== '' + }) + + const isCalcDisabled = computed(() => { + const invalidValue = value.value == null || value.value < props.min || value.value > props.max + return invalidValue || !calcConditionMet.value + }) + watch(resolvedDefault, (newVal) => { if (newVal != null) { value.value = newVal @@ -76,7 +93,7 @@ }, { immediate: true }) function onCalcClick () { - if (props.showCalcButton && value.value != null && value.value >= props.min && value.value <= props.max) { + if (props.showCalcButton && !isCalcDisabled.value) { emit('run-process', { value: value.value }) } } diff --git a/src/components/SubMenu.vue b/src/components/SubMenu.vue index 344ec56..6163f37 100644 --- a/src/components/SubMenu.vue +++ b/src/components/SubMenu.vue @@ -57,7 +57,7 @@ diff --git a/src/components/LayerList.vue b/src/components/LayerList.vue index 1a91964..3c25030 100644 --- a/src/components/LayerList.vue +++ b/src/components/LayerList.vue @@ -25,6 +25,7 @@ v-if="layer.propertiesBox" :layer-id="layer.id" :properties-box-type="layer.propertiesBox" + :flash-when-enabled="layer.flashWhenEnabled ?? false" class="mt-0" /> diff --git a/src/components/NavigationDrawer.vue b/src/components/NavigationDrawer.vue index 0b4ef27..cc428ee 100644 --- a/src/components/NavigationDrawer.vue +++ b/src/components/NavigationDrawer.vue @@ -52,6 +52,9 @@ :requires-confirmation="step.requiresConfirmation || false" :confirmation-source="step.confirmationSource || 'component'" :explanation="step.explanation || ''" + :explanation-flash-when-available="step.explanationFlashWhenAvailable || false" + :confirm-flash-when-enabled="step.confirmFlashWhenEnabled || false" + :required-selections="step.requiredSelections || []" :process="step.process || null" /> diff --git a/src/components/NumberInput.vue b/src/components/NumberInput.vue index d93c450..bb3433d 100644 --- a/src/components/NumberInput.vue +++ b/src/components/NumberInput.vue @@ -14,17 +14,22 @@ hide-details class="number-input__field" /> - + :enabled="needsCalcInteraction" + :flash-when-enabled="flashWhenEnabled" + > + + @@ -34,6 +39,7 @@ import { useAppStore } from '@/stores/app' import { useMapStore } from '@/stores/map' import { resolveInputValue } from '@/lib/ogc-process/resolve-input' + import FlashHighlight from '@/components/FlashHighlight.vue' const appStore = useAppStore() const mapStore = useMapStore() @@ -50,6 +56,7 @@ requiresCalcCondition: { type: Boolean, default: false }, calcConditionSource: { type: String, default: null }, calcButtonTitle: { type: String, default: 'Calculate' }, + flashWhenEnabled: { type: Boolean, default: false }, }) const emit = defineEmits(['step-ready', 'run-process']) @@ -64,6 +71,7 @@ }) const value = ref(resolvedDefault.value) + const lastRunValue = ref(null) const calcConditionMet = computed(() => { if (!props.requiresCalcCondition) return true @@ -80,6 +88,11 @@ return invalidValue || !calcConditionMet.value }) + const needsCalcInteraction = computed(() => { + if (!props.showCalcButton || isCalcDisabled.value) return false + return lastRunValue.value !== value.value + }) + watch(resolvedDefault, (newVal) => { if (newVal != null) { value.value = newVal @@ -94,6 +107,7 @@ function onCalcClick () { if (props.showCalcButton && !isCalcDisabled.value) { + lastRunValue.value = value.value emit('run-process', { value: value.value }) } } diff --git a/src/components/SelectionList.vue b/src/components/SelectionList.vue index 7339be2..bdd04ad 100644 --- a/src/components/SelectionList.vue +++ b/src/components/SelectionList.vue @@ -1,16 +1,22 @@ - + + + {{ confirmLabel }} @@ -29,15 +35,18 @@