[PR #6] [MERGED] Dev #68

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

📋 Pull Request Information

Original PR: https://github.com/BreizhHardware/Site-comptage-heure/pull/6
Author: @BreizhHardware
Created: 10/18/2025
Status: Merged
Merged: 10/18/2025
Merged by: @BreizhHardware

Base: mainHead: dev


📝 Commits (3)

  • 8ccca75 feat: update Docker setup to create uploads directory and ensure data persistence
  • a6ac1e8 feat: implement user password reset functionality and enhance settings context
  • 736d327 feat: add success and error notifications for hour validation and addition

📊 Changes

16 files changed (+760 additions, -1340 deletions)

View changed files

📝 .gitignore (+7 -1)
📝 Dockerfile (+1 -2)
📝 app/admin/page.tsx (+177 -49)
📝 app/api/auth/change-password/route.ts (+2 -0)
📝 app/api/hours/[id]/route.ts (+1 -1)
📝 app/api/hours/route.ts (+6 -0)
📝 app/api/users/[id]/route.ts (+26 -0)
app/api/users/route.ts (+25 -0)
📝 app/dashboard/page.tsx (+12 -3)
📝 components/Header.tsx (+8 -20)
📝 components/providers.tsx (+4 -1)
context/SettingsContext.tsx (+45 -0)
📝 docker-compose.yml (+1 -0)
📝 package.json (+2 -0)
📝 pnpm-lock.yaml (+438 -1260)
📝 prisma/schema.prisma (+5 -3)

📄 Description

This pull request introduces several enhancements and new features to the admin panel, focusing on improved user management, password reset functionality, and better feedback for administrative actions. It also includes backend changes to support these features, such as new API endpoints and updates to existing ones. The most important changes are grouped below.

User Management and Password Reset Functionality

Feedback and Validation Improvements

  • Added toast notifications throughout the admin and dashboard panels to provide immediate feedback for actions such as validation, creation, deletion, and settings updates. [1] [2] [3] [4] [5]
  • Enhanced validation display for hours, showing who validated or rejected each entry in the admin and dashboard tables. [1] [2] [3] [4] [5]

Refactoring and Data Consistency

  • Refactored user mapping and hour aggregation logic to use the newly fetched user list for improved consistency and reliability in the admin panel.
  • Standardized hour and user id types to strings across the frontend and backend for consistency. [1] [2]

Minor UI and UX Improvements

  • Updated role naming in the user creation dropdown from "Admin" to "Bureau" for clarity.
  • Improved Dockerfile startup command to ensure Prisma database is properly initialized before app start.

Backend and Security Enhancements

  • Added dynamic = 'force-dynamic' to password change and user endpoints for proper Next.js API behavior. [1] [2]
  • Changed validatedBy field handling in hours API to use validatedById for better relational integrity. (app/api/hours/[id]/route.tsL30-R30)

🔄 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/6 **Author:** [@BreizhHardware](https://github.com/BreizhHardware) **Created:** 10/18/2025 **Status:** ✅ Merged **Merged:** 10/18/2025 **Merged by:** [@BreizhHardware](https://github.com/BreizhHardware) **Base:** `main` ← **Head:** `dev` --- ### 📝 Commits (3) - [`8ccca75`](https://github.com/BreizhHardware/Site-comptage-heure/commit/8ccca751aa983688ee87f3789722d117f7f41f08) feat: update Docker setup to create uploads directory and ensure data persistence - [`a6ac1e8`](https://github.com/BreizhHardware/Site-comptage-heure/commit/a6ac1e8140182b02b8cdc73b0db0cff4384724e6) feat: implement user password reset functionality and enhance settings context - [`736d327`](https://github.com/BreizhHardware/Site-comptage-heure/commit/736d32705016916e224faa714e42dac69ada9314) feat: add success and error notifications for hour validation and addition ### 📊 Changes **16 files changed** (+760 additions, -1340 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+7 -1) 📝 `Dockerfile` (+1 -2) 📝 `app/admin/page.tsx` (+177 -49) 📝 `app/api/auth/change-password/route.ts` (+2 -0) 📝 `app/api/hours/[id]/route.ts` (+1 -1) 📝 `app/api/hours/route.ts` (+6 -0) 📝 `app/api/users/[id]/route.ts` (+26 -0) ➕ `app/api/users/route.ts` (+25 -0) 📝 `app/dashboard/page.tsx` (+12 -3) 📝 `components/Header.tsx` (+8 -20) 📝 `components/providers.tsx` (+4 -1) ➕ `context/SettingsContext.tsx` (+45 -0) 📝 `docker-compose.yml` (+1 -0) 📝 `package.json` (+2 -0) 📝 `pnpm-lock.yaml` (+438 -1260) 📝 `prisma/schema.prisma` (+5 -3) </details> ### 📄 Description This pull request introduces several enhancements and new features to the admin panel, focusing on improved user management, password reset functionality, and better feedback for administrative actions. It also includes backend changes to support these features, such as new API endpoints and updates to existing ones. The most important changes are grouped below. **User Management and Password Reset Functionality** * Added a new `/api/users` endpoint and frontend integration to allow `SUPER_ADMIN` users to fetch, display, and manage all users in the admin panel. [[1]](diffhunk://#diff-042f8df9a7283c671079c6a20538d3e511722b839a4b0ce4a3b8b077328b3bd4R1-R25) [[2]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R112-R117) [[3]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R134-R149) * Implemented password reset capability for users, including dialog UI for entering and confirming new passwords, and backend support for securely updating user passwords. ([app/api/users/[id]/route.tsR5](diffhunk://#diff-58c29d349b599696e53810cc2f6a8f3e4056e0ba91deefd565776bbddc9bb358R5), [app/api/users/[id]/route.tsR51-R75](diffhunk://#diff-58c29d349b599696e53810cc2f6a8f3e4056e0ba91deefd565776bbddc9bb358R51-R75), [[1]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R87-R97) [[2]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R316-R354) [[3]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R731-R774) [[4]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R523-R539) **Feedback and Validation Improvements** * Added toast notifications throughout the admin and dashboard panels to provide immediate feedback for actions such as validation, creation, deletion, and settings updates. [[1]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R134-R149) [[2]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43L134-R182) [[3]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R231-R233) [[4]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R244-R260) [[5]](diffhunk://#diff-e16c1c1133d5d72341ada507f3e06fa37dd79de574403f158159ff934f9b5013L97-R105) * Enhanced validation display for hours, showing who validated or rejected each entry in the admin and dashboard tables. [[1]](diffhunk://#diff-53f5b1f527e0d09d7aee7f875a64881f5793a728b70fb4f6cb726c8c893ff048R28-R30) [[2]](diffhunk://#diff-53f5b1f527e0d09d7aee7f875a64881f5793a728b70fb4f6cb726c8c893ff048R45-R47) [[3]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43R44-R59) [[4]](diffhunk://#diff-a7c2b21269eaaa6f291a758c44939732a9f1d9fe8e0d71a3a7822b813a196f43L385-R455) [[5]](diffhunk://#diff-e16c1c1133d5d72341ada507f3e06fa37dd79de574403f158159ff934f9b5013L28-R34) **Refactoring and Data Consistency** * Refactored user mapping and hour aggregation logic to use the newly fetched user list for improved consistency and reliability in the admin panel. * Standardized hour and user `id` types to strings across the frontend and backend for consistency. [[1]](diffhunk://#diff-e16c1c1133d5d72341ada507f3e06fa37dd79de574403f158159ff934f9b5013L28-R34) [[2]](diffhunk://#diff-e16c1c1133d5d72341ada507f3e06fa37dd79de574403f158159ff934f9b5013L97-R105) **Minor UI and UX Improvements** * Updated role naming in the user creation dropdown from "Admin" to "Bureau" for clarity. * Improved Dockerfile startup command to ensure Prisma database is properly initialized before app start. **Backend and Security Enhancements** * Added `dynamic = 'force-dynamic'` to password change and user endpoints for proper Next.js API behavior. [[1]](diffhunk://#diff-5a267782f8cc7c64373174df27ae6923528d70152386d5fb486e22ca1bda1ec1R7-R8) [[2]](diffhunk://#diff-042f8df9a7283c671079c6a20538d3e511722b839a4b0ce4a3b8b077328b3bd4R1-R25) * Changed validatedBy field handling in hours API to use `validatedById` for better relational integrity. ([app/api/hours/[id]/route.tsL30-R30](diffhunk://#diff-d0039d092cf52c685c887b4e01d0a30303057a604d0adcba4b4a7ea748603154L30-R30)) --- <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:34 +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#68
No description provided.