Skip to content

Commit 17bdf4f

Browse files
committed
Merge branch 'task/14646-add-ipp-support-for-puerto-rico' of https://github.com/woocommerce/woocommerce-ios into task/14646-add-ipp-support-for-puerto-rico
2 parents b457b4f + 8ab0b6a commit 17bdf4f

29 files changed

+345
-283
lines changed

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PODS:
4646
- WordPressShared (2.1.0)
4747
- WordPressUI (1.15.1)
4848
- Wormholy (1.6.6)
49-
- WPMediaPicker (1.8.11)
49+
- WPMediaPicker (1.8.12)
5050
- wpxmlrpc (0.10.0)
5151
- ZendeskCommonUISDK (9.0.3)
5252
- ZendeskCoreSDK (5.0.5)
@@ -148,7 +148,7 @@ SPEC CHECKSUMS:
148148
WordPressShared: 0aa459e5257a77184db87805a998f447443c9706
149149
WordPressUI: 700e3ec5a9f77b6920c8104c338c85788036ab3c
150150
Wormholy: 09da0b876f9276031fd47383627cb75e194fc068
151-
WPMediaPicker: 79548964e9c7e131ccfa72270bdda3aec8fa56b5
151+
WPMediaPicker: e9eaa804e1b0288d7969776608053ae0ea2941f2
152152
wpxmlrpc: 68db063041e85d186db21f674adf08d9c70627fd
153153
ZendeskCommonUISDK: f3ce3e7a1bd7762550a78dbaff57509f3112c22b
154154
ZendeskCoreSDK: c542b3f82abc3ee52e1291c6fb3436515e098806

RELEASE-NOTES.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
22.0
55
-----
66
- [*] Payments: Puerto Rico is now available in the list of countries that are supported by In-Person Payments, when using WooPayments [https://github.com/woocommerce/woocommerce-ios/pull/14972]
7+
- [*] Payments: Puerto Rico is now available in the list of countries that are supported by in-person payments [https://github.com/woocommerce/woocommerce-ios/pull/14972]
8+
- [*] Product Form: Fix crash related to picking photos [https://github.com/woocommerce/woocommerce-ios/pull/15275]
79

810
21.9
911
-----
1012
- [*] Product Form: Reset uploaded images upon discarding changes [https://github.com/woocommerce/woocommerce-ios/pull/15265]
1113
- [*] Improved accessibility on login flow [https://github.com/woocommerce/woocommerce-ios/pull/15281]
1214

13-
1415
21.8
1516
-----
1617
- [**] Shipping Labels: resolved issue preventing shipping labels from displaying in some orders when an error occurred during label creation. [https://github.com/woocommerce/woocommerce-ios/pull/15101]

WooCommerce/Classes/Extensions/Date+Woo.swift

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -25,45 +25,6 @@ extension Date {
2525
toString(dateStyle: dateStyle, timeStyle: timeStyle, timeZone: .siteTimezone, locale: locale)
2626
}
2727

28-
/// Returns a localized update string relative to the receiver if it's within one day of now *or*
29-
/// a medium datestyle + short timestyle string otherwise.
30-
///
31-
/// *Note:* if the receiver is a future date, "Updated moments ago" will be returned
32-
///
33-
/// - Example: Updated moments ago
34-
/// - Example: Updated 55 minutes ago
35-
/// - Example: Updated 1 hour ago
36-
/// - Example: Updated 14 hours ago
37-
/// - Example: Updated on Jan 28, 2019 at 5:17 PM
38-
///
39-
var relativelyFormattedUpdateString: String {
40-
let now = Date()
41-
let components = Calendar.current.dateComponents(
42-
[.year, .month, .weekOfYear, .day, .hour, .minute, .second],
43-
from: self,
44-
to: now
45-
)
46-
47-
guard let years = components.year, years < 1,
48-
let months = components.month, months < 1,
49-
let weeks = components.weekOfYear, weeks < 1,
50-
let days = components.day, days < 1 else {
51-
let longFormDate = self.toString(dateStyle: .medium, timeStyle: .short)
52-
return String.localizedStringWithFormat(Strings.longFormUpdateStatement, longFormDate)
53-
}
54-
55-
if let hours = components.hour, hours > 0 {
56-
return String.pluralize(hours, singular: Strings.singularHourUpdateStatment, plural: Strings.pluralHourUpdateStatment)
57-
}
58-
59-
// We only display the minutes update string when we have a time interval greater than 2 minutes...otherwise default to the present deictic expression
60-
if let minutes = components.minute, minutes > 1 {
61-
return String.pluralize(minutes, singular: Strings.singularMinuteUpdateStatment, plural: Strings.pluralMinuteUpdateStatment)
62-
}
63-
64-
return Strings.presentDeicticExpression
65-
}
66-
6728
/// Returns a localized string used for describe a date range string based on two dates. E.g.
6829
///
6930
/// receiver: 2021-01-01
@@ -165,40 +126,3 @@ extension Date {
165126
calendar.isDate(self, inSameDayAs: other)
166127
}
167128
}
168-
169-
170-
// MARK: - Constants!
171-
//
172-
private extension Date {
173-
174-
enum Strings {
175-
static let presentDeicticExpression = NSLocalizedString(
176-
"Updated moments ago",
177-
comment: "Deictic expression for a data update that occurred in the very recent past - similar to 'Updated just now'"
178-
)
179-
static let singularMinuteUpdateStatment = NSLocalizedString(
180-
"Updated %ld minute ago",
181-
comment: "Singular of 'minute' — date and time string that represents the time interval since last data update when exactly 1 minute ago. " +
182-
"Usage example: Updated 1 minute ago"
183-
)
184-
static let pluralMinuteUpdateStatment = NSLocalizedString(
185-
"Updated %ld minutes ago",
186-
comment: "Plural of 'minute' — date and time string that represents the time interval since last data update when greater than 1 minute ago. " +
187-
"Usage example: Updated 55 minutes ago"
188-
)
189-
static let singularHourUpdateStatment = NSLocalizedString(
190-
"Updated %ld hour ago",
191-
comment: "Singular of 'hour' — date and time string that represents the time interval since last data update when exactly 1 hour ago. " +
192-
"Usage example: Updated 1 hour ago"
193-
)
194-
static let pluralHourUpdateStatment = NSLocalizedString(
195-
"Updated %ld hours ago",
196-
comment: "Plural of 'hour' — date and time string that represents the time interval since last data update when greater than 1 hour ago. " +
197-
"Usage example: Updated 14 hours ago"
198-
)
199-
static let longFormUpdateStatement = NSLocalizedString(
200-
"Updated on %@",
201-
comment: "A specific date and time string which represents when the data was last updated. Usage example: Updated on Jan 22, 2019 3:31PM"
202-
)
203-
}
204-
}

WooCommerce/Classes/Extensions/UIImage+Woo.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,10 @@ extension UIImage {
420420
return UIImage(named: "delivery-icon")!
421421
}
422422

423+
static var giftIcon: UIImage {
424+
return UIImage(named: "gift-icon")!
425+
}
426+
423427
/// Blaze success image
424428
///
425429
static var blazeSuccessImage: UIImage {

WooCommerce/Classes/POS/Presentation/Card Present Payments/Reader Messages/PointOfSaleCardPresentPaymentCaptureErrorMessageViewModel.swift

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ final class PointOfSaleCardPresentPaymentCaptureErrorMessageViewModel: Observabl
55
let id = UUID()
66
let title = Localization.title
77
let message = Localization.message
8-
let nextStep = Localization.nextStep
98
let tryAgainButtonViewModel: CardPresentPaymentsModalButtonViewModel
109
let newOrderButtonViewModel: CardPresentPaymentsModalButtonViewModel
1110

@@ -29,7 +28,6 @@ final class PointOfSaleCardPresentPaymentCaptureErrorMessageViewModel: Observabl
2928
lhs.id == rhs.id &&
3029
lhs.title == rhs.title &&
3130
lhs.message == rhs.message &&
32-
lhs.nextStep == rhs.nextStep &&
3331
lhs.tryAgainButtonViewModel == rhs.tryAgainButtonViewModel &&
3432
lhs.newOrderButtonViewModel == rhs.newOrderButtonViewModel &&
3533
lhs.showsInfoSheet == rhs.showsInfoSheet
@@ -46,19 +44,14 @@ private extension PointOfSaleCardPresentPaymentCaptureErrorMessageViewModel {
4644
)
4745

4846
static let message = NSLocalizedString(
49-
"pointOfSale.cardPresent.paymentCaptureError.unable.to.confirm.message",
50-
value: "Due to a network error, we’re unable to confirm that the payment succeeded.",
47+
"pointOfSale.cardPresent.paymentCaptureError.unable.to.confirm.message.1",
48+
value: "Due to a network error, we’re unable to confirm that the payment succeeded. " +
49+
"Verify payment on a device with a working network connection. If unsuccessful, retry the payment. " +
50+
"If successful, start a new order.",
5151
comment: "Error message. Presented to users after collecting a payment fails from payment capture error " +
5252
"on the Point of Sale Checkout"
5353
)
5454

55-
static let nextStep = NSLocalizedString(
56-
"pointOfSale.cardPresent.paymentCaptureError.nextSteps",
57-
value: "Verify payment on a device with a working network connection. If unsuccessful, retry the payment. " +
58-
"If successful, start a new order.",
59-
comment: "Next steps hint for what to do after seeing a payment capture error message. Presented to users " +
60-
"after collecting a payment fails from payment capture error on the Point of Sale Checkout")
61-
6255
static let tryPaymentAgain = NSLocalizedString(
6356
"pointOfSale.cardPresent.paymentCaptureError.tryPaymentAgain.button.title",
6457
value: "Try payment again",

WooCommerce/Classes/POS/Presentation/CardReaderConnection/UI States/Reader Messages/PointOfSaleCardPresentPaymentCaptureErrorMessageView.swift

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@ struct PointOfSaleCardPresentPaymentCaptureErrorMessageView: View {
2626
.font(.posHeadingBold)
2727
.matchedGeometryEffect(id: animation.titleTransitionId, in: animation.namespace, properties: .position)
2828

29-
VStack(alignment: .center, spacing: PointOfSaleCardPresentPaymentLayout.textSpacing) {
30-
Text(viewModel.message)
31-
Text(viewModel.nextStep)
32-
}
33-
.font(.posBodyLargeRegular())
34-
.foregroundStyle(Color.posOnSurface)
35-
.matchedGeometryEffect(id: animation.messageTransitionId, in: animation.namespace, properties: .position)
29+
Text(viewModel.message)
30+
.font(.posBodyLargeRegular())
31+
.foregroundStyle(Color.posOnSurface)
32+
.matchedGeometryEffect(id: animation.messageTransitionId, in: animation.namespace, properties: .position)
3633
}
34+
.dynamicWidthScaling(containerWidth: width)
3735

3836
Spacer()
3937
.frame(height: PointOfSaleCardPresentPaymentLayout.textAndButtonSpacing)
@@ -48,9 +46,10 @@ struct PointOfSaleCardPresentPaymentCaptureErrorMessageView: View {
4846
}
4947
.buttonStyle(POSOutlinedButtonStyle(size: .normal))
5048
}
49+
.dynamicWidthScaling(containerWidth: width)
5150
}
5251
.multilineTextAlignment(.center)
53-
.frame(maxWidth: PointOfSaleCardPresentPaymentLayout.errorContentMaxWidth)
52+
.frame(maxWidth: .infinity, maxHeight: .infinity)
5453
.posModal(isPresented: $viewModel.showsInfoSheet) {
5554
PointOfSaleCardPresentPaymentCaptureFailedView(isPresented: $viewModel.showsInfoSheet)
5655
}

WooCommerce/Classes/POS/Presentation/CardReaderConnection/UI States/Reader Messages/PointOfSaleCardPresentPaymentErrorMessageView.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ struct PointOfSaleCardPresentPaymentErrorMessageView: View {
88

99
var body: some View {
1010
VStack(alignment: .center, spacing: POSSpacing.none) {
11+
Spacer()
12+
1113
POSErrorXMark()
1214
.matchedGeometryEffect(id: animation.iconTransitionId, in: animation.namespace, properties: .position)
1315

@@ -26,6 +28,7 @@ struct PointOfSaleCardPresentPaymentErrorMessageView: View {
2628
.foregroundStyle(Color.posOnSurface)
2729
.matchedGeometryEffect(id: animation.messageTransitionId, in: animation.namespace, properties: .position)
2830
}
31+
.dynamicWidthScaling(containerWidth: width)
2932

3033
Spacer()
3134
.frame(height: PointOfSaleCardPresentPaymentLayout.textAndButtonSpacing)
@@ -41,9 +44,12 @@ struct PointOfSaleCardPresentPaymentErrorMessageView: View {
4144
.buttonStyle(POSOutlinedButtonStyle(size: .normal))
4245
}
4346
}
47+
.dynamicWidthScaling(containerWidth: width)
48+
49+
Spacer()
4450
}
4551
.multilineTextAlignment(.center)
46-
.frame(maxWidth: PointOfSaleCardPresentPaymentLayout.errorContentMaxWidth)
52+
.frame(maxWidth: .infinity, maxHeight: .infinity)
4753
.measureWidth({ containerWidth in
4854
width = containerWidth
4955
})

WooCommerce/Classes/POS/Presentation/CardReaderConnection/UI States/Reader Messages/PointOfSaleCardPresentPaymentIntentCreationErrorMessageView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ struct PointOfSaleCardPresentPaymentIntentCreationErrorMessageView: View {
4141
.buttonStyle(POSOutlinedButtonStyle(size: .normal))
4242
}
4343
}
44+
.dynamicWidthScaling(containerWidth: width)
4445
}
4546
.multilineTextAlignment(.center)
46-
.frame(maxWidth: PointOfSaleCardPresentPaymentLayout.errorContentMaxWidth)
47+
.frame(maxWidth: .infinity, maxHeight: .infinity)
4748
.measureWidth({ containerWidth in
4849
width = containerWidth
4950
})

WooCommerce/Classes/POS/Presentation/CardReaderConnection/UI States/Reader Messages/PointOfSaleCardPresentPaymentLayout.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ enum PointOfSaleCardPresentPaymentLayout {
77
static let textSpacing: CGFloat = POSSpacing.small
88
static let buttonSpacing: CGFloat = POSSpacing.large
99
static let horizontalPadding: CGFloat = POSPadding.xxLarge
10-
static let errorContentMaxWidth: CGFloat = 604
1110
}

WooCommerce/Classes/POS/Presentation/CardReaderConnection/UI States/Reader Messages/PointOfSaleCardPresentPaymentNonRetryableErrorMessageView.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ struct PointOfSaleCardPresentPaymentNonRetryableErrorMessageView: View {
88

99
var body: some View {
1010
VStack(alignment: .center, spacing: POSSpacing.none) {
11+
Spacer()
12+
1113
POSErrorXMark()
1214
.matchedGeometryEffect(id: animation.iconTransitionId, in: animation.namespace, properties: .position)
1315

@@ -29,16 +31,20 @@ struct PointOfSaleCardPresentPaymentNonRetryableErrorMessageView: View {
2931
.foregroundStyle(Color.posOnSurface)
3032
.matchedGeometryEffect(id: animation.messageTransitionId, in: animation.namespace, properties: .position)
3133
}
34+
.dynamicWidthScaling(containerWidth: width)
3235

3336
Spacer()
3437
.frame(height: PointOfSaleCardPresentPaymentLayout.textAndButtonSpacing)
3538

3639
Button(viewModel.tryAnotherPaymentMethodButtonViewModel.title,
3740
action: viewModel.tryAnotherPaymentMethodButtonViewModel.actionHandler)
3841
.buttonStyle(POSFilledButtonStyle(size: .normal))
42+
.dynamicWidthScaling(containerWidth: width)
43+
44+
Spacer()
3945
}
4046
.multilineTextAlignment(.center)
41-
.frame(maxWidth: PointOfSaleCardPresentPaymentLayout.errorContentMaxWidth)
47+
.frame(maxWidth: .infinity, maxHeight: .infinity)
4248
.measureWidth({ containerWidth in
4349
width = containerWidth
4450
})

0 commit comments

Comments
 (0)