Commit Graph

634 Commits

Author SHA1 Message Date
a14457e283 Add all documentation placeholder pages and fix content errors
- Created placeholder pages for all 30 documentation pages across 9 sections
- Fixed content errors in getting-started pages based on user feedback:
  - Corrected review process (all jobs reviewed, not just successful)
  - Changed Autotask tickets from automatic to manual creation
  - Updated mail import from IMAP to Graph API
  - Fixed job creation workflow (from Inbox via Approve job, not manual)
  - Added Reparse all functionality explanation
  - Corrected Daily Jobs vs Run Checks distinction
  - Added manual import recommendation before enabling automatic
  - Added role-based menu visibility explanation
  - Added news items feature explanation
- All navigation links now work without Internal Server Errors

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 11:34:44 +01:00
908785ee73 Add documentation system Phase 1 - Core infrastructure
- Created documentation blueprint (doc_bp) with routes and navigation
- Added documentation menu item (📖) to navbar for all users
- Implemented hierarchical navigation with 9 sections, 33 pages
- Created base layout with sidebar, breadcrumb, and prev/next navigation
- Added documentation.css with dark mode support
- Created first 3 getting-started pages (what-is-backupchecks, first-login, quick-start)
- Updated changelog

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 10:59:45 +01:00
73b1f25279 Add comprehensive TODO for documentation system
Static documentation/user guide for BackupChecks application to help
new users understand how the system works.

Key Features:
- Static HTML templates (no in-app editing)
- Multi-page structure with sidebar navigation
- 30+ documentation pages covering all features
- Sections: Getting Started, Users, Customers/Jobs, Mail Import,
  Backup Review, Reports, Autotask, Settings, Troubleshooting
- Screenshots with guidelines
- Responsive design (mobile-friendly)
- Access restricted to logged-in users
- English only (app not translated)

Structure:
- Left sidebar with collapsible sections
- Breadcrumb navigation
- Previous/Next page navigation
- Content area with max-width for readability
- Callout boxes (info/warning/tip/danger)
- Code blocks with syntax highlighting
- Tables for settings/options
- Image support with captions

Implementation Phases:
1. Core infrastructure (routes, templates, CSS)
2. Getting Started content (3 pages)
3. Core features content (16 pages)
4. Advanced features content (14 pages)
5. Polish and review

Total estimate: 24-38 hours

Includes:
- Complete file structure
- Route implementation with navigation
- CSS styling (900+ lines)
- Content template examples
- Screenshot guidelines
- Content writing style guide
- Testing checklist

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-07 23:47:33 +01:00
8ebfb9e90f Add comprehensive TODO for reports improvements
Complete planning document for reporting feature expansion including:

Phase 1 - Settings > Reporting:
- Email settings (from_email, from_name, reply_to)
- Branding (logo upload, company_name, brand_color)
- Footer customization (contact info, footer text)
- Default email template with HTML support
- Test email function with Graph API permission check

Phase 2 - Relative Periods:
- 15 relative period options (yesterday to previous year)
- Timezone-aware period calculation (follows ui_timezone)
- "To date" periods end at yesterday 23:59 (complete days only)
- Email body template per report (HTML with placeholders)
- Template validation and XSS protection

Phase 3 - Scheduling (Future):
- Weekly, Monthly, Quarterly, Yearly frequencies
- Per-report scheduling configuration
- Graph API email sending (no SMTP/SPF issues)
- Retry logic (max 3 attempts)
- Audit logging for deliveries

Includes:
- Complete implementation plan with code snippets
- Database model changes (25+ fields)
- UI mockups for Settings and report creation
- 60+ test cases covering all features
- Success criteria per phase
- All design decisions documented

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-07 23:36:23 +01:00
9074410c77 Auto-commit local changes before build (2026-02-07 21:58:29) 2026-02-07 21:58:29 +01:00
c656751f77 Remove scheduling placeholder from reports overview page
Removed the scheduling placeholder card from the main reports page as
scheduling will be configured per individual report instead of having
an overarching setting.

Changes:
- Removed entire scheduling placeholder card (delivery, frequency, recipients)
- Updated card header subtitle to reflect that scheduling is per-report
- Report definitions table now uses full page width
- Cleaner, more focused UI

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-07 21:57:43 +01:00
88aead460f Fix missing import for _log_admin_event in routes_customers
Added explicit import for _log_admin_event function which is needed for
customer export/import audit logging. Functions with underscore prefix
are not automatically imported by 'from .routes_shared import *'.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-07 21:50:02 +01:00
c88f74a4bf Auto-commit local changes before build (2026-02-07 21:41:42) 2026-02-07 21:41:42 +01:00
45ba50ecfa Expand audit logging to settings, export, and import operations
This commit completes the audit logging expansion by adding comprehensive
logging for critical system operations:

- Settings: Log changes to General, Mail, and Autotask settings with
  before/after values (passwords excluded for security)
- Exports: Log customer and jobs exports with format and record counts
- Imports: Log customer and jobs imports with operation statistics

Also updated UI to reflect "System Audit Log" nomenclature instead of
"Admin activity" for better semantic clarity.

All audit events use structured event_type identifiers and JSON details
for easy filtering and analysis.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-07 21:38:52 +01:00
4c0b5ada37 Rename AdminLog to AuditLog for better semantic clarity
The table name 'admin_logs' was misleading as it contains both admin actions
and automated system events. Renamed to 'audit_logs' to better reflect its
purpose as a comprehensive audit trail.

Changes:
- Renamed model: AdminLog → AuditLog (with backwards compatibility alias)
- Database migration: Renames admin_logs table to audit_logs (idempotent)
- Updated admin_logging.py: log_admin_event → log_audit_event (with alias)
- Updated imports in routes_core.py and routes_shared.py
- Updated all references to use AuditLog instead of AdminLog
- Backwards compatibility maintained via aliases for smooth transition

This is part 1 of audit logging expansion.
Part 2 will add logging for settings changes and export/import actions.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-07 00:25:47 +01:00
b27e8db602 Fix local_datetime filter to handle string datetime values
The filter now accepts both datetime objects and string representations.
This fixes AttributeError when datetime fields are stored/returned as
strings instead of datetime objects from the database.

Changes:
- Added string parsing logic for common datetime formats
- Tries multiple format patterns (ISO, standard, with/without microseconds)
- Returns original string if parsing fails (graceful degradation)
- Maintains full datetime object support

Fixes errors on:
- /customers (autotask_last_sync_at)
- /logging (created_at)
- /admin/all-mail (received_at, parsed_at)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-07 00:16:44 +01:00
1cf3564751 Auto-commit local changes before build (2026-02-07 00:13:44) 2026-02-07 00:13:44 +01:00
8e8b7a4412 Implement timezone-aware datetime display across all pages
All datetime fields now automatically convert from UTC (database storage)
to the configured UI timezone (Settings > General > UI Timezone) for display.

Changes:
- Added local_datetime Jinja2 template filter in app/__init__.py
  - Converts UTC datetime to UI timezone using zoneinfo.ZoneInfo
  - Accepts optional strftime format parameter (default: '%Y-%m-%d %H:%M:%S')
  - Returns empty string for None values
  - Falls back to UTC display if conversion fails
- Updated all datetime displays across 15+ templates:
  - customers.html: autotask_last_sync_at
  - settings.html: autotask_last_sync_at
  - feedback.html, feedback_detail.html: created_at, updated_at, resolved_at
  - logging.html: created_at
  - overrides.html: start_at, end_at
  - archived_jobs.html: archived_at
  - tickets.html, ticket_detail.html: resolved_at, run_at
  - inbox.html, inbox_deleted.html, admin_all_mail.html: received_at, parsed_at, deleted_at
  - job_detail.html: run_at, reviewed_at
  - remark_detail.html: run_at
  - settings_news_reads.html: read_at
- Database values remain in UTC for consistency
- Default timezone: Europe/Amsterdam (configurable via SystemSettings.ui_timezone)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-07 00:12:59 +01:00
86308d2001 Auto-commit local changes before build (2026-02-07 00:04:03) 2026-02-07 00:04:03 +01:00
3bacb55590 Add Autotask company mapping to export/import functionality
Extended both customer and jobs export/import to preserve Autotask
company mappings during data migration and system reset workflows.

Changes:
- Customer export (CSV): Added autotask_company_id and autotask_company_name columns
- Customer import (CSV): Reads and applies Autotask mapping fields, resets sync status
- Jobs export (JSON): Includes Autotask fields in customers array
- Jobs import (JSON): Processes customers array with Autotask mappings before jobs
- Backwards compatible: Old exports without Autotask fields continue to work
- Import feedback: Shows both created and updated customer counts

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-07 00:03:15 +01:00
4c7c97f772 Auto-commit local changes before build (2026-02-06 23:31:42) 2026-02-06 23:31:42 +01:00
f27e956b6f Restore complete consolidated changelog for 2026-02-06
Merged all changes from today's branches into complete changelog:
- Sandbox environment indicator (v20260206-01-04)
- Branch merge and cleanup (v20260206-05)
- Filter archived/deleted jobs (v20260206-06)
- Autotask settings improvements (v20260206-07)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 23:29:52 +01:00
95b78157ad Reorganize Autotask settings with separate save buttons and validation
Split Autotask settings into two separate forms with dedicated save
buttons and field validation:

1. Autotask Settings form:
   - Save button inside card for better UX
   - Required fields: Environment, Username, Password (if not set),
     Tracking Identifier, Base URL
   - Red asterisks indicate required fields

2. Ticket Defaults form:
   - Separate save button inside card
   - Required fields: Queue, Ticket Source, Status, Priority Warning,
     Priority Error
   - Prevents saving incomplete configurations

Benefits:
- Clear visual separation of concerns
- Prevents accidental saving of empty values
- HTML5 validation ensures all required fields are filled
- Better user experience with focused save actions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 23:28:28 +01:00
17b64d1f66 Prevent accidental clearing of default ticket status
Enhanced save logic to protect against losing the default ticket
status value when saving settings with an empty dropdown:

- Only update to new value if a status is actually selected
- Only allow clearing if reference data is loaded (dropdown has options)
- Preserve existing value if dropdown is empty (no reference data)

This fixes the issue where saving settings before reference data
loaded would overwrite the previously configured default status
with NULL, causing "Create Autotask ticket" to fail with error
about missing default status.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 23:28:28 +01:00
a2895b6409 Auto-load Autotask reference data on settings page load
Fixed issue where Default Ticket Status dropdown was empty when
opening the settings page. Now automatically loads reference data
(queues, sources, statuses, priorities) when:
- Autotask integration is enabled
- API credentials are configured
- Reference data cache is empty

This eliminates the need to manually click "Refresh reference data"
before being able to select a default ticket status.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 23:28:28 +01:00
a555dc9c61 Filter out archived jobs and inactive customers from job lists
Added customer active status filtering to prevent jobs from deleted
(inactive) customers from appearing in the UI alongside existing
archived job filtering.

Changes:
- Daily Jobs: Filter jobs where customer is NULL or active=True
- Run Checks: Filter jobs where customer is NULL or active=True
- Jobs list: Filter jobs where customer is NULL or active=True

This prevents showing jobs with "-" status from archived jobs or
deleted customers on Daily Jobs and Run Checks pages.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 23:28:09 +01:00
28f094f80b Merge branches v20260203-01 through v20260205-13 into main
This commit consolidates all development work from the following branch series:
- v20260203-* (13 branches): Initial Autotask integration, graph config UI improvements
- v20260204-* (3 branches): Dashboard redirect setting, additional refinements
- v20260205-* (13 branches): Autotask resolution improvements, changelog restructuring

Key features merged:
- Autotask PSA integration with ticket creation, resolution, and search
- Graph/mail configuration UI improvements with credential testing
- Daily dashboard redirect setting (optional navigation control)
- Changelog restructuring with improved Python structure
- Various bug fixes and UI enhancements

All functionality has been consolidated from the final state of branch
v20260205-13-changelog-python-structure to preserve working features.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 13:41:08 +01:00
7693af9306 Merge branch 'v20260204-03-dashboard-redirect-setting' into main 2026-02-06 13:32:36 +01:00
5ed4c41b80 Merge branch 'v20260204-02-performance-optimizations' into main 2026-02-06 13:23:31 +01:00
a910cc4abc Merge branch 'v20260204-01-add-readme-changelog' into main 2026-02-06 13:23:31 +01:00
e12755321a Merge branch 'v20260203-13-autotask-resolution-item-wrapper' into main 2026-02-06 13:23:31 +01:00
240f8b5c90 Merge branch 'v20260203-12-autotask-resolution-v1-casing-fix' into main 2026-02-06 13:23:31 +01:00
02d7bdd5b8 Merge branch 'v20260203-11-autotask-resolution-get-put-required-fields' into main 2026-02-06 13:23:31 +01:00
753c14bb4e Merge branch 'v20260203-10-autotask-resolution-field-aliases' into main 2026-02-06 13:23:31 +01:00
ce245f7d49 Merge branch 'v20260203-09-autotask-resolution-from-note' into main 2026-02-06 13:23:31 +01:00
34ac317607 Merge branch 'v20260203-08-autotask-ticketnote-timezone-suffix' into main 2026-02-06 13:23:31 +01:00
3b087540cb Merge branch 'v20260203-07-autotask-notes-endpoint-fix' into main 2026-02-06 13:23:31 +01:00
e5123952b2 Merge branch 'v20260203-06-autotask-ticketnotes-child-endpoint' into main 2026-02-06 13:23:31 +01:00
4bbde92c8d Merge branch 'v20260203-04-autotask-resolve-user-note' into main 2026-02-06 13:23:31 +01:00
7b3b89f50c Merge branch 'v20260203-03-autotask-resolve-note-verify' into main 2026-02-06 13:23:31 +01:00
52cd75e420 Merge branch 'v20260203-02-autotask-resolve-button-enabled' into main 2026-02-06 13:23:31 +01:00
83d8d85f30 Merge branch 'v20260203-01-autotask-resolve-note' into main 2026-02-06 13:23:31 +01:00
90ad06cca2 Auto-commit local changes before build (2026-02-06 13:08:37) 2026-02-06 13:08:37 +01:00
d8ddec1fb1 Add direct Autotask ticket link in Run Checks modal
Added "Open in Autotask" button next to ticket number in Run Checks modal
for quick navigation to the ticket in Autotask PSA.

Changes:
- Enhanced renderAutotaskInfo() function in run_checks.html
- Button appears only when autotask_ticket_id exists
- Opens in new tab with proper Autotask URL format
- Styled as small outline button for compact layout
- URL format: https://ww19.autotask.net/Mvc/ServiceDesk/TicketDetail.mvc?workspace=False&ids[0]={id}&ticketId={id}

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 13:08:11 +01:00
cf35879c36 Auto-commit local changes before build (2026-02-06 12:54:28) 2026-02-06 12:54:28 +01:00
d08fbfecd4 Expand changelog entry with detailed implementation description
Added comprehensive breakdown of the Sandbox environment indicator feature
including all modified components (database, backend, frontend, CSS) with
specific technical details for better documentation and understanding.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 12:53:45 +01:00
0bf1151f01 Add Sandbox/Development environment indicator feature
This commit adds a new setting that displays a visual "SANDBOX" banner
when the environment is marked as development or sandbox.

Changes:
- Add is_sandbox_environment boolean column to SystemSettings model
- Add database migration for automatic schema update
- Add Environment section in Settings > General with toggle switch
- Create sandbox.css with diagonal banner styling (non-interactive)
- Inject system_settings into all template contexts
- Add sandbox banner to base.html layout
- Update changelog with feature description

The banner appears as a red diagonal ribbon in the top-left corner and
uses pointer-events: none to remain non-interactive while keeping
underlying elements clickable.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 12:51:53 +01:00
d5cbba2f59 Auto-commit local changes before build (2026-02-06 11:36:11) 2026-02-06 11:36:11 +01:00
0e5294d1fa Add collapsible text functionality to Overall remark and Remark fields
Added ellipsis-field class to both "Overall remark" and "Remark" fields in
the Run Checks modal. This prevents long text from pushing action buttons
(like Autotask ticket creation) out of view. Users can click the field to
expand/collapse the full text.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 11:35:13 +01:00
865bcf6843 Auto-commit local changes before build (2026-02-06 11:24:58) 2026-02-06 11:24:58 +01:00
66ee14ca18 Change Autotask link modal button label from "Refresh" to "Search"
The button in the "Link existing Autotask ticket" modal performed a search
operation but was labeled "Refresh", which was confusing. Renamed to "Search"
to accurately reflect its functionality.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 11:10:58 +01:00
b0ed6c6fe2 Release v0.1.22 on branch v20260205-13-changelog-python-structure (bump type 1) 2026-02-05 23:29:46 +01:00
442981d52a Release v0.1.21 on branch v20260205-13-changelog-python-structure (bump type 1) 2026-02-05 23:29:38 +01:00
b007b9459b Update changelog-claude.md with detailed changelog redesign documentation 2026-02-05 23:28:03 +01:00
2505c8e337 Add all remaining changelog versions (v0.1.19 to v0.1.2) 2026-02-05 23:24:18 +01:00