Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Drop ProductVariant.isAvailable field #965

Merged
merged 5 commits into from
Dec 17, 2020
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Support for multichannel - #937 by @AlicjaSzu
- Fixed image scaling in gallery and thumbnails - #959 by @MarekChoinski
- Use only selection attributes in variant picker - #963 by @orzechdev
- Drop deprecated `ProductVariant.isAvailable` field - #965 by @maarcingebala

## 2.11.0

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@editorjs/list": "^1.6.0",
"@editorjs/quote": "^2.4.0",
"@lhci/cli": "^0.4.1",
"@saleor/sdk": "^0.3.0-3",
"@saleor/sdk": "^0.3.0-4",
"@sentry/apm": "^5.15.5",
"@sentry/browser": "^5.15.5",
"@stripe/react-stripe-js": "^1.1.2",
Expand Down
1 change: 0 additions & 1 deletion src/@next/components/organisms/CartSidebar/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const ITEM_VARIANT = (id: string): ICheckoutModelLineVariant => ({
__typename: "SelectedAttribute",
},
],
isAvailable: true,
quantityAvailable: 5,
name: "The Great Square Table",
sku: "R4ND-0M-5KU",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const productVariants: ProductDetails_product_variants[] = [
sku: "93855755",
name: "1l / cotton / yellow",
quantityAvailable: 50,
isAvailable: true,
images: [],
pricing: {
onSale: false,
Expand Down Expand Up @@ -99,7 +98,6 @@ export const productVariants: ProductDetails_product_variants[] = [
sku: "80884671",
name: "2l / wool / red",
quantityAvailable: 50,
isAvailable: true,
images: [],
pricing: {
onSale: false,
Expand Down Expand Up @@ -191,7 +189,6 @@ export const productVariants: ProductDetails_product_variants[] = [
sku: "100",
name: "500ml / wool / turquoise",
quantityAvailable: 50,
isAvailable: true,
images: [],
pricing: {
onSale: false,
Expand Down
2 changes: 1 addition & 1 deletion src/components/CartTable/ProductRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { generateProductUrl } from "../../core/utils";

export type ILine = Omit<
ProductVariant,
"__typename" | "sku" | "quantityAvailable" | "isAvailable"
"__typename" | "sku" | "quantityAvailable"
> & {
quantity: number;
totalPrice: OrderByToken_orderByToken_lines_unitPrice;
Expand Down
2 changes: 1 addition & 1 deletion src/core/SEO/Product/structuredData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const getVariantsStructuredData = variants => {
const outOfStock = "https://schema.org/OutOfStock";
return variants.map(variant => ({
"@type": "Offer",
availability: variant.isAvailable ? inStock : outOfStock,
availability: variant.quantityAvailable > 0 ? inStock : outOfStock,
itemCondition: "https://schema.org/NewCondition",
price: variant.pricing.price.gross.amount.toFixed(2),
priceCurrency: variant.pricing.price.gross.currency,
Expand Down
4 changes: 0 additions & 4 deletions src/views/Product/gqlTypes/ProductDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,6 @@ export interface ProductDetails_product_variants {
id: string;
sku: string;
name: string;
/**
* Whether the variant is in stock and visible or not.
*/
isAvailable: boolean | null;
/**
* Quantity of a product available for sale in one checkout.
*/
Expand Down
4 changes: 0 additions & 4 deletions src/views/Product/gqlTypes/ProductVariantFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,6 @@ export interface ProductVariantFields {
id: string;
sku: string;
name: string;
/**
* Whether the variant is in stock and visible or not.
*/
isAvailable: boolean | null;
/**
* Quantity of a product available for sale in one checkout.
*/
Expand Down
4 changes: 0 additions & 4 deletions src/views/Product/gqlTypes/VariantList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ export interface VariantList_productVariants_edges_node {
id: string;
sku: string;
name: string;
/**
* Whether the variant is in stock and visible or not.
*/
isAvailable: boolean | null;
/**
* Quantity of a product available for sale in one checkout.
*/
Expand Down
1 change: 0 additions & 1 deletion src/views/Product/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export const productVariantFragment = gql`
id
sku
name
isAvailable
quantityAvailable(countryCode: $countryCode)
images {
id
Expand Down