Overview shows coming due and the last flight; intervals in days, months or years

- Overview: "Coming due" (next 30 days or 10 hours) and "Last flight" (the
  most recent day's legs, meters at the end, fuel and oil left).
- Component replace / TBO / inspect intervals, inspection types and ADs take
  a number and a days / months / years choice (CalendarInterval). Components
  gain month columns (years stored as 12 months; months land on the same
  date); inspection types and ADs keep end-of-month. ADs now honour days.
- Due list: hours already run out count as overdue; a component covered by
  an inspection type no longer gets its own "Inspect every" item.
- Loading calculator moved to a partial; no limit warnings until a load is
  entered. Header buttons don't wrap on phones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-11 21:40:14 -05:00
1 parent 215efe6814
commit 31ac991bab
37 files changed
+385 -75

No files matched your search

+3
View File
@@ -14,6 +14,9 @@ class AircraftController < ApplicationController
@notes = @aircraft.notes.recent_first.includes(:user).limit(5)
@oil = ConsumptionStats.new(@aircraft, "oil")
@fuel = ConsumptionStats.new(@aircraft, "fuel")
@coming_due = DueList.new(@aircraft).soon
last = @aircraft.flight_logs.recent_first.first
@last_day = last && @aircraft.flight_logs.where(date: last.date).order(:created_at).to_a
end
def new
@@ -68,7 +68,7 @@ class AirworthinessDirectivesController < ApplicationController
def ad_params
p = params.require(:airworthiness_directive).permit(
:name, :short_description, :required_action, :compliance_type, :trigger_condition, :recurring,
:recurring_hours, :recurring_months, :recurring_days, :bulletin_type, :mandatory, :document_id, :document_url
:recurring_hours, :recurring_months, :recurring_days, :recurring_every, :recurring_unit, :bulletin_type, :mandatory, :document_id, :document_url
)
p[:document_id] = scoped_id(@aircraft.documents, p[:document_id])
p
+2 -1
View File
@@ -77,7 +77,8 @@ class ComponentsController < ApplicationController
:component_type_id, :parent_component_id, :manufacturer, :model, :serial_number,
:install_location, :notes, :status, :date_in_service, :hours_in_service,
:hours_since_overhaul, :overhaul_date, :overhaul_kind, :tbo_hours, :tbo_days, :inspection_hours,
:inspection_days, :replacement_hours, :replacement_days, :tbo_critical, :on_condition,
:inspection_days, :replacement_hours, :replacement_days, :replacement_every, :replacement_unit, :tbo_every, :tbo_unit,
:inspection_every, :inspection_unit, :tbo_critical, :on_condition,
:inspection_critical, :replacement_critical, :expires_on
).tap do |p|
# Owners can create a component type inline instead of asking an admin.
@@ -68,7 +68,7 @@ class InspectionTypesController < ApplicationController
def type_params
p = params.require(:inspection_type).permit(:name, :recurring, :effect, :hours_tolerance, :satisfies_id,
:recurring_hours, :recurring_days, :recurring_months)
:recurring_hours, :recurring_days, :recurring_months, :recurring_every, :recurring_unit)
p[:satisfies_id] = scoped_id(@aircraft.applicable_inspection_types, p[:satisfies_id]) if p.key?(:satisfies_id)
p
end