Jul 26 - Update scheduled inspection settings
This commit is contained in:
@@ -75,7 +75,8 @@ struct MyInspectionsView: View {
|
||||
.fullScreenCover(item: $scheduledStartTarget) { s in
|
||||
StartInspectionView(
|
||||
preFillTemplateId: s.templateServerId,
|
||||
preFillFacilityId: s.facilityServerId
|
||||
preFillFacilityId: s.facilityServerId,
|
||||
preFillScheduleId: s.serverId
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,8 @@ struct ScheduledInspectionsCard: View {
|
||||
.fullScreenCover(item: $startTarget) { s in
|
||||
StartInspectionView(
|
||||
preFillTemplateId: s.templateServerId,
|
||||
preFillFacilityId: s.facilityServerId
|
||||
preFillFacilityId: s.facilityServerId,
|
||||
preFillScheduleId: s.serverId
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,13 @@ struct StartInspectionView: View {
|
||||
var parentServerId: Int? = nil
|
||||
var parentLocalId: String? = nil
|
||||
|
||||
// ── Scheduled inspection launch ───────────────────────────────────────
|
||||
/// Server ID of the ScheduledInspection this run fulfils, passed when the
|
||||
/// inspector taps Start on a scheduled row. Carried onto the LocalInspection
|
||||
/// so submitInspection() can send it; without it the server cannot fulfil
|
||||
/// the schedule and the "Scheduled" banner never clears.
|
||||
var preFillScheduleId: Int? = nil
|
||||
|
||||
// ── Derived lists ─────────────────────────────────────────────────────
|
||||
|
||||
/// Unique contracts (projectId, projectName) sorted by name.
|
||||
@@ -266,6 +273,8 @@ struct StartInspectionView: View {
|
||||
// Link to parent if this is a re-inspection
|
||||
inspection.parentServerId = parentServerId
|
||||
inspection.parentLocalId = parentLocalId
|
||||
// Link to the schedule if launched from a scheduled row
|
||||
inspection.scheduledInspectionServerId = preFillScheduleId
|
||||
|
||||
// ── Pre-fill from parent (mirrors web app behaviour) ───────────────
|
||||
// Copy non-scoring field values from the parent inspection so the
|
||||
|
||||
Reference in New Issue
Block a user