Disable export until a system has components
The Overview share menu offered a wiring diagram and a full report even for an empty system. Gate it on loads, batteries or chargers being present (iOS + Android) and add UI tests for both states.
This commit is contained in:
@@ -56,6 +56,10 @@ struct LoadsView: View {
|
||||
allChargers.filter { $0.system == system }
|
||||
}
|
||||
|
||||
private var hasComponents: Bool {
|
||||
!savedLoads.isEmpty || !savedBatteries.isEmpty || !savedChargers.isEmpty
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 0) {
|
||||
TabView(selection: $selectedComponentTab) {
|
||||
@@ -174,6 +178,7 @@ struct LoadsView: View {
|
||||
} label: {
|
||||
Image(systemName: "square.and.arrow.up")
|
||||
}
|
||||
.disabled(!hasComponents)
|
||||
.accessibilityIdentifier("system-overview-share-button")
|
||||
}
|
||||
} else if showPrimary || showEditLoads || showEditBatteries || showEditChargers {
|
||||
|
||||
Reference in New Issue
Block a user