Commit Graph

335 Commits

Author SHA1 Message Date
7d72b7ddee Major fix: Inbox only shows unapproved emails, not approved ones
Critical corrections to Inbox Management documentation:

Overview & Page Layout:
- Clarified: Inbox displays only UNAPPROVED emails
- Added callout: "Inbox Shows Only Unapproved Emails"
- Explained: Approved emails immediately disappear from inbox
- Inbox is a staging area for emails awaiting approval/deletion

Email Detail Modal - Metadata Section:
- REMOVED incorrect fields that don't exist for inbox emails:
  * "Customer: If already approved..." (approved emails aren't in inbox!)
  * "Approved: Checkmark..." (no checkmark - they disappear when approved!)
- Added list of action buttons (Approve, Re-parse, Delete, Download .eml)

What Happens After Approval:
- Changed "moved out of inbox" to "immediately disappears from inbox"
- Added: Future emails are "automatically approved and linked WITHOUT
  appearing in the inbox" - they go directly to operational views
- New callout: "Approved Emails Don't Return" explaining auto-approval flow

Inbox Filters and Search:
- Changed "all imported emails" to "all UNAPPROVED imported emails"

Common Workflows - Setting Up New Customer:
- Updated step 5: "approved emails disappear from inbox"
- Added step 6: Jobs appear in Jobs/Daily Jobs/Run Checks pages
- Updated step 7: Future reports auto-approved, never appear in inbox

This accurately reflects that the inbox is ONLY for unapproved emails.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 16:41:56 +01:00
1b9252a800 Fix Inbox Management: EML link and add email detail screenshot
Corrections to Inbox Management documentation:

Table Columns:
- Fixed EML column description: "Download link" instead of "Checkmark (✓)"
- Clarified: "blank if not stored" for emails without stored .eml file

Email Detail Modal section:
- Added screenshot (approve-job.png) showing the email detail modal
- Screenshot displays: metadata section, email body, and approval interface
- Figure caption explains all visible components
- Screenshot reused from earlier documentation (already created)

These corrections accurately reflect the actual UI behavior.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 16:36:54 +01:00
4c09135b84 Fix: Clarify single Save Settings button used twice in workflow
Corrected Mail Import Setup documentation to accurately reflect UI:

Step 2.3: "Save Settings (Again)" instead of "Save Final Configuration"
- Clarified there is only ONE "Save settings" button on the page
- Same button is clicked TWICE: once after credentials, once after folders
- Added warning callout: "Same Button, Two Steps"
- Emphasized this is the same button from Step 2.1, not a separate button

Future Improvement note updated:
- Specifically mentions clicking same button twice is not obvious
- Suggests possible solutions: separate sections with distinct save buttons,
  or visual feedback about which step user is on

This accurately reflects the current UI where a single "Save settings" button
serves double duty, which will be improved in a future version for clarity.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 16:19:34 +01:00
3a3e2fde58 Clarify two-step workflow for Mail Import folder configuration
Enhanced Mail Import Setup documentation to clarify configuration workflow:

Step 2.1 (Enter Graph Credentials):
- Added warning callout: Must save credentials FIRST before folder configuration
- Credentials must be saved and page refreshed before Step 2.2 works

Step 2.2 (Configure Mail Folders):
- Added prerequisite: Ensure credentials saved and page refreshed
- Clarified folder browser popup AUTOMATICALLY loads folder structure
- Emphasized: Don't type paths manually - click folders in popup
- Folder browser connects to Microsoft Graph and retrieves folders
- Added callout: Folder browser auto-generates correct path format
- Added note about planned UI improvement for clearer workflow

Step 2.3 (Save Final Configuration):
- Renamed from "Save Settings" to "Save Final Configuration"
- Clarified this is the SECOND save (first was in 2.1)
- Added tip callout explaining two-step save process
- Enhanced error checking list (credentials, folders, access policy)

This clarifies the actual user workflow where credentials enable folder browsing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 16:16:04 +01:00
80f4052756 Enhance Mail Import Setup with Application Access Policy security
Enhanced Mail Import Setup documentation with additional security measures:
- Step 1.3: Start with Mail.Read only (read-only) for initial testing
- Step 1.4 (NEW): Restrict access to one mailbox via Application Access Policy
  - Exchange PowerShell commands to create and test policy
  - Ensures app can only access backup mailbox, not all tenant mailboxes
  - Marked as "Optional but Recommended" following principle of least privilege
- Step 1.5: Add Mail.ReadWrite after testing (moved from 1.3)
- Updated Security Best Practices section to emphasize mailbox restriction
- Added security notes about starting read-only and rotating secrets (12 months)

Based on setup documented in /docker/develop/HOWTO-CREATE-GRAPH-APP.md

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 16:00:55 +01:00
24cca64824 Complete Mail & Import documentation section (4 pages)
Added comprehensive documentation for the Mail & Import section:
- Mail Import Setup: Microsoft Graph API configuration, Azure AD app registration,
  folder setup, troubleshooting, and security best practices
- Inbox Management: Email review workflow, approval process, re-parsing,
  deletion, and common workflows
- Mail Parsing: Parser system explanation, supported backup software,
  match criteria, execution order, and troubleshooting
- Auto-Import Configuration: Automatic import scheduling, intervals, batch sizes,
  auto-approval logic, manual import, and monitoring

Updated TODO-documentation.md to reflect progress (14 of 33 pages, 42% complete)
Updated changelog-claude.md with detailed content descriptions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 15:44:51 +01:00
eeb8f3cdad Fix Daily Jobs schedule indicators with accurate badge descriptions
Corrected schedule display documentation based on actual UI:

Status Indicators (dots):
- Green dot: Job ran successfully
- Red dot: Job ran but failed
- White dot: Expected but not yet run (time not arrived)
- Gray dot: Expected but overdue (time passed, no run)

Run Count Badges:
- "1 run" (gray badge): Single run received
- "3 runs" (blue/cyan badge): Multiple runs received (stands out)
- Badge appears next to green dot when runs are successful
- Multiple runs (3+) highlighted with blue/cyan for attention

Removed incorrect description about:
- Run counters in parentheses (actually separate badges)
- Times shown only once (times can repeat for different runs)

Added Screenshot:
- schedule-indicators.png: Shows actual time slots with dots and badges

Enhanced workflow tip with specific actions for each indicator type.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 14:02:16 +01:00
79095f088e Enhance Job Schedules documentation with Daily Jobs indicators
Added important details about schedule learning and Daily Jobs display:

Information Jobs:
- Added explanation for jobs without schedules (SSL cert updates, etc.)
- Information jobs are irregular and never learn a schedule pattern
- Will not appear on Daily Jobs page

Daily Jobs Color Indicators:
- Green: Ran successfully today
- Red: Ran with failure today
- White: Expected later today (time hasn't arrived yet)
- Gray: Expected but overdue (time has passed, no run received)

Multiple Runs Per Day:
- Schedule shows time only once
- Run counter displays number of runs (e.g., "10:00 (3)")
- Helps track jobs that run multiple times daily

Added callouts explaining:
- Information jobs concept
- Run counter meaning and usage
- White vs. gray indicator significance

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 13:57:45 +01:00
1c3d08bb1a Add Admin-only column visibility note for Job History
Added documentation note about role-based column visibility:

Job History Table:
- "Reviewed by" column: Admin only
- "Reviewed at" column: Admin only
- Other columns visible to all roles with Jobs page access

Future Change Note:
- May be updated to show these columns to Operators as well
- Currently restricted to Admin role only

Added callout box explaining this restriction and potential future change.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 13:49:48 +01:00
7c356ebf8f Fix archived jobs access documentation
Corrected documentation about archived jobs visibility:

Archived Jobs Access:
- No toggle/filter on Jobs page to show archived jobs
- Archived jobs are on a SEPARATE page
- Only accessible to Admin role (not Operators or Viewers)
- Separate menu item: "Archived Jobs"

Jobs Page:
- Shows only active jobs for active customers
- No option to view archived jobs on this page
- Archived jobs completely hidden from non-admin users

Unarchiving:
- Only admins can unarchive jobs
- Done from Archived Jobs page (not Jobs page)
- Unarchived jobs immediately reappear in operational views

Removed incorrect references to "Show archived jobs" toggle.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 13:47:08 +01:00
ecba3de50b Fix Approved Jobs documentation based on actual UI
Corrected Jobs list and Job details page documentation:

Jobs List Table:
- Only 4 columns shown: Customer, Backup, Type, Job name
- Removed incorrect columns: Last Run, Status, Schedule, Actions
- Entire row is clickable (not just job name)

Job Details Page:
- Added comprehensive field descriptions:
  - Customer, Backup, Type, Job name
  - Tickets count (open/total)
  - Remarks count (open/total)
  - Schedule (inferred) with day/time table in 15-min blocks
  - Archive button (gray)
  - Delete job button (red)

Job History Table:
- Detailed column descriptions:
  - Day run, Run time, Status (green dot for success)
  - Tickets (with ticket numbers), Remarks, Override
  - Reviewed by (username), Reviewed at (timestamp)
- Runs are clickable for full details

Removed:
- Job Status Indicators section (not shown in Jobs list)
- Incorrect Action buttons column

Added Screenshot:
- job-details.png: Shows complete job detail page with schedule and history

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 13:39:01 +01:00
c671a606bd Fix job customer reassignment documentation
Corrected documentation to reflect actual job detail functionality:

Job Detail Page:
- Can only Archive or Delete jobs
- Cannot edit job properties (customer, name, etc.)
- No edit function available on job detail page

Reassigning Jobs to Different Customer:
- Cannot change customer directly
- Must delete job to return emails to Inbox
- Re-approve from Inbox with correct customer selection
- Step-by-step process documented in Common Questions

Approved Jobs:
- Removed incorrect "Editing Job Information" section
- Replaced with "Job Detail Page" showing actual available actions
- Added warning that job properties cannot be edited

Configuring Jobs:
- Updated "Can I change the customer" question with correct process
- Emphasized delete-and-reapprove workflow

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 13:31:05 +01:00
d26e2fc124 Clarify Mail Parser modification restrictions
Updated documentation to reflect that Mail Parsers can only be modified
by the system developer/maintainer, not by administrators:

- Configuring Jobs:
  - Changed "parser must be updated (Admin only)" to "contact system developer/maintainer"
  - Clarified parsers cannot be modified through BackupChecks UI
  - Updated Common Questions section with same clarification

- Approved Jobs:
  - Changed "Mail Parser configuration must be updated by administrator" to "contact system developer/maintainer"
  - Added note that parsers are code-level components

Mail Parsers are Python code modules that require developer-level changes,
not configurable through the application interface.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 13:25:24 +01:00
8121af485d Fix Configuring Jobs documentation - customer selection workflow
Corrected job approval workflow based on actual UI:

Customer Selection:
- Customers CANNOT be created from Inbox
- Customers must be created on Customers page first
- Customer field has autocomplete with fuzzy matching
- Can type any part of customer name (e.g., "toso" finds "Contoso")
- "Select customer" placeholder text shown
- Approve job button only enabled when customer selected

Email Detail Modal:
- Added detailed field descriptions (From, Backup, Type, Job, Overall, etc.)
- Details panel shows parsed backup report content
- Success/failure status with color-coded header
- Backup statistics (start/end time, duration, size, compression)
- Catalog information and version details
- Approve job (blue), Delete (red), Close (gray) buttons

Added Screenshot:
- approve-job.png: Shows inbox email detail modal with customer selection

Removed incorrect information about automatic customer creation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 13:23:54 +01:00
5700f795e4 Fix Managing Customers documentation based on actual UI
Corrected documentation to match actual customer management interface:

Customer Fields:
- Only customer name and active status (no contact fields)
- Customer name is not clickable
- Edit and Delete buttons on right side (no "Actions" column)

Edit Customer Dialog:
- Modal dialog with customer name and active checkbox
- Autotask mapping integrated in same dialog (not separate button)
- Search Autotask companies field with Search button
- Set mapping (blue), Refresh status (gray), Clear mapping (red) buttons
- Current mapping display with sync status timestamp
- Cancel and Save changes buttons

New Customer Interface:
- Simple form at top of page
- Only name field and Active checkbox
- Add button to create customer
- Browse... button for CSV file selection
- Import CSV and Export CSV buttons
- Refresh all Autotask mappings button

Added Screenshots:
- edit-customer.png: Shows edit dialog with Autotask mapping interface
- new-customers.png: Shows customer creation and CSV import/export controls

Removed incorrect information about contact person, email, phone, notes fields.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 13:02:24 +01:00
5896614637 Complete Customers & Jobs documentation section (4 pages)
Added comprehensive documentation for customer and job management:

- Managing Customers:
  - Customer creation with contact information
  - Editing customer details
  - Active/inactive status and impact on job visibility
  - Autotask company mapping workflow with auto-search
  - CSV export/import for backup and migration
  - Delete operations with warnings
  - Job count indicators (red/bold when zero)

- Configuring Jobs:
  - Inbox-based approval workflow (cannot manually create jobs)
  - Mail Parser automatic configuration of all job fields
  - Reparse All functionality for batch processing
  - Job archiving vs deletion
  - Job lifecycle stages
  - Common questions and limitations

- Approved Jobs:
  - Jobs list overview with status indicators
  - Job detail page information
  - Editable vs parser-determined fields
  - Archive/unarchive workflow
  - JSON export/import via Settings > Maintenance
  - Status indicators (success/failed/warning/no runs)

- Job Schedules:
  - Automatic schedule learning from historical runs
  - Schedule types (daily/weekly/monthly/irregular)
  - Minimum data requirements (3-5 runs)
  - Daily Jobs integration and expected run detection
  - Schedule accuracy scenarios
  - Troubleshooting schedule issues

All pages include tables, callouts, cross-references, and practical examples.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 12:46:08 +01:00
eb9d9158db Center documentation images horizontally
- Added display: block to .doc-content img
- Changed margin from '20px 0' to '20px auto' for horizontal centering
- Images now centered like their figcaptions
- Applies to all documentation screenshots (user-management.png, user-settings.png)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 12:39:11 +01:00
46a96a11fb Add user settings screenshot to documentation
- Added user-settings.png showing password change form
- Screenshot displays Change Password section with fields:
  - Current password
  - New password
  - Confirm new password
  - Update password button

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 12:36:20 +01:00
3f75ab87cd Streamline Profile Settings documentation to reflect actual functionality
- Updated page description: only password change available in User Settings
- Added screenshot reference for user-settings.png
- Clarified theme selector location: navigation bar (between username and logout)
- Clarified role selector location: navigation bar (not in settings page)
- Simplified profile information: username and assigned roles (read-only)
- Removed non-existent Notification Preferences section
- Removed Session Information section (not displayed)
- Enhanced troubleshooting section with specific password change issues
- Maintained Data Privacy and Password sections

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 12:34:02 +01:00
79ee970bee Update login authentication documentation with captcha and deployment context
- Added captcha requirement (simple math problem) to login steps
- Noted future plan to make captcha optional via system setting
- Clarified HTTPS context for browser security:
  - Only relevant for external access via domain name
  - Not applicable for internal IP-based deployments
- Marked Mozilla Firefox as recommended browser (most tested)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 12:23:06 +01:00
92b21daad7 Fix user management documentation: use checkboxes (not comma-separated), add screenshot, remove admin+operator example, add password reset section 2026-02-08 12:10:36 +01:00
77f9971233 Remove operator+reporter role example (operator already has reporting access) 2026-02-08 12:05:20 +01:00
d39e8b632f Fix Users section based on feedback: dashboard redirect, remove email field, admin protection, update role scenarios 2026-02-08 12:03:07 +01:00
0283d7947a Add full content to Users section (users-and-roles, login-authentication, profile-settings) 2026-02-08 11:55:03 +01:00
5c57db1f5d Restore strong tags in callout boxes now that CSS is fixed 2026-02-08 11:49:23 +01:00
a303c817ba Fix CSS: only make first strong tag in callout boxes block-level 2026-02-08 11:48:45 +01:00
20f3b5c222 Fix all remaining callout box formatting in Quick Start (Steps 3, 4, 5) 2026-02-08 11:46:02 +01:00
3e498920af Remove strong tag from 'disabled by default' in Recommended Approach callout 2026-02-08 11:44:16 +01:00
5bd195248d Fix callout box formatting in Quick Start page (Recommended Approach and Note) 2026-02-08 11:42:29 +01:00
060063a36d Fix Role-Based Menu Visibility formatting in First Login page 2026-02-08 11:39:00 +01:00
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
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
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
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
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
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
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
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
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
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
2505c8e337 Add all remaining changelog versions (v0.1.19 to v0.1.2) 2026-02-05 23:24:18 +01:00
3f0eff9f9c Further reduce version link spacing - tighter padding and smaller fonts 2026-02-05 23:19:58 +01:00
60a7fd1d44 Add head block to base.html to allow custom CSS per page 2026-02-05 23:15:36 +01:00
d54444eeca Force compact spacing with !important to override Bootstrap 2026-02-05 23:10:53 +01:00
fddba4e856 Further reduce version navigation spacing - more compact layout 2026-02-05 23:08:05 +01:00
8f2667d007 Reduce spacing in version navigation sidebar 2026-02-05 23:06:26 +01:00
a3b4bc939d Fix: rename 'items' to 'changes' to avoid dict.items() conflict 2026-02-05 23:02:28 +01:00
f51a511e64 Fix import path for changelog module (use relative import) 2026-02-05 22:59:43 +01:00
d0811304c6 Redesign changelog to use Python-based structure instead of Markdown
- Created app/changelog.py with structured changelog data (first 3 versions as example)
- Removed Gitea dependency for changelog rendering
- Added new changelog.html template with:
  - Sidebar navigation for version jumping
  - Bootstrap cards for each version
  - Color-coded type badges (feature/improvement/fixed/documentation)
  - Responsive design with sticky navigation
- Added changelog.css with modern styling and dark mode support
- Updated routes_changelog.py to use Python data structure
- No external dependencies, faster loading, always available

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 22:56:43 +01:00
1d9f3662a1 Fix automatic mail import unable to be disabled once enabled
Fixed bug where unchecked automatic mail import checkbox was not
processed by the backend, preventing users from disabling the
automatic import after enabling it.

Root cause: HTML forms do not send unchecked checkbox values. The
existing check `if "auto_import_enabled" in request.form` would skip
updating the setting when the checkbox was unchecked.

Solution: Added import_form_touched flag to detect when the import
settings form is submitted, then update the checkbox value based on
presence (checked) or absence (unchecked) in form data.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 22:15:38 +01:00
9388ec4c01 Improve Autotask customer mapping with auto-search
Added automatic search for similar company names when opening unmapped
customers in the edit modal. This speeds up the mapping process by
eliminating manual searches.

Changes:
- Clear search box when opening customer edit modal
- Auto-populate search with customer name for unmapped customers
- Automatically display matching Autotask companies as suggestions
- Refactor search logic into reusable performAutotaskSearch() function

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 21:39:02 +01:00
873b22f225 Clear search box when opening Autotask Link existing modal
Fixed issue where the search input retained previous search text when
reopening the Link existing modal. The search box now always starts
empty for a better user experience.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 21:26:14 +01:00
077e1fb176 Add cross-company ticket search for overarching issues
The "Link existing ticket" dialog now searches across all companies when
a ticket number is entered, enabling linking of overarching issues.

Changes:
- Added query_tickets_by_number() to Autotask client
- Route searches both customer's company and cross-company when ticket number detected
- Results are combined and deduplicated (customer tickets shown first)
- Enables linking multi-company infrastructure issues to any job

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 17:01:43 +01:00
cc76068206 Make Autotask resolve messages dynamic based on time entries
The resolve confirmation dialog and ticket notes now correctly indicate
whether the ticket will be closed or remain open based on time entry check.

Changes:
- Frontend: Updated confirmation message to explain conditional closure
- Backend: Check time entries before creating note
- Dynamic message in ticket note:
  * "ticket will be closed in Autotask" (no time entries)
  * "ticket remains open in Autotask due to existing time entries" (has time entries)
- Updated route docstring to reflect conditional status behaviour

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 16:46:43 +01:00
9b905fa24f Add conditional ticket status update based on time entries
Implements API contract section 9: ticket resolution workflow with
conditional status updates based on time entry existence.

- Added query_time_entries_by_ticket_id() for POST /TimeEntries/query
- update_ticket_resolution_safe() now checks time entries:
  * No time entries: sets status to 5 (Complete)
  * Has time entries: keeps current status (ticket remains open)

This ensures tickets are only auto-closed when appropriate per the
validated Autotask API workflow.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 16:35:28 +01:00
8a733a356b Fix Autotask resolution to preserve exact field values from GET response
The issueType, subIssueType, and source fields must be sent in the PUT
payload with their exact values from GET response, including null. This
fixes HTTP 500 error where Autotask rejected picklist value 0.

Changed _pick function to return (found, value) tuple to distinguish
between "field missing" and "field is null".

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 16:29:54 +01:00
a9a60e3315 Restore Autotask PSA integration
Restored from branch v20260203-13-autotask-resolution-item-wrapper with
the following functionality:

- Autotask REST API client with support for tickets, notes, companies,
  and reference data (queues, sources, priorities, statuses)
- Safe ticket updates preserving stabilizing fields per API contract
- Database models for Autotask settings, customer mapping, and ticket linkage
- Settings UI for Autotask configuration with connection test
- Run Checks integration for ticket creation
- Customers page with Autotask company mapping
- Ticket linking during mail import

Also preserved the require_daily_dashboard_visit setting from the
current branch.

Added docs/autotask_rest_api.md with validated API contract from Postman tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 14:43:44 +01:00
abf8b89d7c Add setting to enable/disable daily dashboard redirect
Added a new setting in Settings > General > Navigation that allows
administrators to control whether users are redirected to the dashboard
on their first page view each day.

Changes:
- Added require_daily_dashboard_visit column to SystemSettings model
- Added migration for the new column (default: FALSE)
- Modified before_request hook to check the setting before redirecting
- Added Navigation card with toggle in Settings General page
- Restored changelog-claude.md with performance and feature updates

Default is OFF - users can navigate directly to any page without
being forced to visit the dashboard first.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:03:11 +01:00
0ddeaf1896 Add migration for performance indexes
The indexes defined in models.py __table_args__ are not automatically
created by the custom migration system. Added migrate_performance_indexes()
to explicitly create the indexes at startup.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:54:27 +01:00
f91c081456 Performance optimizations for slow storage environments
- Add database indexes on frequently queried FK columns (JobRun, MailMessage,
  MailObject, TicketScope, RemarkScope)
- Fix N+1 query in override recomputation by batch loading jobs
- Optimize Daily Jobs page with batch queries:
  - Batch load all today's runs in single query
  - Batch infer weekly/monthly schedules for all jobs
  - Batch load ticket/remark indicators

These changes reduce query count by 80-90% on pages like Daily Jobs and Run Checks,
significantly improving performance on systems with slower storage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:44:14 +01:00
5ec64e6a13 Auto-commit local changes before build (2026-02-03 17:16:24) 2026-02-03 17:16:24 +01:00
55c6f7ddd6 Auto-commit local changes before build (2026-02-03 16:50:56) 2026-02-03 16:50:56 +01:00
2667e44830 Auto-commit local changes before build (2026-02-03 16:39:32) 2026-02-03 16:39:32 +01:00
04f6041fe6 Auto-commit local changes before build (2026-02-03 16:17:17) 2026-02-03 16:17:17 +01:00
494f792c0d Auto-commit local changes before build (2026-02-03 16:06:14) 2026-02-03 16:06:14 +01:00
bb804f9a1e Auto-commit local changes before build (2026-02-03 14:29:19) 2026-02-03 14:29:19 +01:00
a4a6a60d45 Auto-commit local changes before build (2026-02-03 14:13:08) 2026-02-03 14:13:08 +01:00
ddc6eaa12a Auto-commit local changes before build (2026-02-03 13:59:08) 2026-02-03 13:59:08 +01:00
f6216b8803 Auto-commit local changes before build (2026-02-03 13:12:53) 2026-02-03 13:12:53 +01:00
fb2651392c Auto-commit local changes before build (2026-02-03 12:28:38) 2026-02-03 12:28:38 +01:00
e3303681e1 Auto-commit local changes before build (2026-02-03 11:06:35) 2026-02-03 11:06:35 +01:00
3c7f4c7926 Auto-commit local changes before build (2026-02-03 10:31:44) 2026-02-03 10:31:44 +01:00
3400af58d7 Auto-commit local changes before build (2026-01-20 13:42:54) 2026-01-20 13:42:54 +01:00
67fb063267 Auto-commit local changes before build (2026-01-20 13:32:55) 2026-01-20 13:32:55 +01:00
ae1865dab3 Auto-commit local changes before build (2026-01-20 13:22:37) 2026-01-20 13:22:37 +01:00
92c67805e5 Auto-commit local changes before build (2026-01-20 13:10:45) 2026-01-20 13:10:45 +01:00
fc0cf1ef96 Auto-commit local changes before build (2026-01-20 12:52:16) 2026-01-20 12:52:16 +01:00
899863a0de Auto-commit local changes before build (2026-01-20 10:44:53) 2026-01-20 10:44:53 +01:00
e4e069a6b3 Auto-commit local changes before build (2026-01-20 10:34:23) 2026-01-20 10:34:23 +01:00
dfca88d3bd Auto-commit local changes before build (2026-01-20 10:28:38) 2026-01-20 10:28:38 +01:00
5c0e1b08aa Auto-commit local changes before build (2026-01-20 10:07:44) 2026-01-20 10:07:44 +01:00
5131d24751 Auto-commit local changes before build (2026-01-20 08:49:15) 2026-01-20 08:49:15 +01:00
63526be592 Auto-commit local changes before build (2026-01-19 16:27:38) 2026-01-19 16:27:38 +01:00
b56cdacf6b Auto-commit local changes before build (2026-01-19 15:59:26) 2026-01-19 15:59:26 +01:00
4b3b6162a0 Auto-commit local changes before build (2026-01-19 15:47:15) 2026-01-19 15:47:15 +01:00
a7a61fdd64 Auto-commit local changes before build (2026-01-19 15:40:00) 2026-01-19 15:40:00 +01:00
8407bf45ab Auto-commit local changes before build (2026-01-19 15:30:36) 2026-01-19 15:30:36 +01:00
0cabd2e0fc Auto-commit local changes before build (2026-01-19 15:10:00) 2026-01-19 15:10:00 +01:00
0c5dee307f Auto-commit local changes before build (2026-01-19 14:50:02) 2026-01-19 14:50:02 +01:00
0500491621 Auto-commit local changes before build (2026-01-19 14:23:56) 2026-01-19 14:23:56 +01:00
890553f23e Auto-commit local changes before build (2026-01-19 14:18:29) 2026-01-19 14:18:29 +01:00