From d6ac93c1d1867b2f1fc06935d74bb88010175a64 Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Sun, 31 Dec 2023 09:42:45 -0500 Subject: [PATCH] wip --- src/components/LabelControls.vue | 2 +- src/components/LabelEditor.vue | 11 +++++++---- src/components/ToolLabelEditor.vue | 19 ++++++++++++++++--- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/components/LabelControls.vue b/src/components/LabelControls.vue index c5e671ee2..d2c5cecfc 100644 --- a/src/components/LabelControls.vue +++ b/src/components/LabelControls.vue @@ -120,7 +120,7 @@ function deleteEditingLabel() { - -import { toRefs } from 'vue'; +import { computed, toRefs } from 'vue'; const emit = defineEmits(['done', 'cancel', 'delete', 'update:color']); -const props = defineProps({ - color: String, +const props = defineProps<{ color: string; valid: boolean }>(); +const { color, valid } = toRefs(props); +const doneDisabled = computed(() => { + console.log('valid.value', valid.value); + return !valid.value; }); -const { color } = toRefs(props); const done = () => { emit('done'); @@ -40,6 +42,7 @@ const onDelete = () => { color="secondary" variant="elevated" @click="done" + :disabled="doneDisabled" data-testid="edit-label-done-button" > Done diff --git a/src/components/ToolLabelEditor.vue b/src/components/ToolLabelEditor.vue index c1e72c307..b047e3ff2 100644 --- a/src/components/ToolLabelEditor.vue +++ b/src/components/ToolLabelEditor.vue @@ -1,5 +1,5 @@