Skip to content

Commit a99b74e

Browse files
authored
Merge pull request #7122 from woocommerce/release/9.4
Merge 9.4.0.1 to trunk
2 parents b52c690 + c93135b commit a99b74e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+6841
-2821
lines changed

WooCommerce/Classes/ViewModels/Order Details/OrderDetailsDataSource.swift

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ final class OrderDetailsDataSource: NSObject {
6565
!isEligibleForCardPresentPayment
6666
}
6767

68+
/// Whether the row for amount paid should be visible.
69+
///
70+
private var shouldShowCustomerPaidRow: Bool {
71+
order.datePaid != nil
72+
}
73+
6874
/// Whether the option to re-create shipping labels should be visible.
6975
///
7076
var shouldAllowRecreatingShippingLabels: Bool {
@@ -576,7 +582,7 @@ private extension OrderDetailsDataSource {
576582
}
577583

578584
private func configureRefund(cell: TwoColumnHeadlineFootnoteTableViewCell, at indexPath: IndexPath) {
579-
let index = indexPath.row - Constants.paymentCell - Constants.paidByCustomerCell
585+
let index = indexPath.row - Constants.paymentCell - Constants.paidByCustomerCell(isDisplayed: shouldShowCustomerPaidRow)
580586
let condensedRefund = condensedRefunds[index]
581587
let refund = lookUpRefund(by: condensedRefund.refundID)
582588
let paymentViewModel = OrderPaymentDetailsViewModel(order: order, refund: refund)
@@ -1140,8 +1146,6 @@ extension OrderDetailsDataSource {
11401146
let payment: Section = {
11411147
var rows: [Row] = [.payment]
11421148

1143-
let shouldShowCustomerPaidRow = order.datePaid != nil
1144-
11451149
if shouldShowCustomerPaidRow {
11461150
rows.append(.customerPaid)
11471151
}
@@ -1220,7 +1224,7 @@ extension OrderDetailsDataSource {
12201224
}
12211225

12221226
func refund(at indexPath: IndexPath) -> Refund? {
1223-
let index = indexPath.row - Constants.paymentCell - Constants.paidByCustomerCell
1227+
let index = indexPath.row - Constants.paymentCell - Constants.paidByCustomerCell(isDisplayed: shouldShowCustomerPaidRow)
12241228
let condensedRefund = condensedRefunds[index]
12251229
let refund = refunds.first { $0.refundID == condensedRefund.refundID }
12261230

@@ -1616,10 +1620,15 @@ extension OrderDetailsDataSource {
16161620
case editShippingAddress
16171621
}
16181622

1619-
struct Constants {
1623+
enum Constants {
16201624
static let addOrderCell = 1
16211625
static let paymentCell = 1
1622-
static let paidByCustomerCell = 1
1626+
1627+
/// Input value required because cell is displayed conditionally
1628+
///
1629+
static func paidByCustomerCell(isDisplayed: Bool) -> Int {
1630+
isDisplayed ? 1 : 0
1631+
}
16231632
}
16241633
}
16251634

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
/* A message that tells the user why the app is requesting access to the device’s camera. */
2-
NSCameraUsageDescription = "To take photos or videos to add to your Products, scan barcode for Product SKU, or support tickets.";
3-
4-
/* A message that tells the user why the app is requesting access to the user’s photo library. */
5-
NSPhotoLibraryUsageDescription = "To save photos from camera for Product images, or to add photos or videos to your Products or support tickets.";
6-
7-
/* A message that tells the user why the app is requesting access to the user’s location information while the app is running in the foreground. */
8-
NSLocationWhenInUseUsageDescription = "Location access is required in order to accept payments.";
9-
10-
/* A message that tells the user why the app is requesting the ability to connect to Bluetooth peripherals. */
11-
NSBluetoothPeripheralUsageDescription = "Bluetooth access is required in order to connect to supported card readers.";
12-
13-
/* A message that tells the user why the app needs access to Bluetooth. */
14-
NSBluetoothAlwaysUsageDescription = "This app uses Bluetooth to connect to supported card readers.";
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<!--Warning: Auto-generated file, do not edit.-->
4+
<plist version="1.0">
5+
<dict>
6+
<key>NSBluetoothAlwaysUsageDescription</key>
7+
<string>يستخدم هذا التطبيق تقنية Bluetooth للربط بأجهزة قارئ البطاقة المدعومة.</string>
8+
<key>NSBluetoothPeripheralUsageDescription</key>
9+
<string>يلزم الوصول إلى تقنية Bluetooth للربط بأجهزة قارئ البطاقة المدعومة.</string>
10+
<key>NSCameraUsageDescription</key>
11+
<string>لالتقاط صور أو مقاطع فيديو لإضافتها إلى منتجاتك، قم بإجراء مسح ضوئي للرمز الشريطي الخاص بوحدة SKU للمنتج أو تذاكر الدعم</string>
12+
<key>NSLocationWhenInUseUsageDescription</key>
13+
<string>يلزم الوصول إلى الموقع لقبول المدفوعات.</string>
14+
<key>NSPhotoLibraryUsageDescription</key>
15+
<string>لحفظ الصور من كاميرا خاصة بصور المنتجات أو لإضافة صور أو مقاطع فيديو إلى منتجاتك أو تذاكر الدعم الخاصة بك.</string>
16+
</dict>
17+
</plist>

0 commit comments

Comments
 (0)