diff --git a/app/public/mock/v1/overview/tasks.GET.json b/app/public/mock/v1/overview/tasks.GET.json index 98f2a9d..fe7015c 100644 --- a/app/public/mock/v1/overview/tasks.GET.json +++ b/app/public/mock/v1/overview/tasks.GET.json @@ -5,17 +5,45 @@ "surname": "Glasnak", "work_hours_from": "08:00", "work_hours_to": "19:00", - "unscheduled_time": 123123123, + "unscheduled_times": [ + { + "id": 1, + "time": 10 + }, + { + "id": 1, + "time": 20 + }, + { + "id": 1, + "time": 30 + }, + { + "id": 1, + "time": 40 + }, + { + "id": 1, + "time": 50 + }, + { + "id": 1, + "time": 60 + }, + { + "id": 1, + "time": 70 + } + ], "dates": [ { "id": 1, "task_id": 1, - "starts_at": "2022-12-06T08:30:00+00:00", - "ends_at": "2022-12-06T09:30:00+00:00", + "starts_at": "2022-12-06T08:01:00+00:00", + "ends_at": "2022-12-06T09:00:00+00:00", "title": "title", "project_code": "CO-2201", - "master_task_color": "#121212", - "class": "red" + "master_task_color": "#E9FFE6" }, { @@ -25,8 +53,7 @@ "ends_at": "2022-12-06T10:00:00+00:00", "title": "title", "project_code": "CO-2201", - "master_task_color": "#121212", - "class": "green" + "master_task_color": "#FDE1FF" }, { @@ -36,8 +63,7 @@ "ends_at": "2022-12-06T11:00:00+00:00", "title": "title", "is_blocker": true, - "master_task_color": null, - "class": "blue" + "master_task_color": null }, { @@ -47,8 +73,7 @@ "ends_at": "2022-12-07T12:00:00+00:00", "title": "title", "project_code": "CO-2201", - "master_task_color": "#121212", - "class": "yellow" + "master_task_color": "#E9FFE6" }, { @@ -58,8 +83,7 @@ "ends_at": "2022-12-07T16:00:00+00:00", "title": "title", "project_code": "CO-2201", - "master_task_color": "#121212", - "class": "green" + "master_task_color": "#E7DBF8" } ] }, diff --git a/app/src/plugins/app/_theme/global.sass b/app/src/plugins/app/_theme/global.sass index 449c3b9..c0457c8 100644 --- a/app/src/plugins/app/_theme/global.sass +++ b/app/src/plugins/app/_theme/global.sass @@ -33,4 +33,5 @@ th border: 1px solid #E5E5E5 !important input[type="time"]::-webkit-calendar-picker-indicator - display: none \ No newline at end of file + display: none + border: 1px solid #E5E5E5 !important diff --git a/app/src/plugins/app@vendor/vue-cal/event.vue b/app/src/plugins/app@vendor/vue-cal/event.vue index d34b089..15ec18d 100644 --- a/app/src/plugins/app@vendor/vue-cal/event.vue +++ b/app/src/plugins/app@vendor/vue-cal/event.vue @@ -224,6 +224,7 @@ export default { let width = 100 - (this.eventPosition * 10) let left = 10 * this.eventPosition / 2 let zIdnex = (this.eventPosition + 1) * 10 + let background = this.event.master_task_color if (this.vuecal.minEventWidth && width < this.vuecal.minEventWidth) { width = this.vuecal.minEventWidth @@ -233,6 +234,7 @@ export default { const { top, height } = this.eventDimensions return { + "background": background, "z-index": `${zIdnex}`, top: `${top}px`, height: `${height}px`, @@ -247,6 +249,7 @@ export default { return { [this.event.class]: !!this.event.class, + 'event-blocker': this.event.is_blocker, 'vuecal__event--focus': this.event.focused, 'vuecal__event--resizing': this.event.resizing, 'vuecal__event--background': this.event.background, diff --git a/app/src/plugins/app@vendor/vue-cal/index.vue b/app/src/plugins/app@vendor/vue-cal/index.vue index d360176..c5d16d1 100644 --- a/app/src/plugins/app@vendor/vue-cal/index.vue +++ b/app/src/plugins/app@vendor/vue-cal/index.vue @@ -46,7 +46,7 @@
- + @@ -185,6 +185,7 @@ export default { // This prevents drag creation by mistake when you want to navigate. dragToCreateThreshold: { type: Number, default: 15 }, editableEvents: { type: [Boolean, Object], default: false }, + unscheduledTime: { type: Array, default: [] }, events: { type: Array, default: () => [] }, eventsCountOnYearView: { type: Boolean, default: false }, eventsOnMonthView: { type: [Boolean, String], default: false }, diff --git a/app/src/plugins/app@vendor/vue-cal/styles.scss b/app/src/plugins/app@vendor/vue-cal/styles.scss index 3ff86cf..390e919 100644 --- a/app/src/plugins/app@vendor/vue-cal/styles.scss +++ b/app/src/plugins/app@vendor/vue-cal/styles.scss @@ -1,7 +1,7 @@ $time-column-width: 3em; $week-numbers-width: 3em; $time-column-width-12: 4em; // twelve-hour clock shows am/pm. -$weekdays-headings-height: 2.8em; +$weekdays-headings-height: 4em; $weekdays-headings-height-with-splits: 3.4em; $splits-headers-height: 1.5em; 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 37a01ce..5bb11cb 100644 --- a/app/src/plugins/app@vendor/vue-cal/weekdays-headings.vue +++ b/app/src/plugins/app@vendor/vue-cal/weekdays-headings.vue @@ -30,7 +30,8 @@ export default { props: { transitionDirection: { type: String, default: 'right' }, weekDays: { type: Array, default: () => [] }, - switchToNarrowerView: { type: Function, default: () => {} } + switchToNarrowerView: { type: Function, default: () => {} }, + unscheduledTime: { type: Array, default: [] } }, methods: { @@ -43,6 +44,9 @@ export default { cleanupHeading: heading => ({ label: heading.full, date: heading.date, + unscheduledTime: heading.unscheduledTime, + name: heading.name, + initials: heading.initials, ...(heading.today ? { today: heading.today } : {}) }) }, @@ -54,6 +58,10 @@ 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() return { hide: cell.hide, @@ -62,6 +70,9 @@ export default { // week days when does not fit on screen or with small/xsmall options. small: cell.short || cell.label.substr(0, 3), xsmall: cell.short || cell.label.substr(0, 1), + unscheduledTime: unscheduledTime, + name: name, + initials: initials, // Only for week view. ...(this.view.id === 'week' ? { 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 7f4216b..ea6ce82 100644 --- a/app/src/plugins/tm@dashboard/tasks/_components/z-timeline.vue +++ b/app/src/plugins/tm@dashboard/tasks/_components/z-timeline.vue @@ -10,19 +10,32 @@ :onEventClick="taskClicked" :editable-events="vueCalConfig.editing" :events="calData.dates" + :unscheduledTime="calData.unscheduled_times" :overlaps-per-time-step="false" :showTimeInCells="false" :time-cell-height="200" :min-cell-width="300" - @ready="scrollToYesterday" + @ready="onReady()" @view-change="weekChanged" @event-drop="eventMoved" >