Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [*] Add more filter options to orders filters sales channel [https://github.com/woocommerce/woocommerce-android/pull/14546]
- [*] Automatically populate the weight field in the create shipment flow [https://github.com/woocommerce/woocommerce-android/pull/14525]
- [*] [Shipping Labels] Fixed displaying incorrect hazardous material option for purchased labels [https://github.com/woocommerce/woocommerce-android/pull/14571]
- [*] Shipping Labels: Updated the disabled button text on the package selection screen [https://github.com/woocommerce/woocommerce-android/pull/14558]

23.1
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,15 @@ fun WooShippingCarrierPackageScreen(
enabled = isAddPackageEnabled,
onClick = onAddPackageClick
) {
Text(stringResource(id = R.string.woo_shipping_labels_package_creation_add_package))
Text(
stringResource(
id = if (isAddPackageEnabled) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a simple UI logic, I made the change here instead of in the ViewModel.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm not sure about this. Adding it at screen level means we'll need to replicate this if()else{} 3 times instead of having this logic once at viewmodel level. However, I checked current implementation and adding this change at viewmodel level will involve a bigger refactor than I expected. So I'm good with leaving this as proposed 👍🏼

R.string.woo_shipping_labels_package_creation_add_package
} else {
R.string.shipping_label_select_package_button
}
)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,15 @@ fun WooShippingCustomPackageCreationScreen(
enabled = isAddPackageEnabled,
onClick = { onAddPackageClick(isSaveAsTemplateChecked) }
) {
Text(stringResource(id = R.string.woo_shipping_labels_package_creation_add_package))
Text(
stringResource(
id = if (isAddPackageEnabled) {
R.string.woo_shipping_labels_package_creation_add_package
} else {
R.string.woo_shipping_labels_package_creation_add_package_details
}
)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,15 @@ fun WooShippingSavedPackageScreen(
enabled = isAddPackageEnabled,
onClick = onAddPackageClick
) {
Text(stringResource(id = R.string.woo_shipping_labels_package_creation_add_package))
Text(
stringResource(
id = if (isAddPackageEnabled) {
R.string.woo_shipping_labels_package_creation_add_package
} else {
R.string.shipping_label_select_package_button
}
)
)
}
}
}
Expand Down
1 change: 1 addition & 0 deletions WooCommerce/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4655,6 +4655,7 @@
<string name="woo_shipping_labels_package_creation_invalid_dimension">Package dimensions should all be larger than 0.</string>
<string name="woo_shipping_labels_package_creation_save_package_option">Save this as a new package template</string>
<string name="woo_shipping_labels_package_creation_add_package">Add Package</string>
<string name="woo_shipping_labels_package_creation_add_package_details">Add Package Details</string>
<string name="woo_shipping_labels_package_creation_empty_button">Create a custom package</string>
<string name="woo_shipping_labels_package_creation_empty_carrier_message">No carrier information found</string>
<string name="woo_shipping_labels_package_creation_empty_saved_message">No saved packages yet</string>
Expand Down
Loading