2026.11.1: offline flight logging fixed, inspections from logbook entries, life limits from installation, component inspections moved to inspection types

- Service worker keeps the Log Flight form when opened via Turbo, serves the offline page's script and icon, and treats 502/503/504 as offline; the offline page only links forms actually kept
- Serviced sub-components restart from the airframe time flown since the entry
- New logbook entries can complete inspections (recorded and linked to the entry)
- Components: replacement limit can count from installation (life limit)
- Component-level "Inspect every" / "Inspection critical" removed; a migration converts any unlinked settings into inspection types with a first record; component page lists its inspections

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-12 07:30:59 -05:00
1 parent 7552e4a8a3
commit 352a38c7fb
28 files changed
+289 -69

No files matched your search

+11
View File
@@ -85,6 +85,17 @@ class AirworthinessTest < ActiveSupport::TestCase
assert_equal "RED", Airworthiness.new(@aircraft).call.status
end
test "a life limit counted from installation ignores servicing" do
filter = create_component(@aircraft, component_type: component_type("Oil filter"), replacement_critical: true, replacement_hours: 1250,
hours_in_service: 1250, hours_since_overhaul: 10, date_in_service: Date.current, overhaul_date: Date.current)
assert_equal "GREEN", Airworthiness.new(@aircraft).call.status # counted from the last cleaning: 1240 hrs left
filter.update!(replacement_from_install: true)
assert_equal [ 0, Date.current ], [ filter.hours_to_replacement, filter.replacement_counted_from ]
assert_equal "RED", Airworthiness.new(@aircraft).call.status
filter.update!(hours_in_service: 0, replacement_hours: nil, replacement_months: 60, date_in_service: 61.months.ago.to_date)
assert_equal "RED", Airworthiness.new(@aircraft).call.status # 5 years since installed, though cleaned today
end
test "spare components are ignored" do
create_component(@aircraft, status: "SPARE", replacement_critical: true, replacement_hours: 10, hours_since_overhaul: 50)
assert_equal "GREEN", Airworthiness.new(@aircraft).call.status