diff --git a/app/public/mock/v1/tasks/(id).GET.json b/app/public/mock/v1/tasks/(id).GET.json index 320d663..5dd1e78 100644 --- a/app/public/mock/v1/tasks/(id).GET.json +++ b/app/public/mock/v1/tasks/(id).GET.json @@ -7,7 +7,18 @@ "duration": 5400000, "spent_time": 3000000, "is_finished": false, - "dates": [], + "timeblocks": [ + { + "id": 43, + "start": "2023-01-31 04:02:17", + "end": "2023-01-31 08:23:05" + }, + { + "id": 52, + "start": "2023-09-26 01:01:17", + "end": "2024-02-11 08:23:05" + } + ], "master_task": { "id": 1, "name": "Master task 1", diff --git a/app/src/plugins/app/_config/App.vue b/app/src/plugins/app/_config/App.vue index 19efa9f..6de527d 100644 --- a/app/src/plugins/app/_config/App.vue +++ b/app/src/plugins/app/_config/App.vue @@ -5,16 +5,17 @@ - - + + - - - - - + + + + + + - + diff --git a/app/src/plugins/tm@modal/master-task/z-delete-master-task-modal.vue b/app/src/plugins/tm@modal/master-task/z-delete-master-task-modal.vue new file mode 100644 index 0000000..14fbffb --- /dev/null +++ b/app/src/plugins/tm@modal/master-task/z-delete-master-task-modal.vue @@ -0,0 +1,54 @@ + + + \ No newline at end of file diff --git a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue index af6d06c..c62c19e 100644 --- a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue +++ b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue @@ -133,8 +133,8 @@ @@ -177,9 +177,9 @@ - + - +
- -

{{ masterTask.team }}

-
+ +

Tu bude vypisany nazov Timu

+

{{ employee.name.charAt(0) + employee.surname.charAt(0) }}

@@ -273,19 +273,18 @@
- - - {{ masterTask.name }} + + {{ task.master_task }}

- {{ employee.name.charAt(0) + employee.surname.charAt(0) }} + {{ getFullNameByEmployeeId(task.employee_id).initials }}

-

+

{{ getFullNameByEmployeeId(task.employee_id).fullName }}

- checkmark-icon - pencil-icon + checkmark-icon + pencil-icon trash-icon
@@ -293,7 +292,7 @@
- Pridať Subtask + Pridať Subtask
@@ -358,11 +357,34 @@ export default { } }, + mounted() { + this.$events.on('on-master-task-deleted', (masterTask) => { + if (masterTask?.id == this.masterTask?.id) this.closeModal() + }) + }, + methods: { itemSelected(x) { console.log(x) }, + getFullNameByEmployeeId(employee_id) { + let fullName = '' + let initials = '' + this.employees.forEach(employee => { + if (employee.id === employee_id) { + fullName = `${employee.name} ${employee.surname}` + initials = employee.name.charAt(0) + employee.surname.charAt(0) + } + }) + return { + fullName, + initials + } + + }, + + async showModal(masterTask, editMode = false) { this.visible = true this.masterTask = null @@ -385,7 +407,6 @@ export default { } catch (error) { this.$toast.error(error) } - console.log(this.masterTask) }, async save() { @@ -410,15 +431,8 @@ export default { this.$emit('close', this.masterTask) }, - async _delete() { - // Kravarik: Tu sa ma volat delete-master-task-modal, ak taka funkcionalita vlastne je - - // try { - // await this.$axios.delete(`v1/master-tasks/${this.masterTask.id}`) - // this.closeModal() - // } catch (error) { - // this.$toast.error(error) - // } + openDeleteMasterTaskModal(masterTask) { + this.$events.emit('show-delete-master-task-modal', { masterTask }) }, employeeSelected(selectedOption) { @@ -429,7 +443,11 @@ export default { filesUploaded(files) { this.masterTask.files = files - } + }, + + addTask() { + this.$events.emit('show-task-modal', {}) + }, }, computed: { @@ -502,9 +520,6 @@ export default { .scrolling overflow: hidden !important -.scroll-employees - overflow-x: scroll - .border-bottom border-bottom: 1px solid rgba(0,0,0,.1) diff --git a/app/src/plugins/tm@modal/task/z-delete-task-modal.vue b/app/src/plugins/tm@modal/task/z-delete-task-modal.vue index 56c1962..5ca82b4 100644 --- a/app/src/plugins/tm@modal/task/z-delete-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-delete-task-modal.vue @@ -8,6 +8,7 @@ @click.stop="closeModal()" icon="mdi-close" size="large" + class="mb-15" >
@@ -20,7 +21,7 @@