mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 06:20:21 +00:00
[Master task] Modal fix
This commit is contained in:
1 parent
f3adc68c73
commit
aac8620a0f
3 files changed
+28
-22
No files matched your search
@@ -3,10 +3,15 @@ import moment from 'moment'
|
||||
|
||||
export default {
|
||||
generateTimelineTasks(subtasks, date, employee) {
|
||||
return [
|
||||
...this.generateTimelineEvents(subtasks, employee, date),
|
||||
...this.generateTimelineNonWorkingHours(date, employee)
|
||||
]
|
||||
const { tasks, blockers, homeoffices } = this.generateTimelineEvents(subtasks, employee, date)
|
||||
const { nonWorkingHours } = this.generateTimelineNonWorkingHours(date, employee)
|
||||
|
||||
return {
|
||||
tasks,
|
||||
blockers,
|
||||
nonWorkingHours,
|
||||
homeoffices
|
||||
}
|
||||
},
|
||||
|
||||
getUnscheduledTime(subtasks) {
|
||||
@@ -21,19 +26,24 @@ export default {
|
||||
},
|
||||
|
||||
generateTimelineEvents(subtasks, employee, date) {
|
||||
let events = []
|
||||
let blockers = []
|
||||
const tasks = []
|
||||
|
||||
subtasks.forEach(subtask => {
|
||||
if (['blocker', 'adhoc', 'home_office', 'vacation', 'free_day'].includes(subtask.type)) {
|
||||
events = [...events, ...this._generateEventsFromBlocker(subtask, date)]
|
||||
blockers = [...blockers, ...this._generateEventsFromBlocker(subtask, date)]
|
||||
} else {
|
||||
subtask.timeblocks?.forEach((timeblock) => {
|
||||
events.push(this._composeTimelineEvent(subtask, employee, date, timeblock))
|
||||
tasks.push(this._composeTimelineEvent(subtask, employee, date, timeblock))
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
return events
|
||||
return {
|
||||
tasks,
|
||||
blockers: blockers.filter(blocker => blocker.type != 'home_office'),
|
||||
homeoffices: blockers.filter(blocker => blocker.type == 'home_office')
|
||||
}
|
||||
},
|
||||
|
||||
_composeTimelineEvent(subtask, employee, date, timeblock) {
|
||||
@@ -118,7 +128,7 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
return events
|
||||
return {nonWorkingHours: events}
|
||||
},
|
||||
|
||||
_getSplitFromDate(date, start) {
|
||||
|
||||
@@ -44,16 +44,16 @@ export default {
|
||||
if (!workingHours[task.split])
|
||||
workingHours[task.split] = 0
|
||||
|
||||
if (task.type == 'home_office') {
|
||||
return homeoffice[task.split] = true
|
||||
}
|
||||
|
||||
if (task.type == 'non-working-hours' || task.subtask?.is_finished || task.blocker?.is_finished)
|
||||
return
|
||||
|
||||
workingHours[task.split] += timelineUtils._getDifferenceInHours(task.end, task.start)
|
||||
})
|
||||
|
||||
this.timelineData.homeoffices.forEach(task => {
|
||||
homeoffice[task.split] = true
|
||||
})
|
||||
|
||||
for (let i = 0; i < 7; i++) {
|
||||
days.push({
|
||||
id: i + 1,
|
||||
@@ -80,11 +80,14 @@ export default {
|
||||
if (!this.subtasks || !this.filter)
|
||||
return null
|
||||
|
||||
const { tasks, blockers, nonWorkingHours, homeoffices } = timelineUtils.generateTimelineTasks(this.subtasks, new Date(this.filter.start), this.filter.employee)
|
||||
|
||||
return {
|
||||
name: this.filter.employee.name,
|
||||
surname: this.filter.employee.surname,
|
||||
unscheduledTime: this.unscheduledTime,
|
||||
tasks: timelineUtils.generateTimelineTasks(this.subtasks, new Date(this.filter.start), this.filter.employee)
|
||||
tasks: [...tasks, ...blockers, ...nonWorkingHours],
|
||||
homeoffices
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<v-text-field v-model="mastertask.name" @focus="onInputFocus" class="modal-input" label="Názov mastertasku" variant="solo" :class="{ error: v$.mastertask.name.$errors.length }" :hint="v$.mastertask.name.$errors ? errorUtils.parseErrors(v$.mastertask.name.$errors) : null"></v-text-field>
|
||||
|
||||
<Datepicker v-model="mastertask.deadline" @focus="onDateFocus" class="modal-input" format="dd.MM.yyyy, HH:mm" locale="sk" :class="{ error: v$.mastertask.deadline.$errors.length }" select-text="Vybrať" cancel-text="Zrušiť" placeholder="Deadline" />
|
||||
<Datepicker v-model="mastertask.deadline" @focus="onDateFocus" :min-date="new Date()" class="modal-input" format="dd.MM.yyyy, HH:mm" locale="sk" :class="{ error: v$.mastertask.deadline.$errors.length }" select-text="Vybrať" cancel-text="Zrušiť" placeholder="Deadline" />
|
||||
|
||||
<v-text-field v-model="mastertask.duration" @focus="onInputFocus" class="modal-input mt-5" variant="solo" type="number" disabled :label="`${mastertask.duration} h`"></v-text-field>
|
||||
|
||||
@@ -25,13 +25,6 @@
|
||||
</p>
|
||||
</v-text-field>
|
||||
</template>
|
||||
<template v-else-if="mastertask.subtasks">
|
||||
<v-text-field v-for="(subtask, index) in enrichedSubtasks" :key="subtask.id" @focus="onInputFocus" :class="{ error: !mastertask.subtasks[index].duration }" class="modal-input" :label="`${subtask._fullName}`" variant="solo" placeholder="h" v-model="mastertask.subtasks[index].duration" type="number" min="1" @input="onEmployeeDurationChanged">
|
||||
<p class="employee-select-avatar d-flex justify-center align-center">
|
||||
{{ subtask._initials }}
|
||||
</p>
|
||||
</v-text-field>
|
||||
</template>
|
||||
|
||||
<v-autocomplete v-if="showAddEmployeeInput" :label="$t('Search for employee')" :class="{error: v$.mastertask.project_id.$errors.length}" :items="employeesOptions" item-title="_fullName" item-value="id" variant="solo" class="modal-input" clearable @update:model-value="onEmployeeSelected" />
|
||||
|
||||
|
||||
Reference in new issue
Block a user