From 1024f73ab5f0eb2306d4f83b2b886c01dd658edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Fri, 10 Feb 2023 03:38:54 +0100 Subject: [PATCH] [Task modal, subtask modal] BE --- .../plugins/lib@auth/_theme/auth.theme.sass | 10 +- .../plugins/tm@_components/z-autocomplete.vue | 36 +- .../tm@dashboard/projects/projects.vue | 3 +- .../tm@modal/blocker/z-blocker-modal.vue | 1 + .../_components/a-task-description.vue | 148 +++++ .../master-task/_components/a-tasks-table.vue | 71 +++ .../master-task/_mixins/selects.mixin.ts | 58 ++ .../master-task/z-master-task-modal.vue | 530 ++++-------------- .../plugins/tm@modal/task/z-task-modal.vue | 84 +-- .../plugins/tm@modal/team/z-team-modal.vue | 1 + app/src/plugins/w/axios/models/axios.ts | 22 +- .../plugins/w@custom/axios/models/axios.ts | 2 +- 12 files changed, 477 insertions(+), 489 deletions(-) create mode 100644 app/src/plugins/tm@modal/master-task/_components/a-task-description.vue create mode 100644 app/src/plugins/tm@modal/master-task/_components/a-tasks-table.vue create mode 100644 app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts diff --git a/app/src/plugins/lib@auth/_theme/auth.theme.sass b/app/src/plugins/lib@auth/_theme/auth.theme.sass index 3e642e6..9286d61 100644 --- a/app/src/plugins/lib@auth/_theme/auth.theme.sass +++ b/app/src/plugins/lib@auth/_theme/auth.theme.sass @@ -69,10 +69,16 @@ input::-webkit-inner-spin-button .v-select .v-field--variant-solo border: none !important +.rich-text-editor + border: 1px solid rgba(0, 0, 0, 0.1) + .error .dp__input, -.v-input.error .v-input__control, -.rich-text-editor.error +.v-input.error .v-input__control border: 1px solid red !important +.error .ql-toolbar.ql-snow, +.error .ql-container.ql-snow + border-color: red !important + .v-messages__message color: red !important \ No newline at end of file diff --git a/app/src/plugins/tm@_components/z-autocomplete.vue b/app/src/plugins/tm@_components/z-autocomplete.vue index 3458a89..86b5865 100644 --- a/app/src/plugins/tm@_components/z-autocomplete.vue +++ b/app/src/plugins/tm@_components/z-autocomplete.vue @@ -1,7 +1,7 @@ + + + \ No newline at end of file diff --git a/app/src/plugins/tm@modal/master-task/_components/a-tasks-table.vue b/app/src/plugins/tm@modal/master-task/_components/a-tasks-table.vue new file mode 100644 index 0000000..827ca12 --- /dev/null +++ b/app/src/plugins/tm@modal/master-task/_components/a-tasks-table.vue @@ -0,0 +1,71 @@ + + + + + \ No newline at end of file diff --git a/app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts b/app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts new file mode 100644 index 0000000..d6d003e --- /dev/null +++ b/app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts @@ -0,0 +1,58 @@ +export default { + computed: { + employeesOptions() { + const selectedEmployees = [...this.masterTask.employees, ...this.masterTask.team?.employees] + .map(employee => employee.id) + + const employees = this.employees.filter( + (employee) => !selectedEmployees.includes(employee.id) + ) || [] + + return employees.map((employee) => { + return { + key: employee.id, + value: `${employee.name} ${employee.surname}`, + } + }) + } + }, + + methods: { + onProjectSelected({ key }) { + const project = this.projects.find(project => project.id == key) + this.masterTask.project_code = project.code + this.masterTask.project_id = project.id + }, + + onEmployeeSelected({ key }) { + const employee = this.employees.find(employee => employee.id == key) + this.masterTask.employees.push(employee) + this.showAddEmployeeInput = false + }, + + onEmployeeDurationChanged() { + let totalDuration = 0 + + this.masterTask.employees = this.masterTask.employees.map(employee => { + if (typeof employee.duration == 'string') { + totalDuration += parseInt(employee.duration) + employee.duration = parseInt(employee.duration) + } + else if (typeof employee.duration == 'number') { + totalDuration += employee.duration + } + + return employee + }) + + this.masterTask.duration = totalDuration + } + }, + + watch: { + 'masterTask.team_id'(value) { + if (!value) return + this.masterTask.team = this.teams.find(team => team.id == value) + } + } +} \ No newline at end of file diff --git a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue index fcf79e2..2046ea1 100644 --- a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue +++ b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue @@ -4,138 +4,50 @@ - + - + - + - + - + - +

{{ employee.name.charAt(0) + employee.surname.charAt(0) }}

- + +

+ {{ employee.name.charAt(0) + employee.surname.charAt(0) }} +

+
- - Pridať zamestnanca - + -