Commit Graph

20 Commits

Author SHA1 Message Date
Dries Peeters
fc81cc3d8c feat: Add tests and docs for User Settings page
Add extensive test coverage and documentation for the existing User Settings
page, completing the feature implementation to production-ready status.

## Changes

### Testing (44 tests, 100% passing)
- Add 30 unit tests in tests/test_user_settings.py
  * Page rendering and authentication tests
  * Form validation and preference update tests
  * API endpoint tests (PATCH /api/preferences, POST /api/theme)
  * Integration and CSRF protection tests
- Add 14 smoke tests in tests/smoke_test_user_settings.py
  * Basic functionality validation
  * Critical user path verification
  * Error handling checks

### Documentation
- Add docs/USER_SETTINGS_GUIDE.md
  * Comprehensive user guide for all settings
  * API documentation with examples
  * Database schema reference
  * Troubleshooting guide
  * Best practices for developers
- Add USER_SETTINGS_IMPLEMENTATION_SUMMARY.md
  * Complete implementation overview
  * Feature checklist and verification
  * Test results and metrics

## Features Tested

-  Profile information management (name, email)
-  Notification preferences (5 toggles)
-  Theme selection (light/dark/system) with live preview
-  Regional settings (timezone, date/time formats, week start)
-  Time rounding preferences (intervals, methods)
-  Overtime settings (standard hours per day)
-  API endpoints for AJAX updates
-  Input validation and error handling

## Test Coverage

- Settings page rendering: 4 tests
- Preference updates: 16 tests
- API endpoints: 7 tests
- Integration: 3 tests
- Smoke tests: 14 tests
- Total: 44 tests, 100% passing

## Notes

The User Settings feature backend and frontend were already fully implemented
in app/routes/user.py and app/templates/user/settings.html. This commit adds
the missing test co
2025-10-30 07:47:58 +01:00
Dries Peeters
bdda0f2f1d Update setup.py 2025-10-29 18:49:09 +01:00
Dries Peeters
c93a37f126 feat: add overtime tracking support with configurable working hours
Implement comprehensive overtime tracking feature that allows users to
set their standard working hours per day and automatically calculates
overtime for hours worked beyond that threshold.

Core Features:
- Add standard_hours_per_day field to User model (default: 8.0 hours)
- Create Alembic migration (031_add_standard_hours_per_day.py)
- Implement overtime calculation utilities (app/utils/overtime.py)
  * calculate_daily_overtime: per-day overtime calculation
  * calculate_period_overtime: multi-day overtime aggregation
  * get_daily_breakdown: detailed day-by-day analysis
  * get_weekly_overtime_summary: weekly overtime statistics
  * get_overtime_statistics: comprehensive overtime metrics

User Interface:
- Add "Overtime Settings" section to user settings page
- Display overtime data in user reports (regular vs overtime hours)
- Show "Days with Overtime" badge in reports
- Add overtime analytics API endpoint (/api/analytics/overtime)
- Improve input field styling with cleaner appearance (no spinners)

Reports Enhancement:
- Standardize form input styling across all report pages
- Replace inline Tailwind classes with consistent form-input class
- Add FontAwesome icons to form labels for better UX
- Improve button hover states and transitions

Testing:
- Add comprehensive unit tests (tests/test_overtime.py)
- Add smoke tests for quick validation (tests/test_overtime_smoke.py)
- Test coverage for models, utilities, and various overtime scenarios

Documentation:
- OVERTIME_FEATURE_DOCUMENTATION.md: complete feature guide
- OVERTIME_IMPLEMENTATION_SUMMARY.md: technical implementation details
- docs/features/OVERTIME_TRACKING.md: quick start guide

This change enables organizations to track employee overtime accurately
based on individual working hour configurations, providing better
insights into work patterns and resource allocation.
2025-10-27 08:44:04 +01:00
Dries Peeters
15c378bf7d Update setup.py 2025-10-25 07:43:39 +02:00
Dries Peeters
935f30e4d6 feat: Add Client Notes feature for internal client tracking
Implement comprehensive client notes system allowing users to add
internal notes about clients that are never visible to clients
themselves. Notes support importance flagging, full CRUD operations,
and proper access controls.

Key Changes:
- Add ClientNote model with user/client relationships
- Create Alembic migration (025) for client_notes table
- Implement full REST API with 9 endpoints
- Add client_notes blueprint with CRUD routes
- Create UI templates (edit page + notes section on client view)
- Add importance toggle with AJAX functionality
- Implement permission system (users edit own, admins edit all)

Features:
- Internal-only notes with rich text support
- Mark notes as important for quick identification
- Author tracking with timestamps
- Cascade delete when client is removed
- Mobile-responsive design
- i18n support for all user-facing text

Testing:
- 24 comprehensive model tests
- 23 route/integration tests
- Full coverage of CRUD operations and permissions

Documentation:
- Complete feature guide in docs/CLIENT_NOTES_FEATURE.md
- API documentation with examples
- Troubleshooting section
- Updated main docs index

Database:
- Migration revision 025 (depends on 024)
- Fixed PostgreSQL boolean default value issue
- 4 indexes for query performance
- CASCADE delete constraint on client_id

This feature addresses the need for teams to track important
information about clients internally without exposing sensitive
notes to client-facing interfaces or documents.
2025-10-24 08:37:51 +02:00
Dries Peeters
7dd39ef55a feat(ci): enhance PostHog credential injection visibility in release builds
Improved the Release Build workflow to clearly show that PostHog and Sentry
credentials are being injected from the GitHub Secret Store, providing better
transparency and auditability.

Changes:
- Enhanced workflow step name to explicitly mention "GitHub Secrets"
- Added comprehensive logging with visual separators and clear sections
- Added before/after file content display showing placeholder replacement
- Added secret availability verification with format validation
- Added detailed error messages with step-by-step fix instructions
- Enhanced release summary to highlight successful credential injection
- Updated build configuration documentation with cross-references

Benefits:
- Developers can immediately see credentials come from GitHub Secret Store
- Security teams have clear audit trail of credential injection process
- Better troubleshooting with detailed error messages
- Secrets remain protected with proper redaction (first 8 + last 4 chars)
- Multiple validation steps ensure correct injection

The workflow now outputs 50+ lines of structured logging showing:
- Secret store location (Settings → Secrets and variables → Actions)
- Target file being modified (app/config/analytics_defaults.py)
- Verification that secrets are available
- Format validation (phc_* pattern for PostHog)
- Confirmation of successful placeholder replacement
- Summary with redacted credential previews

Workflow: .github/workflows/cd-release.yml
Documentation: docs/cicd/README_BUILD_CONFIGURATION.md

Fully backward compatible - no breaking changes.
2025-10-23 15:32:57 +02:00
Dries Peeters
1908aea92d Update setup.py 2025-10-23 12:55:13 +02:00
Dries Peeters
84e2096602 feat: enhance CI/CD workflows and improve UX features
This commit improves the testing workflow, CI/CD documentation, and user experience:

## CI/CD Improvements:
- Add comprehensive testing strategy documentation to CD release workflow
- Document workflow triggers and testing approach in ci-comprehensive.yml
- Update CI/CD documentation with testing workflow details

## UX Enhancements:
- Add localStorage persistence for PWA install prompt dismissal
- Prevent repeated PWA install prompts after user dismisses
- Add dismiss button (×) to PWA install toast notification

## Dashboard Features:
- Add edit and delete actions to recent time entries table
- Include delete confirmation dialogs for time entries
- Add notes field to "Start Timer" modal
- Improve table layout with actions column

## Documentation:
- Create TESTING_WORKFLOW_STRATEGY.md for comprehensive testing guidelines
- Add QUICK_REFERENCE_TESTING.md for quick testing reference
- Document changes in CHANGES_SUMMARY_TESTING_WORKFLOW.md
- Update README_CI_CD_SECTION.md with workflow details

## Other Changes:
- Update setup.py configuration
- Enhance task templates (create/edit/view) with improved UI

These changes improve developer experience with better testing documentation
and enhance user experience with smarter PWA prompts and dashboard functionality.
2025-10-22 07:28:39 +02:00
Dries Peeters
6a0fab7cb7 Update setup.py 2025-10-21 20:15:37 +02:00
Dries Peeters
79e826ced2 feat(tasks,ui): enhance task management UI; update routes; add tests
Improve task workflows and overall UX, and align backend routes with the
new UI flows. Update docs and development setup accordingly.

- UI: refine task list/view/edit templates, project views, and Kanban
  partial (`_kanban_tailwind.html`)
- CSS: polish `app/static/enhanced-ui.css` for spacing, layout, and
  responsiveness
- Routes: update `app/routes/tasks.py` and `app/routes/clients.py` to
  support new edit/delete/filter behaviors and validations
- Templates: align clients/projects pages for consistency and navigation
- Docs: refresh `docs/GETTING_STARTED.md` and
  `docs/TASK_MANAGEMENT_README.md`
- Dev: adjust `docker-compose.yml` and `setup.py` to match the latest
  runtime/build expectations
- Tests: add coverage for delete actions, task project editing, and task
  filters UI (`tests/test_delete_actions.py`,
  `tests/test_task_edit_project.py`,
  `tests/test_tasks_filters_ui.py`); update existing tests

Why:
- Streamlines common task operations and improves discoverability
- Ensures backend and UI are consistent and well-tested
2025-10-21 17:05:00 +02:00
Dries Peeters
4c67b25f9d feat: enhance invoice management UI and add generate-from-time feature
- Enhanced invoice creation form with auto-fill client data from project selection
- Redesigned invoice edit page with improved layout and quick actions sidebar
- Added new generate-from-time template for adding unbilled time entries and costs
- Improved form styling and added responsive design enhancements
- Added internationalization (i18n) support throughout invoice templates
- Added notes and terms fields to invoice forms
- Implemented item removal functionality in invoice editor
- Added comprehensive tests for new invoice features
- Updated .gitignore to exclude logs directory
- Bumped version from 3.0.0 to 3.2.0

The invoice UI now provides:
- Quick actions panel with export, duplicate, and payment recording links
- Invoice summary sidebar showing totals and status
- Tips and guidance sidebars for better UX
- Client data auto-population when selecting projects
- Improved visual hierarchy and mobile responsiveness
2025-10-20 21:01:09 +02:00
Dries Peeters
3c3faf13d4 feat: Implement Tailwind CSS UI redesign across application
Migrate frontend from custom CSS to Tailwind CSS framework with comprehensive
template updates and improved component structure.

Breaking Changes:
- Remove legacy CSS files (base.css, calendar.css, ui.css, etc.)
- Replace with Tailwind-based styling system

New Features:
- Add Tailwind CSS configuration with PostCSS pipeline
- Create new template components for admin, clients, invoices, projects, reports
- Add form-bridge.css for smooth transition between legacy and Tailwind styles
- Add default avatar SVG asset
- Implement Tailwind-based kanban board template
- Add comprehensive UI quick wins documentation

Infrastructure:
- Add package.json with Tailwind dependencies
- Configure PostCSS and Tailwind build pipeline
- Update .gitignore for Node modules and build artifacts

Testing:
- Add template rendering tests (test_tasks_templates.py)
- Add UI component tests (test_ui_quick_wins.py)

Templates Added:
- Admin: dashboard, settings, system info, user management
- Clients: list and detail views
- Invoices: full CRUD templates with payment recording
- Projects: list, detail, and Tailwind kanban views
- Reports: comprehensive reporting templates
- Timer: manual entry interface

This commit represents the first phase of the UI redesign initiative,
maintaining backward compatibility where needed while establishing the
foundation for modern, responsive interfaces.
2025-10-17 11:51:36 +02:00
Dries Peeters
1e83a9cad7 Update setup.py 2025-10-16 19:28:02 +02:00
Dries Peeters
e61c628526 feat: enhance CSRF protection with double-submit cookie pattern
Implement comprehensive CSRF token management with cookie-based
double-submit pattern to improve security and SPA compatibility.

Changes:
- Add CSRF cookie configuration in app/config.py
  * WTF_CSRF_SSL_STRICT for strict SSL validation in production
  * CSRF_COOKIE_NAME (default: XSRF-TOKEN) for framework compatibility
  * CSRF_COOKIE_SECURE inherits from SESSION_COOKIE_SECURE by default
  * CSRF_COOKIE_HTTPONLY, CSRF_COOKIE_SAMESITE, and CSRF_COOKIE_DOMAIN settings

- Implement CSRF cookie handler in app/__init__.py
  * Set CSRF token in cookie after each request
  * Configure cookie with secure flags based on environment settings
  * Support for double-submit pattern and SPA frameworks

- Add client-side CSRF token management in base.html
  * JavaScript utilities for token retrieval and validation
  * Cookie synchronization for frameworks that read XSRF-TOKEN
  * Auto-refresh mechanism for stale tokens (>15 minutes)
  * Pre-submit token validation and refresh
  * User notification for missing cookies/tokens

- Clean up docker-compose.yml environment variables
  * Remove redundant SECRET_KEY, WTF_CSRF_*, and cookie security settings
  * These are now managed through .env files and config.py

This enhancement provides better CSRF protection while maintaining
compatibility with modern JavaScript frameworks and SPA architectures.
2025-10-13 12:51:23 +02:00
Dries Peeters
d623164895 Update setup.py 2025-10-12 21:52:31 +02:00
Dries Peeters
ae710e60f0 Updated the dockerfile. 2025-10-11 20:55:54 +02:00
Dries Peeters
430a35b6c1 Update setup.py 2025-10-11 19:57:58 +02:00
Dries Peeters
94f021364d Update setup.py 2025-10-11 09:03:17 +02:00
Dries Peeters
bdbfd621de github workflows 2025-10-10 14:43:02 +02:00
Dries Peeters
6f4c8c8c21 Updated for Ci-testing
Updated for Ci-testing
2025-10-09 13:13:28 +02:00