From 4597fc5e68b26ae0e1ee11fab28dffb6306024f0 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Tue, 29 Aug 2023 22:27:14 +0200 Subject: [PATCH] add "add steps" form --- public/icons/plus.svg | 9 ++++ .../record/components/RecordControls.vue | 22 ++++++++- src/modules/task/components/NewStepsForm.vue | 48 +++++++++++++++++++ src/modules/task/components/StepInput.vue | 21 +++++--- 4 files changed, 92 insertions(+), 8 deletions(-) create mode 100644 public/icons/plus.svg create mode 100644 src/modules/task/components/NewStepsForm.vue diff --git a/public/icons/plus.svg b/public/icons/plus.svg new file mode 100644 index 0000000..21b0bfa --- /dev/null +++ b/public/icons/plus.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/modules/record/components/RecordControls.vue b/src/modules/record/components/RecordControls.vue index 8363dd4..b00a41e 100644 --- a/src/modules/record/components/RecordControls.vue +++ b/src/modules/record/components/RecordControls.vue @@ -3,9 +3,11 @@ import { useTaskStore } from '@/modules/task/stores/useTask.store' import { toISODate } from '@/shared/types/date' import { useActiveElement, useMagicKeys, whenever } from '@vueuse/core' import { logicAnd } from '@vueuse/math' -import { computed, onUnmounted } from 'vue' +import { computed, onUnmounted, ref } from 'vue' import type { TaskRecord } from '../models/task-record' import { useTaskRecordStore } from '../stores/useTaskRecordStore' +import NewStepsFormVue from '@/modules/task/components/NewStepsForm.vue' +import type { Stepable } from '@/modules/task/interfaces/stepable' const props = defineProps<{ taskId: string @@ -75,6 +77,16 @@ const nextStep = () => { }) } +const isAddingSteps = ref(false) +const addStepsForm = () => { + isAddingSteps.value = true +} + +const addSteps = (steps: Stepable[]) => { + console.log(steps) + isAddingSteps.value = false +} + const activeElement = useActiveElement() const INPUT_MATTERS = ['INPUT', 'TEXTAREA'] const notUsingInput = computed( @@ -145,6 +157,9 @@ onUnmounted(() => { +