PDF BOM export
This commit is contained in:
@@ -159,8 +159,10 @@ struct SystemOverviewView: View {
|
||||
goalHours: nil,
|
||||
progressFraction: bomCompletionFraction,
|
||||
hasValue: bomItemsCount > 0,
|
||||
action: onShowBillOfMaterials
|
||||
action: onShowBillOfMaterials,
|
||||
accessibilityIdentifier: "system-bom-button"
|
||||
)
|
||||
|
||||
}
|
||||
.padding(.top, 4)
|
||||
}
|
||||
@@ -190,7 +192,8 @@ struct SystemOverviewView: View {
|
||||
goalHours: Double?,
|
||||
progressFraction: Double?,
|
||||
hasValue: Bool,
|
||||
action: (() -> Void)? = nil
|
||||
action: (() -> Void)? = nil,
|
||||
accessibilityIdentifier: String? = nil
|
||||
) -> some View {
|
||||
let content = VStack(alignment: .leading, spacing: 10) {
|
||||
HStack(alignment: .center, spacing: 12) {
|
||||
@@ -240,12 +243,28 @@ struct SystemOverviewView: View {
|
||||
|
||||
let paddedContent = content
|
||||
.padding(.horizontal, 4)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.contentShape(Rectangle())
|
||||
|
||||
if let action {
|
||||
Button(action: action) {
|
||||
paddedContent
|
||||
if let accessibilityIdentifier {
|
||||
Button(action: action) {
|
||||
paddedContent
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityIdentifier(accessibilityIdentifier)
|
||||
.accessibilityLabel(title)
|
||||
.accessibilityAddTraits(.isButton)
|
||||
.contentShape(Rectangle())
|
||||
} else {
|
||||
Button(action: action) {
|
||||
paddedContent
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityLabel(title)
|
||||
.accessibilityAddTraits(.isButton)
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
} else {
|
||||
paddedContent
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user