warn the user that records are reset when editing task
This commit is contained in:
@@ -2,16 +2,30 @@
|
|||||||
import TaskForm from '@/modules/task/components/TaskForm.vue'
|
import TaskForm from '@/modules/task/components/TaskForm.vue'
|
||||||
import TaskNotFound from '@/modules/task/components/TaskNotFound.vue'
|
import TaskNotFound from '@/modules/task/components/TaskNotFound.vue'
|
||||||
import { useTaskStore } from '@/modules/task/stores/useTask.store'
|
import { useTaskStore } from '@/modules/task/stores/useTask.store'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
const props = defineProps<{ id: string }>()
|
const props = defineProps<{ id: string }>()
|
||||||
const store = useTaskStore()
|
const taskStore = useTaskStore()
|
||||||
|
|
||||||
const task = store.getTask(props.id)
|
const isMessageDisplayed = ref(true)
|
||||||
|
|
||||||
|
const task = taskStore.getTask(props.id)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="edit-task">
|
<div class="edit-task">
|
||||||
<TaskForm v-if="task" :id="task.id" :initial-task="task" />
|
<TaskForm v-if="task" :id="task.id" :initial-task="task" />
|
||||||
<task-not-found v-else />
|
<task-not-found v-else />
|
||||||
|
<article v-if="isMessageDisplayed" class="message is-info">
|
||||||
|
<div class="message-header">
|
||||||
|
<p>Info</p>
|
||||||
|
<button
|
||||||
|
class="delete"
|
||||||
|
aria-label="delete"
|
||||||
|
@click="isMessageDisplayed = false"
|
||||||
|
></button>
|
||||||
|
</div>
|
||||||
|
<div class="message-body">When editing a task, record will be reset.</div>
|
||||||
|
</article>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user