[PR #26] [MERGED] feat: Ajouter des fonctionnalités de tri et de filtrage des heures, incluant la sélection d'utilisateurs et l'ajout de timestamps #84

Closed
opened 2026-05-06 12:18:38 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/BreizhHardware/Site-comptage-heure/pull/26
Author: @BreizhHardware
Created: 11/20/2025
Status: Merged
Merged: 11/20/2025
Merged by: @BreizhHardware

Base: devHead: feat/sort-hours


📝 Commits (1)

  • e825651 feat: Ajouter des fonctionnalités de tri et de filtrage des heures, incluant la sélection d'utilisateurs et l'ajout de timestamps

📊 Changes

9 files changed (+511 additions, -23 deletions)

View changed files

📝 .dockerignore (+1 -1)
📝 app/admin/page.tsx (+103 -21)
📝 app/api/hours/route.ts (+2 -0)
components/ui/checkbox.tsx (+32 -0)
components/ui/select.tsx (+187 -0)
📝 package.json (+4 -1)
📝 pnpm-lock.yaml (+159 -0)
prisma/migrations/20251120171812_add_timestamps_to_hour/migration.sql (+21 -0)
📝 prisma/schema.prisma (+2 -0)

📄 Description

This pull request introduces significant UI improvements and new features to the admin page, primarily by adding reusable UI components (Checkbox and Select), enhancing sorting/filtering options for hours management, and updating dependencies to support these changes. It also includes minor backend adjustments to expose additional data fields and a small update to .dockerignore.

UI Enhancements and Feature Additions:

  • Introduced reusable Checkbox and Select components using Radix UI primitives, enabling consistent and accessible form controls throughout the admin interface (components/ui/checkbox.tsx, components/ui/select.tsx). [1] [2]
  • Refactored the admin page to use the new Checkbox and Select components for user selection, role assignment, and force deletion confirmation, replacing native HTML elements for a more unified UI (app/admin/page.tsx). [1] [2] [3]
  • Added advanced sorting and filtering controls for the hours management table, allowing admins to sort by "effective date" or "date added", choose ascending/descending order, and prioritize pending items (app/admin/page.tsx). [1] [2] [3]

Backend and Data Layer Adjustments:

  • Updated the hours API to include the createdAt field in responses, supporting the new sorting options in the UI (app/api/hours/route.ts). [1] [2]
  • Extended the Hour interface to accept an optional createdAt property, aligning frontend types with backend data (app/admin/page.tsx).

Dependency and Configuration Updates:

  • Added @radix-ui/react-checkbox and @radix-ui/react-select (and their dependencies) to the project dependencies and lockfile to support the new UI components (package.json, pnpm-lock.yaml). [1] [2] [3] [4] [5] [6]
  • Added a new script db:migrate for deploying Prisma migrations (package.json).

Miscellaneous:

  • Updated .dockerignore to exclude the scripts/seed-test.js file, likely to prevent it from being included in Docker builds (.dockerignore).

Closes #21


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BreizhHardware/Site-comptage-heure/pull/26 **Author:** [@BreizhHardware](https://github.com/BreizhHardware) **Created:** 11/20/2025 **Status:** ✅ Merged **Merged:** 11/20/2025 **Merged by:** [@BreizhHardware](https://github.com/BreizhHardware) **Base:** `dev` ← **Head:** `feat/sort-hours` --- ### 📝 Commits (1) - [`e825651`](https://github.com/BreizhHardware/Site-comptage-heure/commit/e825651c57ca5480885bc89811c0f2fb7983b3ac) feat: Ajouter des fonctionnalités de tri et de filtrage des heures, incluant la sélection d'utilisateurs et l'ajout de timestamps ### 📊 Changes **9 files changed** (+511 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `.dockerignore` (+1 -1) 📝 `app/admin/page.tsx` (+103 -21) 📝 `app/api/hours/route.ts` (+2 -0) ➕ `components/ui/checkbox.tsx` (+32 -0) ➕ `components/ui/select.tsx` (+187 -0) 📝 `package.json` (+4 -1) 📝 `pnpm-lock.yaml` (+159 -0) ➕ `prisma/migrations/20251120171812_add_timestamps_to_hour/migration.sql` (+21 -0) 📝 `prisma/schema.prisma` (+2 -0) </details> ### 📄 Description This pull request introduces significant UI improvements and new features to the admin page, primarily by adding reusable UI components (`Checkbox` and `Select`), enhancing sorting/filtering options for hours management, and updating dependencies to support these changes. It also includes minor backend adjustments to expose additional data fields and a small update to `.dockerignore`. **UI Enhancements and Feature Additions:** * Introduced reusable `Checkbox` and `Select` components using Radix UI primitives, enabling consistent and accessible form controls throughout the admin interface (`components/ui/checkbox.tsx`, `components/ui/select.tsx`). [[1]](diffhunk://#diff-488f67026ba7a4a0391c970e0561b381a805b7e8d7139ee31c2e96756b4d3affR1-R32) [[2]](diffhunk://#diff-1712d8a01fd3ffbae40762fc387022a4bf85ba6ce76ff4b946d0979b56652a8dR1-R187) * Refactored the admin page to use the new `Checkbox` and `Select` components for user selection, role assignment, and force deletion confirmation, replacing native HTML elements for a more unified UI (`app/admin/page.tsx`). [[1]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43L398-L411) [[2]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43L690-R782) [[3]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43L745-R831) * Added advanced sorting and filtering controls for the hours management table, allowing admins to sort by "effective date" or "date added", choose ascending/descending order, and prioritize pending items (`app/admin/page.tsx`). [[1]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R107-R109) [[2]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43L366-R398) [[3]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R498-R550) **Backend and Data Layer Adjustments:** * Updated the hours API to include the `createdAt` field in responses, supporting the new sorting options in the UI (`app/api/hours/route.ts`). [[1]](diffhunk://#diff-53f5b1f527e0d09d7aee7f875a64881f5793a728b70fb4f6cb726c8c893ff048R27) [[2]](diffhunk://#diff-53f5b1f527e0d09d7aee7f875a64881f5793a728b70fb4f6cb726c8c893ff048R43) * Extended the `Hour` interface to accept an optional `createdAt` property, aligning frontend types with backend data (`app/admin/page.tsx`). **Dependency and Configuration Updates:** * Added `@radix-ui/react-checkbox` and `@radix-ui/react-select` (and their dependencies) to the project dependencies and lockfile to support the new UI components (`package.json`, `pnpm-lock.yaml`). [[1]](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L13-R23) [[2]](diffhunk://#diff-32824c984905bb02bc7ffcef96a77addd1f1602cff71a11fbbfdd7f53ee026bbR21-R23) [[3]](diffhunk://#diff-32824c984905bb02bc7ffcef96a77addd1f1602cff71a11fbbfdd7f53ee026bbR33-R35) [[4]](diffhunk://#diff-32824c984905bb02bc7ffcef96a77addd1f1602cff71a11fbbfdd7f53ee026bbR423-R425) [[5]](diffhunk://#diff-32824c984905bb02bc7ffcef96a77addd1f1602cff71a11fbbfdd7f53ee026bbR442-R467) [[6]](diffhunk://#diff-32824c984905bb02bc7ffcef96a77addd1f1602cff71a11fbbfdd7f53ee026bbR499-R507) * Added a new script `db:migrate` for deploying Prisma migrations (`package.json`). **Miscellaneous:** * Updated `.dockerignore` to exclude the `scripts/seed-test.js` file, likely to prevent it from being included in Docker builds (`.dockerignore`). Closes #21 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:18:38 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BreizhHardware/Site-comptage-heure#84
No description provided.