Fix subcategory creation (#2041)
* Fix subcategory create button didn't use Button from dashboard * Update snapshots
This commit is contained in:
parent
9cf555d740
commit
66bfd1a32d
4 changed files with 126 additions and 180 deletions
|
@ -1,6 +1,11 @@
|
||||||
import { Card } from "@material-ui/core";
|
import { Card } from "@material-ui/core";
|
||||||
import { categoryListUrl, categoryUrl } from "@saleor/categories/urls";
|
import {
|
||||||
|
categoryAddUrl,
|
||||||
|
categoryListUrl,
|
||||||
|
categoryUrl
|
||||||
|
} from "@saleor/categories/urls";
|
||||||
import { Backlink } from "@saleor/components/Backlink";
|
import { Backlink } from "@saleor/components/Backlink";
|
||||||
|
import { Button } from "@saleor/components/Button";
|
||||||
import { CardSpacer } from "@saleor/components/CardSpacer";
|
import { CardSpacer } from "@saleor/components/CardSpacer";
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import Container from "@saleor/components/Container";
|
import Container from "@saleor/components/Container";
|
||||||
|
@ -13,7 +18,7 @@ import { CategoryDetailsQuery, ProductErrorFragment } from "@saleor/graphql";
|
||||||
import { SubmitPromise } from "@saleor/hooks/useForm";
|
import { SubmitPromise } from "@saleor/hooks/useForm";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { Button, ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
import { ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -32,6 +37,7 @@ export enum CategoryPageTab {
|
||||||
|
|
||||||
export interface CategoryUpdatePageProps
|
export interface CategoryUpdatePageProps
|
||||||
extends TabListActions<"productListToolbar" | "subcategoryListToolbar"> {
|
extends TabListActions<"productListToolbar" | "subcategoryListToolbar"> {
|
||||||
|
categoryId: string;
|
||||||
changeTab: (index: CategoryPageTab) => void;
|
changeTab: (index: CategoryPageTab) => void;
|
||||||
currentTab: CategoryPageTab;
|
currentTab: CategoryPageTab;
|
||||||
errors: ProductErrorFragment[];
|
errors: ProductErrorFragment[];
|
||||||
|
@ -45,7 +51,6 @@ export interface CategoryUpdatePageProps
|
||||||
};
|
};
|
||||||
saveButtonBarState: ConfirmButtonTransitionState;
|
saveButtonBarState: ConfirmButtonTransitionState;
|
||||||
addProductHref: string;
|
addProductHref: string;
|
||||||
addCategoryHref: string;
|
|
||||||
onImageDelete: () => void;
|
onImageDelete: () => void;
|
||||||
onSubmit: (data: CategoryUpdateData) => SubmitPromise;
|
onSubmit: (data: CategoryUpdateData) => SubmitPromise;
|
||||||
onImageUpload(file: File);
|
onImageUpload(file: File);
|
||||||
|
@ -58,6 +63,7 @@ const CategoriesTab = Tab(CategoryPageTab.categories);
|
||||||
const ProductsTab = Tab(CategoryPageTab.products);
|
const ProductsTab = Tab(CategoryPageTab.products);
|
||||||
|
|
||||||
export const CategoryUpdatePage: React.FC<CategoryUpdatePageProps> = ({
|
export const CategoryUpdatePage: React.FC<CategoryUpdatePageProps> = ({
|
||||||
|
categoryId,
|
||||||
changeTab,
|
changeTab,
|
||||||
currentTab,
|
currentTab,
|
||||||
category,
|
category,
|
||||||
|
@ -67,7 +73,6 @@ export const CategoryUpdatePage: React.FC<CategoryUpdatePageProps> = ({
|
||||||
products,
|
products,
|
||||||
saveButtonBarState,
|
saveButtonBarState,
|
||||||
subcategories,
|
subcategories,
|
||||||
addCategoryHref,
|
|
||||||
onDelete,
|
onDelete,
|
||||||
onNextPage,
|
onNextPage,
|
||||||
onPreviousPage,
|
onPreviousPage,
|
||||||
|
@ -171,7 +176,7 @@ export const CategoryUpdatePage: React.FC<CategoryUpdatePageProps> = ({
|
||||||
toolbar={
|
toolbar={
|
||||||
<Button
|
<Button
|
||||||
variant="tertiary"
|
variant="tertiary"
|
||||||
href={addCategoryHref}
|
href={categoryAddUrl(categoryId)}
|
||||||
data-test-id="create-subcategory"
|
data-test-id="create-subcategory"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
|
|
@ -39,7 +39,6 @@ import {
|
||||||
} from "../components/CategoryUpdatePage/CategoryUpdatePage";
|
} from "../components/CategoryUpdatePage/CategoryUpdatePage";
|
||||||
import { CategoryUpdateData } from "../components/CategoryUpdatePage/form";
|
import { CategoryUpdateData } from "../components/CategoryUpdatePage/form";
|
||||||
import {
|
import {
|
||||||
categoryAddUrl,
|
|
||||||
categoryListUrl,
|
categoryListUrl,
|
||||||
categoryUrl,
|
categoryUrl,
|
||||||
CategoryUrlDialog,
|
CategoryUrlDialog,
|
||||||
|
@ -212,12 +211,12 @@ export const CategoryDetails: React.FC<CategoryDetailsProps> = ({
|
||||||
<>
|
<>
|
||||||
<WindowTitle title={maybe(() => data.category.name)} />
|
<WindowTitle title={maybe(() => data.category.name)} />
|
||||||
<CategoryUpdatePage
|
<CategoryUpdatePage
|
||||||
|
categoryId={id}
|
||||||
changeTab={changeTab}
|
changeTab={changeTab}
|
||||||
currentTab={activeTab}
|
currentTab={activeTab}
|
||||||
category={maybe(() => data.category)}
|
category={maybe(() => data.category)}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
errors={updateResult.data?.categoryUpdate.errors || []}
|
errors={updateResult.data?.categoryUpdate.errors || []}
|
||||||
addCategoryHref={categoryAddUrl(id)}
|
|
||||||
addProductHref={productAddUrl()}
|
addProductHref={productAddUrl()}
|
||||||
onDelete={() => openModal("delete")}
|
onDelete={() => openModal("delete")}
|
||||||
onImageDelete={() =>
|
onImageDelete={() =>
|
||||||
|
|
|
@ -40772,19 +40772,20 @@ exports[`Storyshots Views / Categories / Update category default 1`] = `
|
||||||
<div
|
<div
|
||||||
class="MuiCardHeader-action-id"
|
class="MuiCardHeader-action-id"
|
||||||
>
|
>
|
||||||
<button
|
<a
|
||||||
|
aria-disabled="false"
|
||||||
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
data-test-id="create-subcategory"
|
data-test-id="create-subcategory"
|
||||||
href=""
|
href="/categories/123/add"
|
||||||
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
type="button"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="MuiButton-label-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
Create subcategory
|
Create subcategory
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -41548,19 +41549,20 @@ exports[`Storyshots Views / Categories / Update category form errors 1`] = `
|
||||||
<div
|
<div
|
||||||
class="MuiCardHeader-action-id"
|
class="MuiCardHeader-action-id"
|
||||||
>
|
>
|
||||||
<button
|
<a
|
||||||
|
aria-disabled="false"
|
||||||
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
data-test-id="create-subcategory"
|
data-test-id="create-subcategory"
|
||||||
href=""
|
href="/categories/123/add"
|
||||||
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
type="button"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="MuiButton-label-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
Create subcategory
|
Create subcategory
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -42076,19 +42078,20 @@ exports[`Storyshots Views / Categories / Update category loading 1`] = `
|
||||||
<div
|
<div
|
||||||
class="MuiCardHeader-action-id"
|
class="MuiCardHeader-action-id"
|
||||||
>
|
>
|
||||||
<button
|
<a
|
||||||
|
aria-disabled="false"
|
||||||
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
data-test-id="create-subcategory"
|
data-test-id="create-subcategory"
|
||||||
href=""
|
href="/categories/123/add"
|
||||||
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
type="button"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="MuiButton-label-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
Create subcategory
|
Create subcategory
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -42894,19 +42897,20 @@ exports[`Storyshots Views / Categories / Update category no background 1`] = `
|
||||||
<div
|
<div
|
||||||
class="MuiCardHeader-action-id"
|
class="MuiCardHeader-action-id"
|
||||||
>
|
>
|
||||||
<button
|
<a
|
||||||
|
aria-disabled="false"
|
||||||
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
data-test-id="create-subcategory"
|
data-test-id="create-subcategory"
|
||||||
href=""
|
href="/categories/123/add"
|
||||||
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
type="button"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="MuiButton-label-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
Create subcategory
|
Create subcategory
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -44435,19 +44439,20 @@ exports[`Storyshots Views / Categories / Update category no subcategories 1`] =
|
||||||
<div
|
<div
|
||||||
class="MuiCardHeader-action-id"
|
class="MuiCardHeader-action-id"
|
||||||
>
|
>
|
||||||
<button
|
<a
|
||||||
|
aria-disabled="false"
|
||||||
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
data-test-id="create-subcategory"
|
data-test-id="create-subcategory"
|
||||||
href=""
|
href="/categories/123/add"
|
||||||
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
type="button"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="MuiButton-label-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
Create subcategory
|
Create subcategory
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -183365,36 +183370,22 @@ exports[`Storyshots Views / Products / Create product variant add first variant
|
||||||
class="MuiTableRow-root-id MuiTableRow-hover-id"
|
class="MuiTableRow-root-id MuiTableRow-hover-id"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id TableCellAvatar-root-id ProductVariantNavigation-colAvatar-id ProductVariantNavigation-tabActive-id ProductVariantNavigation-noHandle-id ProductVariantNavigation-firstVariant-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
colspan="2"
|
colspan="3"
|
||||||
data-test-id="table-cell-avatar"
|
|
||||||
>
|
>
|
||||||
<div
|
<a
|
||||||
class="Avatar-content-id Avatar-alignRight-id"
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
|
href="/products/variant/add"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<div
|
<span
|
||||||
class="MuiAvatar-root-id MuiAvatar-circle-id Avatar-avatar-id MuiAvatar-colorDefault-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
<svg
|
Add variant
|
||||||
aria-hidden="true"
|
</span>
|
||||||
class="MuiSvgIcon-root-id MuiSvgIcon-colorPrimary-id"
|
</a>
|
||||||
focusable="false"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
clip-rule="evenodd"
|
|
||||||
d="M2 5C2 3.34315 3.34315 2 5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5ZM5 4C4.44772 4 4 4.44772 4 5V15.7962L11.0456 9.63136L12.5 11.0858L16 7.58579L20 11.5858V5C20 4.44772 19.5523 4 19 4H5ZM20 14.4142L16 10.4142L12.5 13.9142L10.9544 12.3686L4 18.4538V19C4 19.5523 4.44772 20 5 20H19C19.5523 20 20 19.5523 20 19V14.4142Z"
|
|
||||||
fill="currentColor"
|
|
||||||
fill-rule="evenodd"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
|
|
||||||
>
|
|
||||||
New Variant
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -184430,36 +184421,22 @@ exports[`Storyshots Views / Products / Create product variant default 1`] = `
|
||||||
class="MuiTableRow-root-id MuiTableRow-hover-id"
|
class="MuiTableRow-root-id MuiTableRow-hover-id"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id TableCellAvatar-root-id ProductVariantNavigation-colAvatar-id ProductVariantNavigation-tabActive-id ProductVariantNavigation-noHandle-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
colspan="2"
|
colspan="3"
|
||||||
data-test-id="table-cell-avatar"
|
|
||||||
>
|
>
|
||||||
<div
|
<a
|
||||||
class="Avatar-content-id Avatar-alignRight-id"
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
|
href="/products/variant/add"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<div
|
<span
|
||||||
class="MuiAvatar-root-id MuiAvatar-circle-id Avatar-avatar-id MuiAvatar-colorDefault-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
<svg
|
Add variant
|
||||||
aria-hidden="true"
|
</span>
|
||||||
class="MuiSvgIcon-root-id MuiSvgIcon-colorPrimary-id"
|
</a>
|
||||||
focusable="false"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
clip-rule="evenodd"
|
|
||||||
d="M2 5C2 3.34315 3.34315 2 5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5ZM5 4C4.44772 4 4 4.44772 4 5V15.7962L11.0456 9.63136L12.5 11.0858L16 7.58579L20 11.5858V5C20 4.44772 19.5523 4 19 4H5ZM20 14.4142L16 10.4142L12.5 13.9142L10.9544 12.3686L4 18.4538V19C4 19.5523 4.44772 20 5 20H19C19.5523 20 20 19.5523 20 19V14.4142Z"
|
|
||||||
fill="currentColor"
|
|
||||||
fill-rule="evenodd"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
|
|
||||||
>
|
|
||||||
New Variant
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -185495,36 +185472,22 @@ exports[`Storyshots Views / Products / Create product variant no warehouses 1`]
|
||||||
class="MuiTableRow-root-id MuiTableRow-hover-id"
|
class="MuiTableRow-root-id MuiTableRow-hover-id"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id TableCellAvatar-root-id ProductVariantNavigation-colAvatar-id ProductVariantNavigation-tabActive-id ProductVariantNavigation-noHandle-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
colspan="2"
|
colspan="3"
|
||||||
data-test-id="table-cell-avatar"
|
|
||||||
>
|
>
|
||||||
<div
|
<a
|
||||||
class="Avatar-content-id Avatar-alignRight-id"
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
|
href="/products/variant/add"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<div
|
<span
|
||||||
class="MuiAvatar-root-id MuiAvatar-circle-id Avatar-avatar-id MuiAvatar-colorDefault-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
<svg
|
Add variant
|
||||||
aria-hidden="true"
|
</span>
|
||||||
class="MuiSvgIcon-root-id MuiSvgIcon-colorPrimary-id"
|
</a>
|
||||||
focusable="false"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
clip-rule="evenodd"
|
|
||||||
d="M2 5C2 3.34315 3.34315 2 5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5ZM5 4C4.44772 4 4 4.44772 4 5V15.7962L11.0456 9.63136L12.5 11.0858L16 7.58579L20 11.5858V5C20 4.44772 19.5523 4 19 4H5ZM20 14.4142L16 10.4142L12.5 13.9142L10.9544 12.3686L4 18.4538V19C4 19.5523 4.44772 20 5 20H19C19.5523 20 20 19.5523 20 19V14.4142Z"
|
|
||||||
fill="currentColor"
|
|
||||||
fill-rule="evenodd"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
|
|
||||||
>
|
|
||||||
New Variant
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -186438,36 +186401,22 @@ exports[`Storyshots Views / Products / Create product variant when loading data
|
||||||
class="MuiTableRow-root-id MuiTableRow-hover-id"
|
class="MuiTableRow-root-id MuiTableRow-hover-id"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id TableCellAvatar-root-id ProductVariantNavigation-colAvatar-id ProductVariantNavigation-tabActive-id ProductVariantNavigation-noHandle-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
colspan="2"
|
colspan="3"
|
||||||
data-test-id="table-cell-avatar"
|
|
||||||
>
|
>
|
||||||
<div
|
<a
|
||||||
class="Avatar-content-id Avatar-alignRight-id"
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
|
href="/products/variant/add"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<div
|
<span
|
||||||
class="MuiAvatar-root-id MuiAvatar-circle-id Avatar-avatar-id MuiAvatar-colorDefault-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
<svg
|
Add variant
|
||||||
aria-hidden="true"
|
</span>
|
||||||
class="MuiSvgIcon-root-id MuiSvgIcon-colorPrimary-id"
|
</a>
|
||||||
focusable="false"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
clip-rule="evenodd"
|
|
||||||
d="M2 5C2 3.34315 3.34315 2 5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5ZM5 4C4.44772 4 4 4.44772 4 5V15.7962L11.0456 9.63136L12.5 11.0858L16 7.58579L20 11.5858V5C20 4.44772 19.5523 4 19 4H5ZM20 14.4142L16 10.4142L12.5 13.9142L10.9544 12.3686L4 18.4538V19C4 19.5523 4.44772 20 5 20H19C19.5523 20 20 19.5523 20 19V14.4142Z"
|
|
||||||
fill="currentColor"
|
|
||||||
fill-rule="evenodd"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
|
|
||||||
>
|
|
||||||
New Variant
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -187373,36 +187322,22 @@ exports[`Storyshots Views / Products / Create product variant with errors 1`] =
|
||||||
class="MuiTableRow-root-id MuiTableRow-hover-id"
|
class="MuiTableRow-root-id MuiTableRow-hover-id"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id TableCellAvatar-root-id ProductVariantNavigation-colAvatar-id ProductVariantNavigation-tabActive-id ProductVariantNavigation-noHandle-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
colspan="2"
|
colspan="3"
|
||||||
data-test-id="table-cell-avatar"
|
|
||||||
>
|
>
|
||||||
<div
|
<a
|
||||||
class="Avatar-content-id Avatar-alignRight-id"
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
|
href="/products/variant/add"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<div
|
<span
|
||||||
class="MuiAvatar-root-id MuiAvatar-circle-id Avatar-avatar-id MuiAvatar-colorDefault-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
<svg
|
Add variant
|
||||||
aria-hidden="true"
|
</span>
|
||||||
class="MuiSvgIcon-root-id MuiSvgIcon-colorPrimary-id"
|
</a>
|
||||||
focusable="false"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
clip-rule="evenodd"
|
|
||||||
d="M2 5C2 3.34315 3.34315 2 5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5ZM5 4C4.44772 4 4 4.44772 4 5V15.7962L11.0456 9.63136L12.5 11.0858L16 7.58579L20 11.5858V5C20 4.44772 19.5523 4 19 4H5ZM20 14.4142L16 10.4142L12.5 13.9142L10.9544 12.3686L4 18.4538V19C4 19.5523 4.44772 20 5 20H19C19.5523 20 20 19.5523 20 19V14.4142Z"
|
|
||||||
fill="currentColor"
|
|
||||||
fill-rule="evenodd"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td
|
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
|
|
||||||
>
|
|
||||||
New Variant
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -224208,17 +224143,19 @@ exports[`Storyshots Views / Products / Product variant details attribute errors
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
colspan="3"
|
colspan="3"
|
||||||
>
|
>
|
||||||
<button
|
<a
|
||||||
|
aria-disabled="false"
|
||||||
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
|
href="/products/variant/add"
|
||||||
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
type="button"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="MuiButton-label-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
Add variant
|
Add variant
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -226127,17 +226064,19 @@ exports[`Storyshots Views / Products / Product variant details no warehouses 1`]
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
colspan="3"
|
colspan="3"
|
||||||
>
|
>
|
||||||
<button
|
<a
|
||||||
|
aria-disabled="false"
|
||||||
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
|
href="/products/variant/add"
|
||||||
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
type="button"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="MuiButton-label-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
Add variant
|
Add variant
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -228036,17 +227975,19 @@ exports[`Storyshots Views / Products / Product variant details when loaded data
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
colspan="3"
|
colspan="3"
|
||||||
>
|
>
|
||||||
<button
|
<a
|
||||||
|
aria-disabled="false"
|
||||||
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
|
href="/products/variant/add"
|
||||||
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
type="button"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="MuiButton-label-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
Add variant
|
Add variant
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -229807,17 +229748,19 @@ exports[`Storyshots Views / Products / Product variant details when loading data
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
colspan="3"
|
colspan="3"
|
||||||
>
|
>
|
||||||
<button
|
<a
|
||||||
|
aria-disabled="false"
|
||||||
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-outlined-id MuiButton-outlinedPrimary-id MuiButton-outlinedSizeSmall-id MuiButton-sizeSmall-id"
|
||||||
|
href="/products/variant/add"
|
||||||
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
type="button"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="MuiButton-label-id"
|
class="MuiButton-label-id"
|
||||||
>
|
>
|
||||||
Add variant
|
Add variant
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -229894,12 +229837,11 @@ exports[`Storyshots Views / Products / Product variant details when loading data
|
||||||
<div
|
<div
|
||||||
class="ProductVariantMedia-root-id"
|
class="ProductVariantMedia-root-id"
|
||||||
>
|
>
|
||||||
<span
|
<div
|
||||||
class="Skeleton-skeleton-id"
|
class="MuiTypography-root-id ProductVariantMedia-helpText-id MuiTypography-body1-id"
|
||||||
data-test-id="skeleton"
|
|
||||||
>
|
>
|
||||||
|
Select a specific variant media from product media
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -16,11 +16,11 @@ const category = categoryFixture(placeholderImage);
|
||||||
|
|
||||||
const updateProps: Omit<CategoryUpdatePageProps, "classes"> = {
|
const updateProps: Omit<CategoryUpdatePageProps, "classes"> = {
|
||||||
category,
|
category,
|
||||||
|
categoryId: "123",
|
||||||
changeTab: undefined,
|
changeTab: undefined,
|
||||||
currentTab: CategoryPageTab.categories,
|
currentTab: CategoryPageTab.categories,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
errors: [],
|
errors: [],
|
||||||
addCategoryHref: "",
|
|
||||||
addProductHref: "",
|
addProductHref: "",
|
||||||
onDelete: () => undefined,
|
onDelete: () => undefined,
|
||||||
onImageDelete: () => undefined,
|
onImageDelete: () => undefined,
|
||||||
|
|
Loading…
Reference in a new issue