-
+
Ukončiť mastertask
-
+
Pridať task
@@ -96,7 +96,7 @@ export default {
// MIXINS
// computed: employeesOptions
// methods: onProjectSelected, onEmployeeSelected, onEmployeeDurationChanged
- // watch: masterTask.team_id
+ // watch: mastertask.team_id
emits: ['master-task-edited', 'close'],
mixins: [VuetifyFixFocusMixin, SelectsMixin],
@@ -116,7 +116,7 @@ export default {
visible: false,
errorUtils,
v$: useVuelidate(),
- masterTask: null,
+ mastertask: null,
showAddEmployeeInput: false,
date: null,
}
@@ -132,7 +132,7 @@ export default {
validations() {
return {
- masterTask: {
+ mastertask: {
project_code: { required },
team_id: { required },
name: { required },
@@ -143,22 +143,22 @@ export default {
},
mounted() {
- this.$events.on('on-master-task-deleted', (masterTask) => {
- if (masterTask?.id == this.masterTask?.id) this.closeModal()
+ this.$events.on('on-master-task-deleted', (mastertask) => {
+ if (mastertask?.id == this.mastertask?.id) this.closeModal()
})
this.$events.on('on-task-deleted', (task) => {
- if (!this.masterTask) return
- this.masterTask.subtasks = this.masterTask.subtasks.filter((subtask) => subtask.id != task.id)
+ if (!this.mastertask) return
+ this.mastertask.subtasks = this.mastertask.subtasks.filter((subtask) => subtask.id != task.id)
})
this.$events.on('on-subtask-edited', (task) => {
- if (!this.masterTask?.subtasks) return
+ if (!this.mastertask?.subtasks) return
- if (this.masterTask.subtasks.find(subtask => subtask.id == task.id)) {
- this.masterTask.subtasks = this.masterTask.subtasks.map(t => t.id == task.id ? task : t)
+ if (this.mastertask.subtasks.find(subtask => subtask.id == task.id)) {
+ this.mastertask.subtasks = this.mastertask.subtasks.map(t => t.id == task.id ? task : t)
} else {
- this.masterTask.subtasks.push(task)
+ this.mastertask.subtasks.push(task)
}
})
},
@@ -170,25 +170,25 @@ export default {
},
methods: {
- async showModal(masterTask, editMode = false) {
+ async showModal(mastertask, editMode = false) {
this.v$.$reset()
this.visible = true
- this.masterTask = null
+ this.mastertask = null
try {
- if (masterTask?.id) {
- this.masterTask = await this.$axios.get_auth_data(`v1/mastertasks/${masterTask.id}`)
+ if (mastertask?.id) {
+ this.mastertask = await this.$axios.get_auth_data(`v1/mastertasks/${mastertask.id}`)
- const project = this.projects.find((project) => project.code == this.masterTask?.project_code)
+ const project = this.projects.find((project) => project.code == this.mastertask?.project_code)
- this.masterTask.team_id = this.masterTask.team.id
- this.masterTask.project_id = project.id
- this.masterTask.project_code = project.code
+ this.mastertask.team_id = this.mastertask.team?.id || null
+ this.mastertask.project_id = project.id
+ this.mastertask.project_code = project.code
} else {
- this.masterTask = { employees: [], duration: 0 }
+ this.mastertask = { employees: [], duration: 0 }
}
- this.editMode = editMode || !this.masterTask.id
+ this.editMode = editMode || !this.mastertask.id
} catch (error) {
this.$toast.error(error)
}
@@ -197,24 +197,24 @@ export default {
async save() {
if (!(await this.v$.$validate())) return
- this.masterTask.description = this.$refs['description'].getHTML()
+ this.mastertask.description = this.$refs['description'].getHTML()
- // this.masterTask.subtasks = this.masterTask.subtasks.map(subtask => {
- // const employee = this.masterTask.employees.find(employee => employee.id == subtask.employee_id)
+ // this.mastertask.subtasks = this.mastertask.subtasks.map(subtask => {
+ // const employee = this.mastertask.employees.find(employee => employee.id == subtask.employee_id)
// subtask.duration = employee.duration
// return subtask
// })
- // this.masterTask.project_code = null
+ // this.mastertask.project_code = null
try {
- this.masterTask.deadline = moment(this.masterTask.deadline).format('YYYY-MM-DD HH:MM:SS')
+ this.mastertask.deadline = moment(this.mastertask.deadline).format('YYYY-MM-DD HH:MM:SS')
- if (this.masterTask.id) await this.$axios.put_auth_data(`v1/mastertasks/${this.masterTask.id}`, this.masterTask)
- else await this.$axios.post_auth_data('v1/mastertasks', this.masterTask)
+ if (this.mastertask.id) await this.$axios.put_auth_data(`v1/mastertasks/${this.mastertask.id}`, this.mastertask)
+ else await this.$axios.post_auth_data('v1/mastertasks', this.mastertask)
- this.$emit('master-task-edited', this.masterTask)
+ this.$emit('master-task-edited', this.mastertask)
this.closeModal()
} catch (error) {
this.$toast.error(error)
@@ -222,26 +222,26 @@ export default {
},
filesUploaded(files) {
- this.masterTask.files = files
+ this.mastertask.files = files
},
closeModal() {
this.visible = false
},
- openDeleteMasterTaskModal(masterTask) {
- this.$events.emit('show-delete-master-task-modal', { masterTask })
+ openDeleteMasterTaskModal(mastertask) {
+ this.$events.emit('show-delete-master-task-modal', { mastertask })
},
addTask() {
- this.$events.emit('show-task-modal', { task: null, editMode: false, masterTask: this.masterTask })
+ this.$events.emit('show-task-modal', { task: null, editMode: false, mastertask: this.mastertask })
}
},
watch: {
editMode() {
this.$nextTick(() => {
- this.$refs['description']?.setHTML(this.masterTask.description || '')
+ this.$refs['description']?.setHTML(this.mastertask.description || '')
})
}
}
diff --git a/app/src/plugins/tm@modal/task/_components/_components/a-mastertask-name.vue b/app/src/plugins/tm@modal/task/_components/_components/a-mastertask-name.vue
index ea2642c..4b6a553 100644
--- a/app/src/plugins/tm@modal/task/_components/_components/a-mastertask-name.vue
+++ b/app/src/plugins/tm@modal/task/_components/_components/a-mastertask-name.vue
@@ -42,7 +42,7 @@ export default {
methods: {
openMastertask() {
this.$emit('close-modal')
- this.$events.emit('show-master-task-modal', {masterTask: {id: this.id}, editMode: false})
+ this.$events.emit('show-master-task-modal', {mastertask: {id: this.id}, editMode: false})
}
}
}
diff --git a/app/src/plugins/tm@modal/task/_components/_components/a-task-description.vue b/app/src/plugins/tm@modal/task/_components/_components/a-task-description.vue
index f5f181f..af4bb55 100644
--- a/app/src/plugins/tm@modal/task/_components/_components/a-task-description.vue
+++ b/app/src/plugins/tm@modal/task/_components/_components/a-task-description.vue
@@ -4,9 +4,9 @@
-
+
@@ -18,7 +18,7 @@ export default {
default: () => null
},
- masterTaskDescription: {
+ mastertaskDescription: {
type: String || null,
default: () => null
}
diff --git a/app/src/plugins/tm@modal/task/_components/z-task-readonly-info.vue b/app/src/plugins/tm@modal/task/_components/z-task-readonly-info.vue
index 930afe0..c0d531f 100644
--- a/app/src/plugins/tm@modal/task/_components/z-task-readonly-info.vue
+++ b/app/src/plugins/tm@modal/task/_components/z-task-readonly-info.vue
@@ -7,7 +7,7 @@
-
+
@@ -21,7 +21,7 @@ import ATaskPlannedTime from './_components/a-task-planned-time.vue'
import ATaskSpentTime from './_components/a-task-spent-time.vue'
import ATaskRemainingTime from './_components/a-task-remaining-time.vue'
import ATaskDescription from './_components/a-task-description.vue'
-import ZFiles from '@/plugins/tm@modal/_components/z-files.vue'
+import ZFiles from '@/plugins/tm@modal/_components/read-only/z-files.vue'
export default {
emits: ['close-modal'],
diff --git a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue
index f967872..b920349 100644
--- a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue
+++ b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue
@@ -2,7 +2,7 @@
-
Ste si istý, že chcete {{ subtask.is_finished ? 'znovu otvoriť' : 'dokončiť' }} task, z masterTasku {{ subtask?.master_task?.name || subtask.master_task }}?
+
Ste si istý, že chcete {{ subtask.is_finished ? 'znovu otvoriť' : 'dokončiť' }} task, z mastertasku {{ subtask?.master_task?.name || subtask.master_task }}?
-
Ste si istý, že chcete zmazať task z masterTasku {{ task.project_code }}?
+
Ste si istý, že chcete zmazať task z mastertasku {{ task.project_code }}?
-
+
-