Commit Graph

273 Commits

Author SHA1 Message Date
Dries Peeters
1908aea92d Update setup.py 2025-10-23 12:55:13 +02:00
Dries Peeters
116171879f Merge pull request #120 from DRYTRIX/Feat-GeneralImprovements
Feat general improvements
2025-10-23 12:52:34 +02:00
Dries Peeters
3e0b6de92b fix(ui): restore 3-column grid layout for task view and edit pages
- Changed tasks/view.html grid from 2 to 3 columns to position Details
  section at top right instead of bottom
- Changed tasks/edit.html grid from 2 to 3 columns with form spanning
  2 columns for better proportions
- Task form now takes 2/3 width and info sidebar takes 1/3 width
- Improves UX by making the Start Timer button and info blocks more
  appropriately sized
- Restores the original Tailwind UI layout with better visual balance

Fixes layout regression introduced in v3.2.3 that made the edit page
Start Timer button uncomfortably wide and pushed task details to the
bottom on the view page.
2025-10-23 12:49:04 +02:00
Dries Peeters
0c316ac5e1 feat: Implement bulk operations and status management improvements
Major improvements:
- Add bulk operations functionality across clients, projects, and tasks
- Implement deletion and status management enhancements
- Add project code field with database migration (022)
- Improve inactive status handling for projects

Backend changes:
- Update project model with new code field and status logic
- Enhance routes for clients, projects, and tasks with bulk actions
- Add migration for project_code field (022_add_project_code_field.py)

Frontend updates:
- Refactor bulk actions widget component
- Update clients list and detail views with bulk operations
- Enhance project list, view, and kanban templates
- Improve task list, edit, view, and kanban displays
- Update base template with UI improvements
- Refine saved filters and time entry templates lists

Testing:
- Add test_project_inactive_status.py for status handling
- Update test_tasks_templates.py with new functionality

Documentation:
- Add BULK_OPERATIONS_IMPROVEMENTS.md
- Add DELETION_AND_STATUS_IMPROVEMENTS.md
- Add docs/QUICK_WINS_IMPLEMENTATION.md
- Update ALL_BUGFIXES_SUMMARY.md and IMPLEMENTATION_COMPLETE.md
2025-10-23 12:41:22 +02:00
Dries Peeters
5280cbad2c fix: prevent re-creation of deleted default client and project
Implements persistent flag tracking to ensure default client and project
are only created on fresh installations and never recreated after user
deletion during updates or restarts.

- Added initial_data_seeded flag to InstallationConfig
- Updated all 3 database initialization scripts to check flag
- Added 3 unit tests (all passing)
- Created comprehensive documentation

Fixes issue where defaults were recreated after deletion during updates.
2025-10-23 09:31:39 +02:00
Dries Peeters
b1973ca49a feat: Add Quick Wins feature set - activity tracking, templates, and user preferences
This commit introduces several high-impact features to improve user experience
and productivity:

New Features:
- Activity Logging: Comprehensive audit trail tracking user actions across the
  system with Activity model, including IP address and user agent tracking
- Time Entry Templates: Reusable templates for frequently logged activities with
  usage tracking and quick-start functionality
- Saved Filters: Save and reuse common search/filter combinations across
  different views (projects, tasks, reports)
- User Preferences: Enhanced user settings including email notifications,
  timezone, date/time formats, week start day, and theme preferences
- Excel Export: Generate formatted Excel exports for time entries and reports
  with styling and proper formatting
- Email Notifications: Complete email system for task assignments, overdue
  invoices, comments, and weekly summaries with HTML templates
- Scheduled Tasks: Background task scheduler for periodic operations

Models Added:
- Activity: Tracks all user actions with detailed context and metadata
- TimeEntryTemplate: Stores reusable time entry configurations
- SavedFilter: Manages user-saved filter configurations

Routes Added:
- user.py: User profile and settings management
- saved_filters.py: CRUD operations for saved filters
- time_entry_templates.py: Template management endpoints

UI Enhancements:
- Bulk actions widget component
- Keyboard shortcuts help modal with advanced shortcuts
- Save filter widget component
- Email notification templates
- User profile and settings pages
- Saved filters management interface
- Time entry templates interface

Database Changes:
- Migration 022: Creates activities and time_entry_templates tables
- Adds user preference columns (notifications, timezone, date/time formats)
- Proper indexes for query optimization

Backend Updates:
- Enhanced keyboard shortcuts system (commands.js, keyboard-shortcuts-advanced.js)
- Updated projects, reports, and tasks routes with activity logging
- Safe database commit utilities integration
- Event tracking for analytics

Dependencies:
- Added openpyxl for Excel generation
- Added Flask-Mail dependencies
- Updated requirements.txt

All new features include proper error handling, activity logging integration,
and maintain existing functionality while adding new capabilities.
2025-10-23 09:05:07 +02:00
Dries Peeters
26b97fb3ea Merge pull request #117 from DRYTRIX/Feat-ExtraGoods
Feat extra goods
2025-10-22 11:26:06 +02:00
Dries Peeters
2cbc029d33 Updated testing 2025-10-22 11:25:10 +02:00
Dries Peeters
34946e1b80 feat: Make user profile pictures persistent across Docker updates
Store user avatars in persistent /data volume instead of application
directory to ensure profile pictures survive container rebuilds and
version updates.

Changes:
- Update avatar upload folder from app/static/uploads/avatars to
  /data/uploads/avatars using existing app_data volume mount
- Modify get_avatar_upload_folder() in auth routes to use persistent
  location with UPLOAD_FOLDER config
- Update User.get_avatar_path() to reference new storage location
- Add migration script to safely move existing avatars to new location
- Preserve backward compatibility - no database changes required

Benefits:
- Profile pictures now persist between Docker image updates
- Consistent with company logo storage pattern (/data/uploads)
- Better user experience - avatars not lost during upgrades
- Production-ready data/code separation
- All persistent uploads consolidated in app_data volume

Migration:
For existing installations with user avatars, run:
  docker-compose run --rm app python /app/docker/migrate-avatar-storage.py

New installations work automatically with no action required.

Documentation:
- docs/AVATAR_STORAGE_MIGRATION.md - Full migration guide
- docs/AVATAR_PERSISTENCE_SUMMARY.md - Quick reference
- docs/TEST_AVATAR_PERSISTENCE.md - Testing guide
- AVATAR_PERSISTENCE_CHANGELOG.md - Detailed changelog

Files modified:
- app/routes/auth.py
- app/models/user.py

Files added:
- docker/migrate-avatar-storage.py
- docs/AVATAR_STORAGE_MIGRATION.md
- docs/AVATAR_PERSISTENCE_SUMMARY.md
- docs/TEST_AVATAR_PERSISTENCE.md
- AVATAR_PERSISTENCE_CHANGELOG.md

Tested: ✓ No linter errors, backward compatible, volume mount verified
2025-10-22 11:12:11 +02:00
Dries Peeters
c523214c9b Merge pull request #116 from DRYTRIX/Feat-ProfilePictures
Feat profile pictures
2025-10-22 10:18:23 +02:00
Dries Peeters
81532fcd55 ci: implement RC branch-based release workflow
Refactor GitHub Actions workflows to support a release candidate (RC)
branch workflow instead of direct develop->main flow.

Changes:
- cd-development.yml: Trigger on PRs to RC branches (not push to develop)
  * Updated summary to show PR context (source/target branches)
  * Build development images when code is promoted to RC

- cd-release.yml: Trigger on PRs from RC to main/master
  * Added path filters for code changes only
  * Enables release validation before merge to main

- ci-comprehensive.yml: Run tests on PRs to RC branches
  * Full test suite now runs for PRs to main, master, and RC branches
  * Ensures code quality before RC promotion

New workflow:
  develop (push) -> no actions
  develop -> rc (PR) -> run tests + development build
  rc -> main (PR) -> run tests + release build

Supports both single RC branch (rc) and versioned RC branches (rc/*)

Breaking change: Development builds no longer trigger on push to develop.
They now require a PR to an RC branch.
2025-10-22 10:17:15 +02:00
Dries Peeters
6559dd948b fix: resolve profile picture upload issues
- Add client_max_body_size 10M to nginx config to fix 413 error
- Add JavaScript preview for profile picture selection
- Include client-side validation for file size and type
2025-10-22 10:10:14 +02:00
Dries Peeters
2f3b4e6779 Merge pull request #115 from DRYTRIX/develop
Develop
2025-10-22 09:57:05 +02:00
Dries Peeters
e02dab56ff Update cd-development.yml 2025-10-22 09:45:08 +02:00
Dries Peeters
0fe6dcf25d Update cd-development.yml 2025-10-22 09:41:03 +02:00
Dries Peeters
189fbb3b96 Update conftest.py 2025-10-22 08:50:29 +02:00
Dries Peeters
a4c1b899af Update conftest.py 2025-10-22 08:40:42 +02:00
Dries Peeters
96747690de Update conftest.py 2025-10-22 08:15:49 +02:00
Dries Peeters
c08c2d8f58 Update conftest.py 2025-10-22 08:13:57 +02:00
Dries Peeters
e868a299fd Update conftest.py 2025-10-22 08:06:01 +02:00
Dries Peeters
6ecf6dadcf fix: Multiple UI/UX improvements and bulk delete implementation
Major Changes:
- Implement bulk delete functionality for tasks with custom confirmation dialog
  * Add /tasks/bulk-delete POST route with permission checks
  * Add checkboxes and "Delete Selected" button to task list
  * Skip tasks with time entries, provide detailed feedback
  * Log all deletions for audit trail
2025-10-22 08:00:48 +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
73c9316b77 feat(profile): allow users to upload profile pictures (avatars)
- Add avatar_filename to User model with URL/path/existence helpers
- Alembic migration 020: add users.avatar_filename (nullable)
- Implement avatar upload in /profile/edit with Pillow validation
- Add avatar removal endpoint: POST /profile/avatar/remove
- Public serving route: /uploads/avatars/<filename>
- Update templates:
  - Header shows user’s avatar if present
  - Profile page displays avatar
  - Edit Profile supports file upload and removal
- Update Docker permission scripts to include uploads/avatars
- Add tests for upload and removal (tests/test_profile_avatar.py)
- Update README to mention profile pictures

Security/UX:
- Restrict types to PNG/JPG/JPEG/GIF/WEBP, verify content with Pillow
- Unique filenames; old file removed on replacement
- Respects MAX_CONTENT_LENGTH from config

Migration:
- Run: flask db upgrade
- Ensure app/static/uploads/avatars is writable (use fix upload permission scripts if needed)

No breaking changes.
2025-10-22 06:27:53 +02:00
Dries Peeters
6a0fab7cb7 Update setup.py 2025-10-21 20:15:37 +02:00
Dries Peeters
ffb9f6fba1 Update to make the remote work 2025-10-21 20:03:21 +02:00
Dries Peeters
257ee30fd2 Update clients.py 2025-10-21 17:29:28 +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
330c4f2b5b Update install instructions 2025-10-21 13:00:59 +02:00
Dries Peeters
20429d8496 tests: fix telemetry patchability and config reload; make telemetry toggle test reflect updated state 2025-10-21 11:46:16 +02:00
Dries Peeters
7d32781932 tests/ci: fix analytics DB init; telemetry env precedence and export; installation config reload; route analytics calls reference app module for mocks 2025-10-21 10:07:20 +02:00
Dries Peeters
e2f924a54d tests: make user fixtures idempotent to avoid unique violations under PostgreSQL 2025-10-21 08:46:09 +02:00
Dries Peeters
60e10d2c48 ci: ensure DB schema exists before tests (flask db upgrade) 2025-10-21 08:14:12 +02:00
Dries Peeters
3b73cb5534 ci: restore v3.0.0 workflows; keep PostHog/Sentry injection in release build 2025-10-21 07:47:44 +02:00
Dries Peeters
7a4354d1fb update cert 2025-10-20 22:07:14 +02:00
Dries Peeters
c823bb1331 Update test_analytics.py 2025-10-20 21:49:08 +02:00
Dries Peeters
8b5d7af40f Update build-and-publish.yml 2025-10-20 21:31:59 +02:00
Dries Peeters
81b759a409 Update build-dev.yml 2025-10-20 21:28:20 +02:00
Dries Peeters
7d1ad9023a Update tests 2025-10-20 21:25:13 +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
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
e99036fb78 Merge pull request #93 from DRYTRIX/Feat-Metrics
Feat metrics
2025-10-20 20:02:39 +02:00
Dries Peeters
10e9bb7c8a Update workflow files 2025-10-20 19:58:09 +02:00
Dries Peeters
264a43083e Update 2025-10-20 19:55:03 +02:00
Dries Peeters
a876980d18 Update .gitignore 2025-10-20 14:59:40 +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
f5c3c3f59f fix: resolve keyboard shortcut conflicts and notification errors
Fixed multiple issues with keyboard shortcuts and browser notifications:

Keyboard Shortcuts:
- Fixed Ctrl+/ not working to focus search input
- Resolved conflict between three event handlers (base.html, commands.js, keyboard-shortcuts-advanced.js)
- Changed inline handler from Ctrl+K to Ctrl+/ to avoid command palette conflict
- Updated search bar UI badge to display Ctrl+/ instead of Ctrl+K
- Removed conflicting ? key handler from commands.js (now uses Shift+? for shortcuts panel)
- Improved key detection to properly handle special characters like / and ?
- Added debug logging for troubleshooting keyboard events

Final keyboard mapping:
- Ctrl+K: Open Command Palette
- Ctrl+/: Focus Search Input
- Shift+?: Show All Keyboard Shortcuts
- Esc: Close Modals/Panels

Notification System:
- Fixed "right-hand side of 'in' should be an object" error in smart-notifications.js
- Changed notification permission request to follow browser security policies
- Permission now checked silently on load, only requested on user interaction
- Added "Enable Notifications" banner in notification center panel
- Fixed service worker sync check to properly verify registration object

Browser Compatibility:
- All fixes respect browser security policies for notification permissions
- Graceful degradation when service worker features unavailable
- Works correctly on Chrome, Firefox, Safari, and Edge

Files modified:
- app/static/enhanced-search.js
- app/static/keyboard-shortcuts-advanced.js
- app/static/smart-notifications.js
- app/templates/base.html
- app/static/commands.js

Closes issues with keyboard shortcuts not responding and browser console errors.
2025-10-20 13:00:39 +02:00
Dries Peeters
04ed5ef8ae fix(oidc): only perform RP-Initiated Logout when OIDC_POST_LOGOUT_REDIRECT_URI is set
ixes #88

When OIDC_POST_LOGOUT_REDIRECT_URI was unset, the application was still
attempting RP-Initiated Logout by falling back to a generated redirect URL.
This caused issues with OIDC providers like Authelia that don't support
RP-Initiated Logout, resulting in failed redirects to unsupported endpoints.

Changes:
- Modified logout logic in app/routes/auth.py to only attempt provider
  logout when OIDC_POST_LOGOUT_REDIRECT_URI is explicitly configured
- If unset, users are now logged out locally and redirected to the
  TimeTracker login page (expected behavior)
- If set, RP-Initiated Logout proceeds as before (backward compatible)

Documentation:
- Updated docs/OIDC_SETUP.md with guidance on when to set the config
- Added clear comments in env.example explaining optional behavior
- Documented troubleshooting steps for providers without RP-Initiated
  Logout support (e.g., Authelia)

Tests:
- Added comprehensive test suite (tests/test_oidc_logout.py) with 9 tests
  covering different logout scenarios and edge cases
- All existing tests continue to pass (no regressions)

This change is fully backward compatible. Users with providers supporting
RP-Initiated Logout can continue using OIDC_POST_LOGOUT_REDIRECT_URI as
before. Users with providers like Authelia should leave it unset for
local-only logout.
2025-10-17 12:51:43 +02:00
Dries Peeters
5bb0959596 Merge pull request #89 from DRYTRIX/Feat-UIRedesign
feat: Implement Tailwind CSS UI redesign across application
2025-10-17 12:41:14 +02:00
Dries Peeters
c616725938 Update analytics.py 2025-10-17 12:34:34 +02:00
Dries Peeters
f873259950 Update test_analytics.py 2025-10-17 12:29:42 +02:00