Commit Graph

27 Commits

Author SHA1 Message Date
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
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
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
a4d9c4f312 Auto-commit local changes before build (2026-02-08 12:23:44) 2026-02-08 12:23: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
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
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
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
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
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
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
b007b9459b Update changelog-claude.md with detailed changelog redesign documentation 2026-02-05 23:28:03 +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