From 8521f5429bfc91f020b64490d2e9e5adcf8c186c Mon Sep 17 00:00:00 2001 From: JakubPapso Date: Mon, 26 Feb 2024 15:34:36 +0100 Subject: [PATCH 1/2] [timeline] selected employee prefill --- app/src/plugins/app@vendor/vue-cal/cell.vue | 2 +- .../plugins/tm@dashboard/tasks/_components/a-tasks-filter.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/plugins/app@vendor/vue-cal/cell.vue b/app/src/plugins/app@vendor/vue-cal/cell.vue index 674c665..71e513c 100644 --- a/app/src/plugins/app@vendor/vue-cal/cell.vue +++ b/app/src/plugins/app@vendor/vue-cal/cell.vue @@ -265,7 +265,7 @@ export default { const time = moment(dateFrom).format('HH:mm') const isTeamCalendar = this.$route.name === 'Dashboard - Teams' - const employee = isTeamCalendar ? split.employee_id : this.user.id + const employee = isTeamCalendar ? split.employee_id : Number(localStorage.getItem('selectedEmployee') || this.user.id) this.$events.emit('show-menu-modal', { time, diff --git a/app/src/plugins/tm@dashboard/tasks/_components/a-tasks-filter.vue b/app/src/plugins/tm@dashboard/tasks/_components/a-tasks-filter.vue index 1978e83..b97c2ea 100644 --- a/app/src/plugins/tm@dashboard/tasks/_components/a-tasks-filter.vue +++ b/app/src/plugins/tm@dashboard/tasks/_components/a-tasks-filter.vue @@ -53,7 +53,7 @@ export default { }, mounted() { - this.selectedEmployee = this.user.id + this.selectedEmployee = Number(localStorage.getItem('selectedEmployee') || this.user.id) // this.time = this.unscheduledTime this.$nextTick(() => this._updateFilters()) }, @@ -88,6 +88,7 @@ export default { selectedEmployee(id) { this.filter.employee = this.enrichedEmployees.find(employee => employee.id == id) this._emitFilterChanged() + localStorage.setItem('selectedEmployee', id) }, splitDays() { From f13afeb72e04e8b145869dfd5a9786643e9bff8a Mon Sep 17 00:00:00 2001 From: JakubPapso Date: Mon, 26 Feb 2024 16:44:53 +0100 Subject: [PATCH 2/2] [timeline] timeblocks jumping --- .../tm@dashboard/_components/z-timeline.vue | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/src/plugins/tm@dashboard/_components/z-timeline.vue b/app/src/plugins/tm@dashboard/_components/z-timeline.vue index 790d58b..564d876 100644 --- a/app/src/plugins/tm@dashboard/_components/z-timeline.vue +++ b/app/src/plugins/tm@dashboard/_components/z-timeline.vue @@ -211,23 +211,23 @@ export default { async eventMoved({ event, newSplit }) { const date = addDays(this.calConfig.date, newSplit - 1) - const start = date.setHours(Math.round(event.startTimeMinutes / 60), Math.round(event.startTimeMinutes % 60), 0) - const end = date.setHours(Math.round(event.endTimeMinutes / 60), Math.round(event.endTimeMinutes % 60), 0) + const start = date.setHours(Math.floor(event.startTimeMinutes / 60), Math.round(event.startTimeMinutes % 60), 0) + const end = date.setHours(Math.floor(event.endTimeMinutes / 60), Math.round(event.endTimeMinutes % 60), 0) const split = this.splits.find(split => split.id == newSplit ) if(this.$route.name == 'Dashboard - Tasks') { const editedSubtask = { ...event.subtask, - timeblocks: [...event.subtask.timeblocks, { - id: event._timeblock_id, - is_finished: 0, - start: tmUtils.formatDateTimeForBackend(start), - end: tmUtils.formatDateTimeForBackend(end) - }], - timesheets: event.subtask.timesheets.map((timesheet) => { - delete timesheet.employee_name - return timesheet - }) + timeblocks: [...event.subtask.timeblocks, { + id: event._timeblock_id, + is_finished: 0, + start: tmUtils.formatDateTimeForBackend(start), + end: tmUtils.formatDateTimeForBackend(end) + }], + timesheets: event.subtask.timesheets.map((timesheet) => { + delete timesheet.employee_name + return timesheet + }) } try {