feat(dashboard): shipping option tax rate overrides UI (#13260)

* feat(dashboard): shipping option tax rate overrides UI

* feat: add location filter

* feat: show service zone in SO table

* feat: display location in the SO table
This commit is contained in:
Frane Polić
2025-08-21 12:06:36 +02:00
committed by GitHub
parent 37f372ccf7
commit 9b38b750de
14 changed files with 480 additions and 76 deletions
@@ -17,3 +17,46 @@ export function isOptionEnabledInStore(
r.operator === "eq"
)
}
/**
* Return a name for the shipping option location or generate one based on the locations address
*/
export function getFormattedShippingOptionLocationName(
shippingOption: HttpTypes.AdminShippingOption
) {
const location = shippingOption.service_zone.fulfillment_set.location
if (!location) {
return "N/A"
}
if (location.name) {
return `${location.name}`
}
let name = ""
if (location.address) {
if (location.address.address_1) {
name += `${location.address.address_1}`
}
if (location.address.address_2) {
name += `${location.address.address_2}`
}
if (location.address.city) {
name += `${location.address.city}`
}
if (location.address.postal_code) {
name += `${location.address.postal_code}`
}
if (location.address.country_code) {
name += `, ${location.address.country_code}`
}
}
return name || "N/A"
}