Skip to content

Commit

Permalink
Merge pull request woocommerce#5093 from woocommerce/issue/5081-custo…
Browse files Browse the repository at this point in the history
…ms-form-description

Shipping Labels: Update description for customs form row when customs form is completed
  • Loading branch information
itsmeichigo authored Oct 1, 2021
2 parents 0742e9c + 3be77bb commit e9269cf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
5 changes: 3 additions & 2 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
7.7
-----
- [***] Shipping Labels: Merchants can now add new payment methods for shipping labels directly from the app. [https://github.com/woocommerce/woocommerce-ios/pull/5023]
- [x] Fix: now a default paper size will be selected in Shipping Label print screen. [https://github.com/woocommerce/woocommerce-ios/pull/5035]
- [*] Fix: now a default paper size will be selected in Shipping Label print screen. [https://github.com/woocommerce/woocommerce-ios/pull/5035]
- [*] Show banner on screens that use cached data when device is offline. [https://github.com/woocommerce/woocommerce-ios/pull/5000]

- [*] Fix incorrect subtitle on customs row of Shipping Label purchase flow. [https://github.com/woocommerce/woocommerce-ios/pull/5093]

7.6
-----
- [x] Show an improved error modal if there are problems while selecting a store. [https://github.com/woocommerce/woocommerce-ios/pull/5006]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private extension ShippingLabelFormViewController {
cell.configure(state: row.cellState,
icon: .globeImage,
title: Localization.customsCellTitle,
body: Localization.customsCellSubtitle,
body: viewModel.getCustomsFormBody(),
buttonTitle: Localization.continueButtonInCells) { [weak self] in
guard let self = self else { return }
self.displayCustomsFormListVC(customsForms: self.viewModel.customsForms)
Expand Down Expand Up @@ -633,7 +633,6 @@ private extension ShippingLabelFormViewController {
static let continueButtonInCells = NSLocalizedString("Continue",
comment: "Continue button inside every cell inside Create Shipping Label form")
static let customsCellTitle = NSLocalizedString("Customs", comment: "Title of the cell Customs inside Create Shipping Label form")
static let customsCellSubtitle = NSLocalizedString("Fill out customs form", comment: "Subtitle of the cell Customs inside Create Shipping Label form")
// Purchase progress view
static let purchaseProgressTitle = NSLocalizedString("Purchasing Label", comment: "Title of the in-progress UI while purchasing a shipping label")
static let purchaseProgressMessage = NSLocalizedString("Please wait", comment: "Message of the in-progress UI while purchasing a shipping label")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,21 @@ final class ShippingLabelFormViewModel {
return packageDescription + "\n" + String.localizedStringWithFormat(Localization.totalPackageWeight, packageWeight)
}

/// Returns the description of the Customs Form row.
///
func getCustomsFormBody() -> String {
guard let rows = state.sections.first?.rows,
let customsRow = rows.first(where: { $0.type == .customs }) else {
return ""
}
switch customsRow.dataState {
case .pending:
return Localization.fillCustomsForm
case .validated:
return Localization.customsFormCompleted
}
}

/// Returns the body of the selected Carrier and Rates.
///
func getCarrierAndRatesBody() -> String {
Expand Down Expand Up @@ -826,6 +841,10 @@ private extension ShippingLabelFormViewModel {
static let totalPackageWeight = NSLocalizedString("Total package weight: %1$@",
comment: "Total package weight label in Shipping Label form. %1$@ is a placeholder for the weight")
static let packageItemCount = NSLocalizedString("%1$d items in %2$d packages", comment: "Total number of items and packages in Shipping Label form.")
static let fillCustomsForm = NSLocalizedString("Fill out customs form", comment: "Subtitle of the cell Customs inside Create Shipping Label form")
static let customsFormCompleted = NSLocalizedString("Customs form completed",
comment: "Subtitle of the cell Customs inside " +
"Create Shipping Label form when the form is completed")
static let carrierAndRatesPlaceholder = NSLocalizedString("Select your shipping carrier and rates",
comment: "Placeholder in Shipping Label form for the Carrier and Rates row.")
static let businessDaySingular = NSLocalizedString("%1$d business day",
Expand Down

0 comments on commit e9269cf

Please sign in to comment.