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
+59 -13
+59 -13
View File
@@ -170,6 +170,7 @@
class="splitted-inputs remove-employee" class="splitted-inputs remove-employee"
:class="{ 'hide-arrow': employee?.id }" :class="{ 'hide-arrow': employee?.id }"
> >
<div class="relative left w-full">
<v-autocomplete <v-autocomplete
v-model="employee.id" v-model="employee.id"
:custom-filter="customFilter" :custom-filter="customFilter"
@@ -179,7 +180,7 @@
item-title="_fullName" item-title="_fullName"
item-value="id" item-value="id"
variant="solo" variant="solo"
class="modal-input left" class="modal-input"
:class="{ error: employeeValidations[index]?.employee }" :class="{ error: employeeValidations[index]?.employee }"
@update:model-value=" @update:model-value="
employeeValidations[index] employeeValidations[index]
@@ -208,6 +209,7 @@
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" 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>
</svg> </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