Commit Graph

11 Commits

Author SHA1 Message Date
Dries Peeters
d3f6a792dd Add prepaid-form parsing, tame console noise, and fix invoice UI
parse prepaid hour/reset fields on client edit/create; guard invalid values with new route tests
suppress benign ResizeObserver warnings globally and load handler on standalone pages
raise invoice actions dropdown as a floating menu so it isn’t clipped or scroll-locking
2025-11-12 08:15:04 +01:00
Dries Peeters
54ec5fe4b2 feat: Add bulk task operations and CSV export across all entities
Implements comprehensive bulk operations and export functionality for tasks,
clients, and projects with consistent UI/UX across all three entities.

Features Added:
- Bulk task operations (delete, status change, assignment, move to project)
- Multi-select checkboxes with "select all" functionality
- CSV export for tasks, clients, and projects
- Export respects current filters and permissions
- Modal dialogs for bulk operation confirmation

Bug Fixes:
- Fixed bulk delete not working due to dialog submission issue
- Fixed dropdown menus being cut off in short tables (z-index and overflow)
- Fixed projects export attempting to access .name on string property

Technical Details:
- Backend: Added 5 new routes (tasks bulk ops, 3 export routes)
- Frontend: Updated task/client/project list templates with consistent UI
- Tests: Added 23 comprehensive tests for bulk operations
- Changed table overflow from overflow-x-auto to overflow-visible
- Added z-50 to all dropdown menus for proper layering

Routes Added:
- POST /tasks/bulk-delete
- POST /tasks/bulk-status
- POST /tasks/bulk-assign
- POST /tasks/bulk-move-project
- GET /tasks/export
- GET /clients/export
- GET /projects/export

Files Changed:
- app/routes/tasks.py (+103 lines)
- app/routes/clients.py (+73 lines)
- app/routes/projects.py (+95 lines)
- app/templates/tasks/list.html (major refactor)
- app/templates/clients/list.html (+export, overflow fix)
- app/templates/projects/list.html (+export fix, overflow fix)
- tests/test_bulk_task_operations.py (NEW, 23 tests)
- docs/BULK_TASK_OPERATIONS.md (NEW)
- BULK_TASK_OPERATIONS_IMPLEMENTATION.md (NEW)
- BUGFIXES_BULK_OPERATIONS.md (NEW)
- BUGFIXES_CONSISTENCY_AND_EXPORT.md (NEW)

Breaking Changes: None
Migration Required: None
2025-10-30 10:06:13 +01:00
Dries Peeters
09dd042209 fix: project description not saving on edit
Fixed a critical bug where changes to project descriptions were not
being persisted when editing projects via Work > Projects > Edit Project.

The issue was caused by an incorrect CSS selector pattern in the form
submit handler that syncs the markdown editor content. The selector
`form[action*="projects/edit"]` failed to match URLs like
`/projects/123/edit` because the project ID breaks the substring match.

Changes:
- Updated form selector to use more generic pattern: `form[action*="/edit"]`
- Added explicit null checking with `if (form)` guard
- Enhanced error logging with console.error for debugging
- Improved code formatting and structure

Testing:
- Added integration test: test_edit_project_description
- Added smoke test: test_project_edit_page_has_markdown_editor
- All 166 project-related tests pass successfully
- No regressions introduced
2025-10-29 09:05:53 +01:00
Dries Peeters
a3e03828f3 Updated tests 2025-10-27 15:31:05 +01:00
Dries Peeters
18d9808d5e feat: add user favorite projects functionality with CSV export enhancements
Features:
Add favorite projects feature allowing users to star/bookmark frequently used projects
New UserFavoriteProject association model with user-project relationships
Star icons in project list for one-click favorite toggling via AJAX
Filter to display only favorite projects
Per-user favorites with proper isolation and cascade delete behavior
Activity logging for favorite/unfavorite actions
Database:
Add user_favorite_projects table with migration (023_add_user_favorite_projects.py)
Foreign keys to users and projects with CASCADE delete
Unique constraint preventing duplicate favorites
Indexes on user_id and project_id for query optimization
Models:
User model: Add favorite_projects relationship with helper methods
add_favorite_project() - add project to favorites
remove_favorite_project() - remove from favorites
is_project_favorite() - check favorite status
get_favorite_projects() - retrieve favorites with status filter
Project model: Add is_favorited_by() method and include favorite status in to_dict()
Export UserFavoriteProject model in app/models/__init__.py
Routes:
Add /projects/<id>/favorite POST endpoint to favorite a project
Add /projects/<id>/unfavorite POST endpoint to unfavorite a project
Update /projects GET route to support favorites=true query parameter
Fix status filtering to work correctly with favorites JOIN query
Add /reports/export/form GET endpoint for enhanced CSV export form
Templates:
Update projects/list.html:
Add favorites filter dropdown to filter form (5-column grid)
Add star icon column with Font Awesome icons (filled/unfilled)
Add JavaScript toggleFavorite() function for AJAX favorite toggling
Improve hover states and transitions for better UX
Pass favorite_project_ids and favorites_only to template
Update reports/index.html:
Update CSV export link to point to new export form
Add icon and improve hover styling
Reports:
Enhance CSV export functionality with dedicated form page
Add filter options for users, projects, clients, and date ranges
Set default date range to last 30 days
Import Client model and or_ operator for advanced filtering
Testing:
Comprehensive test suite in tests/test_favorite_projects.py (550+ lines)
Model tests for UserFavoriteProject creation and validation
User/Project method tests for favorite operations
Route tests for favorite/unfavorite endpoints
Filtering tests for favorites-only view
Relationship tests for cascade delete behavior
Smoke tests for complete workflows
Coverage for edge cases and error handling
Documentation:
Add comprehensive feature documentation in docs/FAVORITE_PROJECTS_FEATURE.md
User guide with step-by-step instructions
Technical implementation details
API documentation for new endpoints
Migration guide and troubleshooting
Performance and security considerations
Template Cleanup:
Remove duplicate templates from root templates/ directory
Admin templates (dashboard, users, settings, OIDC debug, etc.)
Client CRUD templates
Error page templates
Invoice templates
Project templates
Report templates
Timer templates
All templates now properly located in app/templates/
Breaking Changes:
None - fully backward compatible
Migration Required:
Run alembic upgrade head to create user_favorite_projects table
2025-10-23 21:15:16 +02:00
Dries Peeters
6df92646a1 feat: Add Time Entry Duplication functionality
Implement comprehensive time entry duplication feature that allows users
to quickly copy previous entries with pre-filled data, improving
productivity for repetitive time tracking tasks.

Features:
- Add duplicate route endpoint (/timer/duplicate/<id>)
- Add duplicate buttons to dashboard and edit entry pages
- Pre-fill project, task, notes, tags, and billable status
- Show information banner with original entry details
- Implement permission checks (users can duplicate own entries, admins can duplicate any)
- Track analytics events for duplication actions

Backend Changes:
- app/routes/timer.py: Add duplicate_timer() route with security checks
- Route handles pre-filling manual entry form with original entry data
- Analytics tracking for 'timer.duplicated' events

Frontend Changes:
- app/templates/main/dashboard.html: Add duplicate icon button to Recent Entries table
- templates/timer/edit_timer.html: Add duplicate button next to Back button
- app/templates/timer/manual_entry.html: Support pre-filled data and duplication context
- Add blue information banner showing original entry details when duplicating

Testing:
- Add comprehensive test suite with 21 tests (all passing)
- tests/test_time_entry_duplication.py: Unit, integration, security, smoke, and edge case tests
- Test coverage includes: route access, authentication, pre-fill functionality, permissions, UI visibility

Documentation:
- docs/features/TIME_ENTRY_DUPLICATION.md: Technical documentation
- docs/user-guides/DUPLICATING_TIME_ENTRIES.md: User guide with examples
- TIME_ENTRY_DUPLICATION_IMPLEMENTATION.md: Implementation details
- TIME_ENTRY_DUPLICATION_FEATURE_SUMMARY.md: Complete feature overview

Benefits:
- Saves ~60% time when logging similar work
- Reduces manual data entry for recurring tasks
- Maintains data consistency through field copying
- Intuitive workflow with clear visual feedback

Security:
- Users can only duplicate their own entries
- Admin users can duplicate any entry
- Proper authentication and permission checks

Breaking Changes: None
2025-10-23 20:31:51 +02:00
Dries Peeters
2cbc029d33 Updated testing 2025-10-22 11:25:10 +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
f390a13474 chore(devops): streamline Docker Compose and refresh docs/config
- Simplify docker-compose setup and align environment defaults
- Update README and Quick Start to reflect the new compose flow
- Refine app initialization and configuration for clearer env handling
- Minor consistency and cleanup in config modules

No breaking changes expected.
2025-10-20 20:44:11 +02:00
Dries Peeters
e4789cc26e feat: Add telemetry and analytics infrastructure with observability stack
Implement comprehensive analytics and monitoring system with PostHog integration,
complete observability stack (Prometheus, Grafana, Loki, Promtail), and CI/CD
workflows for automated builds.

Features:
- Add PostHog telemetry integration with privacy-focused event tracking
- Implement installation flow for opt-in telemetry configuration
- Add telemetry management UI in admin panel with detailed transparency
- Track key user events across all major features (projects, tasks, timer, etc.)

Infrastructure:
- Set up Prometheus for metrics collection
- Configure Grafana for visualization dashboards
- Integrate Loki and Promtail for log aggregation
- Add separate analytics docker-compose configuration

CI/CD:
- Add GitHub Actions workflows for building and publishing Docker images
- Implement separate dev and production build pipelines
- Configure automated image publishing to registry

Documentation:
- Restructure documentation into organized docs/ directory
- Add comprehensive guides for telemetry, analytics, and local development
- Create transparency documentation for tracked events
- Add CI/CD and build configuration guides

Code improvements:
- Integrate telemetry hooks across all route handlers
- Add feature flags and configuration management
- Refactor test suite for analytics functionality
- Clean up root directory by moving docs and removing test artifacts

Breaking changes:
- Requires new environment variables for PostHog configuration
- Docker compose setup now supports analytics stack

Changes: 73 files changed, 955 insertions(+), 14126 deletions(-)
2025-10-20 14:38:57 +02:00
Dries Peeters
6a412c787e Permissions error on startup
Fix issue permissions on startup
Remove default port on postgres
2025-08-25 09:59:43 +02:00