saleor-dashboard/src/fragments/shipping.ts
Dominik Żegleń e55805a79d
Add zip code exclusion (#877)
* Clean up stories

* Add missing props

* Add zip codes section (#861)

* Add zip code listing

* Add list wrapping

* Update snapshots

* Set up API data

* Fix lgtm warning

* Update snapshots

* Run Actions on all PR

* Checks on PR

* Test envs on PR

* Cleanup action on PR

* Update messages

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>

* Add zip code range dialog

* Fix path management

* Use query params to handle modal actions

* Allow zip codes to be assigned to shipping method

* Make params optional

* Fix types

* Add zip code deletion (#871)

* Add zip code range dialog

* Fix path management

* Use query params to handle modal actions

* Allow zip codes to be assigned to shipping method

* Make params optional

* Fix types

* Clean up urls

* Add zip code range delete action

* Update snapshots and messages

* Update testing and changelog

* Update schema

* Simplify code

* Refresh zip code list after assigning them

* Update view after zip code deletion

* Update types and snapshots

* Update snapshots

* Fix error message, checkbox default value (#880)

* Fix error message, checkbox default value

* Update snapshots

* Use price instead of weight variant

* Update schema and types

* Hide exclude/include zip codes section

* Update stories

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
Co-authored-by: Tomasz Szymański <lime129@gmail.com>
2020-12-01 16:42:25 +01:00

73 lines
1.3 KiB
TypeScript

import { fragmentMoney } from "@saleor/fragments/products";
import gql from "graphql-tag";
export const shippingZoneFragment = gql`
fragment ShippingZoneFragment on ShippingZone {
id
countries {
code
country
}
name
}
`;
export const shippingMethodWithZipCodesFragment = gql`
fragment ShippingMethodWithZipCodesFragment on ShippingMethod {
id
zipCodeRules {
id
start
end
}
}
`;
export const shippingMethodFragment = gql`
${fragmentMoney}
${shippingMethodWithZipCodesFragment}
fragment ShippingMethodFragment on ShippingMethod {
...ShippingMethodWithZipCodesFragment
minimumOrderWeight {
unit
value
}
maximumOrderWeight {
unit
value
}
name
type
channelListings {
id
channel {
id
name
currencyCode
}
price {
...Money
}
minimumOrderPrice {
...Money
}
maximumOrderPrice {
...Money
}
}
}
`;
export const shippingZoneDetailsFragment = gql`
${shippingZoneFragment}
${shippingMethodFragment}
fragment ShippingZoneDetailsFragment on ShippingZone {
...ShippingZoneFragment
default
shippingMethods {
...ShippingMethodFragment
}
warehouses {
id
name
}
}
`;