Merge branch 'feature/office365' of bitbucket.org:studiotem/jandl-taskmanager-app

This commit is contained in:
Matej Glasnák committed 2024-11-19 12:06:48 +01:00
commit 652a834f31
8 files changed
+34 -30

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'
}
},
@@ -16,8 +16,7 @@
</td>
<td class="task-action">
<div class="d-flex justify-start align-center">
<!-- TODO office365: Only for office365 events -->
<template v-if="true">
<template v-if="subtasks.type == 'office365'">
<img class="pencil-icon ml-2" :src="eye" alt="pencil-icon" @click.stop="openTaskModal(subtask)" />
<img class="office-icon" :src="office365" />
</template>
@@ -271,6 +271,7 @@ export default {
this.mastertask = await this.$axios.get_auth_data(`v1/mastertasks/${mastertask.id}`)
// TODO zmazat ked zacne prichadzat project_id a team_id
console.log('1', this.mastertask)
const project = this.projects.find((project) => project.code == this.mastertask.project_code)
this.mastertask.project_id = project?.id || null
this.mastertask.team_id = this.mastertask.team?.id || null
@@ -121,8 +121,7 @@ export default {
computed: {
...mapGetters('tm', ['mastertasks']),
isOffice365Task() {
// TODO office365: Only for office365 events
return true
return this.subtask.type == 'office365'
}
},
@@ -195,6 +194,7 @@ export default {
async toggleTimeblockIsFinished(originalTimeblock) {
// TODO: Pridat odpracovany cas modal?
console.log('toggleTimeblockIsFinished 5', this.subtask)
const subtask = JSON.parse(JSON.stringify(this.subtask))
const timeblock = JSON.parse(JSON.stringify(originalTimeblock))
@@ -230,6 +230,7 @@ export default {
this.subtask = this._enrichTask(data)
// TODO: Remove? riesil som neodstranovanie jedineho zanamu v trvani a odpracovanom case
console.log('2', this.subtask)
this.$forceUpdate()
})
@@ -240,11 +241,10 @@ export default {
methods: {
toggleEditMode() {
// TODO office365: Only for office365 events
if (this.subtask.type == 'office365')
return this.$events.emit('show-unable-to-edit-office-task-modal', { mode: 'edit' })
// this.editMode = !this.editMode
this.editMode = !this.editMode
},
openDatepicker(ref) {
@@ -393,9 +393,10 @@ export default {
},
openDeleteTaskModal(subtask) {
// TODO office365: Only for office365 events
this.$events.emit('show-unable-to-edit-office-task-modal', { mode: 'delete' })
// this.$events.emit('show-delete-task-modal', { subtask })
if (subtask.type == 'office365')
return this.$events.emit('show-unable-to-edit-office-task-modal', { mode: 'delete' })
this.$events.emit('show-delete-task-modal', { subtask })
},
showCompleteTaskModal() {
@@ -28,8 +28,7 @@
<td class="task-action">
<div class="d-flex justify-start align-center">
<!-- TODO office365: Only for office365 events -->
<template v-if="true">
<template v-if="subtask.type == 'office365'">
<img class="pencil-icon" :src="eye" @click.stop="editTask(subtask, false)">
<img class="office-icon" :src="office365" />
</template>
@@ -79,10 +78,10 @@ export default {
},
deleteTask(subtask) {
// TODO office365: Only for office365 events
this.$events.emit('show-unable-to-edit-office-task-modal', { mode: 'delete' })
if (subtask.type == 'office365')
return this.$events.emit('show-unable-to-edit-office-task-modal', { mode: 'delete' })
// this.$events.emit('show-delete-task-modal', {subtask})
this.$events.emit('show-delete-task-modal', {subtask})
},
getDeadline(subtask) {
@@ -24,8 +24,7 @@
<td>{{ subtask.spent_time }} h</td>
<td class="task-action">
<div class="d-flex justify-start align-center">
<!-- TODO office365: Only for office365 events -->
<template v-if="true">
<template v-if="subtask.type == 'office365'">
<img class="pencil-icon" :src="eye" alt="pencil-icon" @click.stop="editTask(subtask, false)">
<img class="office-icon" :src="office365" alt="office-icon" />
</template>
@@ -73,9 +72,10 @@ export default {
},
deleteTask(subtask) {
// TODO office365: Only for office365 events
this.$events.emit('show-unable-to-edit-office-task-modal', { mode: 'delete' })
// this.$events.emit('show-delete-task-modal', {subtask})
if (subtask.type == 'office365')
return this.$events.emit('show-unable-to-edit-office-task-modal', { mode: 'delete' })
this.$events.emit('show-delete-task-modal', {subtask})
},
getDeadline(subtask) {