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="{ 'hide-arrow': employee?.id }"
>
<v-autocomplete
v-model="employee.id"
:custom-filter="customFilter"
:match-any="true"
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
"
/>
<svg
v-if="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="
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="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>
<div class="relative left w-full">
<v-autocomplete
v-model="employee.id"
:custom-filter="customFilter"
:match-any="true"
label="Priradený"
:items="enrichedEmployees"
item-title="_fullName"
item-value="id"
variant="solo"
class="modal-input"
:class="{ error: employeeValidations[index]?.employee }"
@update:model-value="
employeeValidations[index]
? (employeeValidations[index].employee = false)
: null
"
/>
<svg
v-if="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="
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="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>
</div>
<v-text-field
v-model="employee.duration"
class="modal-input right"
@@ -261,16 +263,56 @@
/>
</v-card-actions>
<v-btn v-if="!isSaving" class="button primary" @click="save()">{{
subtask.id ? 'UPRAVIŤ' : 'VYTVORIŤ'
}}</v-btn>
<v-btn v-else class="button primary disabled" disabled>{{
$t('Ukladám...')
}}</v-btn>
<a-resize-handle :current-width="modalWidthPx" :current-height="modalHeightPx" @resize="handleModalResize" @resize-end="handleResizeEnd" />
<template v-if="!subtask.id">
<v-btn class="button primary" :disabled="isSaving" @click="save()"
>VYTVORIŤ</v-btn
>
<v-btn
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-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>
<p>{{ subtask._master_task.project_code }}</p>
@@ -329,7 +371,12 @@
</div>
</div>
</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>
</W-loadable>
</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';
export default {
components: {
ZTaskReadonlyInfo,
ATimeblock,
@@ -1001,8 +1047,8 @@ export default {
svg
position: absolute
right: 205px
top: 28px
right: 5px
top: 29px
z-index: 5
opacity: .5