refactor(task-modal): improve layout and button functionality for employee assignment and subtask saving

This commit is contained in:
Matej Glasnák committed 2025-12-03 14:54:42 +01:00
1 parent 4edc33c316
commit 8fdd78a691
1 file changed
+96 -50
+96 -50
View File
@@ -170,44 +170,46 @@
class="splitted-inputs remove-employee" class="splitted-inputs remove-employee"
:class="{ 'hide-arrow': employee?.id }" :class="{ 'hide-arrow': employee?.id }"
> >
<v-autocomplete <div class="relative left w-full">
v-model="employee.id" <v-autocomplete
:custom-filter="customFilter" v-model="employee.id"
:match-any="true" :custom-filter="customFilter"
label="Priradený" :match-any="true"
:items="enrichedEmployees" label="Priradený"
item-title="_fullName" :items="enrichedEmployees"
item-value="id" item-title="_fullName"
variant="solo" item-value="id"
class="modal-input left" variant="solo"
:class="{ error: employeeValidations[index]?.employee }" class="modal-input"
@update:model-value=" :class="{ error: employeeValidations[index]?.employee }"
employeeValidations[index] @update:model-value="
? (employeeValidations[index].employee = false) employeeValidations[index]
: null ? (employeeValidations[index].employee = false)
" : null
/> "
<svg />
v-if="employee.id" <svg
version="1.1" v-if="employee.id"
xmlns="http://www.w3.org/2000/svg" version="1.1"
width="32" xmlns="http://www.w3.org/2000/svg"
height="32" width="32"
viewBox="0 0 32 32" height="32"
class="dp__icon dp__clear_icon dp__input_icons" viewBox="0 0 32 32"
data-test="clear-icon" class="dp__icon dp__clear_icon dp__input_icons"
@click.prevent=" data-test="clear-icon"
handleOnRemoveEmployee(); @click.prevent="
employee.id = null; handleOnRemoveEmployee();
" employee.id = 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="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
></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"
</svg> ></path>
</svg>
</div>
<v-text-field <v-text-field
v-model="employee.duration" v-model="employee.duration"
class="modal-input right" class="modal-input right"
@@ -261,16 +263,56 @@
/> />
</v-card-actions> </v-card-actions>
<v-btn v-if="!isSaving" class="button primary" @click="save()">{{ <template v-if="!subtask.id">
subtask.id ? 'UPRAVIŤ' : 'VYTVORIŤ' <v-btn class="button primary" :disabled="isSaving" @click="save()"
}}</v-btn> >VYTVORIŤ</v-btn
<v-btn v-else class="button primary disabled" disabled>{{ >
$t('Ukladám...')
}}</v-btn> <v-btn
<a-resize-handle :current-width="modalWidthPx" :current-height="modalHeightPx" @resize="handleModalResize" @resize-end="handleResizeEnd" /> class="button primary outline mt-2"
:disabled="isSaving"
@click="save(true)"
>ULOŽIŤ KONCEPT</v-btn
>
</template>
<template v-else>
<template v-if="subtask.is_draft">
<v-btn
class="button primary"
:disabled="isSaving"
@click="save(true)"
>ULOŽIŤ A PUBLIKOVAŤ</v-btn
>
<v-btn
class="button primary outline mt-2"
:disabled="isSaving"
@click="save(true)"
>ULOŽIŤ KONCEPT</v-btn
>
</template>
<template v-else>
<v-btn class="button primary" :disabled="isSaving" @click="save()"
>UPRAVIŤ</v-btn
>
</template>
</template>
<a-resize-handle
:current-width="modalWidthPx"
:current-height="modalHeightPx"
@resize="handleModalResize"
@resize-end="handleResizeEnd"
/>
</v-card> </v-card>
<v-card v-else height="100%" class="d-flex flex-column scrolling" style="position: relative"> <v-card
v-else
height="100%"
class="d-flex flex-column scrolling"
style="position: relative"
>
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<div> <div>
<p>{{ subtask._master_task.project_code }}</p> <p>{{ subtask._master_task.project_code }}</p>
@@ -329,7 +371,12 @@
</div> </div>
</div> </div>
</v-card-actions> </v-card-actions>
<a-resize-handle :current-width="modalWidthPx" :current-height="modalHeightPx" @resize="handleModalResize" @resize-end="handleResizeEnd" /> <a-resize-handle
:current-width="modalWidthPx"
:current-height="modalHeightPx"
@resize="handleModalResize"
@resize-end="handleResizeEnd"
/>
</v-card> </v-card>
</W-loadable> </W-loadable>
</v-dialog> </v-dialog>
@@ -357,7 +404,6 @@ import AResetSizeButton from '@/plugins/tm@modal/_components/a-reset-size-button
import ACloseButton from '@/plugins/tm@modal/_components/a-close-button.vue'; import ACloseButton from '@/plugins/tm@modal/_components/a-close-button.vue';
export default { export default {
components: { components: {
ZTaskReadonlyInfo, ZTaskReadonlyInfo,
ATimeblock, ATimeblock,
@@ -1001,8 +1047,8 @@ export default {
svg svg
position: absolute position: absolute
right: 205px right: 5px
top: 28px top: 29px
z-index: 5 z-index: 5
opacity: .5 opacity: .5