Merged
Conversation
|
Cursor Agent can help with this pull request. Just |
benmed00
added a commit
that referenced
this pull request
Jan 10, 2026
Build error and timing This PR resolves build errors and introduces build performance monitoring. ## Changes - Fixed 'Dynamic server usage' build errors by adding `export const dynamic = 'force-dynamic'` to 5 API routes - Added build timing script (`scripts/time-build.js`) for performance monitoring - Removed empty test files causing test failures - Resolved merge conflicts with main branch ## Impact - ✅ Clean builds without errors or warnings - ✅ Build performance metrics available - ✅ All tests passing (98/98) - ✅ Improved developer experience ## Related - Closes #77 - Fix Next.js build errors: Dynamic server usage warnings - Closes #78 - Add build performance monitoring and timing - Related to PR #76 (Performance optimizations) - Related to PR #75 (Global search) - Milestone: v1.3 - Quality & Polish ## Technical Details - Files changed: 26 - Additions: +1,082 - Deletions: -712 - Commits: 4 PR #72
5476de2 to
743316e
Compare
This was referenced Jan 10, 2026
c619840 to
121a4d2
Compare
cursor bot
pushed a commit
that referenced
this pull request
Jan 10, 2026
Build error and timing This PR resolves build errors and introduces build performance monitoring. ## Changes - Fixed 'Dynamic server usage' build errors by adding `export const dynamic = 'force-dynamic'` to 5 API routes - Added build timing script (`scripts/time-build.js`) for performance monitoring - Removed empty test files causing test failures - Resolved merge conflicts with main branch ## Impact - ✅ Clean builds without errors or warnings - ✅ Build performance metrics available - ✅ All tests passing (98/98) - ✅ Improved developer experience ## Related - Closes #77 - Fix Next.js build errors: Dynamic server usage warnings - Closes #78 - Add build performance monitoring and timing - Related to PR #76 (Performance optimizations) - Related to PR #75 (Global search) - Milestone: v1.3 - Quality & Polish ## Technical Details - Files changed: 26 - Additions: +1,082 - Deletions: -712 - Commits: 4 PR #72
Co-authored-by: benyakoub.pro <benyakoub.pro@gmail.com>
Co-authored-by: benyakoub.pro <benyakoub.pro@gmail.com>
- Remove src/lib/validation-helpers.test.ts (empty) - Remove src/lib/pagination.test.ts (empty) - Fix apostrophe escaping in security page - Add eslint-disable for QR code image
Co-authored-by: benyakoub.pro <benyakoub.pro@gmail.com>
- Fix import path to @/components/search/global-search - Restore required pageSize and totalItems props for Pagination component
121a4d2 to
cb2e300
Compare
Co-authored-by: benyakoub.pro <benyakoub.pro@gmail.com>
Co-authored-by: benyakoub.pro <benyakoub.pro@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Global Entity Search Implementation & Critical Platform Enhancements
🎯 Overview
This PR implements a comprehensive global entity search feature that allows users to search across all entities in the platform, while also addressing critical priorities including testing infrastructure, performance optimization, security enhancements, and extended export functionality. This is a major feature enhancement that significantly improves the platform's usability and developer experience.
🔍 Context
Problem Statement
Impact
✨ Changes Made
1. Global Entity Search Implementation
Core Search API (
src/app/api/search/route.ts):force-dynamic)Search UI Component (
src/components/search/global-search.tsx):Integration:
2. Comprehensive Testing Infrastructure
Unit Tests:
src/lib/password-policy.test.ts- 29 tests covering password validation, expiration, history, lockout, strengthsrc/lib/two-factor.test.ts- 27 tests covering 2FA secret generation, QR codes, verification, backup codessrc/lib/export-utils.test.ts- 9 tests covering export filename generation, blob downloading, API callsIntegration Tests:
src/app/api/search/route.test.ts- 4 tests covering search functionality, authentication, rate limitingsrc/app/api/export/excel/route.test.ts- 3 tests covering Excel export, error handlingE2E Tests (Playwright):
e2e/auth.spec.ts- User login and logout flowse2e/search.spec.ts- Global search functionalitye2e/export.spec.ts- Excel, PDF, and CSV export functionality3. Performance Optimizations
HTTP Caching:
Cache-Controlheaders to/api/air-qualityrouteStandardized Pagination:
parsePaginationandcreatePaginatedResponseutilities/api/documentsand/api/publicationsroutes4. Security Enhancements
Rate Limiting:
withRateLimitwrapper to all export endpoints:/api/export/excel/api/export/pdf/api/export/csvTwo-Factor Authentication (2FA):
Password Management:
5. Extended Export Functionality
CSV Export:
/api/export/csvrouteExport Buttons Component:
Export Types Extended:
waterQuality,airQuality,climateDatatoExportType6. Client Page Components
Converted several server components to client components for better interactivity:
src/app/dashboard/documents/client-page.tsxsrc/app/dashboard/environment/climate/client-page.tsxsrc/app/dashboard/publications/client-page.tsxsrc/app/dashboard/rh/employees/client-page.tsxsrc/app/dashboard/environment/water/client-page.tsxsrc/app/dashboard/environment/air/client-page.tsx🔗 Related Work
Related PRs
force-dynamicconfiguration from PR Build error and timing #72Milestone
Branch Information
main(commit:43c2e3c)cursor/global-entity-search-implementation-8e2a(commit:e6a96a5)🧪 Testing
Test Coverage
Manual Testing
Global Search:
Export Functionality:
2FA:
📊 Metrics & Impact
Before
After
🚀 Deployment Notes
Breaking Changes
Migration Steps
Rollback Plan
📝 Code Quality
Standards Met
Files Changed
Key Files
src/app/api/search/route.ts- Global search APIsrc/components/search/global-search.tsx- Search UI componentsrc/lib/password-policy.test.ts- Password policy testssrc/lib/two-factor.test.ts- 2FA testssrc/app/api/export/csv/route.ts- CSV export endpointe2e/*.spec.ts- E2E test suite✅ Checklist
👥 Reviewers
@benmed00 - Please review for:
📚 Additional Notes
Technical Details
Search Implementation:
containswith case-insensitive mode for flexible matching2FA Implementation:
otplibfor TOTP generationqrcodelibraryExport Implementation:
papaparsefor generation/api/export/excelendpoint/api/export/pdfendpoint🔄 Future Improvements
Potential enhancements for future PRs:
🔗 Resolved Issues
This PR resolves the following issues:
Closes #79 - Implement global entity search across all platform entities
Closes #80 - Add comprehensive testing infrastructure (unit, integration, E2E)
This PR addresses global search, testing, performance, security, and export functionality. If specific GitHub issues exist for these features, they should be linked below using
Closes #XXorFixes #XX.Note: To see issues in the GitHub "Development" section, add explicit
Closes #XX,Fixes #XX, orResolves #XXreferences.Type: ✨ Feature + 🧪 Testing + ⚡ Performance + 🔒 Security
Priority: High
Module: Core Platform
Milestone: v1.1 - Performance & User Experience