[team calendar] priradenie vsetkych celnov teamu z kalendaru

This commit is contained in:
JakubPapso committed 2024-02-14 20:55:40 +01:00
1 parent 158be83345
commit 89df5d7a11
4 files changed
+10 -6

No files matched your search

+5 -1
View File
@@ -264,10 +264,13 @@ export default {
const time = moment(dateFrom).format('HH:mm')
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]
this.$events.emit('show-menu-modal', {
time: time,
date: tmUtils.formatDateTimeForBackend(dateFrom),
employee: this.user.id
employees
})
setTimeout(() => {
@@ -311,6 +314,7 @@ export default {
computed: {
...mapGetters("auth", ["user"]),
...mapGetters('tm', ['teams']),
// Drag & drop module.
dnd () {
return this.modules.dnd
@@ -349,6 +349,7 @@ export default {
},
editTask({subtask}) {
console.log('edit task')
this.$events.emit('show-subtask-modal', {subtask})
},
@@ -54,11 +54,12 @@ export default {
},
createTask() {
console.log(this.localData.date, this.localData.time, this.localData.employees)
this.$events.emit('show-subtask-modal', {
subtask: {
deadline: this.localData.date,
_deadline_time: this.localData.time,
employee_id: this.localData.employee
employees: this.localData.employees
},
onTaskCreated: () => {
this.closeModal()
@@ -241,7 +241,6 @@ export default {
},
async showModal({ subtask, editMode = false, mastertask = {} }) {
console.log(subtask)
this.isSaving = false
this.subtask = null
this.visible = true
@@ -272,11 +271,10 @@ export default {
} else {
this.subtask = { master_task: mastertask, employees: [{}], _deadline_time: '17:00' }
if (subtask?.deadline && subtask._deadline_time && subtask.employee_id) {
const employee = this.enrichedEmployees.find(employee => employee.id == subtask.employee_id)
this.subtask.employees = [employee]
if (subtask?.deadline && subtask._deadline_time && subtask.employees?.length) {
this.subtask.deadline = subtask.deadline
this.subtask._deadline_time = subtask._deadline_time
this.subtask.employees = subtask.employees
}
if(subtask?.master_task_id && subtask?.project_code) {