Skip to content

Commit

Permalink
Inverse showTitleAndMessage check to have true as a default
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopsaheysa committed Jul 15, 2024
1 parent 311c7dc commit 345786d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,18 @@ extension WMTUserOperation {

var sections = [WMTUserOperationVisualSection]()

if detailTemplate.showTitleAndMessage == true {
if detailTemplate.showTitleAndMessage == false {
let dataSections = attrs.popSections(from: sectionsTemplate)
sections.append(contentsOf: dataSections)
sections.append(.init(cells: attrs.getRemainingCells()))
return .init(sections: sections)
} else {
let headerSection = createHeaderVisual(style: detailTemplate.style)
let dataSection = attrs.popSections(from: sectionsTemplate)
sections.append(headerSection)
sections.append(contentsOf: dataSection)
sections.append(.init(cells: attrs.getRemainingCells()))
return .init(sections: sections)

} else {
let dataSections = attrs.popSections(from: sectionsTemplate)
sections.append(contentsOf: dataSections)
sections.append(.init(cells: attrs.getRemainingCells()))
return .init(sections: sections)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import Foundation
/// Contains prearranged styles for the operation attributes for the app to display
public class WMTTemplates: Codable {

/// The template how the operation should look like in the list of operations
/// How the operation should look like in the list of operations
public let list: ListTemplate?

/// The template for how the operation data should look like
/// How the operation detail should look like
public let detail: DetailTemplate?

// MARK: - Internals
Expand All @@ -45,15 +45,14 @@ public class WMTTemplates: Codable {
self.detail = detail
}

/// This typealias specifies that attributes using it should refer to `WMTOperationAttributes`.
///
/// AttributeId is supposed to be `WMTOperationAttribute.AttributeLabel.id`
public typealias AttributeId = String
/// Value of the `AttributeId` is referencing an existing `WMTOperationAttribute` by `WMTOperationAttribute.AttributeLabel.id`
public typealias AttributeId = String

/// This typealias specifies that attributes using might refer to `WMTOperationAttributes`
/// and additional characters and micht require additional parsing .
/// Value of the `AttributeFormatted` typealias contains placeholders for operation attributes,
/// which are specified using the syntax `${operation.attribute}`.
///
/// Example might be `"${operation.date} - ${operation.place}"`
/// Placeholders in `AttributeFormatted` need to be parsed and replaced with actual attribute values.
public typealias AttributeFormatted = String

/// ListTemplate defines how the operation should look in the list (active operations, history)
Expand Down

0 comments on commit 345786d

Please sign in to comment.