Workflow polish: setup checklist, next leg, grouped component limits

- Setup checklist on a new aircraft's Overview (owners): components,
  standard inspections, DRS AD import, registration/airworthiness
  certificate, weight and balance; hideable per device
- Log Flight: "Save and log next leg" reopens the form on the same date,
  starting where the leg ended
- Component form: limits in two collapsible groups (replacement and expiry;
  overhaul and TBO), open when in use
- Squawk form warns what "Ground Aircraft" does
- Logbook entry form: inspection result only for inspection entries
  (show-when controller); document names default from the file
- Dates in pickers, the activity log, airworthiness lines, search, audits
  and transcription notes use the app format
- No duplicate Report Squawk button on Squawks; "Record service" label

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-14 07:43:03 -05:00
1 parent 3452a35896
commit 03b9ad65cb
34 files changed
+303 -77

No files matched your search

+6 -6
View File
@@ -95,7 +95,7 @@ class Airworthiness
end
@aircraft.squawks.deferred.find_each do |squawk|
add("DEFERRED", INFO, t(:inoperative, issue: squawk.issue_reported.to_s.truncate(80)),
t(:deferred, date: squawk.deferred_at.to_date, name: squawk.deferred_by_name), squawk)
t(:deferred, date: I18n.l(squawk.deferred_at.to_date, format: :app), name: squawk.deferred_by_name), squawk)
end
end
@@ -134,9 +134,9 @@ class Airworthiness
grounds = Document::GROUNDING_EXPIRY_TYPES.include?(doc.doc_type)
if doc.expired?(@today)
add("DOCUMENT", grounds ? RED : ORANGE, t(:expired_title, name: doc.name),
t(grounds ? :document_expired_grounds : :document_expired, type: doc.type_label, date: doc.expires_on), doc)
t(grounds ? :document_expired_grounds : :document_expired, type: doc.type_label, date: I18n.l(doc.expires_on, format: :app)), doc)
elsif @today + doc.expiry_warning_days >= doc.expires_on
add("DOCUMENT", ORANGE, t(:expires_soon_title, name: doc.name), t(:document_expires, type: doc.type_label, date: doc.expires_on), doc)
add("DOCUMENT", ORANGE, t(:expires_soon_title, name: doc.name), t(:document_expires, type: doc.type_label, date: I18n.l(doc.expires_on, format: :app)), doc)
end
end
end
@@ -163,7 +163,7 @@ class Airworthiness
if c.replacement_critical? && (due = c.next_replacement_date)
if @today >= due
overdue = true
desc = t(c.replacement_from_install? ? :replace_every_installed : :replace_every_serviced, interval: c.replacement_interval_label, date: c.replacement_counted_from)
desc = t(c.replacement_from_install? ? :replace_every_installed : :replace_every_serviced, interval: c.replacement_interval_label, date: c.replacement_counted_from && I18n.l(c.replacement_counted_from, format: :app))
elsif @today + DAYS_WARNING >= due
approaching = true
desc = t(:replace_in_days, count: (due - @today).to_i)
@@ -174,11 +174,11 @@ class Airworthiness
if c.expires_on
if c.expired?(@today)
expired = true
desc = t(:component_expired, date: c.expires_on)
desc = t(:component_expired, date: I18n.l(c.expires_on, format: :app))
elsif @today + DAYS_WARNING >= c.expires_on
approaching = true
expiring = true
desc = t(:component_expires, date: c.expires_on)
desc = t(:component_expires, date: I18n.l(c.expires_on, format: :app))
end
end
+1 -1
View File
@@ -33,7 +33,7 @@ class EntrySigner
auth_method: @auth_method, ip_address: @request&.remote_ip, user_agent: @request&.user_agent.to_s.first(255)
)
@entry.supersedes&.update_column(:superseded_at, signature.signed_at)
@entry.aircraft.log_event!("logbook", "Logbook entry signed electronically (#{@entry.date})",
@entry.aircraft.log_event!("logbook", I18n.t("services.entry_signer.signed_event", date: I18n.l(@entry.date, format: :app)),
notes: I18n.t("services.entry_signer.text", signer_name: signature.signer_name, certificate_label: signature.certificate_label, certificate_number: signature.certificate_number), user: @user)
signature
end
+1 -1
View File
@@ -27,7 +27,7 @@ class RecordsAudit
drs_item,
Item.new("procedures", t(:procedures), true,
revision.present? && @policy.complete?,
revision ? t(:revision, number: revision.number, date: revision.adopted_at.to_date) : t(:not_adopted)),
revision ? t(:revision, number: revision.number, date: I18n.l(revision.adopted_at.to_date, format: :app)) : t(:not_adopted)),
Item.new("signatures", t(:signatures), true,
check.present? && check.ok, t(:signed_since, count: signatures_since.count, since: since_label)),
Item.new("certificates", t(:certificates), true, true,
+1 -1
View File
@@ -23,7 +23,7 @@ class RecordsIntegrity
next if sig.imported? || sig.status != :altered
entry = sig.logbook_entry
problems << I18n.t(sig.seal_valid? ? "services.records_integrity.entry_changed" : "services.records_integrity.signature_altered",
tail_number: entry.aircraft.tail_number, date: entry.date, signer: sig.signer_name)
tail_number: entry.aircraft.tail_number, date: I18n.l(entry.date, format: :app), signer: sig.signer_name)
end
AppRevision.touch_current!
IntegrityCheck.create!(ok: problems.empty?, versions_checked: versions, signatures_checked: signatures, problems: problems.first(200))
+2 -2
View File
@@ -23,11 +23,11 @@ class SiteSearch
return {} unless searchable?
@results ||= {
"logbook" => find(LogbookEntry.where(aircraft_id: @ids).order(date: :desc), %w[text signoff_person signoff_location]) { |e, s|
[ I18n.t("services.site_search.logbook", date: e.date, log: LogbookEntry::LOG_TYPES[e.log_type]), s, @urls.aircraft_logbook_entry_path(e.aircraft_id, e) ] },
[ I18n.t("services.site_search.logbook", date: I18n.l(e.date, format: :app), log: LogbookEntry::LOG_TYPES[e.log_type]), s, @urls.aircraft_logbook_entry_path(e.aircraft_id, e) ] },
"squawk" => find(Squawk.where(aircraft_id: @ids).order(created_at: :desc), %w[issue_reported notes deferral_notes]) { |q, s|
[ q.resolved? ? I18n.t("services.site_search.resolved", issue: q.issue_reported.truncate(80)) : q.issue_reported.truncate(80), s, @urls.aircraft_squawks_path(q.aircraft_id) ] },
"note" => find(AircraftNote.where(aircraft_id: @ids).order(created_at: :desc), %w[text]) { |n, s|
[ I18n.t("services.site_search.note", date: n.created_at.to_date), s, @urls.aircraft_notes_path(n.aircraft_id) ] },
[ I18n.t("services.site_search.note", date: I18n.l(n.created_at.to_date, format: :app)), s, @urls.aircraft_notes_path(n.aircraft_id) ] },
"ad" => ads,
"document" => find(Document.where(aircraft_id: @ids).order(:name), %w[name description pages_text]) { |d, s|
[ d.name, s, @urls.aircraft_document_path(d.aircraft_id, d) ] },