Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private extension BookingListView {
.frame(maxWidth: .infinity, alignment: .leading)
.foregroundStyle(Color.primary)

Text(booking.summaryText)
Text(booking.summaryText(separateLines: false))
.font(.footnote)
.fontWeight(.medium)
.foregroundStyle(Color.secondary)
Expand Down
4 changes: 2 additions & 2 deletions WooCommerce/Classes/Extensions/Booking+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import struct Yosemite.Booking

extension Booking {
var summaryText: String {
func summaryText(separateLines: Bool) -> String {
let productName = orderInfo?.productInfo?.name
let customerName: String = {
guard let name = orderInfo?.customerInfo?.billingAddress.fullName else {
Expand All @@ -12,7 +12,7 @@ extension Booking {
}()
return [productName, customerName]
.compactMap { $0 }
.joined(separator: " • ")
.joined(separator: separateLines ? "\n" : " • ")
}

private enum Localization {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extension BookingDetailsViewModel {
timeStyle: .short,
timeZone: BookingListTab.utcTimeZone
)
serviceAndCustomerLine = booking.summaryText
serviceAndCustomerLine = booking.summaryText(separateLines: true)
attendanceStatus = booking.attendanceStatus
bookingStatus = booking.bookingStatus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ final class BookingDetailsViewModelTests: XCTestCase {
return
}

XCTAssertEqual(headerContent.serviceAndCustomerLine, "Massage Therapy • Jane Smith")
XCTAssertEqual(headerContent.serviceAndCustomerLine, "Massage Therapy\nJane Smith")
}

func test_customer_content_populated_from_billing_address() {
Expand Down