-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Excluded Products in shipping view (#866)
* 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> * Allow zip codes to be assigned to shipping method * 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 schema * Refresh zip code list after assigning them * Update types and snapshots * Update snapshots * Fix error message, checkbox default value (#880) * Fix error message, checkbox default value * Update snapshots * Update schema and types * Update stories * add excluded products section in shipping methods views * create UnassignDialog component * use priceRangeFragment in shipping queries * remove unneeded price from ShippingMethodAddProductsDialog * update messages in ShippingMethodProducts * updates after rebase * update snapshots, fix lint errors * fix ShippingMethodProductsAddDialog * update snapshots * small fix in ShippingMethodProducts * update snapshots after rebase * add handleClose func in ShippingMethodProductsAddDialog * Fix metadata not showing in category update * update snapshots again * update ShippingMethodProductsAddDialog * updates after rebase * update Price and Weight rates views Co-authored-by: dominik-zeglen <flesz3@o2.pl> Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com> Co-authored-by: Tomasz Szymański <lime129@gmail.com> Co-authored-by: Magdalena Markusik <magdalena.markusik@mirumee.com>
- Loading branch information
1 parent
f97ddd0
commit b774cc9
Showing
32 changed files
with
7,170 additions
and
1,087 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
src/fragments/types/ShippingMethodWithExcludedProductsFragment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
// This file was automatically generated and should not be edited. | ||
|
||
import { WeightUnitsEnum, ShippingMethodTypeEnum } from "./../../types/globalTypes"; | ||
|
||
// ==================================================== | ||
// GraphQL fragment: ShippingMethodWithExcludedProductsFragment | ||
// ==================================================== | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_zipCodeRules { | ||
__typename: "ShippingMethodZipCodeRule"; | ||
id: string; | ||
start: string | null; | ||
end: string | null; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_minimumOrderWeight { | ||
__typename: "Weight"; | ||
unit: WeightUnitsEnum; | ||
value: number; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_maximumOrderWeight { | ||
__typename: "Weight"; | ||
unit: WeightUnitsEnum; | ||
value: number; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_channelListings_channel { | ||
__typename: "Channel"; | ||
id: string; | ||
name: string; | ||
currencyCode: string; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_channelListings_price { | ||
__typename: "Money"; | ||
amount: number; | ||
currency: string; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_channelListings_minimumOrderPrice { | ||
__typename: "Money"; | ||
amount: number; | ||
currency: string; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_channelListings_maximumOrderPrice { | ||
__typename: "Money"; | ||
amount: number; | ||
currency: string; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_channelListings { | ||
__typename: "ShippingMethodChannelListing"; | ||
id: string; | ||
channel: ShippingMethodWithExcludedProductsFragment_channelListings_channel; | ||
price: ShippingMethodWithExcludedProductsFragment_channelListings_price | null; | ||
minimumOrderPrice: ShippingMethodWithExcludedProductsFragment_channelListings_minimumOrderPrice | null; | ||
maximumOrderPrice: ShippingMethodWithExcludedProductsFragment_channelListings_maximumOrderPrice | null; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_excludedProducts_pageInfo { | ||
__typename: "PageInfo"; | ||
hasNextPage: boolean; | ||
hasPreviousPage: boolean; | ||
endCursor: string | null; | ||
startCursor: string | null; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_excludedProducts_edges_node_thumbnail { | ||
__typename: "Image"; | ||
url: string; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_excludedProducts_edges_node { | ||
__typename: "Product"; | ||
id: string; | ||
name: string; | ||
thumbnail: ShippingMethodWithExcludedProductsFragment_excludedProducts_edges_node_thumbnail | null; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_excludedProducts_edges { | ||
__typename: "ProductCountableEdge"; | ||
node: ShippingMethodWithExcludedProductsFragment_excludedProducts_edges_node; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment_excludedProducts { | ||
__typename: "ProductCountableConnection"; | ||
pageInfo: ShippingMethodWithExcludedProductsFragment_excludedProducts_pageInfo; | ||
edges: ShippingMethodWithExcludedProductsFragment_excludedProducts_edges[]; | ||
} | ||
|
||
export interface ShippingMethodWithExcludedProductsFragment { | ||
__typename: "ShippingMethod"; | ||
id: string; | ||
zipCodeRules: (ShippingMethodWithExcludedProductsFragment_zipCodeRules | null)[] | null; | ||
minimumOrderWeight: ShippingMethodWithExcludedProductsFragment_minimumOrderWeight | null; | ||
maximumOrderWeight: ShippingMethodWithExcludedProductsFragment_maximumOrderWeight | null; | ||
name: string; | ||
type: ShippingMethodTypeEnum | null; | ||
channelListings: ShippingMethodWithExcludedProductsFragment_channelListings[] | null; | ||
excludedProducts: ShippingMethodWithExcludedProductsFragment_excludedProducts | null; | ||
} |
34 changes: 34 additions & 0 deletions
34
src/shipping/components/ShippingMethodProducts/ShippingMethodProducts.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { shippingZone } from "@saleor/shipping/fixtures"; | ||
import Decorator from "@saleor/storybook//Decorator"; | ||
import { storiesOf } from "@storybook/react"; | ||
import React from "react"; | ||
|
||
import ShippingMethodProducts, { | ||
ShippingMethodProductsProps | ||
} from "./ShippingMethodProducts"; | ||
|
||
const products = shippingZone.shippingMethods[0].excludedProducts.edges.map( | ||
edge => edge.node | ||
); | ||
|
||
const props: ShippingMethodProductsProps = { | ||
disabled: false, | ||
isChecked: () => undefined, | ||
onNextPage: () => undefined, | ||
onPreviousPage: () => undefined, | ||
onProductAssign: () => undefined, | ||
onProductUnassign: () => undefined, | ||
pageInfo: { | ||
hasNextPage: false, | ||
hasPreviousPage: false | ||
}, | ||
products, | ||
selected: products.length, | ||
toggle: () => undefined, | ||
toggleAll: () => undefined, | ||
toolbar: () => undefined | ||
}; | ||
|
||
storiesOf("Shipping / ShippingMethodProducts", module) | ||
.addDecorator(Decorator) | ||
.add("default", () => <ShippingMethodProducts {...props} />); |
Oops, something went wrong.