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"
|
||||
>
|
||||
<h2 class="card-title text-lg">Filtros</h2>
|
||||
{#if funcionario}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary gap-2"
|
||||
onclick={() => (mostrarWizard = true)}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary gap-2"
|
||||
onclick={() => {
|
||||
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
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-5 w-5"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
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}
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
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>
|
||||
</div>
|
||||
<div class="mt-4 grid grid-cols-1 gap-4 md:grid-cols-1">
|
||||
<div class="form-control">
|
||||
|
||||
Reference in New Issue
Block a user