From b56287c535e55d6b94539142a05335ffb780bff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Kalu=C5=BEa?= Date: Mon, 9 Jan 2023 16:00:25 +0100 Subject: [PATCH] [timeline] dynamicke tyzdne, non-working hours --- app/public/mock/v1/overview/tasks.GET.json | 39 ++++----- app/src/plugins/app@vendor/vue-cal/event.vue | 3 +- app/src/plugins/app@vendor/vue-cal/index.vue | 7 +- .../tasks/_components/a-tasks-filter.vue | 4 +- .../tasks/_components/z-timeline.vue | 83 +++++++++++++------ app/src/plugins/tm@dashboard/tasks/tasks.vue | 75 +++++++++++++++-- app/src/plugins/tm@dashboard/teams/teams.vue | 6 ++ 7 files changed, 156 insertions(+), 61 deletions(-) diff --git a/app/public/mock/v1/overview/tasks.GET.json b/app/public/mock/v1/overview/tasks.GET.json index ed8f7a7..8d9873c 100644 --- a/app/public/mock/v1/overview/tasks.GET.json +++ b/app/public/mock/v1/overview/tasks.GET.json @@ -39,9 +39,9 @@ { "id": 1, "task_id": 1, - "starts_at": "2023-01-03T08:01:00+00:00", - "ends_at": "2023-01-03T09:00:00+00:00", - "title": "Task 1", + "starts_at": "2023-01-08T08:01:00+00:00", + "ends_at": "2023-01-08T09:00:00+00:00", + "title": "Task DNES", "project_code": "CO-2201", "master_task_color": "#E9FFE6" }, @@ -49,8 +49,8 @@ { "id": 2, "task_id": 2, - "starts_at": "2023-01-03T08:30:00+00:00", - "ends_at": "2023-01-03T09:00:00+00:00", + "starts_at": "2023-01-08T08:30:00+00:00", + "ends_at": "2023-01-08T09:00:00+00:00", "title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e", "project_code": "CO-2201", "master_task_color": "#f27e57" @@ -59,8 +59,8 @@ { "id": 3, "task_id": 3, - "starts_at": "2023-01-03T10:30:00+00:00", - "ends_at": "2023-01-03T10:45:00+00:00", + "starts_at": "2023-01-08T10:30:00+00:00", + "ends_at": "2023-01-08T10:45:00+00:00", "title": "Kratky 15min", "project_code": "CO-2201", "master_task_color": "#57e0f2" @@ -69,8 +69,8 @@ { "id": 4, "task_id": 4, - "starts_at": "2023-01-03T08:00:00+00:00", - "ends_at": "2023-01-03T10:00:00+00:00", + "starts_at": "2023-01-08T08:00:00+00:00", + "ends_at": "2023-01-08T10:00:00+00:00", "title": "Task 2", "project_code": "CO-2201", "master_task_color": "#FDE1FF" @@ -79,8 +79,8 @@ { "id": 6, "task_id": 6, - "starts_at": "2023-01-04T09:00:00+00:00", - "ends_at": "2023-01-04T12:00:00+00:00", + "starts_at": "2023-01-09T09:00:00+00:00", + "ends_at": "2023-01-09T12:00:00+00:00", "title": "Task 6", "project_code": "CO-2201", "master_task_color": "#57e0f2" @@ -89,8 +89,8 @@ { "id": 7, "task_id": 7, - "starts_at": "2023-01-05T12:00:00+00:00", - "ends_at": "2023-01-05T16:00:00+00:00", + "starts_at": "2023-01-10T12:00:00+00:00", + "ends_at": "2023-01-10T16:00:00+00:00", "title": "Task 7", "project_code": "CO-2201", "master_task_color": "#E7DBF8" @@ -99,8 +99,8 @@ { "id": 8, "task_id": 8, - "starts_at": "2023-01-03T07:00:00+00:00", - "ends_at": "2023-01-03T09:00:00+00:00", + "starts_at": "2023-01-08T07:00:00+00:00", + "ends_at": "2023-01-08T09:00:00+00:00", "title": "Task 8", "project_code": "CO-2201", "master_task_color": "#57e0f2" @@ -109,8 +109,8 @@ { "id": 9, "task_id": 9, - "starts_at": "2023-01-04T09:00:00+00:00", - "ends_at": "2023-01-04T12:00:00+00:00", + "starts_at": "2023-01-09T09:00:00+00:00", + "ends_at": "2023-01-09T12:00:00+00:00", "title": "Task 9", "project_code": "CO-2201", "master_task_color": "#E9FFE6" @@ -119,12 +119,13 @@ { "id": 10, "task_id": 10, - "starts_at": "2023-01-03T12:00:00+00:00", - "ends_at": "2023-01-03T13:00:00+00:00", + "starts_at": "2023-01-08T12:00:00+00:00", + "ends_at": "2023-01-08T13:00:00+00:00", "title": "Task 10", "project_code": "CO-2201", "master_task_color": "#57e0f2" } + ] }, "status": 200 diff --git a/app/src/plugins/app@vendor/vue-cal/event.vue b/app/src/plugins/app@vendor/vue-cal/event.vue index ca6b7b9..f352468 100644 --- a/app/src/plugins/app@vendor/vue-cal/event.vue +++ b/app/src/plugins/app@vendor/vue-cal/event.vue @@ -157,9 +157,8 @@ export default { }, onDragStart(e) { - console.log(`ID from dragStart: ${this.event.id}`) + if (this.event.nonWorking) return this.event.draggingStatic = false - this.dnd && this.dnd.eventDragStart(e, this.event); }, diff --git a/app/src/plugins/app@vendor/vue-cal/index.vue b/app/src/plugins/app@vendor/vue-cal/index.vue index 7db0629..6d928bc 100644 --- a/app/src/plugins/app@vendor/vue-cal/index.vue +++ b/app/src/plugins/app@vendor/vue-cal/index.vue @@ -16,7 +16,7 @@ - -
+
{{ split.label }}
@@ -1307,7 +1307,8 @@ export default { } this.$refs['vuecal_scroll'].addEventListener('scroll', () => { - this.$refs['vuecal_weekday_heading'].onTimelineScroll(this.$refs['vuecal_scroll'].scrollTop) + // this.$refs['vuecal_splits_heading'].onTimelineScroll(this.$refs['vuecal_scroll'].scrollTop) + this.$refs['vuecal_splits_heading'].style.top = `${this.$refs['vuecal_scroll'].scrollTop}px` }) this.viewportTimelineOffset = this.$refs['vuecal_scroll'].getBoundingClientRect().top 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 b965b4c..c2335c1 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 @@ -47,8 +47,8 @@ export default { methods: { getWeek() { - this.firstDay = addDays(startOfWeek(this.date), 1) - this.lastDay = addDays(endOfWeek(this.date), 1) + this.firstDay = subDays(this.date, 1) + this.lastDay = addDays(this.date, 5) this.$emit('weekChange', {firstDay: this.firstDay, lastDay: this.lastDay}) this.selectedDate = String(this.firstDay.toLocaleDateString('sk-SK') + ' - ' + this.lastDay.toLocaleDateString('sk-SK')) diff --git a/app/src/plugins/tm@dashboard/tasks/_components/z-timeline.vue b/app/src/plugins/tm@dashboard/tasks/_components/z-timeline.vue index 5e475a2..d3c02fc 100644 --- a/app/src/plugins/tm@dashboard/tasks/_components/z-timeline.vue +++ b/app/src/plugins/tm@dashboard/tasks/_components/z-timeline.vue @@ -3,7 +3,8 @@ -