diff --git a/src/discounts/components/SaleCreatePage/SaleCreatePage.tsx b/src/discounts/components/SaleCreatePage/SaleCreatePage.tsx index 67577afc6..800ced791 100644 --- a/src/discounts/components/SaleCreatePage/SaleCreatePage.tsx +++ b/src/discounts/components/SaleCreatePage/SaleCreatePage.tsx @@ -11,16 +11,20 @@ import PageHeader from "@saleor/components/PageHeader"; import SaveButtonBar from "@saleor/components/SaveButtonBar"; import { sectionNames } from "@saleor/intl"; import { UserError } from "../../../types"; -import { SaleType } from "../../../types/globalTypes"; +import { SaleType as SaleTypeEnum } from "../../../types/globalTypes"; +import DiscountDates from "../DiscountDates"; import SaleInfo from "../SaleInfo"; -import SalePricing from "../SalePricing"; +import SaleType from "../SaleType"; export interface FormData { + endDate: string; + endTime: string; + hasEndDate: boolean; name: string; startDate: string; - endDate: string; + startTime: string; + type: SaleTypeEnum; value: string; - type: SaleType; } export interface SaleCreatePageProps { @@ -44,9 +48,12 @@ const SaleCreatePage: React.StatelessComponent = ({ const initialForm: FormData = { endDate: "", + endTime: "", + hasEndDate: false, name: "", startDate: "", - type: SaleType.FIXED, + startTime: "", + type: SaleTypeEnum.FIXED, value: "" }; return ( @@ -71,10 +78,12 @@ const SaleCreatePage: React.StatelessComponent = ({ onChange={change} /> - + + diff --git a/src/products/components/ProductVariantCreateDialog/ProductVariantCreatePrices.tsx b/src/products/components/ProductVariantCreateDialog/ProductVariantCreatePrices.tsx index 2880d8ad4..bdfe40469 100644 --- a/src/products/components/ProductVariantCreateDialog/ProductVariantCreatePrices.tsx +++ b/src/products/components/ProductVariantCreateDialog/ProductVariantCreatePrices.tsx @@ -162,7 +162,7 @@ const ProductVariantCreatePrices: React.FC<
{priceAttributeValues && priceAttributeValues.map(attributeValue => ( - <> +
@@ -198,7 +198,7 @@ const ProductVariantCreatePrices: React.FC< />
- +
))} )} @@ -272,7 +272,7 @@ const ProductVariantCreatePrices: React.FC<
{stockAttributeValues && stockAttributeValues.map(attributeValue => ( - <> +
@@ -301,7 +301,7 @@ const ProductVariantCreatePrices: React.FC< />
- +
))} )} diff --git a/src/products/components/ProductVariantCreateDialog/ProductVariantCreateSummary.tsx b/src/products/components/ProductVariantCreateDialog/ProductVariantCreateSummary.tsx index b251e7723..ff87cda05 100644 --- a/src/products/components/ProductVariantCreateDialog/ProductVariantCreateSummary.tsx +++ b/src/products/components/ProductVariantCreateDialog/ProductVariantCreateSummary.tsx @@ -200,6 +200,7 @@ const ProductVariantCreateSummary: React.FC< style={{ color: colors[valueIndex % colors.length] }} + key={value} > {value} diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index 3763dfa36..f06fe7349 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -37820,7 +37820,7 @@ exports[`Storyshots Views / Discounts / Sale create default 1`] = ` - Pricing + Discount Type
-
- - -
- USD + + + + - -
+ Percentage + + +
+
+
+
+
+ + Active Dates + +
+
+

-
- Time Frame -
-
- + +
+
+
+ +
+ + +
-
- -
- -
-
+ + + Set end date + +
@@ -38092,7 +38153,7 @@ exports[`Storyshots Views / Discounts / Sale create form errors 1`] = ` - Pricing + Discount Type
-
- - -
- USD + + + + - -
+ Percentage + + +
-

- Generic form error -

+
+
+
+
+ + Active Dates + +
+
+

-
- Time Frame -
-
- + +
+

+ Generic form error +

-

- Generic form error -

+ +
+ + +
+

+ Generic form error +

+
-
- -
- -
-

+ - Generic form error -

-
+ Set end date + +
@@ -38375,7 +38492,7 @@ exports[`Storyshots Views / Discounts / Sale create loading 1`] = ` - Pricing + Discount Type
-
- - -
- USD + + + + - -
+ Percentage + + +
+
+
+
+
+ + Active Dates + +
+
+

-
- Time Frame -
-
- + +
+
+
+ +
+ + +
-
- -
- -
-
+ + + Set end date + +
@@ -38645,7 +38826,7 @@ exports[`Storyshots Views / Discounts / Sale details collections 1`] = ` - Pricing + Discount Type
-
- - -
- % + + + + - -
-
-
-
-
-
-
- Time Frame -
-
- -
- - -
-
-
- -
- - + Fixed Amount + +
@@ -39046,6 +39164,130 @@ exports[`Storyshots Views / Discounts / Sale details collections 1`] = `
+
+
+
+ + Active Dates + +
+
+
+
+
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+
- Pricing + Discount Type
-
- - -
- % + + + + - -
-
-
-
-
-
-
- Time Frame -
-
- -
- - -
-
-
- -
- - + Fixed Amount + +
@@ -39638,6 +39817,130 @@ exports[`Storyshots Views / Discounts / Sale details default 1`] = `
+
+
+
+ + Active Dates + +
+
+
+
+
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+
- Pricing + Discount Type
-
- - -
- % + + + + - -
-
-

- Generic form error -

-
-
-
-
-
- Time Frame -
-
- -
- - -
-

- Generic form error -

-
-
- -
- - + Fixed Amount + +
-

- Generic form error -

@@ -40250,6 +40475,140 @@ exports[`Storyshots Views / Discounts / Sale details form errors 1`] = `
+
+
+
+ + Active Dates + +
+
+
+
+
+
+
+ +
+ + +
+

+ Generic form error +

+
+
+ +
+ + +
+

+ Generic form error +

+
+
+ +
+
- Pricing + Discount Type
-
- - -
- USD + + + + - -
-
-
-
-
-
-
- Time Frame -
-
- -
- - -
-
-
- -
- - + Fixed Amount + +
@@ -40865,6 +41162,132 @@ exports[`Storyshots Views / Discounts / Sale details loading 1`] = `
+
+
+
+ + Active Dates + +
+
+
+
+
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+
- Pricing + Discount Type
-
- - -
- % + + + + - -
-
-
-
-
-
-
- Time Frame -
-
- -
- - -
-
-
- -
- - + Fixed Amount + +
@@ -41757,6 +42117,130 @@ exports[`Storyshots Views / Discounts / Sale details products 1`] = `
+
+
+
+ + Active Dates + +
+
+
+
+
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+

-

-
+
-

+
-

+
-

-