diff --git a/app/public/mock/v1/overview/tasks.GET.json b/app/public/mock/v1/overview/tasks.GET.json index fe7015c..3bd143d 100644 --- a/app/public/mock/v1/overview/tasks.GET.json +++ b/app/public/mock/v1/overview/tasks.GET.json @@ -35,12 +35,12 @@ "time": 70 } ], - "dates": [ + "tasks": [ { "id": 1, "task_id": 1, - "starts_at": "2022-12-06T08:01:00+00:00", - "ends_at": "2022-12-06T09:00:00+00:00", + "starts_at": "2022-12-12T08:01:00+00:00", + "ends_at": "2022-12-12T09:00:00+00:00", "title": "title", "project_code": "CO-2201", "master_task_color": "#E9FFE6" @@ -49,8 +49,8 @@ { "id": 2, "task_id": 2, - "starts_at": "2022-12-06T08:00:00+00:00", - "ends_at": "2022-12-06T10:00:00+00:00", + "starts_at": "2022-12-12T08:00:00+00:00", + "ends_at": "2022-12-12T10:00:00+00:00", "title": "title", "project_code": "CO-2201", "master_task_color": "#FDE1FF" @@ -59,8 +59,8 @@ { "id": 4, "task_id": null, - "starts_at": "2022-12-06T07:00:00+00:00", - "ends_at": "2022-12-06T11:00:00+00:00", + "starts_at": "2022-12-13T07:00:00+00:00", + "ends_at": "2022-12-13T11:00:00+00:00", "title": "title", "is_blocker": true, "master_task_color": null @@ -69,8 +69,8 @@ { "id": 5, "task_id": 1, - "starts_at": "2022-12-07T09:00:00+00:00", - "ends_at": "2022-12-07T12:00:00+00:00", + "starts_at": "2022-12-13T09:00:00+00:00", + "ends_at": "2022-12-13T12:00:00+00:00", "title": "title", "project_code": "CO-2201", "master_task_color": "#E9FFE6" @@ -79,8 +79,8 @@ { "id": 6, "task_id": 2, - "starts_at": "2022-12-07T12:00:00+00:00", - "ends_at": "2022-12-07T16:00:00+00:00", + "starts_at": "2022-12-14T12:00:00+00:00", + "ends_at": "2022-12-14T16:00:00+00:00", "title": "title", "project_code": "CO-2201", "master_task_color": "#E7DBF8" diff --git a/app/src/plugins/app@vendor/vue-cal/weekdays-headings.vue b/app/src/plugins/app@vendor/vue-cal/weekdays-headings.vue index 5bb11cb..1a1bc63 100644 --- a/app/src/plugins/app@vendor/vue-cal/weekdays-headings.vue +++ b/app/src/plugins/app@vendor/vue-cal/weekdays-headings.vue @@ -4,7 +4,7 @@ template(v-for="(heading, i) in headings" :key="i") .vuecal__flex.vuecal__heading( v-if="!heading.hide" - :class="{ today: heading.today, clickable: cellHeadingsClickable, 'yesterday-cell' : new Date(heading.date).toLocaleDateString('sk-SK') == new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString('sk-SK') }" + :class="{ today: heading.today, 'today-cell' : heading.today, clickable: cellHeadingsClickable, 'yesterday-cell' : new Date(heading.date).toLocaleDateString('sk-SK') == new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString('sk-SK') }" :style="weekdayCellStyles" @click="view.id === 'week' && selectCell(heading.date, $event)" @dblclick="view.id === 'week' && vuecal.dblclickToNavigate && switchToNarrowerView()") @@ -58,10 +58,16 @@ export default { let todayFound = false const headings = this.weekDays.map((cell, i) => { const date = this.utils.date.addDays(this.view.startDate, this.vuecal.startWeekOnSunday ? i - 1 : i) - let unscheduledTime = this.unscheduledTime[i].time ? this.unscheduledTime[i].time : 0 - unscheduledTime = Math.floor(unscheduledTime / 60) + "," + String(unscheduledTime % 60)[0] - const name = this.unscheduledTime[i].name + " " + this.unscheduledTime[i].surname - const initials = this.unscheduledTime[i].name.charAt(0).toUpperCase() + this.unscheduledTime[i].surname.charAt(0).toUpperCase() + let unscheduledTime = null + let name = null + let initials = null + if (this.unscheduledTime[i]?.time) { + unscheduledTime = Math.floor(this.unscheduledTime[i].time / 60) + "," + String(this.unscheduledTime[i].time % 60)[0] + } + if (this.unscheduledTime[i]?.name && this.unscheduledTime[i]?.name) { + name = this.unscheduledTime[i].name + " " + this.unscheduledTime[i].surname + initials = this.unscheduledTime[i].name.charAt(0).toUpperCase() + this.unscheduledTime[i].surname.charAt(0).toUpperCase() + } return { hide: cell.hide, 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 ea6ce82..9ac0ace 100644 --- a/app/src/plugins/tm@dashboard/tasks/_components/z-timeline.vue +++ b/app/src/plugins/tm@dashboard/tasks/_components/z-timeline.vue @@ -9,7 +9,7 @@ :selected-date="calConfig.date" :onEventClick="taskClicked" :editable-events="vueCalConfig.editing" - :events="calData.dates" + :events="calData.tasks" :unscheduledTime="calData.unscheduled_times" :overlaps-per-time-step="false" :showTimeInCells="false" @@ -26,7 +26,7 @@
{{ getHeadingDate(heading.date) }}
-{{heading.initials}}