mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[team calendar] prefill only one employee
This commit is contained in:
1 parent
89df5d7a11
commit
2f9e7eee71
4 files changed
+10
-11
No files matched your search
@@ -257,7 +257,7 @@ export default {
|
|||||||
|
|
||||||
onCellClick(DOMEvent, split) {
|
onCellClick(DOMEvent, split) {
|
||||||
if (DOMEvent.offsetY > 950 && DOMEvent.offsetY < 1700) {
|
if (DOMEvent.offsetY > 950 && DOMEvent.offsetY < 1700) {
|
||||||
const dateFrom = split.date
|
const dateFrom = split.date
|
||||||
dateFrom.setHours(Math.floor(DOMEvent.offsetY / 100), 0, 0, 0)
|
dateFrom.setHours(Math.floor(DOMEvent.offsetY / 100), 0, 0, 0)
|
||||||
const dateTo = new Date(dateFrom)
|
const dateTo = new Date(dateFrom)
|
||||||
dateTo.setHours(dateFrom.getHours() + 1)
|
dateTo.setHours(dateFrom.getHours() + 1)
|
||||||
@@ -265,12 +265,12 @@ export default {
|
|||||||
const time = moment(dateFrom).format('HH:mm')
|
const time = moment(dateFrom).format('HH:mm')
|
||||||
|
|
||||||
const isTeamCalendar = this.$route.name === 'Dashboard - Teams'
|
const isTeamCalendar = this.$route.name === 'Dashboard - Teams'
|
||||||
const employees = isTeamCalendar ? JSON.parse(JSON.stringify(this.teams.find(team => team.id == localStorage.getItem('selectedTeam')).employees)) : [this.user]
|
const employee = isTeamCalendar ? split.employee_id : this.user.id
|
||||||
|
|
||||||
this.$events.emit('show-menu-modal', {
|
this.$events.emit('show-menu-modal', {
|
||||||
time: time,
|
time,
|
||||||
date: tmUtils.formatDateTimeForBackend(dateFrom),
|
date: tmUtils.formatDateTimeForBackend(dateFrom),
|
||||||
employees
|
employee
|
||||||
})
|
})
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -314,7 +314,6 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters("auth", ["user"]),
|
...mapGetters("auth", ["user"]),
|
||||||
...mapGetters('tm', ['teams']),
|
|
||||||
// Drag & drop module.
|
// Drag & drop module.
|
||||||
dnd () {
|
dnd () {
|
||||||
return this.modules.dnd
|
return this.modules.dnd
|
||||||
|
|||||||
@@ -349,7 +349,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
editTask({subtask}) {
|
editTask({subtask}) {
|
||||||
console.log('edit task')
|
|
||||||
this.$events.emit('show-subtask-modal', {subtask})
|
this.$events.emit('show-subtask-modal', {subtask})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export default {
|
|||||||
subtask: {
|
subtask: {
|
||||||
deadline: this.localData.date,
|
deadline: this.localData.date,
|
||||||
_deadline_time: this.localData.time,
|
_deadline_time: this.localData.time,
|
||||||
employees: this.localData.employees
|
employee_id: this.localData.employee
|
||||||
},
|
},
|
||||||
onTaskCreated: () => {
|
onTaskCreated: () => {
|
||||||
this.closeModal()
|
this.closeModal()
|
||||||
|
|||||||
@@ -271,10 +271,11 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.subtask = { master_task: mastertask, employees: [{}], _deadline_time: '17:00' }
|
this.subtask = { master_task: mastertask, employees: [{}], _deadline_time: '17:00' }
|
||||||
|
|
||||||
if (subtask?.deadline && subtask._deadline_time && subtask.employees?.length) {
|
if (subtask?.deadline && subtask._deadline_time && subtask.employee_id) {
|
||||||
|
const employee = this.enrichedEmployees.find(employee => employee.id == subtask.employee_id)
|
||||||
|
this.subtask.employees = [employee]
|
||||||
this.subtask.deadline = subtask.deadline
|
this.subtask.deadline = subtask.deadline
|
||||||
this.subtask._deadline_time = subtask._deadline_time
|
this.subtask._deadline_time = subtask._deadline_time
|
||||||
this.subtask.employees = subtask.employees
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(subtask?.master_task_id && subtask?.project_code) {
|
if(subtask?.master_task_id && subtask?.project_code) {
|
||||||
|
|||||||
Reference in new issue
Block a user