refactor: update vacation scheduling button logic and UI
- Modified the vacation scheduling button to enable/disable based on employee ID availability. - Improved user feedback with dynamic button titles reflecting the validation status of employee data. - Cleaned up the button's SVG structure for better readability and maintainability.
This commit is contained in:
@@ -1307,29 +1307,35 @@
|
|||||||
class="flex flex-col items-start justify-between gap-4 md:flex-row md:items-center"
|
class="flex flex-col items-start justify-between gap-4 md:flex-row md:items-center"
|
||||||
>
|
>
|
||||||
<h2 class="card-title text-lg">Filtros</h2>
|
<h2 class="card-title text-lg">Filtros</h2>
|
||||||
{#if funcionario}
|
<button
|
||||||
<button
|
type="button"
|
||||||
type="button"
|
class="btn btn-primary gap-2"
|
||||||
class="btn btn-primary gap-2"
|
onclick={() => {
|
||||||
onclick={() => (mostrarWizard = true)}
|
if (funcionarioIdDisponivel) {
|
||||||
|
mostrarWizard = true;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
disabled={!funcionarioIdDisponivel}
|
||||||
|
title={funcionarioIdDisponivel
|
||||||
|
? 'Clique para agendar suas férias'
|
||||||
|
: 'Estamos validando seus dados de funcionário...'}
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
class="h-5 w-5"
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
stroke="currentColor"
|
||||||
>
|
>
|
||||||
<svg
|
<path
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
stroke-linecap="round"
|
||||||
class="h-5 w-5"
|
stroke-linejoin="round"
|
||||||
fill="none"
|
stroke-width="2"
|
||||||
viewBox="0 0 24 24"
|
d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
|
||||||
stroke="currentColor"
|
/>
|
||||||
>
|
</svg>
|
||||||
<path
|
Agendar Férias
|
||||||
stroke-linecap="round"
|
</button>
|
||||||
stroke-linejoin="round"
|
|
||||||
stroke-width="2"
|
|
||||||
d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
Agendar Férias
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 grid grid-cols-1 gap-4 md:grid-cols-1">
|
<div class="mt-4 grid grid-cols-1 gap-4 md:grid-cols-1">
|
||||||
<div class="form-control">
|
<div class="form-control">
|
||||||
|
|||||||
Reference in New Issue
Block a user