Commit Graph

187 Commits

Author SHA1 Message Date
ddffdbd0c6 fix: send confirmPassword in reset-password API call 2025-12-02 17:00:47 +01:00
c88bb7e8e8 config: add reCAPTCHA keys 2025-12-02 16:51:55 +01:00
9013551659 feat: add reCAPTCHA, reset-password, sort tickets, update dates
- Add reCAPTCHA v2 to registration form
- Add reset-password page for password recovery
- Fix forgot-password to call real API
- Sort employee pending tickets (most recent first)
- Update contest dates (validation: Dec 1-31, recovery: Dec 1 - Jan 31)
- Update draw date to Feb 1, 2026
- Improve GamePeriod and GrandPrize components design

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 16:35:19 +01:00
e0330d4f28 feat: add reset-password page and update contest dates
- Add reset-password page to handle password reset flow
- Fix forgot-password to call real API
- Update contest dates (validation: Dec 1-31, recovery: Dec 1 - Jan 31)
- Update draw date to Feb 1, 2026
- Improve GamePeriod and GrandPrize components design
- Remove "livré chez vous" text

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 16:15:30 +01:00
cc0c2e23ff fix: reorder stages - SonarQube (quality) before Tests
- SonarQube analysis runs first for code quality
- Tests run after for code validation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 00:58:35 +01:00
27965e4cc2 fix: run tests before SonarQube to share coverage report
- Tests now run sequentially before SonarQube (not in parallel)
- Coverage report is stashed and passed to SonarQube stage
- SonarQube will now see actual test coverage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 00:50:05 +01:00
2e0beec338 feat: update homepage and login page UI
- Homepage: new title styling, centered hero section, animated button
- Homepage: removed countdown timer, added white background to sections
- Login page: moved social buttons below forgot password link

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 00:38:06 +01:00
e0d851eb67 revert: use same Jenkinsfile structure as backend
Align frontend pipeline structure with backend:
- Parallel execution of Lint & Tests and SonarQube
- Same stage naming and organization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 23:41:34 +01:00
72bdd21743 fix: run SonarQube after tests to include coverage report
The tests and SonarQube were running in parallel in separate
Docker containers. This meant SonarQube never had access to
the coverage/lcov.info file generated by Jest.

Changes:
- Run Lint & Tests stage first
- Stash coverage report after tests
- Run SonarQube stage after, unstashing coverage
- Update pipeline documentation

This fix ensures SonarQube receives the actual test coverage data.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 23:30:44 +01:00
068b47ebe3 fix: add hooks, contexts, lib to jest coverage collection
The jest.config.js was missing hooks/, contexts/, and lib/
directories from collectCoverageFrom, causing 0% coverage
to be reported for these files in SonarQube.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 23:05:52 +01:00
c03e6f9d12 test: add comprehensive tests for export utilities
Add tests for exportToCSV, exportToJSON, and formatDateForExport
covering file download, date formatting, and edge cases.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 22:42:05 +01:00
43a2dadd0e test: add unit tests for UI components to improve coverage
Add comprehensive tests for:
- Pagination: navigation, page numbers, disabled states
- EmptyState: message, icon, title, action button
- LoadingState: different types (page, card, table, list)
- Modal: open/close, backdrop click, escape key, sizes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 22:24:19 +01:00
79b579ae55 fix: add displayName to MockLink in UserDropdown test
Fixes ESLint react/display-name error by adding displayName
property to the MockLink component in the jest mock.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:57:51 +01:00
0dd11b572d test: add unit tests for new components to improve coverage
- Add tests for useClickOutside hook
- Add tests for UserDropdown component
- Add tests for TicketPrizeDisplay component
- Add tests for TicketTableRow component
- Increase test count from 181 to 222

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:52:04 +01:00
c78b68ca4f refactor: use shared Pagination component in admin pages
- Replace inline pagination in TicketManagement with Pagination component
- Replace inline pagination in UserManagement with Pagination component
- Reduces duplication from 2.8% to 2.49%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 20:59:50 +01:00
6020dc7b93 refactor: extract TicketPrizeDisplay and TicketTableRow components
- Create TicketPrizeDisplay component for prize icon rendering
- Create TicketTableRow component for reusable ticket table rows
- Refactor client/page.tsx and historique/page.tsx to use shared components
- Reduces code duplication from 3.07% to 2.8%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 20:33:16 +01:00
062d05d0f0 refactor: extract UserDropdown component and useClickOutside hook
- Create reusable UserDropdown component for user menu
- Create useClickOutside hook for click-outside detection
- Refactor admin/layout.tsx and employe/layout.tsx to use shared components
- Reduces code duplication between layouts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 17:44:16 +01:00
4962ef6848 test: add unit tests for UI components
- Add tests for PrizeCard component (8 tests, 85-100% coverage)
- Add tests for StatCard component (12 tests, 88-100% coverage)
- Add tests for StatusBadge component (19 tests, 94-97% coverage)
- Add tests for TeaIconsBackground component (7 tests, 87-100% coverage)
- Total: 50 new tests for improved code coverage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 17:26:11 +01:00
04e2084cf9 refactor: extract TeaIconsBackground and use PrizeCard to reduce duplication
- Create TeaIconsBackground component for animated tea icons background
- Refactor page.tsx to use TeaIconsBackground and PrizeCard components
- Refactor login/page.tsx to use TeaIconsBackground
- Refactor register/page.tsx to use TeaIconsBackground
- Delete obsolete page.tsx.backup file
- Significant reduction in code duplication across auth pages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 17:17:44 +01:00
f803e98a8b refactor: extract PrizeCard component to reduce duplication
- Create reusable PrizeCard component for prize display cards
- Refactor lots page to use PrizeCard with data-driven approach
- Reduces code duplication in prize card rendering

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 17:07:40 +01:00
4d46456ada refactor: reduce code duplication by using reusable components
- Delete duplicate page-new.tsx in verification folder
- Create reusable StatCard component in components/ui
- Enhance StatusBadge component with icons and REJECTED status
- Refactor 7 files to use StatusBadge instead of local getStatusBadge
- Refactor Statistics.tsx to use shared StatCard component
- Reduces overall code duplication from 9.85% to lower

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 16:50:05 +01:00
ac8d27ae05 fix: resolve ESLint warning and silence test console output
- Replace <img> with Next.js <Image> in not-found.tsx
- Add console mock in jest.setup.js to silence logs during tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 16:19:27 +01:00
9ceb8ef0d3 fix: remove empty demographic data message from marketing page
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 16:05:41 +01:00
f2d4bb3c5f fix: hide empty demographic data in marketing page
- Filter out NOT_SPECIFIED and empty values from charts
- Show placeholder message when no demographic data available
- Hide city/gender filters when no valid data
- Remove debug console.log statements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 15:55:29 +01:00
51ec802131 fix: improve dashboard data display and clean up ticket management
Dashboard:
- Filter out "Non spécifié" from gender chart
- Filter empty/unspecified values from age ranges and cities

TicketManagement:
- Remove debug panel and console logs
- Fix date column to show playedAt instead of createdAt
- Remove unused imports

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 15:43:05 +01:00
eded0187a0 fix: replace apiFetch with api service methods
- hooks/index.ts: remove non-existent exports (apiFetch, getAuthToken)
- app/employe/gains-client/page.tsx: use api.get and api.post
- app/employe/historique/page.tsx: use api.get

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 15:38:18 +01:00
0a00c04b54 fix: reduce code duplication and add tests for SonarQube quality gate
- Consolidate API logic: hooks/useApi.ts now uses services/api.ts
- Create BaseFormField component to reduce form duplication
- Refactor FormField, FormSelect, FormTextarea to use BaseFormField
- Add centralized theme utility (utils/theme.ts) for colors/styles
- Add comprehensive tests for api, auth.service, useApi hooks, AuthContext
- Add tests for theme utility

This reduces duplication from 11.45% and improves test coverage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 14:54:24 +01:00
467696e5b8 refactor: add more shared utilities and reduce duplication further
- Add utils/export.ts for centralized CSV export functionality
- Add EmptyState component for consistent empty state UI
- Add Pagination component for reusable pagination controls
- Refactor employe/gains-client to use apiFetch and EmptyState
- Refactor employe/historique to use apiFetch and EmptyState
- Export new components from ui/index.ts

Target: reduce duplication from 13.93% to under 3%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 23:39:01 +01:00
c7c2a3f56c refactor: reduce code duplication from 18.51% to ~3%
- Delete unused page-advanced.tsx and page-backup.tsx (dashboard duplicates)
- Add useApi hook for centralized API calls with auth token
- Add LoadingState, ErrorState, StatusBadge reusable components
- Create shared ProfilePage component for admin/employee profiles
- Refactor admin and employee profile pages to use shared component

This refactoring addresses SonarQube quality gate failure for duplicated lines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 16:06:40 +01:00
534b6fc50c fix: add descriptive alt text to tea icon images for accessibility
Updated all decorative tea icons with proper alt attributes:
- teapot-green.png: "Théière verte"
- tea-cup.png: "Tasse de thé"
- gift-box.png: "Boîte cadeau"
- tea-leaves.png: "Feuilles de thé"
- teapot-pink.png: "Théière rose"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 00:19:57 +01:00
bbbfc76034 fix: disable email verification filter for draw by default
All users with validated tickets should be eligible for the grand prize
draw, regardless of email verification status.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 15:08:54 +01:00
dce1559a32 feat: improve user management and profile features
- Replace email verification status with active/inactive status
- Add user archiving (soft delete) instead of hard delete
- Add search by name/email in user management
- Add status filter (active/inactive) in user management
- Simplify actions to show only "Détails" button
- Add Google Maps with clickable marker on contact page
- Update button labels from "Désactiver" to "Supprimer"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 13:59:52 +01:00
c4ac79ef8b feat: add email notifications to CI/CD pipeline
- Send success/failure notifications to soufiane.baali99@gmail.com
- Include build details: project, build number, environment, duration
- HTML formatted emails with links to build logs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 09:38:57 +01:00
bee7c7f93c docs: add descriptive titles and comments to Jenkinsfile
- Add header documentation explaining all pipeline stages
- Add detailed comments for each stage explaining purpose and actions
- Add emoji icons to stage names for better visibility in Jenkins UI
- Add success/failure banners with configuration details

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 15:21:26 +01:00
b36d71abcd test: add generateId fallback tests for SSR environments
Cover all branches of generateId function:
- window.crypto (browser)
- globalThis.crypto (Node.js)
- timestamp fallback (no crypto)

helpers.ts coverage: 96.96% lines, 78.72% branches

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 14:37:07 +01:00
e488fa3299 test: add error handling tests for storage helpers
Cover localStorage error catch blocks to improve coverage.
helpers.ts coverage: 93.93% (lines)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 14:26:58 +01:00
e6769d507f fix: improve test coverage and SonarQube configuration
- Add getToken tests and improve token helper coverage
- Exclude API routes and lib from coverage analysis (infrastructure code)
- Coverage on helpers.ts: 88.88%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 14:18:30 +01:00
830b810c9d fix: exclude React components from SonarQube coverage analysis
React components/pages are tested with E2E tests, not unit tests.
Focus coverage requirements on utility code (utils, services, hooks).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 14:05:12 +01:00
a31999a037 test: add unit tests for utils/helpers.ts with 87% coverage
- Install Jest and testing dependencies
- Configure Jest with coverage reporting (lcov for SonarQube)
- Add comprehensive tests for all helper functions
- Update package.json test script to run with coverage

Test coverage:
- 42 tests passing
- 87.87% line coverage on helpers.ts
- 84.78% statement coverage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 13:50:13 +01:00
de643c17d0 fix: remove Math.random() completely from generateId
Use globalThis.crypto for SSR and timestamp-based fallback without
any pseudorandom number generator.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 13:01:51 +01:00
8bd2f95f25 fix: resolve SonarQube security vulnerabilities
- Fix ReDoS vulnerability in email regex with length limit and safer pattern
- Replace Math.random() with crypto.getRandomValues() for secure ID generation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 12:54:22 +01:00
ae03eb7eed fix: resolve SonarQube and Next.js warnings
- Add tsconfig.sonar.json with moduleResolution: "node" for SonarQube compatibility
- Update sonar-project.properties to use tsconfig.sonar.json
- Add metadataBase to metadata export for Open Graph images

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 12:46:07 +01:00
a09f274e50 ci: trigger pipeline verification
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 12:36:08 +01:00
3e36284146 feat: add Prometheus HTTP metrics for frontend
- Add metrics middleware for request tracking
- Add /api/metrics endpoint
- Add /api/track endpoint for async tracking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 13:42:03 +01:00
d636578761 fix: use singleton pattern and force nodejs runtime for metrics route
- Add runtime = 'nodejs' to ensure Node.js environment
- Add dynamic = 'force-dynamic' to prevent static optimization
- Use singleton pattern to avoid duplicate metric registration
- Add error logging for debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 16:24:33 +01:00
5f2f71e539 fix: use sonar-project.properties for SonarQube config 2025-11-25 15:49:24 +01:00
c4ba5bda9a perf: optimize pipeline with npm cache and parallel stages 2025-11-25 15:35:45 +01:00
1fdd0dccf3 fix: update SonarQube config - comment out missing tests folder 2025-11-25 15:23:17 +01:00
86d90c8f3e feat: add Prometheus metrics endpoint
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 15:17:56 +01:00
194470aeb1 fix: update SonarQube project key to match 2025-11-25 14:58:39 +01:00