From b5eaf0b637cda81d27a8157b7e988ae28bcd8390 Mon Sep 17 00:00:00 2001 From: baldo Date: Fri, 26 Aug 2022 18:01:06 +0200 Subject: [PATCH] Allow picking coordinates from map. --- frontend/src/components/NodeMap.vue | 78 +++++++++++++-- .../components/form/ValidationFormInput.vue | 21 +++- .../components/nodes/NodeCoordinatesInput.vue | 95 +++++++++++++++++++ .../src/components/nodes/NodeCreateForm.vue | 18 +++- .../src/components/nodes/NodeDeleteForm.vue | 1 + frontend/src/scss/_variables.scss | 7 +- 6 files changed, 205 insertions(+), 15 deletions(-) create mode 100644 frontend/src/components/nodes/NodeCoordinatesInput.vue diff --git a/frontend/src/components/NodeMap.vue b/frontend/src/components/NodeMap.vue index a4952b4..ec5a64c 100644 --- a/frontend/src/components/NodeMap.vue +++ b/frontend/src/components/NodeMap.vue @@ -1,21 +1,32 @@ diff --git a/frontend/src/components/form/ValidationFormInput.vue b/frontend/src/components/form/ValidationFormInput.vue index 54c8c74..d6a9e44 100644 --- a/frontend/src/components/form/ValidationFormInput.vue +++ b/frontend/src/components/form/ValidationFormInput.vue @@ -4,8 +4,9 @@ import { type Constraint, forConstraint } from "@/shared/validation/validator"; import ExpandableHelpBox from "@/components/ExpandableHelpBox.vue"; interface Props { + name: string; modelValue?: string; - label: string; + label?: string; type?: string; placeholder: string; constraint: Constraint; @@ -19,7 +20,11 @@ const emit = defineEmits<{ }>(); const displayLabel = computed(() => - props.constraint.optional ? props.label : `${props.label}*` + props.label + ? props.constraint.optional + ? props.label + : `${props.label}*` + : undefined ); const input = ref(); @@ -75,17 +80,27 @@ onMounted(() => {