mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[Teams] Calendar fix
This commit is contained in:
1 parent
e4abc1fc36
commit
c3e7e70da6
6 files changed
+40
-36
No files matched your search
@@ -30,7 +30,7 @@
|
||||
<p class="weekday-label">{{ getHeadingDate(split.date) }}</p>
|
||||
</span>
|
||||
<span v-else class="d-flex align-center">
|
||||
<p class="weekday-label">{{ split.firstName }}</p>
|
||||
<p class="weekday-label">{{ split.name }}</p>
|
||||
</span>
|
||||
|
||||
<span v-if="split.date">
|
||||
@@ -42,7 +42,7 @@
|
||||
<p>{{ split.initials }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="mb-0 mt-0 unscheduled-time-name">{{split.name}}</p>
|
||||
<p class="mb-0 mt-0 unscheduled-time-name">{{split.fullname}}</p>
|
||||
<h1 class="mb-0 mt-0">{{split.unscheduledTime}} h</h1>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,7 +64,7 @@
|
||||
<h3>{{ event.subtask.master_task?.name || event.subtask.master_task }}</h3>
|
||||
<div class="d-flex align-center event-details event-initials-wrapper">
|
||||
<div class="event-initials d-flex justify-center align-center">
|
||||
<small>{{ getUserInitials(event) }}</small>
|
||||
<small>{{ event.initials }}</small>
|
||||
</div>
|
||||
<small class="event-initials-date">{{ event.start.toLocaleDateString('sk-SK') }}</small>
|
||||
</div>
|
||||
@@ -189,10 +189,6 @@ export default {
|
||||
return date.toLocaleDateString('sk-SK')
|
||||
},
|
||||
|
||||
getUserInitials(event) {
|
||||
return event.name.charAt(0).toUpperCase() + event.surname.charAt(0).toUpperCase()
|
||||
},
|
||||
|
||||
getEventLenght(event) {
|
||||
return event.end.getTime() - event.start.getTime()
|
||||
},
|
||||
|
||||
@@ -40,8 +40,6 @@ export default {
|
||||
start: addDays(new Date(timeblock.start), diffInDays),
|
||||
end: addDays(new Date(timeblock.end), diffInDays),
|
||||
master_task: subtask.master_task,
|
||||
name: employee.name,
|
||||
surname: employee.surname,
|
||||
date: new Date(timeblock.start),
|
||||
isWeekend: this.isWeekend(timeblock.start),
|
||||
initials: employee.name.charAt(0).toUpperCase() + employee.surname.charAt(0).toUpperCase(),
|
||||
|
||||
@@ -47,12 +47,12 @@ export default {
|
||||
workingHours[task.split] += timelineUtils._getDifferenceInHours(task.end, task.start)
|
||||
})
|
||||
|
||||
for (let i = 1; i <= 7; i++) {
|
||||
for (let i = 0; i < 7; i++) {
|
||||
days.push({
|
||||
id: i ,
|
||||
name: this.filter.employee.name + " " + this.filter.employee.surname,
|
||||
id: i + 1,
|
||||
fullname: `${this.filter.employee.name} ${this.filter.employee.surname}`,
|
||||
initials: this.filter.employee.name.charAt(0).toUpperCase() + this.filter.employee.surname.charAt(0).toUpperCase(),
|
||||
unscheduledTime: capacityPerDay - workingHours[i],
|
||||
unscheduledTime: capacityPerDay - workingHours[i + 1],
|
||||
date: addDays(this.filter.start, i),
|
||||
isWeekend: timelineUtils.isWeekend(addDays(this.filter.start, i))
|
||||
})
|
||||
@@ -108,6 +108,7 @@ export default {
|
||||
try {
|
||||
const { subtasks } = await this.$axios.get_auth(`v1/subtasks?${queryParameters}`)
|
||||
this.config.scrollHour = this.filter.employee.work_start - 1
|
||||
this.config.date = this.filter.start
|
||||
this.subtasks = subtasks
|
||||
} catch (error) {
|
||||
this.$toast.error('Nepodarilo sa nacitat data!')
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
import ATeamFilter from './_components/a-team-filter.vue'
|
||||
import ZTimeline from '@/plugins/tm@dashboard/_components/z-timeline.vue'
|
||||
|
||||
import { setHours, setMinutes } from 'date-fns'
|
||||
import { setHours, setMinutes, addDays } from 'date-fns'
|
||||
import moment from 'moment'
|
||||
import timelineUtils from '../tasks/_utils/timeline.utils'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -35,30 +36,37 @@ export default {
|
||||
const days = []
|
||||
|
||||
this.filter.team.employees.forEach((employee, index) => {
|
||||
let workingHours = 0
|
||||
const capacityPerDay = employee.work_end - employee.work_start
|
||||
|
||||
this.timelineData.tasks.forEach(task => {
|
||||
if (task?.subtask?.employee_id == employee.id)
|
||||
workingHours += timelineUtils._getDifferenceInHours(task.end, task.start)
|
||||
})
|
||||
|
||||
days.push({
|
||||
id: index,
|
||||
name: `${employee.name} ${employee.surname}`,
|
||||
id: index + 1,
|
||||
name: employee.name,
|
||||
fullname: `${employee.name} ${employee.surname}`,
|
||||
initials: employee.name.charAt(0).toUpperCase() + employee.surname.charAt(0).toUpperCase(),
|
||||
unscheduledTime: 111
|
||||
unscheduledTime: capacityPerDay - workingHours
|
||||
})
|
||||
})
|
||||
|
||||
return days
|
||||
},
|
||||
|
||||
unscheduledTime() {
|
||||
return 222
|
||||
// if (!this.subtasks) return 0
|
||||
|
||||
// return timelineUtils.getUnscheduledTime(this.subtasks)
|
||||
},
|
||||
|
||||
|
||||
timelineData() {
|
||||
if (!this.subtasks)
|
||||
return
|
||||
|
||||
console.log([...this._generateNonWorking(), ...this._generateTasks()])
|
||||
// let unscheduledTime = 0
|
||||
// const tasks = [...this._generateNonWorking(), ...this._generateTasks()]
|
||||
|
||||
// tasks.forEach(task => {
|
||||
// if (!task.nonWorking)
|
||||
// workingHours += timelineUtils._getDifferenceInHours(task.end, task.start)
|
||||
// })
|
||||
|
||||
return {
|
||||
unscheduledTime: 333,
|
||||
@@ -79,7 +87,7 @@ export default {
|
||||
|
||||
this.filter.team.employees.forEach((e, index) => {
|
||||
if (e.id == subtask.employee_id) {
|
||||
split = index
|
||||
split = index + 1
|
||||
employee = e
|
||||
}
|
||||
})
|
||||
@@ -93,11 +101,11 @@ export default {
|
||||
start: new Date(timeblock.start),
|
||||
end: new Date(timeblock.end),
|
||||
master_task: subtask.master_task,
|
||||
name: employee.name,
|
||||
surname: employee.surname,
|
||||
name: employee?.name,
|
||||
surname: employee?.surname,
|
||||
// date: new Date(timeblock.start),
|
||||
isWeekend: moment(timeblock.start).day() % 6 == 0,
|
||||
initials: employee.name.charAt(0).toUpperCase() + employee.surname.charAt(0).toUpperCase(),
|
||||
initials: employee?.name?.charAt(0)?.toUpperCase() + employee?.surname?.charAt(0)?.toUpperCase(),
|
||||
split: split,
|
||||
project_code: subtask.project_code,
|
||||
subtask: subtask,
|
||||
@@ -112,8 +120,9 @@ export default {
|
||||
|
||||
_generateNonWorking() {
|
||||
const tasks = []
|
||||
let earliestStartHour = null
|
||||
const date = new Date(this.filter.start)
|
||||
let earliestStartHour = null
|
||||
this.config.date = date
|
||||
|
||||
this.filter.team.employees.forEach((employee, index) => {
|
||||
if (!earliestStartHour || employee.work_start < earliestStartHour)
|
||||
@@ -123,7 +132,7 @@ export default {
|
||||
title: "Non working hours",
|
||||
start: setMinutes(setHours(date, 0), 0),
|
||||
end: setMinutes(setHours(date, employee.work_start), 0),
|
||||
split: index,
|
||||
split: index + 1,
|
||||
nonWorking: true,
|
||||
draggable: false
|
||||
})
|
||||
@@ -132,7 +141,7 @@ export default {
|
||||
title: "Non working hours",
|
||||
start: setMinutes(setHours(date, employee.work_end), 0),
|
||||
end: setMinutes(setHours(date, 23), 59),
|
||||
split: index,
|
||||
split: index + 1,
|
||||
nonWorking: true,
|
||||
draggable: false
|
||||
})
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<v-card>
|
||||
<div class="d-flex justify-space-between align-center">
|
||||
<h1>Pridať dátum</h1>
|
||||
<v-icon @click.stop="clsoeModal()" icon="mdi-close" size="large"></v-icon>
|
||||
<v-icon @click.stop="closeModal()" icon="mdi-close" size="large"></v-icon>
|
||||
</div>
|
||||
|
||||
<v-card-actions class="mt-10 d-flex flex-column modal-content">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import axios from '@/plugins/w/axios/models/axios'
|
||||
import './refreshExpired'
|
||||
// import './refreshExpired'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
@@ -35,7 +35,7 @@ export default {
|
||||
actions: {
|
||||
login({commit}: {commit: any}, credentials: any) {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.post('v1/tokens/create', credentials)
|
||||
axios.post('v1/tokens/create', {data: credentials})
|
||||
.then((response: any) => {
|
||||
console.log(response)
|
||||
const token = response.token
|
||||
|
||||
Reference in new issue
Block a user