Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Enable navigation from product to product type

dominik-zeglen1113f1ad2766
diff --git a/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx b/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx
index b787177ac0..64e658ce51 100644
--- a/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx
@@ -60,6 +60,7 @@ export const ProductVariants = decorate<ProductVariantsProps>(
classes,
variants,
fallbackPrice,
+ onAttributesEdit,
onRowClick,
onVariantAdd
}) => (
@@ -68,10 +69,9 @@ export const ProductVariants = decorate<ProductVariantsProps>(
title={i18n.t("Variants")}
toolbar={
<>
- {/* TODO: enable after adding attribute section */}
- {/* <Button onClick={onAttributesEdit} variant="flat" color="secondary">
+ <Button onClick={onAttributesEdit} variant="flat" color="secondary">
{i18n.t("Edit attributes")}
- </Button> */}
+ </Button>
<Button onClick={onVariantAdd} variant="flat" color="secondary">
{i18n.t("Add variant")}
</Button>
diff --git a/saleor/static/dashboard-next/products/views/ProductUpdate.tsx b/saleor/static/dashboard-next/products/views/ProductUpdate.tsx
index 3210ae03fe..189877c1ee 100644
--- a/saleor/static/dashboard-next/products/views/ProductUpdate.tsx
+++ b/saleor/static/dashboard-next/products/views/ProductUpdate.tsx
@@ -2,12 +2,12 @@ import * as React from "react";
import { arrayMove } from "react-sortable-hoc";
import * as placeholderImg from "../../../images/placeholder255x255.png";
-import { attributesListUrl } from "../../attributes";
import ErrorMessageCard from "../../components/ErrorMessageCard";
import Messages from "../../components/messages";
import Navigator from "../../components/Navigator";
import i18n from "../../i18n";
import { decimal } from "../../misc";
+import { productTypeDetailsUrl } from "../../productTypes";
import ProductUpdatePage from "../components/ProductUpdatePage";
import ProductUpdateOperations from "../containers/ProductUpdateOperations";
import {
@@ -143,7 +143,15 @@ export const ProductUpdate: React.StatelessComponent<ProductUpdateProps> = ({
? product.variants.edges.map(edge => edge.node)
: undefined
}
- onAttributesEdit={() => navigate(attributesListUrl)}
+ onAttributesEdit={() =>
+ navigate(
+ productTypeDetailsUrl(
+ encodeURIComponent(
+ data.product.productType.id
+ )
+ )
+ )
+ }
onBack={() => {
navigate(productListUrl);
}}
diff --git a/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap b/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap
index 2ddc717858..e0158ddc87 100644
--- a/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap
+++ b/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap
@@ -5842,1472 +5842,6 @@ exports[`Storyshots SiteSettings / Add key dialog default 1`] = `<div />`;
exports[`Storyshots SiteSettings / Add key dialog form errors 1`] = `<div />`;
-exports[`Storyshots Views / Attributes / Attribute details default 1`] = `
-<div>
- <form>
- <div
- class="Component-md-id"
- >
- <div
- class="Component-root-id"
- >
- <button
- class="MuiButtonBase-root-id MuiIconButton-root-id MuiIconButton-colorInherit-id Component-menuButton-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
- />
- </g>
- </svg>
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- <h2
- class="MuiTypography-root-id MuiTypography-title-id PageHeader-title-id"
- >
- generating
- </h2>
- <div
- class="Component-action-id"
- />
- </div>
- <div
- class="Component-root-id"
- >
- <div>
- <div
- class="MuiPaper-root-id MuiPaper-elevation1-id MuiPaper-rounded-id MuiCard-root-id"
- >
- <div
- class="MuiCardContent-root-id"
- >
- <div
- class="MuiFormControl-root-id MuiFormControl-fullWidth-id"
- >
- <label
- class="MuiFormLabel-root-id MuiFormLabel-filled-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-shrink-id"
- data-shrink="true"
- >
- Name
- </label>
- <div
- class="MuiInput-root-id MuiInput-fullWidth-id MuiInput-formControl-id MuiInput-underline-id"
- >
- <input
- aria-invalid="false"
- class="MuiInput-input-id"
- name="name"
- type="text"
- value="generating"
- />
- </div>
- </div>
- </div>
- </div>
- <div
- class="MuiPaper-root-id MuiPaper-elevation1-id MuiPaper-rounded-id MuiCard-root-id Component-root-id"
- >
- <div
- class="Component-root-id"
- >
- <span
- class="MuiTypography-root-id MuiTypography-body1-id Component-title-id"
- >
- Attribute values
- </span>
- <div
- class="Component-toolbar-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Add value
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- </div>
- </div>
- <div
- class="Component-children-id"
- />
- <hr
- class="Component-hr-id"
- />
- <table
- class="MuiTable-root-id"
- padding="default"
- >
- <thead
- class="MuiTableHead-root-id"
- >
- <tr
- class="MuiTableRow-root-id MuiTableRow-head-id"
- >
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id"
- scope="col"
- >
- Name
- </th>
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id Component-deleteIcon-id"
- scope="col"
- />
- </tr>
- </thead>
- <tbody
- class="MuiTableBody-root-id"
- >
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id Component-container-id"
- >
- <div>
- <span
- class="MuiTypography-root-id MuiTypography-caption-id Component-text-id"
- >
- Open-source
- </span>
- </div>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id Component-deleteIcon-id"
- >
- <button
- class="MuiButtonBase-root-id MuiIconButton-root-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
- />
- </g>
- </svg>
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id Component-container-id"
- >
- <div>
- <span
- class="MuiTypography-root-id MuiTypography-caption-id Component-text-id"
- >
- knowledge base
- </span>
- </div>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id Component-deleteIcon-id"
- >
- <button
- class="MuiButtonBase-root-id MuiIconButton-root-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
- />
- </g>
- </svg>
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id Component-container-id"
- >
- <div>
- <span
- class="MuiTypography-root-id MuiTypography-caption-id Component-text-id"
- >
- productize
- </span>
- </div>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id Component-deleteIcon-id"
- >
- <button
- class="MuiButtonBase-root-id MuiIconButton-root-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
- />
- </g>
- </svg>
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id Component-container-id"
- >
- <div>
- <span
- class="MuiTypography-root-id MuiTypography-caption-id Component-text-id"
- >
- Investment Account
- </span>
- </div>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id Component-deleteIcon-id"
- >
- <button
- class="MuiButtonBase-root-id MuiIconButton-root-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
- />
- </g>
- </svg>
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div
- class="Component-root-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButton-root-id MuiButton-contained-id MuiButton-raised-id Component-deleteButton-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Remove
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- <div
- class="Component-spacer-id"
- />
- <button
- class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-flat-id Component-cancelButton-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Cancel
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- <button
- class="MuiButtonBase-root-id MuiButtonBase-disabled-id MuiButton-root-id MuiButton-contained-id MuiButton-containedSecondary-id MuiButton-raised-id MuiButton-raisedSecondary-id MuiButton-disabled-id"
- disabled=""
- tabindex="-1"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Save
- </span>
- </button>
- </div>
- </div>
- </form>
-</div>
-`;
-
-exports[`Storyshots Views / Attributes / Attribute details when loading 1`] = `
-<div>
- <form>
- <div
- class="Component-md-id"
- >
- <div
- class="Component-root-id"
- >
- <button
- class="MuiButtonBase-root-id MuiIconButton-root-id MuiIconButton-colorInherit-id Component-menuButton-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
- />
- </g>
- </svg>
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- <h2
- class="MuiTypography-root-id MuiTypography-title-id PageHeader-title-id"
- >
- <span
- class="Skeleton-skeleton-id"
- style="width:10em"
- >
- ‌
- </span>
- </h2>
- <div
- class="Component-action-id"
- />
- </div>
- <div
- class="Component-root-id"
- >
- <div>
- <div
- class="MuiPaper-root-id MuiPaper-elevation1-id MuiPaper-rounded-id MuiCard-root-id"
- >
- <div
- class="MuiCardContent-root-id"
- >
- <div
- class="MuiFormControl-root-id MuiFormControl-fullWidth-id"
- >
- <label
- class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id"
- data-shrink="false"
- >
- Name
- </label>
- <div
- class="MuiInput-root-id MuiInput-disabled-id MuiInput-fullWidth-id MuiInput-formControl-id MuiInput-underline-id"
- >
- <input
- aria-invalid="false"
- class="MuiInput-input-id MuiInput-disabled-id"
- disabled=""
- name="name"
- type="text"
- />
- </div>
- </div>
- </div>
- </div>
- <div
- class="MuiPaper-root-id MuiPaper-elevation1-id MuiPaper-rounded-id MuiCard-root-id Component-root-id"
- >
- <div
- class="Component-root-id"
- >
- <span
- class="MuiTypography-root-id MuiTypography-body1-id Component-title-id"
- >
- Attribute values
- </span>
- <div
- class="Component-toolbar-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButtonBase-disabled-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiButton-disabled-id"
- disabled=""
- tabindex="-1"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Add value
- </span>
- </button>
- </div>
- </div>
- <div
- class="Component-children-id"
- />
- <hr
- class="Component-hr-id"
- />
- <table
- class="MuiTable-root-id"
- padding="default"
- >
- <thead
- class="MuiTableHead-root-id"
- >
- <tr
- class="MuiTableRow-root-id MuiTableRow-head-id"
- >
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id"
- scope="col"
- >
- Name
- </th>
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id Component-deleteIcon-id"
- scope="col"
- />
- </tr>
- </thead>
- <tbody
- class="MuiTableBody-root-id"
- >
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Skeleton-skeleton-id"
- >
- ‌
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id Component-deleteIcon-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButtonBase-disabled-id MuiIconButton-root-id MuiIconButton-disabled-id"
- disabled=""
- tabindex="-1"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
- />
- </g>
- </svg>
- </span>
- </button>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div
- class="Component-root-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButton-root-id MuiButton-contained-id MuiButton-raised-id Component-deleteButton-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Remove
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- <div
- class="Component-spacer-id"
- />
- <button
- class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-flat-id Component-cancelButton-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Cancel
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- <button
- class="MuiButtonBase-root-id MuiButtonBase-disabled-id MuiButton-root-id MuiButton-contained-id MuiButton-containedSecondary-id MuiButton-raised-id MuiButton-raisedSecondary-id MuiButton-disabled-id"
- disabled=""
- tabindex="-1"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Save
- </span>
- </button>
- </div>
- </div>
- </form>
-</div>
-`;
-
-exports[`Storyshots Views / Attributes / Attribute details when no values 1`] = `
-<div>
- <form>
- <div
- class="Component-md-id"
- >
- <div
- class="Component-root-id"
- >
- <button
- class="MuiButtonBase-root-id MuiIconButton-root-id MuiIconButton-colorInherit-id Component-menuButton-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
- />
- </g>
- </svg>
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- <h2
- class="MuiTypography-root-id MuiTypography-title-id PageHeader-title-id"
- >
- generating
- </h2>
- <div
- class="Component-action-id"
- />
- </div>
- <div
- class="Component-root-id"
- >
- <div>
- <div
- class="MuiPaper-root-id MuiPaper-elevation1-id MuiPaper-rounded-id MuiCard-root-id"
- >
- <div
- class="MuiCardContent-root-id"
- >
- <div
- class="MuiFormControl-root-id MuiFormControl-fullWidth-id"
- >
- <label
- class="MuiFormLabel-root-id MuiFormLabel-filled-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-shrink-id"
- data-shrink="true"
- >
- Name
- </label>
- <div
- class="MuiInput-root-id MuiInput-fullWidth-id MuiInput-formControl-id MuiInput-underline-id"
- >
- <input
- aria-invalid="false"
- class="MuiInput-input-id"
- name="name"
- type="text"
- value="generating"
- />
- </div>
- </div>
- </div>
- </div>
- <div
- class="MuiPaper-root-id MuiPaper-elevation1-id MuiPaper-rounded-id MuiCard-root-id Component-root-id"
- >
- <div
- class="Component-root-id"
- >
- <span
- class="MuiTypography-root-id MuiTypography-body1-id Component-title-id"
- >
- Attribute values
- </span>
- <div
- class="Component-toolbar-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Add value
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- </div>
- </div>
- <div
- class="Component-children-id"
- />
- <hr
- class="Component-hr-id"
- />
- <table
- class="MuiTable-root-id"
- padding="default"
- >
- <thead
- class="MuiTableHead-root-id"
- >
- <tr
- class="MuiTableRow-root-id MuiTableRow-head-id"
- >
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id"
- scope="col"
- >
- Name
- </th>
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id Component-deleteIcon-id"
- scope="col"
- />
- </tr>
- </thead>
- <tbody
- class="MuiTableBody-root-id"
- >
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- colspan="2"
- >
- No attribute values found
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div
- class="Component-root-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButton-root-id MuiButton-contained-id MuiButton-raised-id Component-deleteButton-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Remove
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- <div
- class="Component-spacer-id"
- />
- <button
- class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-flat-id Component-cancelButton-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Cancel
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- <button
- class="MuiButtonBase-root-id MuiButtonBase-disabled-id MuiButton-root-id MuiButton-contained-id MuiButton-containedSecondary-id MuiButton-raised-id MuiButton-raisedSecondary-id MuiButton-disabled-id"
- disabled=""
- tabindex="-1"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Save
- </span>
- </button>
- </div>
- </div>
- </form>
-</div>
-`;
-
-exports[`Storyshots Views / Attributes / Attribute list default 1`] = `
-<div>
- <div
- class="Component-md-id"
- >
- <div
- class="Component-root-id"
- >
- <h2
- class="MuiTypography-root-id MuiTypography-title-id PageHeader-title-id"
- >
- Attributes
- </h2>
- <div
- class="Component-action-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButton-root-id MuiButton-contained-id MuiButton-containedSecondary-id MuiButton-raised-id MuiButton-raisedSecondary-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Add attribute
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- </div>
- </div>
- <div
- class="MuiPaper-root-id MuiPaper-elevation1-id MuiPaper-rounded-id MuiCard-root-id"
- >
- <table
- class="MuiTable-root-id"
- padding="default"
- >
- <thead
- class="MuiTableHead-root-id"
- >
- <tr
- class="MuiTableRow-root-id MuiTableRow-head-id"
- >
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id"
- scope="col"
- >
- Name
- </th>
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id"
- scope="col"
- >
- Values
- </th>
- </tr>
- </thead>
- <tfoot
- class="MuiTableFooter-root-id"
- >
- <tr
- class="MuiTableRow-root-id MuiTableRow-footer-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-footer-id TablePagination-root-id"
- colspan="2"
- >
- <div
- class="MuiToolbar-root-id MuiToolbar-regular-id MuiToolbar-gutters-id TablePagination-toolbar-id"
- >
- <div
- class="TablePagination-spacer-id"
- />
- <div
- class="TablePaginationActions-root-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButtonBase-disabled-id MuiIconButton-root-id MuiIconButton-disabled-id"
- disabled=""
- tabindex="-1"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"
- />
- </svg>
- </span>
- </button>
- <button
- class="MuiButtonBase-root-id MuiIconButton-root-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"
- />
- </svg>
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- </div>
- </div>
- </td>
- </tr>
- </tfoot>
- <tbody
- class="MuiTableBody-root-id"
- >
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Component-link-id"
- >
- generating
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- Open-source, knowledge base, productize, Investment Account
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Component-link-id"
- >
- Buckinghamshire
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- sky blue
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Component-link-id"
- >
- connecting
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- Licensed, secured line, implementation
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Component-link-id"
- >
- Vietnam
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- 24 hour, online, sexy, grid-enabled
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Component-link-id"
- >
- Product
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- synergize, object-oriented
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Component-link-id"
- >
- core
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- Usability, Mount, Camp
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Component-link-id"
- >
- application
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- SMS, Steel, Investment Account
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Component-link-id"
- >
- Berkshire
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- Computers, Lead, Road, Future
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Component-link-id"
- >
- bypass
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- system, teal, Cloned, internet solution, pixel
- </td>
- </tr>
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Component-link-id"
- >
- web-readiness
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- magnetic, Triple-buffered, Berkshire
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
-</div>
-`;
-
-exports[`Storyshots Views / Attributes / Attribute list loading 1`] = `
-<div>
- <div
- class="Component-md-id"
- >
- <div
- class="Component-root-id"
- >
- <h2
- class="MuiTypography-root-id MuiTypography-title-id PageHeader-title-id"
- >
- Attributes
- </h2>
- <div
- class="Component-action-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButtonBase-disabled-id MuiButton-root-id MuiButton-contained-id MuiButton-containedSecondary-id MuiButton-raised-id MuiButton-raisedSecondary-id MuiButton-disabled-id"
- disabled=""
- tabindex="-1"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Add attribute
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- </button>
- </div>
- </div>
- <div
- class="MuiPaper-root-id MuiPaper-elevation1-id MuiPaper-rounded-id MuiCard-root-id"
- >
- <table
- class="MuiTable-root-id"
- padding="default"
- >
- <thead
- class="MuiTableHead-root-id"
- >
- <tr
- class="MuiTableRow-root-id MuiTableRow-head-id"
- >
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id"
- scope="col"
- >
- Name
- </th>
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id"
- scope="col"
- >
- Values
- </th>
- </tr>
- </thead>
- <tfoot
- class="MuiTableFooter-root-id"
- >
- <tr
- class="MuiTableRow-root-id MuiTableRow-footer-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-footer-id TablePagination-root-id"
- colspan="2"
- >
- <div
- class="MuiToolbar-root-id MuiToolbar-regular-id MuiToolbar-gutters-id TablePagination-toolbar-id"
- >
- <div
- class="TablePagination-spacer-id"
- />
- <div
- class="TablePaginationActions-root-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButtonBase-disabled-id MuiIconButton-root-id MuiIconButton-disabled-id"
- disabled=""
- tabindex="-1"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"
- />
- </svg>
- </span>
- </button>
- <button
- class="MuiButtonBase-root-id MuiButtonBase-disabled-id MuiIconButton-root-id MuiIconButton-disabled-id"
- disabled=""
- tabindex="-1"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"
- />
- </svg>
- </span>
- </button>
- </div>
- </div>
- </td>
- </tr>
- </tfoot>
- <tbody
- class="MuiTableBody-root-id"
- >
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Skeleton-skeleton-id"
- >
- ‌
- </span>
- </td>
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- >
- <span
- class="Skeleton-skeleton-id"
- >
- ‌
- </span>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
-</div>
-`;
-
-exports[`Storyshots Views / Attributes / Attribute list no data 1`] = `
-<div>
- <div
- class="Component-md-id"
- >
- <div
- class="Component-root-id"
- >
- <h2
- class="MuiTypography-root-id MuiTypography-title-id PageHeader-title-id"
- >
- Attributes
- </h2>
- <div
- class="Component-action-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButton-root-id MuiButton-contained-id MuiButton-containedSecondary-id MuiButton-raised-id MuiButton-raisedSecondary-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiButton-label-id"
- >
- Add attribute
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- </div>
- </div>
- <div
- class="MuiPaper-root-id MuiPaper-elevation1-id MuiPaper-rounded-id MuiCard-root-id"
- >
- <table
- class="MuiTable-root-id"
- padding="default"
- >
- <thead
- class="MuiTableHead-root-id"
- >
- <tr
- class="MuiTableRow-root-id MuiTableRow-head-id"
- >
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id"
- scope="col"
- >
- Name
- </th>
- <th
- class="MuiTableCell-root-id MuiTableCell-head-id"
- scope="col"
- >
- Values
- </th>
- </tr>
- </thead>
- <tfoot
- class="MuiTableFooter-root-id"
- >
- <tr
- class="MuiTableRow-root-id MuiTableRow-footer-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-footer-id TablePagination-root-id"
- colspan="2"
- >
- <div
- class="MuiToolbar-root-id MuiToolbar-regular-id MuiToolbar-gutters-id TablePagination-toolbar-id"
- >
- <div
- class="TablePagination-spacer-id"
- />
- <div
- class="TablePaginationActions-root-id"
- >
- <button
- class="MuiButtonBase-root-id MuiButtonBase-disabled-id MuiIconButton-root-id MuiIconButton-disabled-id"
- disabled=""
- tabindex="-1"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"
- />
- </svg>
- </span>
- </button>
- <button
- class="MuiButtonBase-root-id MuiIconButton-root-id"
- tabindex="0"
- type="button"
- >
- <span
- class="MuiIconButton-label-id"
- >
- <svg
- aria-hidden="true"
- class="MuiSvgIcon-root-id"
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"
- />
- </svg>
- </span>
- <span
- class="MuiTouchRipple-root-id"
- />
- </button>
- </div>
- </div>
- </td>
- </tr>
- </tfoot>
- <tbody
- class="MuiTableBody-root-id"
- >
- <tr
- class="MuiTableRow-root-id"
- >
- <td
- class="MuiTableCell-root-id MuiTableCell-body-id"
- colspan="2"
- >
- No attributes found
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
-</div>
-`;
-
exports[`Storyshots Views / Authentication / Log in default 1`] = `
<div>
<form>
@@ -34998,6 +33532,20 @@ exports[`Storyshots Views / Products / Product edit when data is fully loaded 1`
<div
class="Component-toolbar-id"
>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Edit attributes
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
<button
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id"
tabindex="0"
@@ -36755,6 +35303,20 @@ exports[`Storyshots Views / Products / Product edit when product has no images 1
<div
class="Component-toolbar-id"
>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Edit attributes
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
<button
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id"
tabindex="0"
diff --git a/saleor/static/dashboard-next/storybook/config.js b/saleor/static/dashboard-next/storybook/config.js
index 2847866e9e..46c9fcc101 100644
--- a/saleor/static/dashboard-next/storybook/config.js
+++ b/saleor/static/dashboard-next/storybook/config.js
@@ -28,10 +28,6 @@ function loadStories() {
require("./stories/components/Timeline");
require("./stories/components/messages");
- // Attributes
- require("./stories/attributes/AttributeDetailsPage");
- require("./stories/attributes/AttributeListPage");
-
// Authentication
require("./stories/auth/LoginPage");
require("./stories/auth/LoginLoading");
diff --git a/saleor/static/dashboard-next/storybook/stories/attributes/AttributeDetailsPage.tsx b/saleor/static/dashboard-next/storybook/stories/attributes/AttributeDetailsPage.tsx
deleted file mode 100644
index 2317d257f5..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/attributes/AttributeDetailsPage.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import AttributeDetailsPage from "../../../attributes/components/AttributeDetailsPage";
-import { attributes } from "../../../attributes/fixtures";
-import Decorator from "../../Decorator";
-
-storiesOf("Views / Attributes / Attribute details", module)
- .addDecorator(Decorator)
- .add("default", () => (
- <AttributeDetailsPage
- attribute={attributes[0]}
- disabled={false}
- saveButtonBarState="default"
- onBack={() => undefined}
- onDelete={undefined}
- onSubmit={() => undefined}
- />
- ))
- .add("when loading", () => (
- <AttributeDetailsPage
- disabled={true}
- saveButtonBarState="default"
- onBack={() => undefined}
- onDelete={undefined}
- onSubmit={() => undefined}
- />
- ))
- .add("when no values", () => (
- <AttributeDetailsPage
- attribute={{
- id: attributes[0].id,
- name: attributes[0].name,
- values: []
- }}
- disabled={false}
- saveButtonBarState="default"
- onBack={() => undefined}
- onDelete={undefined}
- onSubmit={() => undefined}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/attributes/AttributeListPage.tsx b/saleor/static/dashboard-next/storybook/stories/attributes/AttributeListPage.tsx
deleted file mode 100644
index 811910819f..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/attributes/AttributeListPage.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import AttributeListPage from "../../../attributes/components/AttributeListPage";
-import { attributes } from "../../../attributes/fixtures";
-import { pageListProps } from "../../../fixtures";
-import Decorator from "../../Decorator";
-
-storiesOf("Views / Attributes / Attribute list", module)
- .addDecorator(Decorator)
- .add("default", () => (
- <AttributeListPage attributes={attributes} {...pageListProps.default} />
- ))
- .add("loading", () => <AttributeListPage {...pageListProps.loading} />)
- .add("no data", () => (
- <AttributeListPage attributes={[]} {...pageListProps.default} />
- ));