diff --git a/app/public/mock/v1/overview/tasks.GET.json b/app/public/mock/v1/overview/tasks.GET.json index 6784960..06e3949 100644 --- a/app/public/mock/v1/overview/tasks.GET.json +++ b/app/public/mock/v1/overview/tasks.GET.json @@ -5,7 +5,36 @@ "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, diff --git a/app/src/plugins/app/_theme/global.sass b/app/src/plugins/app/_theme/global.sass index 2b1b72e..ed63947 100644 --- a/app/src/plugins/app/_theme/global.sass +++ b/app/src/plugins/app/_theme/global.sass @@ -32,4 +32,5 @@ th .border-select .v-input__control border: 1px solid #E5E5E5 !important - \ No newline at end of file +.min-h-100 + min-height: 100% \ No newline at end of file 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..59cc018 100644 --- a/app/src/plugins/app@vendor/vue-cal/weekdays-headings.vue +++ b/app/src/plugins/app@vendor/vue-cal/weekdays-headings.vue @@ -30,9 +30,14 @@ export default { props: { transitionDirection: { type: String, default: 'right' }, weekDays: { type: Array, default: () => [] }, - switchToNarrowerView: { type: Function, default: () => {} } + switchToNarrowerView: { type: Function, default: () => {} }, + unscheduledTime: { type: Array, default: [] } }, + // created() { + // console.log(this.weekDays) + // }, + methods: { selectCell (date, DOMEvent) { if (date.getTime() !== this.view.selectedDate.getTime()) { @@ -43,6 +48,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 +62,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 +74,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' ? { @@ -71,6 +86,8 @@ export default { } : {}) } }) + + console.log(headings) return headings }, cellWidth () { 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 cd03127..37625cc 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" >