mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
Feat(office365) Finished connection to API
This commit is contained in:
1 parent
a4941e511f
commit
5bf90cff14
8 files changed
+35
-31
No files matched your search
@@ -7,13 +7,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</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 }">
|
<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>
|
<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>
|
<h3>{{ props.event.subtask.title ?? props.event.subtask.master_task?.name ?? props.event.subtask.master_task }}</h3>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<v-tooltip :text="event.blocker?.approved ? 'Schválený' : 'Neschválený'" location="bottom">
|
<v-tooltip :text="event.blocker?.approved ? 'Schválený' : 'Neschválený'" location="bottom">
|
||||||
<template v-slot:activator="{ props }">
|
<template v-slot:activator="{ props }">
|
||||||
@@ -31,7 +30,7 @@
|
|||||||
<small class="event-initials-date">{{ props.event.date?.toLocaleDateString('sk-SK') }}</small>
|
<small class="event-initials-date">{{ props.event.date?.toLocaleDateString('sk-SK') }}</small>
|
||||||
</div>
|
</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" />
|
<v-icon icon="mdi-skull-outline" size="small" />
|
||||||
<small v-if="props.event?.subtask.deadline" class="ml-1">{{ deadline }}</small>
|
<small v-if="props.event?.subtask.deadline" class="ml-1">{{ deadline }}</small>
|
||||||
<v-tooltip v-else text="Deadline z Mastertasku" location="bottom">
|
<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 { bin, checkmarkDouble, checkmark, eye, pencil, office365 } from '@/plugins/app/_img'
|
||||||
import { computed, ComputedRef, defineProps, defineEmits, getCurrentInstance } from 'vue'
|
import { computed, ComputedRef, defineProps, defineEmits, getCurrentInstance } from 'vue'
|
||||||
|
|
||||||
const instance = getCurrentInstance()
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
event: any // TODO office365: Define type
|
event: any
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emits = defineEmits<{
|
const emits = defineEmits<{
|
||||||
@@ -110,7 +107,7 @@ const subtaskCssClass: ComputedRef<string> = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const isOfficeEvent: ComputedRef<boolean> = computed(() => {
|
const isOfficeEvent: ComputedRef<boolean> = computed(() => {
|
||||||
return true
|
return props.event.type === 'office365'
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,13 @@ export default {
|
|||||||
_composeTimelineEvent(subtask, employee, date, timeblock) {
|
_composeTimelineEvent(subtask, employee, date, timeblock) {
|
||||||
const diffInDays = differenceInCalendarDays(date, new Date(timeblock.start))
|
const diffInDays = differenceInCalendarDays(date, new Date(timeblock.start))
|
||||||
|
|
||||||
|
// console.log('subtask', subtask.type)
|
||||||
|
|
||||||
|
let type = 'subtask'
|
||||||
|
|
||||||
|
if (subtask.type == 'office365')
|
||||||
|
type = 'office365'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: subtask.id,
|
id: subtask.id,
|
||||||
start: addDays(new Date(timeblock.start), diffInDays),
|
start: addDays(new Date(timeblock.start), diffInDays),
|
||||||
@@ -60,12 +67,12 @@ export default {
|
|||||||
split: this._getSplitFromDate(date, timeblock.start),
|
split: this._getSplitFromDate(date, timeblock.start),
|
||||||
project_code: subtask.project_code,
|
project_code: subtask.project_code,
|
||||||
subtask: subtask,
|
subtask: subtask,
|
||||||
type: 'subtask',
|
type,
|
||||||
_timeblock_id: timeblock.id,
|
_timeblock_id: timeblock.id,
|
||||||
_timeblock_is_finished: timeblock.is_finished,
|
_timeblock_is_finished: timeblock.is_finished,
|
||||||
_real_start: new Date(timeblock.start),
|
_real_start: new Date(timeblock.start),
|
||||||
_real_end: new Date(timeblock.end),
|
_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>
|
||||||
<td class="task-action">
|
<td class="task-action">
|
||||||
<div class="d-flex justify-start align-center">
|
<div class="d-flex justify-start align-center">
|
||||||
<!-- TODO office365: Only for office365 events -->
|
<template v-if="subtasks.type == 'office365'">
|
||||||
<template v-if="true">
|
|
||||||
<img class="pencil-icon ml-2" :src="eye" alt="pencil-icon" @click.stop="openTaskModal(subtask)" />
|
<img class="pencil-icon ml-2" :src="eye" alt="pencil-icon" @click.stop="openTaskModal(subtask)" />
|
||||||
<img class="office-icon" :src="office365" />
|
<img class="office-icon" :src="office365" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -271,6 +271,7 @@ export default {
|
|||||||
this.mastertask = await this.$axios.get_auth_data(`v1/mastertasks/${mastertask.id}`)
|
this.mastertask = await this.$axios.get_auth_data(`v1/mastertasks/${mastertask.id}`)
|
||||||
|
|
||||||
// TODO zmazat ked zacne prichadzat project_id a team_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)
|
const project = this.projects.find((project) => project.code == this.mastertask.project_code)
|
||||||
this.mastertask.project_id = project?.id || null
|
this.mastertask.project_id = project?.id || null
|
||||||
this.mastertask.team_id = this.mastertask.team?.id || null
|
this.mastertask.team_id = this.mastertask.team?.id || null
|
||||||
|
|||||||
@@ -121,8 +121,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters('tm', ['mastertasks']),
|
...mapGetters('tm', ['mastertasks']),
|
||||||
isOffice365Task() {
|
isOffice365Task() {
|
||||||
// TODO office365: Only for office365 events
|
return this.subtask.type == 'office365'
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -195,6 +194,7 @@ export default {
|
|||||||
|
|
||||||
async toggleTimeblockIsFinished(originalTimeblock) {
|
async toggleTimeblockIsFinished(originalTimeblock) {
|
||||||
// TODO: Pridat odpracovany cas modal?
|
// TODO: Pridat odpracovany cas modal?
|
||||||
|
console.log('toggleTimeblockIsFinished 5', this.subtask)
|
||||||
const subtask = JSON.parse(JSON.stringify(this.subtask))
|
const subtask = JSON.parse(JSON.stringify(this.subtask))
|
||||||
const timeblock = JSON.parse(JSON.stringify(originalTimeblock))
|
const timeblock = JSON.parse(JSON.stringify(originalTimeblock))
|
||||||
|
|
||||||
|
|||||||
@@ -230,6 +230,7 @@ export default {
|
|||||||
this.subtask = this._enrichTask(data)
|
this.subtask = this._enrichTask(data)
|
||||||
|
|
||||||
// TODO: Remove? riesil som neodstranovanie jedineho zanamu v trvani a odpracovanom case
|
// TODO: Remove? riesil som neodstranovanie jedineho zanamu v trvani a odpracovanom case
|
||||||
|
console.log('2', this.subtask)
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -240,11 +241,10 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
toggleEditMode() {
|
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' })
|
return this.$events.emit('show-unable-to-edit-office-task-modal', { mode: 'edit' })
|
||||||
|
|
||||||
|
this.editMode = !this.editMode
|
||||||
// this.editMode = !this.editMode
|
|
||||||
},
|
},
|
||||||
|
|
||||||
openDatepicker(ref) {
|
openDatepicker(ref) {
|
||||||
@@ -393,9 +393,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
openDeleteTaskModal(subtask) {
|
openDeleteTaskModal(subtask) {
|
||||||
// TODO office365: Only for office365 events
|
if (subtask.type == 'office365')
|
||||||
this.$events.emit('show-unable-to-edit-office-task-modal', { mode: 'delete' })
|
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 })
|
||||||
},
|
},
|
||||||
|
|
||||||
showCompleteTaskModal() {
|
showCompleteTaskModal() {
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
|
|
||||||
<td class="task-action">
|
<td class="task-action">
|
||||||
<div class="d-flex justify-start align-center">
|
<div class="d-flex justify-start align-center">
|
||||||
<!-- TODO office365: Only for office365 events -->
|
<template v-if="subtask.type == 'office365'">
|
||||||
<template v-if="true">
|
|
||||||
<img class="pencil-icon" :src="eye" @click.stop="editTask(subtask, false)">
|
<img class="pencil-icon" :src="eye" @click.stop="editTask(subtask, false)">
|
||||||
<img class="office-icon" :src="office365" />
|
<img class="office-icon" :src="office365" />
|
||||||
</template>
|
</template>
|
||||||
@@ -79,10 +78,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
deleteTask(subtask) {
|
deleteTask(subtask) {
|
||||||
// TODO office365: Only for office365 events
|
if (subtask.type == 'office365')
|
||||||
this.$events.emit('show-unable-to-edit-office-task-modal', { mode: 'delete' })
|
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) {
|
getDeadline(subtask) {
|
||||||
|
|||||||
@@ -24,8 +24,7 @@
|
|||||||
<td>{{ subtask.spent_time }} h</td>
|
<td>{{ subtask.spent_time }} h</td>
|
||||||
<td class="task-action">
|
<td class="task-action">
|
||||||
<div class="d-flex justify-start align-center">
|
<div class="d-flex justify-start align-center">
|
||||||
<!-- TODO office365: Only for office365 events -->
|
<template v-if="subtask.type == 'office365'">
|
||||||
<template v-if="true">
|
|
||||||
<img class="pencil-icon" :src="eye" alt="pencil-icon" @click.stop="editTask(subtask, false)">
|
<img class="pencil-icon" :src="eye" alt="pencil-icon" @click.stop="editTask(subtask, false)">
|
||||||
<img class="office-icon" :src="office365" alt="office-icon" />
|
<img class="office-icon" :src="office365" alt="office-icon" />
|
||||||
</template>
|
</template>
|
||||||
@@ -73,9 +72,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
deleteTask(subtask) {
|
deleteTask(subtask) {
|
||||||
// TODO office365: Only for office365 events
|
if (subtask.type == 'office365')
|
||||||
this.$events.emit('show-unable-to-edit-office-task-modal', { mode: 'delete' })
|
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) {
|
getDeadline(subtask) {
|
||||||
|
|||||||
Reference in new issue
Block a user