diff --git a/public/icons/edit.svg b/public/icons/edit.svg
new file mode 100644
index 0000000..9f36b2d
--- /dev/null
+++ b/public/icons/edit.svg
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/src/modules/task/components/TaskForm.vue b/src/modules/task/components/TaskForm.vue
index 5b080ee..3ba9487 100644
--- a/src/modules/task/components/TaskForm.vue
+++ b/src/modules/task/components/TaskForm.vue
@@ -3,19 +3,20 @@ import EstimationTimeArrival from '@/components/EstimationTimeArrival.vue'
import { computed, ref } from 'vue'
import { useRouter } from 'vue-router'
import type { Stepable } from '../interfaces/stepable'
+import type { Taskable } from '../interfaces/taskable'
import { Task } from '../models/task'
import { useTaskStore } from '../stores/useTask.store'
import StepInput from './StepInput.vue'
const store = useTaskStore()
const router = useRouter()
-const props = defineProps<{ id: string }>()
+const props = defineProps<{ id: string; initialTask?: Taskable }>()
const id = computed(() => props.id)
-const steps = ref([])
+const steps = ref(props.initialTask?.steps ?? [])
-const title = ref('')
-const link = ref('')
+const title = ref(props.initialTask?.title ?? '')
+const link = ref(props.initialTask?.link ?? '')
const totalEstimation = computed(() =>
steps.value.map((step) => step.estimation).reduce((a, b) => a + b, 0)
diff --git a/src/router/index.ts b/src/router/index.ts
index bfc9e07..3f1c90e 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -25,6 +25,12 @@ export const router = createRouter({
props: true,
component: () => import('../views/task/TaskView.vue')
},
+ {
+ path: '/task/:id/edit',
+ name: 'edit-task',
+ props: true,
+ component: () => import('../views/task/EditTask.vue')
+ },
{
path: '/task/:taskId/record',
name: 'record-view',
diff --git a/src/views/task/EditTask.vue b/src/views/task/EditTask.vue
new file mode 100644
index 0000000..482fe4f
--- /dev/null
+++ b/src/views/task/EditTask.vue
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
Task not found.
+
+
+ go to homepage
+
+
+
+
+
diff --git a/src/views/task/TaskView.vue b/src/views/task/TaskView.vue
index 6d227fe..cca7985 100644
--- a/src/views/task/TaskView.vue
+++ b/src/views/task/TaskView.vue
@@ -26,9 +26,22 @@ const deleteTask = () => {
-
+
{{ task.title }}
@@ -65,7 +78,7 @@ const deleteTask = () => {
max-width: 600px;
}
-.delete-task {
+.actions {
float: right;
}