From 1cfdf1b04438143554dd3d2e37b98e77af67fa09 Mon Sep 17 00:00:00 2001 From: romankko2 Date: Thu, 7 Sep 2023 20:38:15 +0200 Subject: [PATCH 1/9] [mastertask] complete mastertask --- .../z-complete-master-task-modal.vue | 5 +++-- .../master-task/z-master-task-modal.vue | 19 ++++++++++++++++--- .../tm@modal/task/z-complete-task-modal.vue | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/app/src/plugins/tm@modal/master-task/z-complete-master-task-modal.vue b/app/src/plugins/tm@modal/master-task/z-complete-master-task-modal.vue index dbd3066..77e5033 100644 --- a/app/src/plugins/tm@modal/master-task/z-complete-master-task-modal.vue +++ b/app/src/plugins/tm@modal/master-task/z-complete-master-task-modal.vue @@ -22,7 +22,7 @@ import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin' export default { mixins: [ modalMixin ], - emits: ['close', 'on-master-task-edited'], + emits: ['close', 'master-task-edited'], data() { return { @@ -43,7 +43,8 @@ export default { const { mastertask } = await this.$axios.put_auth(`v1/mastertasks/${tempMastertask.id}`, tempMastertask) this.visible = false - this.$emit('on-master-task-edited', mastertask) + this.$emit('master-task-edited', mastertask) + this.$events.emit('close-both-modals') } catch (error) { this.$toast.error(error) } 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 f1ab6c6..42f8503 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 @@ -60,7 +60,7 @@ @@ -184,6 +184,8 @@ export default { }, mounted() { + this.$events.on('close-both-modals', this.closeBothModals) + this.$events.on('master-task:team-member-deleted', ({ teamId, memberId }) => { if (this.mastertask.team_id != teamId) return @@ -216,9 +218,15 @@ export default { this.$events.off('on-subtask-deleted') this.$events.off('on-subtask-edited') this.$events.off('master-task:team-member-deleted') + this.$events.off('close-both-modals', this.closeBothModals) }, methods: { + closeBothModals() { + this.$emit('close') + this.visible = false + }, + removeEmployee({ id }) { // const isEmployeeInTeam = this.mastertask.team?.employees.find(employee => employee.id == id) @@ -253,6 +261,11 @@ export default { this.mastertask.project_id = project?.id || null this.mastertask.team_id = this.mastertask.team?.id || null + // this.mastertask.subtasks.forEach(({ employee_id, duration}) => { + // const employee = this.mastertask.employees.find(({ id }) => id == employee_id) + // employee.duration = duration + // }) + // this.mastertask.project_code = project.code } else { this.mastertask = { employees: [], duration: 0, _deadline_time: '17:00' } @@ -264,8 +277,8 @@ export default { } }, - async toggleIsFinished(mastertask) { - this.$events.emit('show-complete-master-task-modal', { mastertask }) + toggleIsFinished() { + this.$events.emit('show-complete-master-task-modal', { mastertask: this.mastertask }) }, async save() { diff --git a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue index 5fb9b78..8c54fa1 100644 --- a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue @@ -43,7 +43,7 @@ export default { delete timesheet.employee_name return timesheet })} - const { subtask } = await this.$axios.put_auth(`v1/subtasks/${tempSubtask.id}`, tempSubtask) + const { subtask } = await this.$axios.put_auth(`v1/subtasks/${tempSubtask.id}`, tempSubtask) this.visible = false this.$emit('on-subtask-edited', subtask) From 561f8942b0c5e8759ff1a32a082c8f0d035ae487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Mon, 11 Sep 2023 12:27:02 +0200 Subject: [PATCH 2/9] [Mastertask modal] Duration edit fix --- .../_components/a-mastertask-description.vue | 2 +- .../master-task/z-master-task-modal.vue | 25 +++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/src/plugins/tm@modal/master-task/_components/a-mastertask-description.vue b/app/src/plugins/tm@modal/master-task/_components/a-mastertask-description.vue index 30abd81..a3205d2 100644 --- a/app/src/plugins/tm@modal/master-task/_components/a-mastertask-description.vue +++ b/app/src/plugins/tm@modal/master-task/_components/a-mastertask-description.vue @@ -2,7 +2,7 @@ - + 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 42f8503..fcc5622 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 @@ -25,7 +25,7 @@ -