diff --git a/.gitignore b/.gitignore index 8ee54e8..0b3b8e9 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,14 @@ coverage /cypress/videos/ /cypress/screenshots/ +public +public/ +public/* + + # Editor directories and files +.vscode +.vscode/ .vscode/* !.vscode/extensions.json .idea diff --git a/README.md b/README.md index acd524a..a528774 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,8 @@ # odin-todo-vue -This template should help get you started developing with Vue 3 in Vite. +![preview](image.png) -## Recommended IDE Setup - -[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). - -## Customize configuration - -See [Vite Configuration Reference](https://vitejs.dev/config/). +using vue, vue-modal dialogs, vue dropdown, vue 3 date picker, tailwind, etc... ## Project Setup diff --git a/image.png b/image.png new file mode 100644 index 0000000..aef31b8 Binary files /dev/null and b/image.png differ diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 8823a79..5d60706 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -1,24 +1,31 @@ - + + + Tasks + + + + + diff --git a/src/instances/Task.vue b/src/instances/Task.vue index 0e8823e..86e04fa 100644 --- a/src/instances/Task.vue +++ b/src/instances/Task.vue @@ -19,6 +19,7 @@ const props = defineProps(['item', 'remove', 'currentProject', 'rename']) const parsedDate = parseISO(props.item.dueDate ?? ''); const isValidDate = isDateValid(parsedDate); // const formattedDate = formatDate(parsedDate, 'dd-MM-yyyy'); +const showModalDeleteTask = ref(false); const dateEnabled = ref(isValidDate); @@ -30,6 +31,12 @@ function editMe(event) { setTimeout(() => showModalEdit.value = false, 1); } +function removeMe(e) { + e.preventDefault(); + props.remove(props.item); + setTimeout(() => showModalDeleteTask.value = false, 1); +} + @@ -109,7 +116,7 @@ function editMe(event) { + @click="showModalDeleteTask = true"> Delete @@ -169,6 +176,23 @@ function editMe(event) { + + + + + + Delete {{ props.item.name }}? + + + + + + \ No newline at end of file diff --git a/src/views/TasksView.vue b/src/views/TasksView.vue index 6fdec85..9cc37ed 100644 --- a/src/views/TasksView.vue +++ b/src/views/TasksView.vue @@ -33,7 +33,24 @@ function newTask(event) { let form = new FormData(event.srcElement); let values = form.values(); let item = toRaw(currentProject.value).newTask(values.next().value); - item.changeDescription(values.next().value.trim()); + let desc = values.next().value.trim(); + if (desc != "") { + item.changeDescription(desc); + } else { + item.changeDescription(null); + } + values.next(); + + + let dateDate = values.next().value; + if (dateDate) { + let testDate = new Date(dateDate).toISOString(); + item.changeDueDate(testDate); + console.log(testDate); + } else { + item.changeDueDate(null); + } + setTimeout(() => showModalAddTask.value = false, 1); refreshTasks(); } @@ -64,9 +81,9 @@ function editTask(event, item) { function removeTask(item) { console.log(toRaw(item)) - if (confirm(`Are you sure you want to remove task ${toRaw(item).name}?`)) { - toRaw(item).remove(); - } + // if (confirm(`Are you sure you want to remove task ${toRaw(item).name}?`)) { + toRaw(item).remove(); + // } refreshTasks(); } @@ -100,6 +117,10 @@ function checkIfAtLeastOneDone() { } +const dateEnabled = ref(false); + +const dateE = ref(null); + @@ -121,6 +142,12 @@ function checkIfAtLeastOneDone() { Description + + Due date + Enabled + + +