Feat(office365) Finished connection to API

This commit is contained in:
Matej Glasnák committed 2024-11-19 12:06:19 +01:00
1 parent a4941e511f
commit 5bf90cff14
8 files changed
+35 -31

No files matched your search

@@ -7,13 +7,12 @@
</div>
</div>
<div v-else-if="['subtask', 'blocker', 'adhoc', 'vacation', 'free_day'].includes(event.type)" class="custom-event-body colWidth h-100 d-flex flex-column justify-space-between" :class="subtaskCssClass" :style="{ backgroundColor: event._timeblock_is_finished || event.subtask?.is_finished ? '#dedfe0' : event.color || event.subtask?.color }">
<div v-else-if="['subtask', 'blocker', 'adhoc', 'vacation', 'free_day', 'office365'].includes(event.type)" class="custom-event-body colWidth h-100 d-flex flex-column justify-space-between" :class="subtaskCssClass" :style="{ backgroundColor: event._timeblock_is_finished || event.subtask?.is_finished ? '#dedfe0' : event.color || event.subtask?.color }">
<div class="event-content" :class="{ 'is-blocker': props.event.isBlocker }">
<template v-if="props.event.type == 'subtask'">
<template v-if="['subtask', 'office365'].includes(event.type)">
<small v-if="props.event.subtask.project_code" class="project-code">{{ props.event.subtask.project_code }}</small>
<h3>{{ props.event.subtask.title ?? props.event.subtask.master_task?.name ?? props.event.subtask.master_task }}</h3>
</template>
<template v-else>
<v-tooltip :text="event.blocker?.approved ? 'Schválený' : 'Neschválený'" location="bottom">
<template v-slot:activator="{ props }">
@@ -31,7 +30,7 @@
<small class="event-initials-date">{{ props.event.date?.toLocaleDateString('sk-SK') }}</small>
</div>
<div v-if="event.type == 'subtask'" class="d-flex align-center">
<div v-if="['subtask', 'office365'].includes(event.type)" class="d-flex align-center">
<v-icon icon="mdi-skull-outline" size="small" />
<small v-if="props.event?.subtask.deadline" class="ml-1">{{ deadline }}</small>
<v-tooltip v-else text="Deadline z Mastertasku" location="bottom">
@@ -73,10 +72,8 @@
import { bin, checkmarkDouble, checkmark, eye, pencil, office365 } from '@/plugins/app/_img'
import { computed, ComputedRef, defineProps, defineEmits, getCurrentInstance } from 'vue'
const instance = getCurrentInstance()
const props = defineProps<{
event: any // TODO office365: Define type
event: any
}>()
const emits = defineEmits<{
@@ -110,7 +107,7 @@ const subtaskCssClass: ComputedRef<string> = computed(() => {
})
const isOfficeEvent: ComputedRef<boolean> = computed(() => {
return true
return props.event.type === 'office365'
})
</script>
@@ -49,6 +49,13 @@ export default {
_composeTimelineEvent(subtask, employee, date, timeblock) {
const diffInDays = differenceInCalendarDays(date, new Date(timeblock.start))
// console.log('subtask', subtask.type)
let type = 'subtask'
if (subtask.type == 'office365')
type = 'office365'
return {
id: subtask.id,
start: addDays(new Date(timeblock.start), diffInDays),
@@ -60,12 +67,12 @@ export default {
split: this._getSplitFromDate(date, timeblock.start),
project_code: subtask.project_code,
subtask: subtask,
type: 'subtask',
type,
_timeblock_id: timeblock.id,
_timeblock_is_finished: timeblock.is_finished,
_real_start: new Date(timeblock.start),
_real_end: new Date(timeblock.end),
draggable: false // TODO office365: Disable only for office 365 events
draggable: type !== 'office365'
}
},