From 0de3a8faf4d725ea1b5f1f2068d7230f84184881 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 19:40:48 +0000 Subject: [PATCH] Refactor: Centralize UI card component with NucleoDataCard This commit introduces a new `NucleoDataCard.vue` component to centralize the common structure and styling of various card elements used throughout the UI. The following existing card components have been refactored to use `NucleoDataCard.vue`: - `ui/src/components/asistencias/cardAsistencia.vue` - `ui/src/components/empleados/cardEmpleado.vue` - `ui/src/components/planillas/cardPlanilla.vue` - `ui/src/components/tareas/cardTarea.vue` Key changes: - Created `NucleoDataCard.vue` in `ui/src/components/ui/` with flexible props (title, status, fields, accentColor, backgroundColor, avatarUrl, observation, showEditButton, showDeleteButton) and slots (header, body, footer, actions) to accommodate different card designs. - Updated `NucleoDataCard.vue` to directly use hex color values for `accentColor` and `backgroundColor` props for easier integration with the UI store. - Refactored the listed existing card components to utilize `NucleoDataCard.vue`, passing data through props and customizing specific sections (like avatars or field icons) via slots. - Ensured that all functionalities, including edit/delete actions and dynamic styling based on the UI store, are preserved in the refactored components. This centralization reduces code duplication, improves maintainability, and provides a consistent foundation for future card-based UI elements. --- .../components/asistencias/cardAsistencia.vue | 101 +++++++-------- ui/src/components/empleados/cardEmpleado.vue | 118 ++++++++---------- ui/src/components/planillas/cardPlanilla.vue | 93 +++++++------- ui/src/components/tareas/cardTarea.vue | 107 ++++++++-------- ui/src/components/ui/NucleoDataCard.vue | 89 +++++++++++++ 5 files changed, 277 insertions(+), 231 deletions(-) create mode 100644 ui/src/components/ui/NucleoDataCard.vue diff --git a/ui/src/components/asistencias/cardAsistencia.vue b/ui/src/components/asistencias/cardAsistencia.vue index f5a14b7..c09c91b 100644 --- a/ui/src/components/asistencias/cardAsistencia.vue +++ b/ui/src/components/asistencias/cardAsistencia.vue @@ -1,41 +1,30 @@ diff --git a/ui/src/components/empleados/cardEmpleado.vue b/ui/src/components/empleados/cardEmpleado.vue index a3a2997..f186c0e 100644 --- a/ui/src/components/empleados/cardEmpleado.vue +++ b/ui/src/components/empleados/cardEmpleado.vue @@ -1,57 +1,55 @@ - diff --git a/ui/src/components/planillas/cardPlanilla.vue b/ui/src/components/planillas/cardPlanilla.vue index 7d610b2..9f23559 100644 --- a/ui/src/components/planillas/cardPlanilla.vue +++ b/ui/src/components/planillas/cardPlanilla.vue @@ -1,39 +1,29 @@ diff --git a/ui/src/components/tareas/cardTarea.vue b/ui/src/components/tareas/cardTarea.vue index 71cfe39..f4b5ad3 100644 --- a/ui/src/components/tareas/cardTarea.vue +++ b/ui/src/components/tareas/cardTarea.vue @@ -1,42 +1,30 @@ diff --git a/ui/src/components/ui/NucleoDataCard.vue b/ui/src/components/ui/NucleoDataCard.vue new file mode 100644 index 0000000..7781a93 --- /dev/null +++ b/ui/src/components/ui/NucleoDataCard.vue @@ -0,0 +1,89 @@ + + + + +