Morning Checks - edmozley/freeitsm GitHub Wiki

Morning Checks

Folder: morning-checks/ Colour: Cyan #00acc1

Daily infrastructure health check recording with configurable statuses (Green / Amber / Red by default, customisable), 30-day trend charts with resizable layout, PDF export, and integrated ticket creation for any status that requires notes.

Workflow

  1. Define checks in settings โ€” one row per thing to check daily (e.g. "Backup job โ€” last night's full backup", "VPN concentrator response time")
  2. Open today's checks โ€” each defined check appears with one button per active status and a notes field
  3. Pick a status โ€” buttons render dynamically from the configured status options. Picking a status whose Requires notes flag is true pops a notes modal; otherwise the result saves immediately
  4. Trend chart updates โ€” the bottom-of-page bar chart refreshes as soon as a status is set

Configurable Statuses

The status options are stored in morningChecks_Statuses and managed under Settings โ†’ Statuses. Each status has:

  • Label โ€” e.g. Green, Amber, Red, or anything else you want
  • Colour โ€” hex value drives the button colour, the bar-chart segment, the PDF status colour, and the row colour
  • Requires notes โ€” when true, picking this status pops the notes modal before saving
  • Active โ€” toggle off to retire a status without losing historical data

Defaults seeded on install: ๐ŸŸข Green (no notes) ยท ๐ŸŸก Amber (requires notes) ยท ๐Ÿ”ด Red (requires notes).

Properly normalised โ€” with a guided migration tool

Results store a StatusID FK to the configured status (not the label string). The label is resolved at read time via a JOIN, so renaming a status updates the dashboard, chart, and PDF everywhere with no rewrites.

If a status is deleted while results reference it, the FK is ON DELETE SET NULL but delete_status.php snapshots the label into the result row first โ€” so the orphan keeps its label for the Settings โ†’ Statuses โ†’ Normalisation tool. That tool only appears when orphans exist; it lists each orphan label with row count and a dropdown of active statuses to map to. The dashboard also shows a yellow banner pointing at the tool whenever any orphan rows are present.

Dashboard

Full-width vertical flex column:

  • Top: date display + date picker + Today + Save to PDF
  • Middle (scrollable): today's checks table
  • Drag handle: 6px thin horizontal divider โ€” drag to resize the chart vs the checks table. The split is saved per analyst (mc_chart_height_pct user preference) and reapplies on window resize. Hidden when the chart is collapsed.
  • Bottom: trend chart with floating collapse chevron in the corner

30-Day Trend Chart

Each day's results are rendered as a stacked bar segmented by status โ€” one dataset per active status (added/removed automatically as statuses are configured). Click any bar to jump to that day's checks.

  • X-axis: just day numbers (denoised โ€” the month name moves to a single axis title underneath, e.g. "Last 30 days overview ยท May" or "โ€ฆ ยท May โ€“ June" when the window straddles a month boundary).
  • Heading: lives in the x-axis title; the chart-footer header bar was removed entirely to save vertical real estate.
  • Collapse chevron: small floating button in the chart's bottom-right corner, aligned with the legend.
  • Bar fill: Plain (solid) or Gradient (light at top, full colour at bottom). Per-analyst preference under Settings โ†’ Chart; the gradient is rebuilt against the live chart area on every draw so it tracks resize / drag / window resize.

The split between the checks table and chart is fully draggable and persisted per analyst.

Groups and Routing

Optional. Checks can be grouped into sections, and each group pointed at a team or a named analyst; a single check can override its group with an analyst of its own. Routing is guidance, never permission โ€” anyone with module access can complete any check, which is the point when somebody is off sick. A Mine filter appears beside the date once anything is routed, and stays hidden otherwise.

Full detail: Morning check groups and routing ยท Developer Guide.

Raise a Ticket or a Task from a Check

Every check row carries a + in the Actions column. It opens a modal pre-filled with the check name, status, date and notes, and asks first whether you want a ticket or a task. For a ticket the analyst picks priority, assignee, department and type, and a ticket is created with the current analyst as the requester; priority guess maps the highest-sort-order requires-notes status to High and others to Normal. Whatever is raised is recorded against the result in morningChecks_ResultLinks.

Raising used to appear only on statuses whose Requires notes flag was true. It is now offered on every check โ€” that flag is a fair proxy for something is wrong but a poor one for I want to follow this up, and a green check can still warrant a task.

Undo a Check

A completed row also carries an undo arrow, which puts the check back to not checked. It deletes the result row rather than nulling its status, so the state is identical to a check nobody has touched. It confirms first, because the note and the attribution go with it. Any ticket or task already raised from that result is not touched โ€” only the link record cascades away.

Changing a check to a status that does not carry a note also confirms, because the existing note would be discarded.

PDF Export

Export the day's checks to a PDF with:

  • Selectable text (not a screenshot)
  • Company logo
  • Status values coloured by the configured Colour of each status (hex โ†’ RGB on the fly)
  • Notes

Used for compliance evidence โ€” audit trails of routine checks performed.

Settings

Four tabs:

  • Checks โ€” name, description, display order, active flag, group and routed analyst, drag-and-drop reordering; add/edit via modal popups
  • Statuses โ€” full CRUD on the status options (see Configurable Statuses above). Normalisation tool appears here when orphan results exist.
  • Groups โ€” optional groups and their routing (morning_checks.groups). See Morning check groups and routing.
  • Chart โ€” Plain vs Gradient bar fill (per-analyst preference, also surfaced on System โ†’ Preferences)

Help

Interactive guide at morning-checks/help.php โ€” seven sections covering the overview, performing the daily round, groups and routing, the trend chart, PDF export, all four settings tabs, and quick tips.

Watchtower Integration

The Watchtower attention card shows today's completion status, and counts of failed (red) and warning (amber) checks. Click through to today's checks page.

Key Tables

Table Purpose
morningChecks_Checks Defined checks (name, description, display order, active flag, GroupID, AssignedAnalystID)
morningChecks_Results Daily results. StatusID FK to morningChecks_Statuses (ON DELETE SET NULL). Status (VARCHAR) is kept as a label snapshot for orphan rows the normalisation tool can remap. CreatedBy is who first recorded a result that day (the meaning the v1 API publishes); ModifiedBy is who set the status currently showing
morningChecks_Statuses Configurable status options (Label, Colour, RequiresNotes, SortOrder, IsActive)
morningChecks_Groups Optional groups and their routing (AssignedTeamID, AssignedAnalystID, IsActive, SortOrder)
morningChecks_ResultLinks Tickets and tasks raised from a result. ON DELETE CASCADE on the result โ€” clearing a check drops the link, never the ticket
user_preferences Houses mc_chart_height_pct (drag-divider split) and mc_chart_fill_style (plain / gradient) per analyst