Merge branch 'main' of bitbucket.org:studiotem/jandl-taskmanager-app

This commit is contained in:
StudioTem committed 2023-09-06 15:46:22 +02:00
commit 026ca33971
13 files changed
+175 -123

No files matched your search

+3 -3
View File
@@ -55,7 +55,7 @@ const routes: Array<RouteRecordRaw> = [
{
path: '/app/dashboard/tasks',
name: 'Dashboard - Tasks',
meta: { title: 'Tasks', requiresAuth: true },
meta: { title: 'Sub Tasks', requiresAuth: true },
component: () => import('@/plugins/tm@dashboard/tasks/tasks.vue')
},
{
@@ -74,13 +74,13 @@ const routes: Array<RouteRecordRaw> = [
{
path: '/app/overview/unscheduled',
name: 'Overview - Unscheduled tasks',
meta: { title: 'Unscheduled tasks', requiresAuth: true },
meta: { title: 'Unscheduled Sub Tasks', requiresAuth: true },
component: () => import('@/plugins/tm@overview/tasks-unscheduled/tasks-unscheduled.vue')
},
{
path: '/app/overview/ongoing',
name: 'Overview - Ongoing tasks',
meta: { title: 'Ongoing tasks', requiresAuth: true },
meta: { title: 'Ongoing Sub Tasks', requiresAuth: true },
component: () => import('@/plugins/tm@overview/tasks-ongoing/tasks-ongoing.vue')
},
{
@@ -30,7 +30,7 @@ export default {
data() {
return {
pages: [{
title: 'Tasks',
title: 'Sub Tasks',
pageName: 'Dashboard - Tasks'
},
{
@@ -42,11 +42,11 @@ export default {
pageName: 'Dashboard - Projects'
},
{
title: 'Unscheduled tasks',
title: 'Unscheduled Sub Tasks',
pageName: 'Overview - Unscheduled tasks'
},
{
title: 'Ongoing tasks',
title: 'Ongoing Sub Tasks',
pageName: 'Overview - Ongoing tasks'
},
{
@@ -88,7 +88,7 @@ export default {
<style lang="sass" scoped>
ion-item
font-weight: 500 !important
font-size: 15px
font-size: 13.5px
--background: #fff
&:hover
@@ -1,6 +1,6 @@
<template>
<div v-if="Array.isArray(subtasks) && subtasks.length">
<h1 class="px-3 py-3">Tasks</h1>
<h1 class="px-3 py-3">Subtasks</h1>
<v-table>
<tbody>
<tr v-for="subtask in enrichedtasks" :key="subtask.id">
@@ -83,9 +83,14 @@
<small class="event-initials-date">{{ event.date?.toLocaleDateString('sk-SK') }}</small>
</div>
<div v-if="event.subtask?.deadline" class="d-flex align-center">
<div v-if="event.type == 'subtask'" class="d-flex align-center">
<v-icon icon="mdi-skull-outline" size="small" />
<small class="ml-1" :class="`${tmUtils.isAfter(event.subtask?.deadline) ? 'text-black' : 'text-red-darken-4'}`">{{ tmUtils.formatDate(event.subtask?.deadline) }}</small>
<small v-if="event?.subtask.deadline" class="ml-1">{{ getDeadline(event?.subtask) }}</small>
<v-tooltip v-else text="Deadline z Mastertasku" location="bottom">
<template v-slot:activator="{ props }">
<small class="cursor-pointer ml-1" v-if="!event?.subtask?.deadline" v-bind="props">{{ getDeadline(event?.subtask) }}*</small>
</template>
</v-tooltip>
</div>
</div>
@@ -109,8 +114,10 @@
</template>
<script>
import { addDays } from 'date-fns'
import tmUtils from '@/plugins/tm@_utils/tm.utils'
import { addDays } from 'date-fns'
import tmUtils from '@/plugins/tm@_utils/tm.utils'
import { mapGetters } from 'vuex'
import moment from 'moment'
export default {
props: {
@@ -154,7 +161,18 @@ export default {
}
},
computed: {
...mapGetters('tm', ['mastertasks'])
},
methods: {
getDeadline(subtask) {
if(subtask.deadline) return moment(subtask.deadline).format('DD.MM.yyyy')
else if(!this.mastertasks) return ''
const masterTask = this.mastertasks.find((mt) => mt.id === subtask.master_task_id)
return moment(masterTask).format('DD.MM.yyyy') ? moment(masterTask.deadline).format('DD.MM.yyyy') : ''
},
weekChanged() {
const scrollContainer = this.$el.getElementsByClassName('vuecal__scrollable-body')[0]
scrollContainer.scrollLeft = 0
@@ -294,8 +312,8 @@ export default {
.colWidth
width: 120px
@media (min-width: 1476px)
width: 100% !important
// @media (min-width: 1476px)
// width: 100% !important
.vuecal
box-shadow: none !important
@@ -435,7 +453,6 @@ export default {
.vuecal__event
border-radius: 16px
// padding: 20px 10px
min-height: 70px !important
text-align: left
background: rgba(248, 248, 248, 1)
@@ -466,7 +483,7 @@ export default {
&.vuecal__event--focus
z-index: 100 !important
min-height: 250px !important
min-height: 350px !important
width: 100% !important
left: 0 !important
@@ -485,14 +502,15 @@ export default {
.mini-event
.event-content
display: flex
align-items: center
flex-wrap: nowrap
justify-content: space-between
// display: flex
// align-items: center
// flex-wrap: nowrap
// justify-content: space-between
width: 100%
padding: 5px 10px
.event-initials-wrapper
margin-bottom: 0
// margin-bottom: 0
.event-initials
margin-right: 0
@@ -5,7 +5,8 @@ export default {
methods: {
handleKeyDown(event) {
if (event.keyCode === 27) this.closeModal()
// if (event.keyCode === 27) this.closeModal()
if (event.keyCode === 27) this.visible = false
}
},
}
@@ -39,7 +39,7 @@ export default {
async complete() {
try {
const tempMastertask = {...this.mastertask, is_finished: this.mastertask.is_finished ? 0 : 1, duration: this.mastertask.duration }
const tempMastertask = {...this.mastertask, is_finished: this.mastertask.is_finished ? 0 : 1 }
const { mastertask } = await this.$axios.put_auth(`v1/mastertasks/${tempMastertask.id}`, tempMastertask)
this.visible = false
@@ -76,7 +76,7 @@
<A-tasks-table :subtasks="mastertask.subtasks" />
<div class="d-flex align-center ">
<v-btn class="subtask-btn w-100" @click="addTask()" ><v-icon class="mx-1" icon="mdi-plus" />Pridať task</v-btn>
<v-btn class="subtask-btn w-100" @click="addTask()" ><v-icon class="mx-1" icon="mdi-plus" />Pridať sub task</v-btn>
</div>
</div>
</v-card-actions>
@@ -10,28 +10,46 @@
</v-col>
<v-col cols="7">
<v-sheet class="py-3">
<p v-if="deadline" :class="`${tmUtils.isAfter(deadline) ? 'text-black' : 'text-red-darken-4'}`">{{ tmUtils.formatDate(deadline) }}</p>
<p v-else>Tento task nema určený deadline</p>
<p v-if="subtask.deadline" :class="`${tmUtils.isAfter(subtask.deadline) ? 'text-black' : 'text-red-darken-4'}`">{{ tmUtils.formatDate(subtask.deadline) }}</p>
<v-tooltip v-else text="Deadline z Mastertasku" location="end">
<template v-slot:activator="{ props }">
<span class="cursor-pointer" v-bind="props">{{ getMasterTaskDeadline(subtask) }}*</span>
</template>
</v-tooltip>
</v-sheet>
</v-col>
</v-row>
</template>
<script>
import tmUtils from '@/plugins/tm@_utils/tm.utils'
import tmUtils from '@/plugins/tm@_utils/tm.utils'
import moment from 'moment'
import { mapGetters } from 'vuex'
export default {
props: {
deadline: {
subtask: {
type: [String, Object, null],
required: true
}
},
computed: {
...mapGetters('tm', ['mastertasks'])
},
data() {
return {
tmUtils
}
},
methods: {
getMasterTaskDeadline(subtask) {
if(!this.mastertasks) return ''
const masterTask = this.mastertasks.find((mt) => mt.id === subtask.master_task_id)
return moment(masterTask).format('DD.MM.yyyy') ? moment(masterTask.deadline).format('DD.MM.yyyy') : ''
}
}
}
</script>
@@ -1,7 +1,7 @@
<template>
<A-mastertask-name :name="subtask._master_task.name" :id="subtask.master_task_id" :color="subtask._master_task.color" @close-modal="$emit('close-modal')" />
<A-mastertask-status :isFinished="subtask.is_finished" />
<A-task-deadline :deadline="subtask.deadline" />
<A-task-deadline :subtask="subtask" />
<A-task-timeblocks :timeblocks="subtask.timeblocks" :subtask="subtask" @update-subtask="$emit('update-subtask', $event)" />
<Z-created-by :employee-id="subtask.created_by" />
<A-task-assigned-employee :employee="subtask._employee" />
@@ -2,7 +2,7 @@
<v-dialog v-model="visible" max-width="750" persistent>
<v-card>
<div class="d-flex justify-space-between align-center">
<h1>Ste si istý, že chcete {{ subtask.is_finished ? 'znovu otvoriť' : 'dokončiť' }} task, z mastertasku <b>{{ subtask?.master_task?.name || subtask.master_task }}</b>?</h1>
<h1>Ste si istý, že chcete {{ subtask.is_finished ? 'znovu otvoriť' : 'dokončiť' }} sub task, z mastertasku <b>{{ subtask?.master_task?.name || subtask.master_task }}</b>?</h1>
<v-icon
@click.stop="closeModal()"
icon="mdi-close"
@@ -2,7 +2,7 @@
<v-dialog v-model="visible" max-width="750" persistent>
<v-card>
<div class="d-flex justify-space-between align-center">
<h1>Ste si istý, že chcete zmazať task z mastertasku <b>{{ subtask.project_code }}</b>?</h1>
<h1>Ste si istý, že chcete zmazať sub task z mastertasku <b>{{ subtask.project_code }}</b>?</h1>
<v-icon
@click.stop="closeModal()"
+101 -90
View File
@@ -3,51 +3,55 @@
<W-loadable :content="subtask" class="h-100">
<v-card v-if="editMode" height="100%" class="d-flex flex-column scrolling">
<div class="d-flex justify-space-between align-center modal-header">
<h1>{{ subtask?.id ? 'Upraviť task' : 'Vytvoriť task' }}</h1>
<h1>{{ subtask?.id ? 'Upraviť sub task' : 'Vytvoriť sub task' }}</h1>
<v-icon @click.stop="closeModal()" icon="mdi-close" size="large"></v-icon>
</div>
<v-card-actions class="d-flex flex-column modal-content">
<v-text-field v-model="subtask.project_code" label="Kód projektu" :value="subtask.project_code" @focus="onInputFocus" class="modal-input" variant="solo" disabled></v-text-field>
<v-autocomplete :custom-filter="customFilter" :match-any="true" v-model="subtask.master_task_id" label="Master task" :class="{error: v$.subtask.master_task_id.$errors.length}" :items="mastertasks" item-title="name" item-value="id" variant="solo" class="modal-input" clearable />
<v-autocomplete :custom-filter="customFilter" :match-any="true" v-model="subtask.master_task_id" label="Master task" :class="{ error: v$.subtask.master_task_id.$errors.length }" :items="mastertasks" item-title="name" item-value="id" variant="solo" class="modal-input" clearable />
<v-text-field v-model="subtask.title" @focus="onInputFocus" class="modal-input" label="Názov subtasku" variant="solo"></v-text-field>
<div class="splitted-inputs">
<!-- TODO: Bialko validacie -->
<Datepicker v-model="subtask.deadline" :auto-apply="true" @focus="onDateFocus" :min-date="new Date()" class="modal-input left" format="dd.MM.yyyy" locale="sk" select-text="Vybrať" cancel-text="Zrušiť" placeholder="Dátum"
:class="{ error: v$.subtask.deadline.$errors?.length }" :validations="v$.subtask.deadline" />
<Datepicker v-model="subtask.deadline" :auto-apply="true" @focus="onDateFocus" :min-date="new Date()" class="modal-input left" format="dd.MM.yyyy" locale="sk" select-text="Vybrať" cancel-text="Zrušiť" placeholder="Dátum" :class="{ error: v$.subtask.deadline.$errors?.length }" :validations="v$.subtask.deadline" />
<v-text-field class="modal-input right" variant="solo" v-model="subtask._deadline_time" label="Čas" append-inner-icon="mdi-clock-outline" type="time" @focus="onInputFocus"
:class="{ error: v$.subtask._deadline_time.$errors.length }" :hint="v$.subtask._deadline_time.$errors ? errorUtils.parseErrors(v$.subtask._deadline_time.$errors) : null" />
<v-text-field class="modal-input right" variant="solo" v-model="subtask._deadline_time" label="Čas" append-inner-icon="mdi-clock-outline" type="time" @focus="onInputFocus" :class="{ error: v$.subtask._deadline_time.$errors.length }" :hint="v$.subtask._deadline_time.$errors ? errorUtils.parseErrors(v$.subtask._deadline_time.$errors) : null" />
</div>
<!-- TODO: Toto tu nema byt ci? -->
<!-- <div class="w-full">
<A-task-timeblocks
class="w-full"
:timeblocks="subtask.timeblocks"
:subtask="subtask"
<A-task-timeblocks
class="w-full"
:timeblocks="subtask.timeblocks"
:subtask="subtask"
@update-subtask="$emit('update-subtask')"
@update-unfinished-subtask="subtask = $event"
@delete-timeblock="deleteTimeblock($event)"
/>
</div> -->
<template v-if="subtask.id">
<v-autocomplete :custom-filter="customFilter" :match-any="true" v-model="subtask.employee_id" label="Priradený" :items="enrichedEmployees" item-title="_fullName" item-value="id" variant="solo" class="modal-input" :class="{ error: employeeValidations[0]?.employee }"
@update:model-value="employeeValidations[0] ? employeeValidations[0].employee = false : null" />
<v-text-field v-model="subtask.duration" class="modal-input" variant="solo" type="number" label="Časový odhad" :class="{ error: employeeValidations[0]?.duration }" append-inner-icon="mdi-clock-outline" @focus="onInputFocus"
@update:model-value="employeeValidations[0] ? employeeValidations[0].duration = false : null" />
<div class="employee-wrapper" :class="{'hide-arrow': subtask.employee_id}">
<svg v-if="subtask.employee_id" version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" class="dp__icon dp__clear_icon dp__input_icons" data-test="clear-icon"
@click.prevent="subtask.employee_id = null; subtask.employee = null">
<path d="M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"></path>
<path d="M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"></path>
</svg>
<v-autocomplete :custom-filter="customFilter" :match-any="true" v-model="subtask.employee_id" label="Priradený" :items="enrichedEmployees" item-title="_fullName" item-value="id" variant="solo" class="modal-input" :class="{ error: employeeValidations[0]?.employee }" @update:model-value="employeeValidations[0] ? (employeeValidations[0].employee = false) : null" />
</div>
<v-text-field v-model="subtask.duration" class="modal-input" variant="solo" type="number" label="Časový odhad" :class="{ error: employeeValidations[0]?.duration }" append-inner-icon="mdi-clock-outline" @focus="onInputFocus" @update:model-value="employeeValidations[0] ? (employeeValidations[0].duration = false) : null" />
</template>
<template v-else>
<!-- R: Subtask nemoze mat viacero employees ci? Vyhodit -->
<div v-for="(employee, index) in subtask.employees" :key="`employee-${index}`" class="splitted-inputs">
<v-autocomplete :custom-filter="customFilter" :match-any="true" v-model="employee.id" label="Priradený" :items="enrichedEmployees" item-title="_fullName" item-value="id" variant="solo" class="modal-input left" :class="{ error: employeeValidations[index]?.employee }"
@update:model-value="employeeValidations[index] ? employeeValidations[index].employee = false : null" />
<v-text-field v-model="employee.duration" class="modal-input right" variant="solo" type="number" label="Časový odhad" append-inner-icon="mdi-clock-outline" :class="{ error: employeeValidations[index]?.duration }" @focus="onInputFocus"
@update:model-value="employeeValidations[index] ? employeeValidations[index].duration = false : null" />
<v-autocomplete :custom-filter="customFilter" :match-any="true" v-model="employee.id" label="Priradený" :items="enrichedEmployees" item-title="_fullName" item-value="id" variant="solo" class="modal-input left" :class="{ error: employeeValidations[index]?.employee }" @update:model-value="employeeValidations[index] ? (employeeValidations[index].employee = false) : null" />
<v-text-field v-model="employee.duration" class="modal-input right" variant="solo" type="number" label="Časový odhad" append-inner-icon="mdi-clock-outline" :class="{ error: employeeValidations[index]?.duration }" @focus="onInputFocus" @update:model-value="employeeValidations[index] ? (employeeValidations[index].duration = false) : null" />
</div>
</template>
@@ -58,8 +62,8 @@
<Z-files-upload class="mt-15 files" :files="subtask.files" @files-uploaded="filesUploaded" :is-saving="isSaving" />
</v-card-actions>
<v-btn class="button primary" v-if="!isSaving" @click="save()">{{ subtask.id ? "UPRAVIŤ" : "VYTVORIŤ" }}</v-btn>
<v-btn class="button primary disabled" v-else disabled>{{ $t('Ukladám...')}}</v-btn>
<v-btn class="button primary" v-if="!isSaving" @click="save()">{{ subtask.id ? 'UPRAVIŤ' : 'VYTVORIŤ' }}</v-btn>
<v-btn class="button primary disabled" v-else disabled>{{ $t('Ukladám...') }}</v-btn>
</v-card>
<v-card v-else height="100%" class="d-flex flex-column scrolling">
@@ -104,26 +108,26 @@
<script>
import Datepicker from '@vuepic/vue-datepicker'
import ZFilesUpload from "@/plugins/tm@_components/z-files-upload.vue"
import ZFilesUpload from '@/plugins/tm@_components/z-files-upload.vue'
import ATaskTimeblocks from '@/plugins/tm@modal/task/_components/_components/a-task-timeblocks.vue'
import useVuelidate from "@vuelidate/core"
import { required } from "@vuelidate/validators"
import errorUtils from "@/plugins/lib@auth/_utils/error.utils"
import { QuillEditor } from "@vueup/vue-quill"
import VuetifyFixFocusMixin from "@/plugins/tm@modal/_mixins/vuetify-fix-focus"
import SelectsMixin from "../master-task/_mixins/selects.mixin"
import * as FileSaver from "file-saver"
import tmUtils from "@/plugins/tm@_utils/tm.utils"
import useVuelidate from '@vuelidate/core'
import { required } from '@vuelidate/validators'
import errorUtils from '@/plugins/lib@auth/_utils/error.utils'
import { QuillEditor } from '@vueup/vue-quill'
import VuetifyFixFocusMixin from '@/plugins/tm@modal/_mixins/vuetify-fix-focus'
import SelectsMixin from '../master-task/_mixins/selects.mixin'
import * as FileSaver from 'file-saver'
import tmUtils from '@/plugins/tm@_utils/tm.utils'
import moment from 'moment'
import "@vueup/vue-quill/dist/vue-quill.snow.css"
import '@vueup/vue-quill/dist/vue-quill.snow.css'
import AutocompleteMixin from '@/plugins/tm@_mixins/autocomplete.mixin'
import ZTaskReadonlyInfo from "./_components/z-task-readonly-info.vue"
import { mapGetters } from "vuex"
import ZTaskReadonlyInfo from './_components/z-task-readonly-info.vue'
import { mapGetters } from 'vuex'
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
export default {
emits: ["close", "refresh"],
emits: ['close', 'refresh'],
mixins: [VuetifyFixFocusMixin, SelectsMixin, AutocompleteMixin, modalMixin],
components: {
@@ -151,10 +155,7 @@ export default {
},
computed: {
...mapGetters('tm', [
'mastertasks',
'enrichedEmployees'
])
...mapGetters('tm', ['mastertasks', 'enrichedEmployees'])
},
validations() {
@@ -169,19 +170,24 @@ export default {
},
mounted() {
this.$events.on("add-timeblock", (timeblock) => {
if (!this.subtask?.timeblocks) { this.subtask.timeblocks = [] }
if (!this.subtask?.timesheets) { this.subtask.timesheets = [] }
if (!this.subtask?.is_finished) { this.subtask.is_finished = 0 }
this.$events.on('add-timeblock', (timeblock) => {
if (!this.subtask?.timeblocks) {
this.subtask.timeblocks = []
}
if (!this.subtask?.timesheets) {
this.subtask.timesheets = []
}
if (!this.subtask?.is_finished) {
this.subtask.is_finished = 0
}
this.subtask.timeblocks.push(timeblock)
})
this.$events.on("on-subtask-edited", (subtask) => {
if (subtask?.id == this.subtask?.id)
this.subtask = this._enrichTask(subtask)
this.$events.on('on-subtask-edited', (subtask) => {
if (subtask?.id == this.subtask?.id) this.subtask = this._enrichTask(subtask)
// TODO: Remove? riesil som neodstranovanie jedineho zanamu v trvani a odpracovanom case
this.$forceUpdate()
// TODO: Remove? riesil som neodstranovanie jedineho zanamu v trvani a odpracovanom case
this.$forceUpdate()
})
this.$events.on('on-subtask-deleted', (subtask) => {
@@ -190,18 +196,17 @@ export default {
},
methods: {
async showModal({subtask, editMode = false, mastertask = {}}) {
this.isSaving = false
this.subtask = null
this.visible = true
async showModal({ subtask, editMode = false, mastertask = {} }) {
this.isSaving = false
this.subtask = null
this.visible = true
this.$nextTick(() => this.v$.$reset())
try {
if (subtask?.id) {
const data = await this.$axios.get_auth_data(`v1/subtasks/${subtask.id}`)
if (!data.deadline)
return this.subtask = this._enrichTask(data)
if (!data.deadline) return (this.subtask = this._enrichTask(data))
const splittedDeadline = data.deadline.split(' ')
data.deadline = moment(splittedDeadline[0])
@@ -229,7 +234,7 @@ export default {
closeModal() {
this.visible = false
this.$router.replace({name: this.$route.name})
this.$router.replace({ name: this.$route.name })
},
async save() {
@@ -251,19 +256,19 @@ export default {
return timesheet
})
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${this.subtask.id}`, {...this.subtask, timesheets})
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${this.subtask.id}`, { ...this.subtask, timesheets })
this.$store.commit('tm/update_subtask', subtask)
this.$events.emit("on-subtask-edited", this.subtask)
this.$events.emit('on-subtask-edited', this.subtask)
} else {
const { subtasks } = await this.$axios.post_auth(`v1/mastertasks/${this.subtask.master_task_id}/subtasks`, this.subtask)
this.subtask.id = subtasks[0].id
subtasks.forEach(subtask => {
subtasks.forEach((subtask) => {
this.$store.commit('tm/update_subtask', subtask)
this.$events.emit("on-subtask-edited", this.subtask)
this.$events.emit('on-subtask-edited', this.subtask)
})
this.$events.emit("task-created")
this.$events.emit('task-created')
}
this.closeModal()
@@ -275,12 +280,12 @@ export default {
},
openDeleteTaskModal(subtask) {
this.$events.emit("show-delete-task-modal", { subtask })
this.$events.emit('show-delete-task-modal', { subtask })
},
showCompleteTaskModal() {
this.$events.emit('show-complete-task-modal', { subtask: this.subtask })
if(this.subtask.deadline) this.subtask.deadline = tmUtils.formatDateTimeForBackend(this.subtask.deadline)
if (this.subtask.deadline) this.subtask.deadline = tmUtils.formatDateTimeForBackend(this.subtask.deadline)
},
filesUploaded(files) {
@@ -307,36 +312,28 @@ export default {
this.employeeValidations = []
if (this.subtask.id) {
if (this.subtask.employee && this.subtask.duration)
return
if (this.subtask.employee && this.subtask.duration) return
this.employeeValidations[0] = {}
if (!this.subtask.employee_id)
this.employeeValidations[0].employee = true
if (!this.subtask.employee_id) this.employeeValidations[0].employee = true
if (!this.subtask.duration)
this.employeeValidations[0].duration = true
if (!this.subtask.duration) this.employeeValidations[0].duration = true
} else {
this.subtask.employees.forEach((employee, index) => {
if (index == this.subtask.employees.length - 1 && index > 0)
return // Skip the last which is allways empty
if (employee.id && employee.duration)
return
if (index == this.subtask.employees.length - 1 && index > 0) return // Skip the last which is allways empty
if (employee.id && employee.duration) return
this.employeeValidations[index] = {}
if (!employee.id)
this.employeeValidations[index].employee = true
if (!employee.duration)
this.employeeValidations[index].duration = true
if (!employee.id) this.employeeValidations[index].employee = true
if (!employee.duration) this.employeeValidations[index].duration = true
})
}
const isError = this.employeeValidations.some(employee => employee.duration || employee.employee)
const isError = this.employeeValidations.some((employee) => employee.duration || employee.employee)
resolve(!isError)
})
},
@@ -356,17 +353,15 @@ export default {
if (!value || !oldValue) return
this.subtask.timeblocks = []
this.subtask._employee = this.enrichedEmployees.find((employee) => employee.id == this.subtask.employee_id)
this.subtask._employee = this.enrichedEmployees.find((employee) => employee.id == this.subtask.employee_id)
},
'subtask.employees': {
handler() {
if (!this.subtask?.employees)
return
if (!this.subtask?.employees) return
const lastEmployee = this.subtask.employees[this.subtask.employees.length - 1]
if (lastEmployee.id || lastEmployee.duration)
this.subtask.employees.push({})
if (lastEmployee.id || lastEmployee.duration) this.subtask.employees.push({})
},
deep: true
},
@@ -379,7 +374,7 @@ export default {
editMode() {
this.$nextTick(() => {
this.$refs["description"]?.setHTML(this.subtask.description || "")
this.$refs['description']?.setHTML(this.subtask.description || '')
})
}
}
@@ -413,6 +408,22 @@ export default {
height: 50px
width: 203px
.employee-wrapper
position: relative
width: 100%
svg
position: absolute
right: 4px
top: 28px
z-index: 5
opacity: 0.5
&.hide-arrow ::v-deep
.mdi-menu-down,
.mdi-menu-up
display: none
@media screen and (max-width: 522px)
.files
margin-top: 104px !important
@@ -113,10 +113,14 @@ export default {
try {
if (this.team.id) {
const { team } = await this.$axios.put_auth(`v1/teams/${this.team.id}`, this.team)
this.$store.commit('tm/update_team', team)
const fullTeamResource = await this.$axios.get_auth_data(`v1/teams/${team.id}`)
this.$store.commit('tm/update_team', fullTeamResource)
} else {
const { team } = await this.$axios.post_auth(`v1/teams`, this.team)
this.$store.commit('tm/save_team', team)
const fullTeamResource = await this.$axios.get_auth_data(`v1/teams/${team.id}`)
this.$store.commit('tm/save_team', fullTeamResource)
}
this.closeModal()