mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
[Fix] Handling of deleted employee in master task
This commit is contained in:
1 parent
7457616e0c
commit
8a0e9072c1
2 files changed
+11
-6
No files matched your search
@@ -47,8 +47,8 @@ export default {
|
||||
|
||||
return {
|
||||
...subtask,
|
||||
_employeeInitials: employee._initials,
|
||||
_employeeFullName: employee._fullName
|
||||
_employeeInitials: employee ? employee._initials : '?',
|
||||
_employeeFullName: employee ? employee._fullName : ''
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<v-text-field v-model="mastertask.duration" @focus="onInputFocus" class="modal-input" variant="solo" type="number" :label="`${mastertask.duration} h`" :disabled="true"></v-text-field>
|
||||
|
||||
<v-select v-model="mastertask.team_id" @focus="onInputFocus" class="modal-input border-select" :class="{error: v$.mastertask.employees.$errors.length}" label="Tím" variant="solo" :items="teams" item-value="id" item-title="name" :disabled="mastertask.id" :clearable="true" />
|
||||
<v-select v-model="mastertask.team_id" @focus="onInputFocus" class="modal-input border-select" :class="{error: v$.mastertask.employees.$errors.length}" label="Tím" variant="solo" :items="teams" item-value="id" item-title="name" :disabled="!!mastertask.id" :clearable="true" />
|
||||
|
||||
<template v-if="!mastertask.id">
|
||||
<v-text-field v-for="(employee, index) in mastertask.employees" :key="employee.id" @focus="onInputFocus" class="modal-input" :class="{error: employee.invalid}" :label="`${employee.name} ${employee.surname}`" variant="solo" placeholder="h" v-model="mastertask.employees[index].duration" type="number" min="1" @input="onEmployeeDurationChanged">
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
<!-- <Z-autocomplete label="Vyhľadať zamestnanca" :options="employeesOptions" class="modal-input" @option-selected="onEmployeeSelected" /> -->
|
||||
|
||||
<v-btn :disabled="mastertask.id" class="w-100 mb-5 button secondary" :class="{error: v$.mastertask.project_id.$errors.length}" @click="showAddEmployeeInput = true"> <v-icon class="mx-1" icon="mdi-plus" />Pridať zamestnanca </v-btn>
|
||||
<v-btn :disabled="!!mastertask.id" class="w-100 mb-5 button secondary" :class="{error: v$.mastertask.project_id.$errors.length}" @click="showAddEmployeeInput = true"> <v-icon class="mx-1" icon="mdi-plus" />Pridať zamestnanca </v-btn>
|
||||
|
||||
<div class="w-100 modal-input" :class="{ error: v$.mastertask.description.$errors.length }">
|
||||
<QuillEditor ref="description" v-model="mastertask.description" placeholder="Popis" theme="snow" class="rich-text-editor" @keyup="onQuillEditorInput" />
|
||||
@@ -170,7 +170,7 @@ export default {
|
||||
_initials: employee ? employee.name.charAt(0) + employee.surname.charAt(0) : '?',
|
||||
_fullName: employee ? `${employee.name} ${employee.surname}` : ''
|
||||
}
|
||||
})
|
||||
}).filter(subtask => subtask !== null)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -275,10 +275,15 @@ export default {
|
||||
|
||||
this.mastertask._allEmployees = this.mastertask.subtasks.map(({ employee_id, duration}) => {
|
||||
const employee = this.enrichedEmployees.find(({ id }) => id == employee_id)
|
||||
|
||||
if (!employee) {
|
||||
return null
|
||||
}
|
||||
|
||||
employee.duration = duration
|
||||
|
||||
return employee
|
||||
})
|
||||
}).filter(employee => employee !== null)
|
||||
|
||||
// this.mastertask.project_code = project.code
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user