Skip to content

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

Add order pages (#2177)

Dominik Żegleń46259417a230
diff --git a/package-lock.json b/package-lock.json
index 2c021703d6..de318e88ed 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8200,6 +8200,15 @@
"subarg": "^1.0.0"
}
},
+ "crc-32": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz",
+ "integrity": "sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA==",
+ "requires": {
+ "exit-on-epipe": "1.0.1",
+ "printj": "1.1.2"
+ }
+ },
"create-ecdh": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
@@ -9170,6 +9179,11 @@
"dotenv": "^5.0.1"
}
},
+ "downshift": {
+ "version": "1.31.14",
+ "resolved": "https://registry.npmjs.org/downshift/-/downshift-1.31.14.tgz",
+ "integrity": "sha512-KguEqOCAykRVkBG8kB1YMOf4RWolupoUMW3cv6VLVBQw+yOB1BrROX4MbUoCqDaj9vBZS7DNqz7VBqfM4x3dsg=="
+ },
"drip": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/drip/-/drip-1.1.0.tgz",
@@ -10138,6 +10152,11 @@
"integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=",
"dev": true
},
+ "exit-on-epipe": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz",
+ "integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw=="
+ },
"expand-brackets": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
@@ -17136,6 +17155,11 @@
"hoist-non-react-statics": "^2.3.1"
}
},
+ "moment": {
+ "version": "2.22.1",
+ "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.1.tgz",
+ "integrity": "sha512-shJkRTSebXvsVqk56I+lkb2latjBs8I+pc2TzWc545y2iFnSjm7Wg0QMh+ZWcdSLQyGEau5jI8ocnmkyTgr9YQ=="
+ },
"move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
@@ -20361,6 +20385,11 @@
}
}
},
+ "printj": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz",
+ "integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ=="
+ },
"private": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
diff --git a/package.json b/package.json
index bc28fb1bc9..34e2a21ecd 100644
--- a/package.json
+++ b/package.json
@@ -27,7 +27,9 @@
"apollo-upload-client": "^8.0.0",
"bootstrap": "4.0.0",
"classnames": "^2.2.5",
+ "crc-32": "^1.2.0",
"detect-passive-events": "^1.0.4",
+ "downshift": "^1.31.14",
"dropzone": "^5.2.0",
"graphql": "^0.13.2",
"graphql-tag": "^2.6.1",
@@ -38,6 +40,7 @@
"jquery": "^3.1.1",
"jquery.cookie": "^1.4.1",
"jss": "^9.8.1",
+ "keycode": "^2.2.0",
"lazysizes": "^4.0.1",
"lodash": "^4.17.5",
"material-ui": "^1.0.0-beta.42",
@@ -45,6 +48,7 @@
"medium-editor": "^5.23.3",
"mobx": "^3.0.2",
"mobx-react": "^4.1.0",
+ "moment": "^2.22.1",
"popper.js": "^1.14.1",
"prop-types": "^15.6.0",
"qs": "^6.5.1",
diff --git a/saleor/static/dashboard-next/category/components/CategoryBaseForm/CategoryBaseForm.test.tsx b/saleor/static/dashboard-next/category/components/CategoryBaseForm/CategoryBaseForm.test.tsx
deleted file mode 100644
index 391415a0fc..0000000000
--- a/saleor/static/dashboard-next/category/components/CategoryBaseForm/CategoryBaseForm.test.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import * as React from "react";
-import { MemoryRouter } from "react-router-dom";
-import * as renderer from "react-test-renderer";
-
-import CategoryBaseForm from "./CategoryBaseForm";
-
-const category = {
- description:
- "Across pressure PM food discover recognize. Send letter reach listen. Quickly work plan rule.\nTell lose part purpose do when. Whatever drug contain particularly defense.",
- name: "Apparel"
-};
-const errors = [
- {
- field: "name",
- message: "To pole jest wymagane."
- }
-];
-
-describe("<CategoryBaseForm />", () => {
- it("renders with initial data", () => {
- const component = renderer.create(<CategoryBaseForm {...category} />);
- expect(component).toMatchSnapshot();
- });
- it("renders without initial data", () => {
- const component = renderer.create(
- <MemoryRouter>
- <CategoryBaseForm />
- </MemoryRouter>
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when errors occured", () => {
- const component = renderer.create(
- <CategoryBaseForm {...category} errors={errors} />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/category/components/CategoryBaseForm/__snapshots__/CategoryBaseForm.test.tsx.snap b/saleor/static/dashboard-next/category/components/CategoryBaseForm/__snapshots__/CategoryBaseForm.test.tsx.snap
deleted file mode 100644
index 96faacc5e7..0000000000
--- a/saleor/static/dashboard-next/category/components/CategoryBaseForm/__snapshots__/CategoryBaseForm.test.tsx.snap
+++ /dev/null
@@ -1,368 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<CategoryBaseForm /> renders when errors occured 1`] = `
-<div
- className="MuiCardContent-root-3"
->
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-4 MuiFormControl-fullWidth-7 Component-textField-2"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-13 MuiFormLabel-error-16 MuiInputLabel-root-8 MuiInputLabel-formControl-9 MuiInputLabel-animated-12 MuiInputLabel-shrink-11"
- data-shrink={true}
- htmlFor={undefined}
- >
- Name
- </label>
- <div
- className="MuiInput-root-18 MuiInput-error-23 MuiInput-fullWidth-25 MuiInput-formControl-19 MuiInput-underline-22"
- >
- <input
- aria-invalid={true}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={true}
- className="MuiInput-input-26"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="name"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value="Apparel"
- />
- </div>
- <p
- className="MuiFormHelperText-root-34 MuiFormHelperText-error-35"
- id={undefined}
- >
- To pole jest wymagane.
- </p>
- </div>
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-4 MuiFormControl-fullWidth-7"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-13 MuiInputLabel-root-8 MuiInputLabel-formControl-9 MuiInputLabel-animated-12 MuiInputLabel-shrink-11"
- data-shrink={true}
- htmlFor={undefined}
- >
- Description
- </label>
- <div
- className="MuiInput-root-18 MuiInput-fullWidth-25 MuiInput-formControl-19 MuiInput-multiline-24 MuiInput-underline-22"
- >
- <div
- className="Textarea-root-31"
- style={
- Object {
- "height": 19,
- }
- }
- >
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-33 Textarea-textarea-32"
- readOnly={true}
- rows="1"
- tabIndex={-1}
- value=""
- />
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-33 Textarea-textarea-32"
- defaultValue={undefined}
- readOnly={true}
- rows={1}
- tabIndex={-1}
- value="Across pressure PM food discover recognize. Send letter reach listen. Quickly work plan rule.
-Tell lose part purpose do when. Whatever drug contain particularly defense."
- />
- <textarea
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="Textarea-textarea-32 MuiInput-input-26 MuiInput-inputMultiline-28"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="description"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={1}
- type="text"
- value="Across pressure PM food discover recognize. Send letter reach listen. Quickly work plan rule.
-Tell lose part purpose do when. Whatever drug contain particularly defense."
- />
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-34"
- id={undefined}
- >
- Optional
- </p>
- </div>
-</div>
-`;
-
-exports[`<CategoryBaseForm /> renders with initial data 1`] = `
-<div
- className="MuiCardContent-root-3"
->
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-4 MuiFormControl-fullWidth-7 Component-textField-2"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-13 MuiInputLabel-root-8 MuiInputLabel-formControl-9 MuiInputLabel-animated-12 MuiInputLabel-shrink-11"
- data-shrink={true}
- htmlFor={undefined}
- >
- Name
- </label>
- <div
- className="MuiInput-root-18 MuiInput-fullWidth-25 MuiInput-formControl-19 MuiInput-underline-22"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={true}
- className="MuiInput-input-26"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="name"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value="Apparel"
- />
- </div>
- </div>
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-4 MuiFormControl-fullWidth-7"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-13 MuiInputLabel-root-8 MuiInputLabel-formControl-9 MuiInputLabel-animated-12 MuiInputLabel-shrink-11"
- data-shrink={true}
- htmlFor={undefined}
- >
- Description
- </label>
- <div
- className="MuiInput-root-18 MuiInput-fullWidth-25 MuiInput-formControl-19 MuiInput-multiline-24 MuiInput-underline-22"
- >
- <div
- className="Textarea-root-31"
- style={
- Object {
- "height": 19,
- }
- }
- >
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-33 Textarea-textarea-32"
- readOnly={true}
- rows="1"
- tabIndex={-1}
- value=""
- />
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-33 Textarea-textarea-32"
- defaultValue={undefined}
- readOnly={true}
- rows={1}
- tabIndex={-1}
- value="Across pressure PM food discover recognize. Send letter reach listen. Quickly work plan rule.
-Tell lose part purpose do when. Whatever drug contain particularly defense."
- />
- <textarea
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="Textarea-textarea-32 MuiInput-input-26 MuiInput-inputMultiline-28"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="description"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={1}
- type="text"
- value="Across pressure PM food discover recognize. Send letter reach listen. Quickly work plan rule.
-Tell lose part purpose do when. Whatever drug contain particularly defense."
- />
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-34"
- id={undefined}
- >
- Optional
- </p>
- </div>
-</div>
-`;
-
-exports[`<CategoryBaseForm /> renders without initial data 1`] = `
-<div
- className="MuiCardContent-root-3"
->
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-4 MuiFormControl-fullWidth-7 Component-textField-2"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-13 MuiInputLabel-root-8 MuiInputLabel-formControl-9 MuiInputLabel-animated-12"
- data-shrink={false}
- htmlFor={undefined}
- >
- Name
- </label>
- <div
- className="MuiInput-root-18 MuiInput-fullWidth-25 MuiInput-formControl-19 MuiInput-underline-22"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={true}
- className="MuiInput-input-26"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="name"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value=""
- />
- </div>
- </div>
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-4 MuiFormControl-fullWidth-7"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-13 MuiInputLabel-root-8 MuiInputLabel-formControl-9 MuiInputLabel-animated-12"
- data-shrink={false}
- htmlFor={undefined}
- >
- Description
- </label>
- <div
- className="MuiInput-root-18 MuiInput-fullWidth-25 MuiInput-formControl-19 MuiInput-multiline-24 MuiInput-underline-22"
- >
- <div
- className="Textarea-root-31"
- style={
- Object {
- "height": 19,
- }
- }
- >
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-33 Textarea-textarea-32"
- readOnly={true}
- rows="1"
- tabIndex={-1}
- value=""
- />
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-33 Textarea-textarea-32"
- defaultValue={undefined}
- readOnly={true}
- rows={1}
- tabIndex={-1}
- value=""
- />
- <textarea
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="Textarea-textarea-32 MuiInput-input-26 MuiInput-inputMultiline-28"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="description"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={1}
- type="text"
- value=""
- />
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-34"
- id={undefined}
- >
- Optional
- </p>
- </div>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/category/components/CategoryProducts/CategoryProducts.test.tsx b/saleor/static/dashboard-next/category/components/CategoryProducts/CategoryProducts.test.tsx
deleted file mode 100644
index 9a2fe15866..0000000000
--- a/saleor/static/dashboard-next/category/components/CategoryProducts/CategoryProducts.test.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import * as React from "react";
-import { MemoryRouter } from "react-router-dom";
-import * as renderer from "react-test-renderer";
-
-import CategoryProducts from "./CategoryProducts";
-
-const products = [
- {
- id: "UHJvZHVjdDox",
- name: "Gardner, Graham and King",
- thumbnailUrl:
- "/media/__sized__/products/saleor/static/placeholders/t-shirts/6_tdo7a5D-crop-c0-5__0-5-255x255-70.jpg",
- productType: {
- id: "1",
- name: "T-Shirt"
- }
- },
- {
- id: "UHJvZHVjdDoy",
- name: "Gardner, Graham and King",
- thumbnailUrl:
- "/media/__sized__/products/saleor/static/placeholders/t-shirts/6_tdo7a5D-crop-c0-5__0-5-255x255-70.jpg",
- productType: {
- id: "1",
- name: "T-Shirt"
- }
- },
- {
- id: "UHJvZHVjdDoz",
- name: "Gardner, Graham and King",
- thumbnailUrl:
- "/media/__sized__/products/saleor/static/placeholders/t-shirts/6_tdo7a5D-crop-c0-5__0-5-255x255-70.jpg",
- productType: {
- id: "1",
- name: "T-Shirt"
- }
- },
- {
- id: "UHJvZHVjdDoa",
- name: "Gardner, Graham and King",
- thumbnailUrl:
- "/media/__sized__/products/saleor/static/placeholders/t-shirts/6_tdo7a5D-crop-c0-5__0-5-255x255-70.jpg",
- productType: {
- id: "1",
- name: "T-Shirt"
- }
- }
-];
-
-describe("<CategoryProducts />", () => {
- it("renders with initial data", () => {
- const component = renderer.create(
- <CategoryProducts
- hasNextPage={true}
- hasPreviousPage={false}
- products={products}
- onCreate={jest.fn()}
- onFilter={jest.fn()}
- onNextPage={jest.fn()}
- onPreviousPage={jest.fn()}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders without initial data", () => {
- const component = renderer.create(
- <CategoryProducts
- hasNextPage={true}
- hasPreviousPage={false}
- products={[]}
- onCreate={jest.fn()}
- onFilter={jest.fn()}
- onNextPage={jest.fn()}
- onPreviousPage={jest.fn()}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when loading data", () => {
- const component = renderer.create(
- <CategoryProducts
- hasNextPage={true}
- hasPreviousPage={false}
- onCreate={jest.fn()}
- onFilter={jest.fn()}
- onNextPage={jest.fn()}
- onPreviousPage={jest.fn()}
- />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/category/components/CategoryProducts/__snapshots__/CategoryProducts.test.tsx.snap b/saleor/static/dashboard-next/category/components/CategoryProducts/__snapshots__/CategoryProducts.test.tsx.snap
deleted file mode 100644
index 10222bce10..0000000000
--- a/saleor/static/dashboard-next/category/components/CategoryProducts/__snapshots__/CategoryProducts.test.tsx.snap
+++ /dev/null
@@ -1,787 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<CategoryProducts /> renders when loading data 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="Component-root-32"
- >
- <h2
- className="MuiTypography-root-35 MuiTypography-title-41 Component-title-34"
- >
- Products
- </h2>
- <div
- className="Component-action-29"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <table
- className="MuiTable-root-82"
- >
- <thead
- className="MuiTableHead-root-83"
- >
- <tr
- className="MuiTableRow-root-84 MuiTableRow-head-87"
- >
- <th
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-head-90 Component-avatarCell-80"
- scope="col"
- />
- <th
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-head-90"
- scope="col"
- >
- Name
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-head-90"
- scope="col"
- >
- Type
- </th>
- </tr>
- </thead>
- <tfoot>
- <tr
- className="MuiTableRow-root-84 MuiTableRow-footer-88"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-footer-92 MuiTablePagination-root-100"
- colSpan={3}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-106 MuiToolbar-gutters-107 MuiTablePagination-toolbar-105"
- >
- <div
- className="MuiTablePagination-spacer-104"
- />
- <div
- className="MuiTablePaginationActions-root-108"
- >
- <button
- className="MuiButtonBase-root-65 MuiButtonBase-disabled-66 MuiIconButton-root-59 MuiIconButton-disabled-63"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- 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
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- 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
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- </td>
- </tr>
- </tfoot>
- <tbody
- className="MuiTableBody-root-109"
- >
- <tr
- className="MuiTableRow-root-84"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91 Component-avatarCell-80"
- scope={undefined}
- >
- <div
- className="MuiAvatar-root-110 MuiAvatar-colorDefault-111"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 8l-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z"
- />
- </g>
- </svg>
- </div>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91"
- scope={undefined}
- >
- <span
- className="Component-skeleton-113"
- style={undefined}
- >
- ‌
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91"
- scope={undefined}
- >
- <span
- className="Component-skeleton-113"
- style={undefined}
- >
- ‌
- </span>
- </td>
- </tr>
- </tbody>
- </table>
-</div>
-`;
-
-exports[`<CategoryProducts /> renders with initial data 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="Component-root-32"
- >
- <h2
- className="MuiTypography-root-35 MuiTypography-title-41 Component-title-34"
- >
- Products
- </h2>
- <div
- className="Component-action-29"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <table
- className="MuiTable-root-82"
- >
- <thead
- className="MuiTableHead-root-83"
- >
- <tr
- className="MuiTableRow-root-84 MuiTableRow-head-87"
- >
- <th
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-head-90 Component-avatarCell-80"
- scope="col"
- />
- <th
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-head-90"
- scope="col"
- >
- Name
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-head-90"
- scope="col"
- >
- Type
- </th>
- </tr>
- </thead>
- <tfoot>
- <tr
- className="MuiTableRow-root-84 MuiTableRow-footer-88"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-footer-92 MuiTablePagination-root-100"
- colSpan={3}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-106 MuiToolbar-gutters-107 MuiTablePagination-toolbar-105"
- >
- <div
- className="MuiTablePagination-spacer-104"
- />
- <div
- className="MuiTablePaginationActions-root-108"
- >
- <button
- className="MuiButtonBase-root-65 MuiButtonBase-disabled-66 MuiIconButton-root-59 MuiIconButton-disabled-63"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- 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
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- 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
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- </td>
- </tr>
- </tfoot>
- <tbody
- className="MuiTableBody-root-109"
- >
- <tr
- className="MuiTableRow-root-84"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91 Component-avatarCell-80"
- scope={undefined}
- >
- <div
- className="MuiAvatar-root-110"
- >
- <img
- alt={undefined}
- className="MuiAvatar-img-112"
- sizes={undefined}
- src="/media/__sized__/products/saleor/static/placeholders/t-shirts/6_tdo7a5D-crop-c0-5__0-5-255x255-70.jpg"
- srcSet={undefined}
- />
- </div>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91"
- scope={undefined}
- >
- <span
- className=""
- onClick={[Function]}
- >
- Gardner, Graham and King
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91"
- scope={undefined}
- >
- T-Shirt
- </td>
- </tr>
- <tr
- className="MuiTableRow-root-84"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91 Component-avatarCell-80"
- scope={undefined}
- >
- <div
- className="MuiAvatar-root-110"
- >
- <img
- alt={undefined}
- className="MuiAvatar-img-112"
- sizes={undefined}
- src="/media/__sized__/products/saleor/static/placeholders/t-shirts/6_tdo7a5D-crop-c0-5__0-5-255x255-70.jpg"
- srcSet={undefined}
- />
- </div>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91"
- scope={undefined}
- >
- <span
- className=""
- onClick={[Function]}
- >
- Gardner, Graham and King
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91"
- scope={undefined}
- >
- T-Shirt
- </td>
- </tr>
- <tr
- className="MuiTableRow-root-84"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91 Component-avatarCell-80"
- scope={undefined}
- >
- <div
- className="MuiAvatar-root-110"
- >
- <img
- alt={undefined}
- className="MuiAvatar-img-112"
- sizes={undefined}
- src="/media/__sized__/products/saleor/static/placeholders/t-shirts/6_tdo7a5D-crop-c0-5__0-5-255x255-70.jpg"
- srcSet={undefined}
- />
- </div>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91"
- scope={undefined}
- >
- <span
- className=""
- onClick={[Function]}
- >
- Gardner, Graham and King
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91"
- scope={undefined}
- >
- T-Shirt
- </td>
- </tr>
- <tr
- className="MuiTableRow-root-84"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91 Component-avatarCell-80"
- scope={undefined}
- >
- <div
- className="MuiAvatar-root-110"
- >
- <img
- alt={undefined}
- className="MuiAvatar-img-112"
- sizes={undefined}
- src="/media/__sized__/products/saleor/static/placeholders/t-shirts/6_tdo7a5D-crop-c0-5__0-5-255x255-70.jpg"
- srcSet={undefined}
- />
- </div>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91"
- scope={undefined}
- >
- <span
- className=""
- onClick={[Function]}
- >
- Gardner, Graham and King
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91"
- scope={undefined}
- >
- T-Shirt
- </td>
- </tr>
- </tbody>
- </table>
-</div>
-`;
-
-exports[`<CategoryProducts /> renders without initial data 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="Component-root-32"
- >
- <h2
- className="MuiTypography-root-35 MuiTypography-title-41 Component-title-34"
- >
- Products
- </h2>
- <div
- className="Component-action-29"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <table
- className="MuiTable-root-82"
- >
- <thead
- className="MuiTableHead-root-83"
- >
- <tr
- className="MuiTableRow-root-84 MuiTableRow-head-87"
- >
- <th
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-head-90 Component-avatarCell-80"
- scope="col"
- />
- <th
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-head-90"
- scope="col"
- >
- Name
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-head-90"
- scope="col"
- >
- Type
- </th>
- </tr>
- </thead>
- <tfoot>
- <tr
- className="MuiTableRow-root-84 MuiTableRow-footer-88"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-footer-92 MuiTablePagination-root-100"
- colSpan={3}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-106 MuiToolbar-gutters-107 MuiTablePagination-toolbar-105"
- >
- <div
- className="MuiTablePagination-spacer-104"
- />
- <div
- className="MuiTablePaginationActions-root-108"
- >
- <button
- className="MuiButtonBase-root-65 MuiButtonBase-disabled-66 MuiIconButton-root-59 MuiIconButton-disabled-63"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- 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
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- 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
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- </td>
- </tr>
- </tfoot>
- <tbody
- className="MuiTableBody-root-109"
- >
- <tr
- className="MuiTableRow-root-84"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91 Component-avatarCell-80"
- scope={undefined}
- />
- <td
- aria-sort={null}
- className="MuiTableCell-root-89 MuiTableCell-body-91"
- colSpan={2}
- scope={undefined}
- >
- No products found
- </td>
- </tr>
- </tbody>
- </table>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/category/components/CategorySubcategories/CategorySubcategories.test.tsx b/saleor/static/dashboard-next/category/components/CategorySubcategories/CategorySubcategories.test.tsx
deleted file mode 100644
index 584df9dc9e..0000000000
--- a/saleor/static/dashboard-next/category/components/CategorySubcategories/CategorySubcategories.test.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import * as React from "react";
-import { MemoryRouter } from "react-router-dom";
-import * as renderer from "react-test-renderer";
-
-import CategorySubcategories from "./CategorySubcategories";
-
-describe("<CategorySubcategories />", () => {
- it("renders with initial data", () => {
- const categories = [
- {
- id: "123123",
- name: "Lorem ipsum dolor"
- },
- {
- id: "876752",
- name: "Mauris vehicula tortor vulputate"
- }
- ];
- const component = renderer.create(
- <CategorySubcategories
- subcategories={categories}
- onClickSubcategory={jest.fn()}
- onCreate={jest.fn()}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders without initial data", () => {
- const component = renderer.create(
- <CategorySubcategories
- subcategories={[]}
- onClickSubcategory={jest.fn()}
- onCreate={jest.fn()}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when loading data", () => {
- const component = renderer.create(
- <CategorySubcategories
- onClickSubcategory={jest.fn()}
- onCreate={jest.fn()}
- />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/category/components/CategorySubcategories/__snapshots__/CategorySubcategories.test.tsx.snap b/saleor/static/dashboard-next/category/components/CategorySubcategories/__snapshots__/CategorySubcategories.test.tsx.snap
deleted file mode 100644
index 038a577242..0000000000
--- a/saleor/static/dashboard-next/category/components/CategorySubcategories/__snapshots__/CategorySubcategories.test.tsx.snap
+++ /dev/null
@@ -1,308 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<CategorySubcategories /> renders when loading data 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="Component-root-32"
- >
- <h2
- className="MuiTypography-root-35 MuiTypography-title-41 Component-title-34"
- >
- Subcategories
- </h2>
- <div
- className="Component-action-29"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <ul
- className="MuiList-root-80 MuiList-padding-81"
- >
- <li
- className="MuiListItem-root-84 MuiListItem-default-87 MuiListItem-gutters-91"
- disabled={false}
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiListItemIcon-root-94"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"
- />
- </g>
- </svg>
- <div
- className="MuiListItemText-root-95"
- >
- <h3
- className="MuiTypography-root-35 MuiTypography-subheading-42 MuiListItemText-primary-98"
- >
- <span
- className="Component-skeleton-106"
- style={undefined}
- >
- ‌
- </span>
- </h3>
- </div>
- </li>
- </ul>
-</div>
-`;
-
-exports[`<CategorySubcategories /> renders with initial data 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="Component-root-32"
- >
- <h2
- className="MuiTypography-root-35 MuiTypography-title-41 Component-title-34"
- >
- Subcategories
- </h2>
- <div
- className="Component-action-29"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <ul
- className="MuiList-root-80 MuiList-padding-81"
- >
- <div
- className="MuiButtonBase-root-65 MuiListItem-root-84 MuiListItem-default-87 MuiListItem-gutters-91 MuiListItem-button-92"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- role="button"
- tabIndex="0"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiListItemIcon-root-94"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"
- />
- </g>
- </svg>
- <div
- className="MuiListItemText-root-95"
- >
- <h3
- className="MuiTypography-root-35 MuiTypography-subheading-42 MuiListItemText-primary-98"
- >
- Lorem ipsum dolor
- </h3>
- </div>
- <span
- className="MuiTouchRipple-root-73"
- />
- </div>
- <div
- className="MuiButtonBase-root-65 MuiListItem-root-84 MuiListItem-default-87 MuiListItem-gutters-91 MuiListItem-button-92"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- role="button"
- tabIndex="0"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiListItemIcon-root-94"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"
- />
- </g>
- </svg>
- <div
- className="MuiListItemText-root-95"
- >
- <h3
- className="MuiTypography-root-35 MuiTypography-subheading-42 MuiListItemText-primary-98"
- >
- Mauris vehicula tortor vulputate
- </h3>
- </div>
- <span
- className="MuiTouchRipple-root-73"
- />
- </div>
- </ul>
-</div>
-`;
-
-exports[`<CategorySubcategories /> renders without initial data 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="Component-root-32"
- >
- <h2
- className="MuiTypography-root-35 MuiTypography-title-41 Component-title-34"
- >
- Subcategories
- </h2>
- <div
- className="Component-action-29"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <ul
- className="MuiList-root-80 MuiList-padding-81"
- >
- <li
- className="MuiListSubheader-root-101 MuiListSubheader-sticky-105"
- >
- No categories found
- </li>
- </ul>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/category/components/ProductFilters/ProductFilters.test.tsx b/saleor/static/dashboard-next/category/components/ProductFilters/ProductFilters.test.tsx
deleted file mode 100644
index d7d51a3ad0..0000000000
--- a/saleor/static/dashboard-next/category/components/ProductFilters/ProductFilters.test.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import ProductFilters from "./";
-
-const productTypes = [
- { id: "123123123", name: "Type 1" },
- { id: "123123124", name: "Type 2" },
- { id: "123123125", name: "Type 3" },
- { id: "123123126", name: "Type 4" }
-];
-const productFilters = {
- highlighted: "false",
- name: "Lorem ipsum",
- price_max: "50",
- price_min: "30",
- productTypes: ["123123123", "123123126"],
- published: "true"
-};
-
-describe("<ProductFilters />", () => {
- it("renders without initial state", () => {
- const component = renderer.create(
- <ProductFilters
- handleClear={jest.fn()}
- handleSubmit={jest.fn()}
- productTypes={productTypes}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with initial state", () => {
- const component = renderer.create(
- <ProductFilters
- formState={productFilters}
- handleClear={jest.fn()}
- handleSubmit={jest.fn()}
- productTypes={productTypes}
- />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/category/components/ProductFilters/__snapshots__/ProductFilters.test.tsx.snap b/saleor/static/dashboard-next/category/components/ProductFilters/__snapshots__/ProductFilters.test.tsx.snap
deleted file mode 100644
index a96e8c7a0e..0000000000
--- a/saleor/static/dashboard-next/category/components/ProductFilters/__snapshots__/ProductFilters.test.tsx.snap
+++ /dev/null
@@ -1,876 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<ProductFilters /> renders with initial state 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <form>
- <div
- className="MuiCardHeader-root-29"
- >
- <div
- className="MuiCardHeader-content-32"
- >
- <span
- className="MuiTypography-root-35 MuiTypography-headline-40 MuiCardHeader-title-33"
- >
- Filters
- </span>
- </div>
- <div
- className="MuiCardHeader-action-31"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <div
- className="MuiCardContent-root-80"
- >
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-81 MuiFormControl-fullWidth-84"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89 MuiInputLabel-shrink-88"
- data-shrink={true}
- htmlFor={undefined}
- >
- Name
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-103"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="name"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value="Lorem ipsum"
- />
- </div>
- </div>
- <div
- className="Component-spacer-108"
- />
- <div
- className="MuiFormControl-root-81 Component-formControl-111"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89 MuiInputLabel-shrink-88"
- data-shrink={true}
- >
- Product type
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <div
- className="MuiSelect-root-112"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-113 MuiSelect-selectMenu-114 MuiInput-input-103"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <div
- className="Component-chipContainer-110"
- >
- <div
- className="MuiChip-root-129 Component-chip-109"
- onClick={undefined}
- onKeyDown={[Function]}
- role="button"
- tabIndex={-1}
- >
- <span
- className="MuiChip-label-134"
- >
- Type 1
- </span>
- </div>
- <div
- className="MuiChip-root-129 Component-chip-109"
- onClick={undefined}
- onKeyDown={[Function]}
- role="button"
- tabIndex={-1}
- >
- <span
- className="MuiChip-label-134"
- >
- Type 4
- </span>
- </div>
- </div>
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name="productTypes"
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value="123123123,123123126"
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiSelect-icon-116"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- </div>
- <div
- className="Component-spacer-108"
- />
- <div
- className="Component-widgetContainer-124"
- >
- <div
- className="Component-inputContainer-121"
- >
- <div
- className="MuiFormControl-root-81"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89 MuiInputLabel-shrink-88"
- data-shrink={true}
- htmlFor="price_min"
- >
- Price
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-103 MuiInput-inputType-106"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_min"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value="30"
- />
- <div
- className="MuiInputAdornment-root-125 MuiInputAdornment-positionEnd-127"
- >
- <p
- className="MuiTypography-root-35 MuiTypography-body1-44 MuiTypography-colorTextSecondary-57"
- >
- USD
- </p>
- </div>
- </div>
- </div>
- <span
- className="Component-separator-123"
- >
- -
- </span>
- <div
- className="MuiFormControl-root-81"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99 Component-pullDown-122"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-103 MuiInput-inputType-106"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_max"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value="50"
- />
- <div
- className="MuiInputAdornment-root-125 MuiInputAdornment-positionEnd-127"
- >
- <p
- className="MuiTypography-root-35 MuiTypography-body1-44 MuiTypography-colorTextSecondary-57"
- >
- USD
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div
- className="Component-spacer-108"
- />
- <div
- className="MuiFormControl-root-81 Component-formControl-128"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89 MuiInputLabel-shrink-88"
- data-shrink={true}
- >
- Published
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <div
- className="MuiSelect-root-112"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-113 MuiSelect-selectMenu-114 MuiInput-input-103"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name="published"
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value="true"
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiSelect-icon-116"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- </div>
- <div
- className="Component-spacer-108"
- />
- <div
- className="MuiFormControl-root-81 Component-formControl-128"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89 MuiInputLabel-shrink-88"
- data-shrink={true}
- >
- Highlighted
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <div
- className="MuiSelect-root-112"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-113 MuiSelect-selectMenu-114 MuiInput-input-103"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name="highlighted"
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value="false"
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiSelect-icon-116"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- </div>
- </div>
- </form>
-</div>
-`;
-
-exports[`<ProductFilters /> renders without initial state 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <form>
- <div
- className="MuiCardHeader-root-29"
- >
- <div
- className="MuiCardHeader-content-32"
- >
- <span
- className="MuiTypography-root-35 MuiTypography-headline-40 MuiCardHeader-title-33"
- >
- Filters
- </span>
- </div>
- <div
- className="MuiCardHeader-action-31"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <div
- className="MuiCardContent-root-80"
- >
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-81 MuiFormControl-fullWidth-84"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89"
- data-shrink={false}
- htmlFor={undefined}
- >
- Name
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-103"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="name"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value=""
- />
- </div>
- </div>
- <div
- className="Component-spacer-108"
- />
- <div
- className="MuiFormControl-root-81 Component-formControl-111"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89"
- data-shrink={false}
- >
- Product type
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <div
- className="MuiSelect-root-112"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-113 MuiSelect-selectMenu-114 MuiInput-input-103"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name="productTypes"
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiSelect-icon-116"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- </div>
- <div
- className="Component-spacer-108"
- />
- <div
- className="Component-widgetContainer-124"
- >
- <div
- className="Component-inputContainer-121"
- >
- <div
- className="MuiFormControl-root-81"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89"
- data-shrink={false}
- htmlFor="price_min"
- >
- Price
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-103 MuiInput-inputType-106"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_min"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <div
- className="MuiInputAdornment-root-125 MuiInputAdornment-positionEnd-127"
- >
- <p
- className="MuiTypography-root-35 MuiTypography-body1-44 MuiTypography-colorTextSecondary-57"
- >
- USD
- </p>
- </div>
- </div>
- </div>
- <span
- className="Component-separator-123"
- >
- -
- </span>
- <div
- className="MuiFormControl-root-81"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99 Component-pullDown-122"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-103 MuiInput-inputType-106"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_max"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <div
- className="MuiInputAdornment-root-125 MuiInputAdornment-positionEnd-127"
- >
- <p
- className="MuiTypography-root-35 MuiTypography-body1-44 MuiTypography-colorTextSecondary-57"
- >
- USD
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div
- className="Component-spacer-108"
- />
- <div
- className="MuiFormControl-root-81 Component-formControl-128"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89"
- data-shrink={false}
- >
- Published
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <div
- className="MuiSelect-root-112"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-113 MuiSelect-selectMenu-114 MuiInput-input-103"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name="published"
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiSelect-icon-116"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- </div>
- <div
- className="Component-spacer-108"
- />
- <div
- className="MuiFormControl-root-81 Component-formControl-128"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89"
- data-shrink={false}
- >
- Highlighted
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <div
- className="MuiSelect-root-112"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-113 MuiSelect-selectMenu-114 MuiInput-input-103"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name="highlighted"
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiSelect-icon-116"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- </div>
- </div>
- </form>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/category/components/RootCategoryList/RootCategoryList.test.tsx b/saleor/static/dashboard-next/category/components/RootCategoryList/RootCategoryList.test.tsx
deleted file mode 100644
index e76767b54e..0000000000
--- a/saleor/static/dashboard-next/category/components/RootCategoryList/RootCategoryList.test.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import * as React from "react";
-import { MemoryRouter } from "react-router-dom";
-import * as renderer from "react-test-renderer";
-
-import RootCategoryList from "./";
-
-describe("<CategorySubcategories />", () => {
- it("renders with initial data", () => {
- const categories = [
- {
- id: "123123",
- name: "Lorem ipsum dolor"
- },
- {
- id: "876752",
- name: "Mauris vehicula tortor vulputate"
- }
- ];
- const component = renderer.create(
- <RootCategoryList
- categories={categories}
- onClick={jest.fn()}
- onCreate={jest.fn()}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders without initial data", () => {
- const component = renderer.create(
- <RootCategoryList
- categories={[]}
- onClick={jest.fn()}
- onCreate={jest.fn()}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when loading data", () => {
- const component = renderer.create(
- <RootCategoryList onClick={jest.fn()} onCreate={jest.fn()} />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/category/components/RootCategoryList/__snapshots__/RootCategoryList.test.tsx.snap b/saleor/static/dashboard-next/category/components/RootCategoryList/__snapshots__/RootCategoryList.test.tsx.snap
deleted file mode 100644
index 37fdb16d14..0000000000
--- a/saleor/static/dashboard-next/category/components/RootCategoryList/__snapshots__/RootCategoryList.test.tsx.snap
+++ /dev/null
@@ -1,308 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<CategorySubcategories /> renders when loading data 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="Component-root-32"
- >
- <h2
- className="MuiTypography-root-35 MuiTypography-title-41 Component-title-34"
- >
- Categories
- </h2>
- <div
- className="Component-action-29"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <ul
- className="MuiList-root-80 MuiList-padding-81"
- >
- <li
- className="MuiListItem-root-84 MuiListItem-default-87 MuiListItem-gutters-91"
- disabled={false}
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiListItemIcon-root-94"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"
- />
- </g>
- </svg>
- <div
- className="MuiListItemText-root-95"
- >
- <h3
- className="MuiTypography-root-35 MuiTypography-subheading-42 MuiListItemText-primary-98"
- >
- <span
- className="Component-skeleton-106"
- style={undefined}
- >
- ‌
- </span>
- </h3>
- </div>
- </li>
- </ul>
-</div>
-`;
-
-exports[`<CategorySubcategories /> renders with initial data 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="Component-root-32"
- >
- <h2
- className="MuiTypography-root-35 MuiTypography-title-41 Component-title-34"
- >
- Categories
- </h2>
- <div
- className="Component-action-29"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <ul
- className="MuiList-root-80 MuiList-padding-81"
- >
- <div
- className="MuiButtonBase-root-65 MuiListItem-root-84 MuiListItem-default-87 MuiListItem-gutters-91 MuiListItem-button-92"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- role="button"
- tabIndex="0"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiListItemIcon-root-94"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"
- />
- </g>
- </svg>
- <div
- className="MuiListItemText-root-95"
- >
- <h3
- className="MuiTypography-root-35 MuiTypography-subheading-42 MuiListItemText-primary-98"
- >
- Lorem ipsum dolor
- </h3>
- </div>
- <span
- className="MuiTouchRipple-root-73"
- />
- </div>
- <div
- className="MuiButtonBase-root-65 MuiListItem-root-84 MuiListItem-default-87 MuiListItem-gutters-91 MuiListItem-button-92"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- role="button"
- tabIndex="0"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67 MuiListItemIcon-root-94"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"
- />
- </g>
- </svg>
- <div
- className="MuiListItemText-root-95"
- >
- <h3
- className="MuiTypography-root-35 MuiTypography-subheading-42 MuiListItemText-primary-98"
- >
- Mauris vehicula tortor vulputate
- </h3>
- </div>
- <span
- className="MuiTouchRipple-root-73"
- />
- </div>
- </ul>
-</div>
-`;
-
-exports[`<CategorySubcategories /> renders without initial data 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="Component-root-32"
- >
- <h2
- className="MuiTypography-root-35 MuiTypography-title-41 Component-title-34"
- >
- Categories
- </h2>
- <div
- className="Component-action-29"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <ul
- className="MuiList-root-80 MuiList-padding-81"
- >
- <li
- className="MuiListSubheader-root-101 MuiListSubheader-sticky-105"
- >
- No categories found
- </li>
- </ul>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/components/CategoryList/CategoryList.test.tsx b/saleor/static/dashboard-next/components/CategoryList/CategoryList.test.tsx
deleted file mode 100644
index c15678cad5..0000000000
--- a/saleor/static/dashboard-next/components/CategoryList/CategoryList.test.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import CategoryList from "./CategoryList";
-
-const categories = [
- {
- id: "cat1",
- name: "Apparel"
- },
- {
- id: "cat2",
- name: "Accessories"
- },
- {
- id: "cat3",
- name: "Groceries"
- },
- {
- id: "cat4",
- name: "Books"
- }
-];
-
-describe("<CategoryList />", () => {
- it("renders while data is loading", () => {
- const component = renderer.create(<CategoryList />);
- expect(component).toMatchSnapshot();
- });
- it("renders when data is fully loaded", () => {
- const component = renderer.create(
- <CategoryList categories={categories} onClick={jest.fn()} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when category list is empty", () => {
- const component = renderer.create(<CategoryList categories={[]} />);
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/components/CategoryList/__snapshots__/CategoryList.test.tsx.snap b/saleor/static/dashboard-next/components/CategoryList/__snapshots__/CategoryList.test.tsx.snap
deleted file mode 100644
index a18ebd250c..0000000000
--- a/saleor/static/dashboard-next/components/CategoryList/__snapshots__/CategoryList.test.tsx.snap
+++ /dev/null
@@ -1,227 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<CategoryList /> renders when category list is empty 1`] = `
-<ul
- className="MuiList-root-1 MuiList-padding-2"
->
- <li
- className="MuiListSubheader-root-62 MuiListSubheader-sticky-66"
- >
- No categories found
- </li>
-</ul>
-`;
-
-exports[`<CategoryList /> renders when data is fully loaded 1`] = `
-<ul
- className="MuiList-root-1 MuiList-padding-2"
->
- <div
- className="MuiButtonBase-root-53 MuiListItem-root-5 MuiListItem-default-8 MuiListItem-gutters-12 MuiListItem-button-13"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- role="button"
- tabIndex="0"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-16 MuiListItemIcon-root-15"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"
- />
- </g>
- </svg>
- <div
- className="MuiListItemText-root-22"
- >
- <h3
- className="MuiTypography-root-28 MuiTypography-subheading-35 MuiListItemText-primary-25"
- >
- Apparel
- </h3>
- </div>
- <span
- className="MuiTouchRipple-root-55"
- />
- </div>
- <div
- className="MuiButtonBase-root-53 MuiListItem-root-5 MuiListItem-default-8 MuiListItem-gutters-12 MuiListItem-button-13"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- role="button"
- tabIndex="0"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-16 MuiListItemIcon-root-15"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"
- />
- </g>
- </svg>
- <div
- className="MuiListItemText-root-22"
- >
- <h3
- className="MuiTypography-root-28 MuiTypography-subheading-35 MuiListItemText-primary-25"
- >
- Accessories
- </h3>
- </div>
- <span
- className="MuiTouchRipple-root-55"
- />
- </div>
- <div
- className="MuiButtonBase-root-53 MuiListItem-root-5 MuiListItem-default-8 MuiListItem-gutters-12 MuiListItem-button-13"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- role="button"
- tabIndex="0"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-16 MuiListItemIcon-root-15"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"
- />
- </g>
- </svg>
- <div
- className="MuiListItemText-root-22"
- >
- <h3
- className="MuiTypography-root-28 MuiTypography-subheading-35 MuiListItemText-primary-25"
- >
- Groceries
- </h3>
- </div>
- <span
- className="MuiTouchRipple-root-55"
- />
- </div>
- <div
- className="MuiButtonBase-root-53 MuiListItem-root-5 MuiListItem-default-8 MuiListItem-gutters-12 MuiListItem-button-13"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- role="button"
- tabIndex="0"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-16 MuiListItemIcon-root-15"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"
- />
- </g>
- </svg>
- <div
- className="MuiListItemText-root-22"
- >
- <h3
- className="MuiTypography-root-28 MuiTypography-subheading-35 MuiListItemText-primary-25"
- >
- Books
- </h3>
- </div>
- <span
- className="MuiTouchRipple-root-55"
- />
- </div>
-</ul>
-`;
-
-exports[`<CategoryList /> renders while data is loading 1`] = `
-<ul
- className="MuiList-root-1 MuiList-padding-2"
->
- <li
- className="MuiListItem-root-5 MuiListItem-default-8 MuiListItem-gutters-12"
- disabled={false}
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-16 MuiListItemIcon-root-15"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"
- />
- </g>
- </svg>
- <div
- className="MuiListItemText-root-22"
- >
- <h3
- className="MuiTypography-root-28 MuiTypography-subheading-35 MuiListItemText-primary-25"
- >
- <span
- className="Component-skeleton-52"
- style={undefined}
- >
- ‌
- </span>
- </h3>
- </div>
- </li>
-</ul>
-`;
diff --git a/saleor/static/dashboard-next/components/CategoryPropertiesCard/CategoryPropertiesCard.test.tsx b/saleor/static/dashboard-next/components/CategoryPropertiesCard/CategoryPropertiesCard.test.tsx
deleted file mode 100644
index 00a59edc34..0000000000
--- a/saleor/static/dashboard-next/components/CategoryPropertiesCard/CategoryPropertiesCard.test.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import * as React from "react";
-import { MemoryRouter } from "react-router-dom";
-import * as renderer from "react-test-renderer";
-
-import CategoryPropertiesCard from "./CategoryPropertiesCard";
-
-describe("<CategoryPropertiesCard />", () => {
- it("renders while data is loading", () => {
- const component = renderer.create(
- <MemoryRouter>
- <CategoryPropertiesCard description="" onDelete={jest.fn()} title="" />
- </MemoryRouter>
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when data is loaded", () => {
- const component = renderer.create(
- <MemoryRouter>
- <CategoryPropertiesCard
- description="These are the best shoes."
- onDelete={jest.fn()}
- onEdit={jest.fn()}
- title="Shoes"
- />
- </MemoryRouter>
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/components/CategoryPropertiesCard/__snapshots__/CategoryPropertiesCard.test.tsx.snap b/saleor/static/dashboard-next/components/CategoryPropertiesCard/__snapshots__/CategoryPropertiesCard.test.tsx.snap
deleted file mode 100644
index 7f5063abac..0000000000
--- a/saleor/static/dashboard-next/components/CategoryPropertiesCard/__snapshots__/CategoryPropertiesCard.test.tsx.snap
+++ /dev/null
@@ -1,211 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<CategoryPropertiesCard /> renders when data is loaded 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="Component-root-32"
- >
- <h2
- className="MuiTypography-root-35 MuiTypography-title-41 Component-title-34"
- >
- Shoes
- </h2>
- <div
- className="Component-action-29"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <div
- className="MuiCardContent-root-80"
- >
- <p
- className="MuiTypography-root-35 MuiTypography-body1-44"
- >
- These are the best shoes.
- </p>
- </div>
-</div>
-`;
-
-exports[`<CategoryPropertiesCard /> renders while data is loading 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="Component-root-32"
- >
- <h2
- className="MuiTypography-root-35 MuiTypography-title-41 Component-title-34"
- >
-
- </h2>
- <div
- className="Component-action-29"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={undefined}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <div
- className="MuiCardContent-root-80"
- >
- <p
- className="MuiTypography-root-35 MuiTypography-body1-44"
- >
-
- </p>
- </div>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/components/DateFormatter/DateFormatter.tsx b/saleor/static/dashboard-next/components/DateFormatter/DateFormatter.tsx
new file mode 100644
index 0000000000..615c4102db
--- /dev/null
+++ b/saleor/static/dashboard-next/components/DateFormatter/DateFormatter.tsx
@@ -0,0 +1,61 @@
+import { withStyles } from "material-ui/styles";
+import Tooltip from "material-ui/Tooltip";
+import Typography from "material-ui/Typography";
+import * as moment from "moment";
+import * as React from "react";
+
+interface DateFormatterProps {
+ date: string;
+ dateNow?: number;
+ inputFormat?: string;
+ outputFormat?: string;
+ showTooltip?: boolean;
+ locale?: string;
+ typography?: string;
+}
+
+const decorate = withStyles(theme => ({ root: { display: "inline" } }));
+const DateFormatter = decorate<DateFormatterProps>(
+ ({
+ classes,
+ date,
+ dateNow,
+ inputFormat,
+ outputFormat,
+ showTooltip = true,
+ locale,
+ typography
+ }) => {
+ const momentDate = inputFormat ? moment(date, inputFormat) : moment(date);
+ if (!dateNow || moment(dateNow).diff(momentDate, "days") > 1) {
+ return (
+ <Typography
+ className={classes.root}
+ variant={(typography as any) || "body1"}
+ >
+ {momentDate.format(outputFormat || "DD.MM.YYYY HH:mm")}
+ </Typography>
+ );
+ }
+ if (showTooltip) {
+ return (
+ <Tooltip
+ title={momentDate.format(outputFormat || "DD.MM.YYYY HH:mm")}
+ placement="bottom"
+ >
+ <Typography className={classes.root}>
+ {locale
+ ? momentDate.locale(locale).fromNow()
+ : momentDate.fromNow()}
+ </Typography>
+ </Tooltip>
+ );
+ }
+ return (
+ <Typography className={classes.root}>
+ {locale ? momentDate.locale(locale).fromNow() : momentDate.fromNow()}
+ </Typography>
+ );
+ }
+);
+export default DateFormatter;
diff --git a/saleor/static/dashboard-next/components/DateFormatter/DateProvider.tsx b/saleor/static/dashboard-next/components/DateFormatter/DateProvider.tsx
new file mode 100644
index 0000000000..fa519a897e
--- /dev/null
+++ b/saleor/static/dashboard-next/components/DateFormatter/DateProvider.tsx
@@ -0,0 +1,34 @@
+import * as React from "react";
+
+interface DateProviderProps {
+ children: ((
+ props: {
+ date: number;
+ }
+ ) => React.ReactElement<any>);
+}
+interface DateProviderState {
+ date: number;
+ intervalId: number;
+}
+
+export class DateProvider extends React.Component<
+ DateProviderProps,
+ DateProviderState
+> {
+ constructor(props) {
+ super(props);
+ const intervalId = setInterval(() => this.setState({ date: Date.now() }));
+ this.state = {
+ date: Date.now(),
+ intervalId
+ };
+ }
+
+ render() {
+ const content = this.props.children({
+ date: this.state.date
+ });
+ return content;
+ }
+}
diff --git a/saleor/static/dashboard-next/components/DateFormatter/index.ts b/saleor/static/dashboard-next/components/DateFormatter/index.ts
new file mode 100644
index 0000000000..6d136ef6d8
--- /dev/null
+++ b/saleor/static/dashboard-next/components/DateFormatter/index.ts
@@ -0,0 +1,3 @@
+export { default } from "./DateFormatter";
+export * from "./DateFormatter";
+export * from "./DateProvider";
diff --git a/saleor/static/dashboard-next/components/EditableTableCell/EditableTableCell.tsx b/saleor/static/dashboard-next/components/EditableTableCell/EditableTableCell.tsx
new file mode 100644
index 0000000000..4bf2d37af3
--- /dev/null
+++ b/saleor/static/dashboard-next/components/EditableTableCell/EditableTableCell.tsx
@@ -0,0 +1,91 @@
+import Card, { CardContent } from "material-ui/Card";
+import { withStyles } from "material-ui/styles";
+import { TableCell } from "material-ui/Table";
+import TextField, { TextFieldProps } from "material-ui/TextField";
+import Typography from "material-ui/Typography";
+import * as React from "react";
+
+import Form from "../../components/Form";
+import Toggle from "../../components/Toggle";
+
+interface EditableTableCellProps {
+ className?: string;
+ InputProps?: TextFieldProps;
+ value: string;
+ onConfirm(value: string): () => void;
+}
+
+const decorate = withStyles(theme => ({
+ container: {
+ position: "relative" as "relative"
+ },
+ overlay: {
+ cursor: "pointer",
+ height: "100vh",
+ left: 0,
+ position: "fixed" as "fixed",
+ top: 0,
+ width: "100vw",
+ zIndex: 1
+ },
+ root: {
+ left: 0,
+ minWidth: theme.spacing.unit * 20,
+ position: "absolute" as "absolute",
+ top: 0,
+ width: `calc(100% + ${4 * theme.spacing.unit}px)`,
+ zIndex: 2
+ },
+ text: {
+ cursor: "pointer"
+ }
+}));
+export const EditableTableCell = decorate<EditableTableCellProps>(
+ ({ classes, className, InputProps, value, onConfirm }) => (
+ <TableCell className={[classes.container, className].join(" ")}>
+ <Toggle>
+ {(opened, { enable, disable }) => {
+ const handleConfirm = (data: { value: string }) => {
+ disable();
+ onConfirm(data.value);
+ };
+ return (
+ <>
+ {opened && <div className={classes.overlay} onClick={disable} />}
+ <Form initial={{ value }} onSubmit={handleConfirm}>
+ {({ change, data, submit }) => (
+ <>
+ <Typography
+ variant="caption"
+ onClick={enable}
+ className={classes.text}
+ >
+ {value}
+ </Typography>
+ {opened && (
+ <div className={classes.root}>
+ <Card>
+ <CardContent>
+ <TextField
+ name="value"
+ autoFocus
+ fullWidth
+ onChange={change}
+ value={data.value}
+ {...InputProps}
+ />
+ </CardContent>
+ </Card>
+ </div>
+ )}
+ </>
+ )}
+ </Form>
+ </>
+ );
+ }}
+ </Toggle>
+ </TableCell>
+ )
+);
+export default EditableTableCell;
diff --git a/saleor/static/dashboard-next/components/EditableTableCell/index.ts b/saleor/static/dashboard-next/components/EditableTableCell/index.ts
new file mode 100644
index 0000000000..82c842fa9b
--- /dev/null
+++ b/saleor/static/dashboard-next/components/EditableTableCell/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./EditableTableCell";
+export * from "./EditableTableCell";
diff --git a/saleor/static/dashboard-next/components/ErrorMessageCard/ErrorMessageCard.test.tsx b/saleor/static/dashboard-next/components/ErrorMessageCard/ErrorMessageCard.test.tsx
deleted file mode 100644
index 9f81a8f7e0..0000000000
--- a/saleor/static/dashboard-next/components/ErrorMessageCard/ErrorMessageCard.test.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import ErrorMessageCard from "./ErrorMessageCard";
-
-describe("<ErrorMessageCard />", () => {
- it("renders properly", () => {
- const component = renderer.create(
- <ErrorMessageCard message="Things are terrible." />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/components/ErrorMessageCard/__snapshots__/ErrorMessageCard.test.tsx.snap b/saleor/static/dashboard-next/components/ErrorMessageCard/__snapshots__/ErrorMessageCard.test.tsx.snap
deleted file mode 100644
index 23647521f8..0000000000
--- a/saleor/static/dashboard-next/components/ErrorMessageCard/__snapshots__/ErrorMessageCard.test.tsx.snap
+++ /dev/null
@@ -1,22 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<ErrorMessageCard /> renders properly 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <div
- className="MuiCardContent-root-29"
- >
- <h2
- className="MuiTypography-root-30 MuiTypography-headline-35"
- >
- Error
- </h2>
- <p
- className="MuiTypography-root-30 MuiTypography-body1-39"
- >
- Things are terrible.
- </p>
- </div>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/components/FilterCard/FilterCard.test.tsx b/saleor/static/dashboard-next/components/FilterCard/FilterCard.test.tsx
deleted file mode 100644
index c75cedcda1..0000000000
--- a/saleor/static/dashboard-next/components/FilterCard/FilterCard.test.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import FilterCard from "./FilterCard";
-
-describe("<FilterCard />", () => {
- it("renders properly", () => {
- const component = renderer.create(<FilterCard handleClear={jest.fn()} />);
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/components/FilterCard/__snapshots__/FilterCard.test.tsx.snap b/saleor/static/dashboard-next/components/FilterCard/__snapshots__/FilterCard.test.tsx.snap
deleted file mode 100644
index a0e40e7a72..0000000000
--- a/saleor/static/dashboard-next/components/FilterCard/__snapshots__/FilterCard.test.tsx.snap
+++ /dev/null
@@ -1,68 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<FilterCard /> renders properly 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <form>
- <div
- className="MuiCardHeader-root-29"
- >
- <div
- className="MuiCardHeader-content-32"
- >
- <span
- className="MuiTypography-root-35 MuiTypography-headline-40 MuiCardHeader-title-33"
- >
- Filters
- </span>
- </div>
- <div
- className="MuiCardHeader-action-31"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <div
- className="MuiCardContent-root-80"
- />
- </form>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/components/Money/Money.tsx b/saleor/static/dashboard-next/components/Money/Money.tsx
new file mode 100644
index 0000000000..0969925f49
--- /dev/null
+++ b/saleor/static/dashboard-next/components/Money/Money.tsx
@@ -0,0 +1,21 @@
+import grey from "material-ui/colors/grey";
+import { withStyles } from "material-ui/styles";
+import Typography from "material-ui/Typography";
+import * as React from "react";
+
+interface MoneyProps {
+ amount: number;
+ currency: string;
+}
+
+const decorate = withStyles(theme => ({
+ currency: {
+ color: theme.palette.grey[500]
+ }
+}));
+const Money = decorate<MoneyProps>(({ classes, amount, currency }) => (
+ <Typography>
+ {amount.toFixed(2)} <span className={classes.currency}>{currency}</span>
+ </Typography>
+));
+export default Money;
diff --git a/saleor/static/dashboard-next/components/Money/index.ts b/saleor/static/dashboard-next/components/Money/index.ts
new file mode 100644
index 0000000000..ace2118caa
--- /dev/null
+++ b/saleor/static/dashboard-next/components/Money/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./Money";
+export * from "./Money";
diff --git a/saleor/static/dashboard-next/components/MultiSelectField/MultiSelectField.test.tsx b/saleor/static/dashboard-next/components/MultiSelectField/MultiSelectField.test.tsx
deleted file mode 100644
index c76093f4f6..0000000000
--- a/saleor/static/dashboard-next/components/MultiSelectField/MultiSelectField.test.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import MultiSelectField from "./";
-
-const choices = [
- { value: "1", label: "Apparel" },
- { value: "2", label: "Groceries" },
- { value: "3", label: "Books" },
- { value: "4", label: "Accessories" }
-];
-
-describe("<MultiSelectField />", () => {
- it("renders with no value", () => {
- const component = renderer.create(
- <MultiSelectField choices={choices} onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with value", () => {
- const component = renderer.create(
- <MultiSelectField
- choices={choices}
- onChange={() => {}}
- value={[choices[0].value]}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with label", () => {
- const component = renderer.create(
- <MultiSelectField
- choices={choices}
- onChange={() => {}}
- label="Lorem ipsum"
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with hint", () => {
- const component = renderer.create(
- <MultiSelectField
- choices={choices}
- onChange={() => {}}
- hint="Lorem ipsum"
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with label and hint", () => {
- const component = renderer.create(
- <MultiSelectField
- choices={choices}
- onChange={() => {}}
- label="Lorem"
- hint="Ipsum"
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with value, label and hint", () => {
- const component = renderer.create(
- <MultiSelectField
- choices={choices}
- onChange={() => {}}
- value={[choices[0].value]}
- label="Lorem"
- hint="Ipsum"
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with error hint", () => {
- const component = renderer.create(
- <MultiSelectField
- choices={choices}
- onChange={() => {}}
- hint="Lorem error"
- error={true}
- />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/components/MultiSelectField/__snapshots__/MultiSelectField.test.tsx.snap b/saleor/static/dashboard-next/components/MultiSelectField/__snapshots__/MultiSelectField.test.tsx.snap
deleted file mode 100644
index 3d04fcb1e9..0000000000
--- a/saleor/static/dashboard-next/components/MultiSelectField/__snapshots__/MultiSelectField.test.tsx.snap
+++ /dev/null
@@ -1,514 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<MultiSelectField /> renders with error hint 1`] = `
-<div
- className="MuiFormControl-root-4 Component-formControl-3"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <div
- className="MuiInput-root-13 MuiInput-error-18 MuiInput-fullWidth-20 MuiInput-formControl-14 MuiInput-underline-17"
- >
- <div
- className="MuiSelect-root-8"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-9 MuiSelect-selectMenu-10 MuiInput-input-21"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={true}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-26 MuiSelect-icon-12"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-53 MuiFormHelperText-error-54"
- >
- Lorem error
- </p>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with hint 1`] = `
-<div
- className="MuiFormControl-root-4 Component-formControl-3"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <div
- className="MuiInput-root-13 MuiInput-fullWidth-20 MuiInput-formControl-14 MuiInput-underline-17"
- >
- <div
- className="MuiSelect-root-8"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-9 MuiSelect-selectMenu-10 MuiInput-input-21"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-26 MuiSelect-icon-12"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-53"
- >
- Lorem ipsum
- </p>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with label 1`] = `
-<div
- className="MuiFormControl-root-4 Component-formControl-3"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-48 MuiInputLabel-root-43 MuiInputLabel-formControl-44 MuiInputLabel-animated-47"
- data-shrink={false}
- >
- Lorem ipsum
- </label>
- <div
- className="MuiInput-root-13 MuiInput-fullWidth-20 MuiInput-formControl-14 MuiInput-underline-17"
- >
- <div
- className="MuiSelect-root-8"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-9 MuiSelect-selectMenu-10 MuiInput-input-21"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-26 MuiSelect-icon-12"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with label and hint 1`] = `
-<div
- className="MuiFormControl-root-4 Component-formControl-3"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-48 MuiInputLabel-root-43 MuiInputLabel-formControl-44 MuiInputLabel-animated-47"
- data-shrink={false}
- >
- Lorem
- </label>
- <div
- className="MuiInput-root-13 MuiInput-fullWidth-20 MuiInput-formControl-14 MuiInput-underline-17"
- >
- <div
- className="MuiSelect-root-8"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-9 MuiSelect-selectMenu-10 MuiInput-input-21"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-26 MuiSelect-icon-12"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-53"
- >
- Ipsum
- </p>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with no value 1`] = `
-<div
- className="MuiFormControl-root-4 Component-formControl-3"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <div
- className="MuiInput-root-13 MuiInput-fullWidth-20 MuiInput-formControl-14 MuiInput-underline-17"
- >
- <div
- className="MuiSelect-root-8"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-9 MuiSelect-selectMenu-10 MuiInput-input-21"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-26 MuiSelect-icon-12"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with value 1`] = `
-<div
- className="MuiFormControl-root-4 Component-formControl-3"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <div
- className="MuiInput-root-13 MuiInput-fullWidth-20 MuiInput-formControl-14 MuiInput-underline-17"
- >
- <div
- className="MuiSelect-root-8"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-9 MuiSelect-selectMenu-10 MuiInput-input-21"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <div
- className="Component-chipContainer-2"
- >
- <div
- className="MuiChip-root-36 Component-chip-1"
- onClick={undefined}
- onKeyDown={[Function]}
- role="button"
- tabIndex={-1}
- >
- <span
- className="MuiChip-label-41"
- >
- Apparel
- </span>
- </div>
- </div>
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value="1"
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-26 MuiSelect-icon-12"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with value, label and hint 1`] = `
-<div
- className="MuiFormControl-root-4 Component-formControl-3"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-48 MuiInputLabel-root-43 MuiInputLabel-formControl-44 MuiInputLabel-animated-47 MuiInputLabel-shrink-46"
- data-shrink={true}
- >
- Lorem
- </label>
- <div
- className="MuiInput-root-13 MuiInput-fullWidth-20 MuiInput-formControl-14 MuiInput-underline-17"
- >
- <div
- className="MuiSelect-root-8"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-9 MuiSelect-selectMenu-10 MuiInput-input-21"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <div
- className="Component-chipContainer-2"
- >
- <div
- className="MuiChip-root-36 Component-chip-1"
- onClick={undefined}
- onKeyDown={[Function]}
- role="button"
- tabIndex={-1}
- >
- <span
- className="MuiChip-label-41"
- >
- Apparel
- </span>
- </div>
- </div>
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value="1"
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-26 MuiSelect-icon-12"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-53"
- >
- Ipsum
- </p>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/components/PageHeader/PageHeader.test.tsx b/saleor/static/dashboard-next/components/PageHeader/PageHeader.test.tsx
deleted file mode 100644
index c071be1362..0000000000
--- a/saleor/static/dashboard-next/components/PageHeader/PageHeader.test.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import DeleteIcon from "@material-ui/icons/Delete";
-import IconButton from "material-ui/IconButton";
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import PageHeader from "./";
-
-describe("<PageHeader />", () => {
- it("renders without title", () => {
- const component = renderer.create(<PageHeader />);
- expect(component).toMatchSnapshot();
- });
- it("renders with title", () => {
- const component = renderer.create(<PageHeader title="Lorem ipsum" />);
- expect(component).toMatchSnapshot();
- });
- it("renders with title and back button", () => {
- const component = renderer.create(
- <PageHeader title="Lorem ipsum" onBack={jest.fn()} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with title icon bar", () => {
- const component = renderer.create(
- <PageHeader title="Lorem ipsum">
- <IconButton>
- <DeleteIcon />
- </IconButton>
- </PageHeader>
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with title, back button and icon bar", () => {
- const component = renderer.create(
- <PageHeader title="Lorem ipsum" onBack={jest.fn()}>
- <IconButton>
- <DeleteIcon />
- </IconButton>
- </PageHeader>
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/components/PageHeader/__snapshots__/PageHeader.test.tsx.snap b/saleor/static/dashboard-next/components/PageHeader/__snapshots__/PageHeader.test.tsx.snap
deleted file mode 100644
index 99d04766b5..0000000000
--- a/saleor/static/dashboard-next/components/PageHeader/__snapshots__/PageHeader.test.tsx.snap
+++ /dev/null
@@ -1,237 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<PageHeader /> renders with title 1`] = `
-<div
- className="Component-root-4"
->
- <h2
- className="MuiTypography-root-7 MuiTypography-title-13 Component-title-6"
- >
- Lorem ipsum
- </h2>
- <div
- className="Component-action-1"
- />
-</div>
-`;
-
-exports[`<PageHeader /> renders with title and back button 1`] = `
-<div
- className="Component-root-4"
->
- <button
- className="MuiButtonBase-root-38 MuiIconButton-root-32 MuiIconButton-colorInherit-33 Component-menuButton-3"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-37"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-40"
- color={undefined}
- 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
- className="MuiTouchRipple-root-46"
- />
- </button>
- <h2
- className="MuiTypography-root-7 MuiTypography-title-13 Component-title-6"
- >
- Lorem ipsum
- </h2>
- <div
- className="Component-action-1"
- />
-</div>
-`;
-
-exports[`<PageHeader /> renders with title icon bar 1`] = `
-<div
- className="Component-root-4"
->
- <h2
- className="MuiTypography-root-7 MuiTypography-title-13 Component-title-6"
- >
- Lorem ipsum
- </h2>
- <div
- className="Component-action-1"
- >
- <button
- className="MuiButtonBase-root-38 MuiIconButton-root-32"
- disabled={false}
- onBlur={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-37"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-40"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-46"
- />
- </button>
- </div>
-</div>
-`;
-
-exports[`<PageHeader /> renders with title, back button and icon bar 1`] = `
-<div
- className="Component-root-4"
->
- <button
- className="MuiButtonBase-root-38 MuiIconButton-root-32 MuiIconButton-colorInherit-33 Component-menuButton-3"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-37"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-40"
- color={undefined}
- 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
- className="MuiTouchRipple-root-46"
- />
- </button>
- <h2
- className="MuiTypography-root-7 MuiTypography-title-13 Component-title-6"
- >
- Lorem ipsum
- </h2>
- <div
- className="Component-action-1"
- >
- <button
- className="MuiButtonBase-root-38 MuiIconButton-root-32"
- disabled={false}
- onBlur={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-37"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-40"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-46"
- />
- </button>
- </div>
-</div>
-`;
-
-exports[`<PageHeader /> renders without title 1`] = `
-<div
- className="Component-root-4"
->
- <h2
- className="MuiTypography-root-7 MuiTypography-title-13 Component-title-6"
- >
- <span
- className="Component-skeleton-31"
- style={
- Object {
- "width": "10em",
- }
- }
- >
- ‌
- </span>
- </h2>
- <div
- className="Component-action-1"
- />
-</div>
-`;
diff --git a/saleor/static/dashboard-next/components/PhoneField/PhoneField.tsx b/saleor/static/dashboard-next/components/PhoneField/PhoneField.tsx
new file mode 100644
index 0000000000..946c0a5a36
--- /dev/null
+++ b/saleor/static/dashboard-next/components/PhoneField/PhoneField.tsx
@@ -0,0 +1,50 @@
+import { withStyles } from "material-ui/styles";
+import TextField from "material-ui/TextField";
+import * as React from "react";
+
+import SingleSelectField from "../../components/SingleSelectField";
+
+interface PhoneFieldProps {
+ name: string;
+ prefix: string;
+ number: string;
+ prefixes: string[];
+ label?: string;
+ onChange(event: React.ChangeEvent<any>);
+}
+
+const decorate = withStyles(theme => ({
+ root: {
+ display: "grid",
+ gridColumnGap: `${theme.spacing.unit * 2}px`,
+ gridTemplateColumns: "5rem 1fr"
+ }
+}));
+const PhoneField = decorate<PhoneFieldProps>(
+ ({
+ classes,
+ name,
+ number: phoneNumber,
+ prefix,
+ prefixes,
+ label,
+ onChange
+ }) => (
+ <div className={classes.root}>
+ <SingleSelectField
+ name={name + "_prefix"}
+ choices={prefixes.map(p => ({ label: "+" + p, value: p }))}
+ onChange={onChange}
+ value={prefix}
+ label={label}
+ />
+ <TextField
+ name={name + "_number"}
+ onChange={onChange}
+ value={phoneNumber}
+ label="&nbsp;"
+ />
+ </div>
+ )
+);
+export default PhoneField;
diff --git a/saleor/static/dashboard-next/components/PhoneField/index.ts b/saleor/static/dashboard-next/components/PhoneField/index.ts
new file mode 100644
index 0000000000..2f53bef789
--- /dev/null
+++ b/saleor/static/dashboard-next/components/PhoneField/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./PhoneField";
+export * from "./PhoneField";
diff --git a/saleor/static/dashboard-next/components/PriceField/PriceField.test.tsx b/saleor/static/dashboard-next/components/PriceField/PriceField.test.tsx
deleted file mode 100644
index f21801240c..0000000000
--- a/saleor/static/dashboard-next/components/PriceField/PriceField.test.tsx
+++ /dev/null
@@ -1,137 +0,0 @@
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import PriceField, { PriceRangeField } from "./";
-
-const value = {
- max: "30",
- min: "10"
-};
-
-describe("<PriceRangeField />", () => {
- it("renders with no value", () => {
- const component = renderer.create(<PriceRangeField onChange={() => {}} />);
- expect(component).toMatchSnapshot();
- });
- it("renders with value", () => {
- const component = renderer.create(
- <PriceRangeField value={value} onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with label", () => {
- const component = renderer.create(
- <PriceRangeField label="Lorem ipsum" onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with hint", () => {
- const component = renderer.create(
- <PriceRangeField hint="Lorem ipsum" onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with currency symbol", () => {
- const component = renderer.create(
- <PriceRangeField currencySymbol="$" onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when disabled", () => {
- const component = renderer.create(
- <PriceRangeField disabled onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with label and hint", () => {
- const component = renderer.create(
- <PriceRangeField label="Lorem" hint="Ipsum" onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with value, label and hint", () => {
- const component = renderer.create(
- <PriceRangeField
- value={value}
- label="Lorem"
- hint="Ipsum"
- onChange={() => {}}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with value, label and error", () => {
- const component = renderer.create(
- <PriceRangeField
- value={value}
- label="Lorem"
- hint="Ipsum"
- error={true}
- onChange={() => {}}
- />
- );
- expect(component).toMatchSnapshot();
- });
-});
-
-describe("<PriceField />", () => {
- it("renders with no value", () => {
- const component = renderer.create(<PriceField onChange={() => {}} />);
- expect(component).toMatchSnapshot();
- });
- it("renders with value", () => {
- const component = renderer.create(
- <PriceField value={"30"} onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with label", () => {
- const component = renderer.create(
- <PriceField label="Lorem ipsum" onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with hint", () => {
- const component = renderer.create(
- <PriceField hint="Lorem ipsum" onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with currency symbol", () => {
- const component = renderer.create(
- <PriceField currencySymbol="$" onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when disabled", () => {
- const component = renderer.create(
- <PriceField disabled onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with label and hint", () => {
- const component = renderer.create(
- <PriceField label="Lorem" hint="Ipsum" onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with value, label and hint", () => {
- const component = renderer.create(
- <PriceField value={"30"} label="Lorem" hint="Ipsum" onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with value, label, currency symbol and error", () => {
- const component = renderer.create(
- <PriceField
- value={"30"}
- label="Lorem"
- hint="Ipsum"
- error={true}
- onChange={() => {}}
- currencySymbol="$"
- />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/components/PriceField/__snapshots__/PriceField.test.tsx.snap b/saleor/static/dashboard-next/components/PriceField/__snapshots__/PriceField.test.tsx.snap
deleted file mode 100644
index 10683c0301..0000000000
--- a/saleor/static/dashboard-next/components/PriceField/__snapshots__/PriceField.test.tsx.snap
+++ /dev/null
@@ -1,1191 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<PriceField /> renders when disabled 1`] = `
-<div
- className="MuiFormControl-root-5 MuiFormControl-fullWidth-8"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <div
- className="MuiInput-root-9 MuiInput-disabled-12 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-disabled-12 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={true}
- id={undefined}
- name="price"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
-</div>
-`;
-
-exports[`<PriceField /> renders with currency symbol 1`] = `
-<div
- className="MuiFormControl-root-5 MuiFormControl-fullWidth-8"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <div
- className="MuiInput-root-9 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <div
- className="MuiInputAdornment-root-36 MuiInputAdornment-positionEnd-38"
- >
- <p
- className="MuiTypography-root-39 MuiTypography-body1-48 MuiTypography-colorTextSecondary-61"
- >
- $
- </p>
- </div>
- </div>
-</div>
-`;
-
-exports[`<PriceField /> renders with hint 1`] = `
-<div
- className="MuiFormControl-root-5 MuiFormControl-fullWidth-8"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <div
- className="MuiInput-root-9 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- <p
- className="MuiFormHelperText-root-32"
- >
- Lorem ipsum
- </p>
-</div>
-`;
-
-exports[`<PriceField /> renders with label 1`] = `
-<div
- className="MuiFormControl-root-5 MuiFormControl-fullWidth-8"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-27 MuiInputLabel-root-22 MuiInputLabel-formControl-23 MuiInputLabel-animated-26"
- data-shrink={false}
- htmlFor="price"
- >
- Lorem ipsum
- </label>
- <div
- className="MuiInput-root-9 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
-</div>
-`;
-
-exports[`<PriceField /> renders with label and hint 1`] = `
-<div
- className="MuiFormControl-root-5 MuiFormControl-fullWidth-8"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-27 MuiInputLabel-root-22 MuiInputLabel-formControl-23 MuiInputLabel-animated-26"
- data-shrink={false}
- htmlFor="price"
- >
- Lorem
- </label>
- <div
- className="MuiInput-root-9 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- <p
- className="MuiFormHelperText-root-32"
- >
- Ipsum
- </p>
-</div>
-`;
-
-exports[`<PriceField /> renders with no value 1`] = `
-<div
- className="MuiFormControl-root-5 MuiFormControl-fullWidth-8"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <div
- className="MuiInput-root-9 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
-</div>
-`;
-
-exports[`<PriceField /> renders with value 1`] = `
-<div
- className="MuiFormControl-root-5 MuiFormControl-fullWidth-8"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <div
- className="MuiInput-root-9 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value="30"
- />
- <span />
- </div>
-</div>
-`;
-
-exports[`<PriceField /> renders with value, label and hint 1`] = `
-<div
- className="MuiFormControl-root-5 MuiFormControl-fullWidth-8"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-27 MuiInputLabel-root-22 MuiInputLabel-formControl-23 MuiInputLabel-animated-26 MuiInputLabel-shrink-25"
- data-shrink={true}
- htmlFor="price"
- >
- Lorem
- </label>
- <div
- className="MuiInput-root-9 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value="30"
- />
- <span />
- </div>
- <p
- className="MuiFormHelperText-root-32"
- >
- Ipsum
- </p>
-</div>
-`;
-
-exports[`<PriceField /> renders with value, label, currency symbol and error 1`] = `
-<div
- className="MuiFormControl-root-5 MuiFormControl-fullWidth-8"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-27 MuiFormLabel-error-30 MuiInputLabel-root-22 MuiInputLabel-formControl-23 MuiInputLabel-animated-26 MuiInputLabel-shrink-25"
- data-shrink={true}
- htmlFor="price"
- >
- Lorem
- </label>
- <div
- className="MuiInput-root-9 MuiInput-error-14 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={true}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value="30"
- />
- <div
- className="MuiInputAdornment-root-36 MuiInputAdornment-positionEnd-38"
- >
- <p
- className="MuiTypography-root-39 MuiTypography-body1-48 MuiTypography-colorTextSecondary-61"
- >
- $
- </p>
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-32 MuiFormHelperText-error-33"
- >
- Ipsum
- </p>
-</div>
-`;
-
-exports[`<PriceRangeField /> renders when disabled 1`] = `
-<div
- className="Component-widgetContainer-4"
->
- <div
- className="Component-inputContainer-1"
- >
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-disabled-12 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-disabled-12 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={true}
- id={undefined}
- name="price_min"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- </div>
- <span
- className="Component-separator-3"
- >
- -
- </span>
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-disabled-12 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-disabled-12 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={true}
- id={undefined}
- name="price_max"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- </div>
- </div>
-</div>
-`;
-
-exports[`<PriceRangeField /> renders with currency symbol 1`] = `
-<div
- className="Component-widgetContainer-4"
->
- <div
- className="Component-inputContainer-1"
- >
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_min"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <div
- className="MuiInputAdornment-root-36 MuiInputAdornment-positionEnd-38"
- >
- <p
- className="MuiTypography-root-39 MuiTypography-body1-48 MuiTypography-colorTextSecondary-61"
- >
- $
- </p>
- </div>
- </div>
- </div>
- <span
- className="Component-separator-3"
- >
- -
- </span>
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_max"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <div
- className="MuiInputAdornment-root-36 MuiInputAdornment-positionEnd-38"
- >
- <p
- className="MuiTypography-root-39 MuiTypography-body1-48 MuiTypography-colorTextSecondary-61"
- >
- $
- </p>
- </div>
- </div>
- </div>
- </div>
-</div>
-`;
-
-exports[`<PriceRangeField /> renders with hint 1`] = `
-<div
- className="Component-widgetContainer-4"
->
- <div
- className="Component-inputContainer-1"
- >
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_min"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- <p
- className="MuiFormHelperText-root-32"
- >
- Lorem ipsum
- </p>
- </div>
- <span
- className="Component-separator-3"
- >
- -
- </span>
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_max"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- </div>
- </div>
-</div>
-`;
-
-exports[`<PriceRangeField /> renders with label 1`] = `
-<div
- className="Component-widgetContainer-4"
->
- <div
- className="Component-inputContainer-1"
- >
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-27 MuiInputLabel-root-22 MuiInputLabel-formControl-23 MuiInputLabel-animated-26"
- data-shrink={false}
- htmlFor="price_min"
- >
- Lorem ipsum
- </label>
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_min"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- </div>
- <span
- className="Component-separator-3"
- >
- -
- </span>
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_max"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- </div>
- </div>
-</div>
-`;
-
-exports[`<PriceRangeField /> renders with label and hint 1`] = `
-<div
- className="Component-widgetContainer-4"
->
- <div
- className="Component-inputContainer-1"
- >
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-27 MuiInputLabel-root-22 MuiInputLabel-formControl-23 MuiInputLabel-animated-26"
- data-shrink={false}
- htmlFor="price_min"
- >
- Lorem
- </label>
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_min"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- <p
- className="MuiFormHelperText-root-32"
- >
- Ipsum
- </p>
- </div>
- <span
- className="Component-separator-3"
- >
- -
- </span>
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_max"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- </div>
- </div>
-</div>
-`;
-
-exports[`<PriceRangeField /> renders with no value 1`] = `
-<div
- className="Component-widgetContainer-4"
->
- <div
- className="Component-inputContainer-1"
- >
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_min"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- </div>
- <span
- className="Component-separator-3"
- >
- -
- </span>
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_max"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value=""
- />
- <span />
- </div>
- </div>
- </div>
-</div>
-`;
-
-exports[`<PriceRangeField /> renders with value 1`] = `
-<div
- className="Component-widgetContainer-4"
->
- <div
- className="Component-inputContainer-1"
- >
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_min"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value="10"
- />
- <span />
- </div>
- </div>
- <span
- className="Component-separator-3"
- >
- -
- </span>
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_max"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value="30"
- />
- <span />
- </div>
- </div>
- </div>
-</div>
-`;
-
-exports[`<PriceRangeField /> renders with value, label and error 1`] = `
-<div
- className="Component-widgetContainer-4"
->
- <div
- className="Component-inputContainer-1"
- >
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-27 MuiFormLabel-error-30 MuiInputLabel-root-22 MuiInputLabel-formControl-23 MuiInputLabel-animated-26 MuiInputLabel-shrink-25"
- data-shrink={true}
- htmlFor="price_min"
- >
- Lorem
- </label>
- <div
- className="MuiInput-root-9 MuiInput-error-14 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={true}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_min"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value="10"
- />
- <span />
- </div>
- <p
- className="MuiFormHelperText-root-32 MuiFormHelperText-error-33"
- >
- Ipsum
- </p>
- </div>
- <span
- className="Component-separator-3"
- >
- -
- </span>
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-error-14 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={true}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_max"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value="30"
- />
- <span />
- </div>
- </div>
- </div>
-</div>
-`;
-
-exports[`<PriceRangeField /> renders with value, label and hint 1`] = `
-<div
- className="Component-widgetContainer-4"
->
- <div
- className="Component-inputContainer-1"
- >
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-27 MuiInputLabel-root-22 MuiInputLabel-formControl-23 MuiInputLabel-animated-26 MuiInputLabel-shrink-25"
- data-shrink={true}
- htmlFor="price_min"
- >
- Lorem
- </label>
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_min"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value="10"
- />
- <span />
- </div>
- <p
- className="MuiFormHelperText-root-32"
- >
- Ipsum
- </p>
- </div>
- <span
- className="Component-separator-3"
- >
- -
- </span>
- <div
- className="MuiFormControl-root-5"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <div
- className="MuiInput-root-9 MuiInput-fullWidth-16 MuiInput-formControl-10 MuiInput-underline-13 Component-pullDown-2"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-17 MuiInput-inputType-20"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="price_max"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="number"
- value="30"
- />
- <span />
- </div>
- </div>
- </div>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/components/ProductList/ProductList.test.tsx b/saleor/static/dashboard-next/components/ProductList/ProductList.test.tsx
deleted file mode 100644
index 216dc5c8f1..0000000000
--- a/saleor/static/dashboard-next/components/ProductList/ProductList.test.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import ProductList from "./ProductList";
-
-const products = [
- {
- id: "prod1",
- name: "Lewis PLC",
- productType: {
- id: "123412341234",
- name: "T-sirts"
- },
- thumbnailUrl:
- "/media/__sized__/products/saleor/static/placeholders/t-shirts/5_ZoF6Xi8-crop-c0-5__0-5-255x255-70.jpg"
- },
- {
- id: "prod2",
- name: "Kennedy-Ramirez",
- productType: {
- id: "123412341234",
- name: "T-sirts"
- },
- thumbnailUrl:
- "/media/__sized__/products/saleor/static/placeholders/t-shirts/6_07Fa6v8-crop-c0-5__0-5-255x255-70.jpg"
- },
- {
- id: "prod3",
- name: "Newman, Ashley and Roberson",
- productType: {
- id: "123412341234",
- name: "T-sirts"
- },
- thumbnailUrl:
- "/media/__sized__/products/saleor/static/placeholders/t-shirts/6_zeczDly-crop-c0-5__0-5-255x255-70.jpg"
- }
-];
-
-describe("<ProductList />", () => {
- it("renders while data is loading", () => {
- const component = renderer.create(
- <ProductList
- hasPreviousPage={false}
- hasNextPage={false}
- onNextPage={jest.fn()}
- onPreviousPage={jest.fn()}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders properly when data is loaded", () => {
- const component = renderer.create(
- <ProductList
- hasPreviousPage={false}
- hasNextPage={false}
- onNextPage={jest.fn()}
- onPreviousPage={jest.fn()}
- products={products}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders properly when product list is empty", () => {
- const component = renderer.create(
- <ProductList
- hasNextPage={false}
- onNextPage={jest.fn()}
- onPreviousPage={jest.fn()}
- products={[]}
- />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/components/ProductList/__snapshots__/ProductList.test.tsx.snap b/saleor/static/dashboard-next/components/ProductList/__snapshots__/ProductList.test.tsx.snap
deleted file mode 100644
index e7ae0bfa2d..0000000000
--- a/saleor/static/dashboard-next/components/ProductList/__snapshots__/ProductList.test.tsx.snap
+++ /dev/null
@@ -1,573 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<ProductList /> renders properly when data is loaded 1`] = `
-<table
- className="MuiTable-root-3"
->
- <thead
- className="MuiTableHead-root-4"
- >
- <tr
- className="MuiTableRow-root-5 MuiTableRow-head-8"
- >
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11 Component-avatarCell-1"
- scope="col"
- />
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Name
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Type
- </th>
- </tr>
- </thead>
- <tfoot>
- <tr
- className="MuiTableRow-root-5 MuiTableRow-footer-9"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-footer-13 MuiTablePagination-root-21"
- colSpan={3}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-27 MuiToolbar-gutters-28 MuiTablePagination-toolbar-26"
- >
- <div
- className="MuiTablePagination-spacer-25"
- />
- <div
- className="MuiTablePaginationActions-root-29"
- >
- <button
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiTableBody-root-44"
- >
- <tr
- className="MuiTableRow-root-5"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-avatarCell-1"
- scope={undefined}
- >
- <div
- className="MuiAvatar-root-45"
- >
- <img
- alt={undefined}
- className="MuiAvatar-img-47"
- sizes={undefined}
- src="/media/__sized__/products/saleor/static/placeholders/t-shirts/5_ZoF6Xi8-crop-c0-5__0-5-255x255-70.jpg"
- srcSet={undefined}
- />
- </div>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- <span
- className=""
- onClick={[Function]}
- >
- Lewis PLC
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- T-sirts
- </td>
- </tr>
- <tr
- className="MuiTableRow-root-5"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-avatarCell-1"
- scope={undefined}
- >
- <div
- className="MuiAvatar-root-45"
- >
- <img
- alt={undefined}
- className="MuiAvatar-img-47"
- sizes={undefined}
- src="/media/__sized__/products/saleor/static/placeholders/t-shirts/6_07Fa6v8-crop-c0-5__0-5-255x255-70.jpg"
- srcSet={undefined}
- />
- </div>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- <span
- className=""
- onClick={[Function]}
- >
- Kennedy-Ramirez
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- T-sirts
- </td>
- </tr>
- <tr
- className="MuiTableRow-root-5"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-avatarCell-1"
- scope={undefined}
- >
- <div
- className="MuiAvatar-root-45"
- >
- <img
- alt={undefined}
- className="MuiAvatar-img-47"
- sizes={undefined}
- src="/media/__sized__/products/saleor/static/placeholders/t-shirts/6_zeczDly-crop-c0-5__0-5-255x255-70.jpg"
- srcSet={undefined}
- />
- </div>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- <span
- className=""
- onClick={[Function]}
- >
- Newman, Ashley and Roberson
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- T-sirts
- </td>
- </tr>
- </tbody>
-</table>
-`;
-
-exports[`<ProductList /> renders properly when product list is empty 1`] = `
-<table
- className="MuiTable-root-3"
->
- <thead
- className="MuiTableHead-root-4"
- >
- <tr
- className="MuiTableRow-root-5 MuiTableRow-head-8"
- >
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11 Component-avatarCell-1"
- scope="col"
- />
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Name
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Type
- </th>
- </tr>
- </thead>
- <tfoot>
- <tr
- className="MuiTableRow-root-5 MuiTableRow-footer-9"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-footer-13 MuiTablePagination-root-21"
- colSpan={3}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-27 MuiToolbar-gutters-28 MuiTablePagination-toolbar-26"
- >
- <div
- className="MuiTablePagination-spacer-25"
- />
- <div
- className="MuiTablePaginationActions-root-29"
- >
- <button
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiTableBody-root-44"
- >
- <tr
- className="MuiTableRow-root-5"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-avatarCell-1"
- scope={undefined}
- />
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- colSpan={2}
- scope={undefined}
- >
- No products found
- </td>
- </tr>
- </tbody>
-</table>
-`;
-
-exports[`<ProductList /> renders while data is loading 1`] = `
-<table
- className="MuiTable-root-3"
->
- <thead
- className="MuiTableHead-root-4"
- >
- <tr
- className="MuiTableRow-root-5 MuiTableRow-head-8"
- >
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11 Component-avatarCell-1"
- scope="col"
- />
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Name
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Type
- </th>
- </tr>
- </thead>
- <tfoot>
- <tr
- className="MuiTableRow-root-5 MuiTableRow-footer-9"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-footer-13 MuiTablePagination-root-21"
- colSpan={3}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-27 MuiToolbar-gutters-28 MuiTablePagination-toolbar-26"
- >
- <div
- className="MuiTablePagination-spacer-25"
- />
- <div
- className="MuiTablePaginationActions-root-29"
- >
- <button
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiTableBody-root-44"
- >
- <tr
- className="MuiTableRow-root-5"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-avatarCell-1"
- scope={undefined}
- >
- <div
- className="MuiAvatar-root-45 MuiAvatar-colorDefault-46"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M19 8l-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z"
- />
- </g>
- </svg>
- </div>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- <span
- className="Component-skeleton-48"
- style={undefined}
- >
- ‌
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- <span
- className="Component-skeleton-48"
- style={undefined}
- >
- ‌
- </span>
- </td>
- </tr>
- </tbody>
-</table>
-`;
diff --git a/saleor/static/dashboard-next/components/SaveButtonBar/SaveButtonBar.test.tsx b/saleor/static/dashboard-next/components/SaveButtonBar/SaveButtonBar.test.tsx
deleted file mode 100644
index 23846dceec..0000000000
--- a/saleor/static/dashboard-next/components/SaveButtonBar/SaveButtonBar.test.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import SaveButtonBar from "./SaveButtonBar";
-
-describe("<SaveButtonBar />", () => {
- it("renders", () => {
- const component = renderer.create(
- <SaveButtonBar onBack={jest.fn()} onSave={jest.fn()} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when disabled", () => {
- const component = renderer.create(
- <SaveButtonBar onBack={jest.fn()} onSave={jest.fn()} disabled />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/components/SaveButtonBar/__snapshots__/SaveButtonBar.test.tsx.snap b/saleor/static/dashboard-next/components/SaveButtonBar/__snapshots__/SaveButtonBar.test.tsx.snap
deleted file mode 100644
index 7e80394151..0000000000
--- a/saleor/static/dashboard-next/components/SaveButtonBar/__snapshots__/SaveButtonBar.test.tsx.snap
+++ /dev/null
@@ -1,122 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<SaveButtonBar /> renders 1`] = `
-<div
- className="Component-root-1"
->
- <div
- className="Component-spacer-2"
- />
- <button
- className="MuiButtonBase-root-19 MuiButton-root-4 Component-button-3"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiButton-label-5"
- >
- Cancel
- </span>
- <span
- className="MuiTouchRipple-root-21"
- />
- </button>
- <button
- className="MuiButtonBase-root-19 MuiButton-root-4 MuiButton-raised-9 MuiButton-raisedPrimary-10"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiButton-label-5"
- >
- Save
- </span>
- <span
- className="MuiTouchRipple-root-21"
- />
- </button>
-</div>
-`;
-
-exports[`<SaveButtonBar /> renders when disabled 1`] = `
-<div
- className="Component-root-1"
->
- <div
- className="Component-spacer-2"
- />
- <button
- className="MuiButtonBase-root-19 MuiButton-root-4 Component-button-3"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiButton-label-5"
- >
- Cancel
- </span>
- <span
- className="MuiTouchRipple-root-21"
- />
- </button>
- <button
- className="MuiButtonBase-root-19 MuiButtonBase-disabled-20 MuiButton-root-4 MuiButton-raised-9 MuiButton-raisedPrimary-10 MuiButton-disabled-13"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiButton-label-5"
- >
- Save
- </span>
- </button>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx b/saleor/static/dashboard-next/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx
new file mode 100644
index 0000000000..356befa775
--- /dev/null
+++ b/saleor/static/dashboard-next/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx
@@ -0,0 +1,143 @@
+import Downshift from "downshift";
+import * as keycode from "keycode";
+import Chip from "material-ui/Chip";
+import { MenuItem } from "material-ui/Menu";
+import Paper from "material-ui/Paper";
+import { CircularProgress } from "material-ui/Progress";
+import { withStyles } from "material-ui/styles";
+import TextField from "material-ui/TextField";
+import * as React from "react";
+
+import i18n from "../../i18n";
+
+interface SingleAutocompleteSelectFieldProps {
+ name: string;
+ choices: Array<{
+ label: string;
+ value: string;
+ }>;
+ value?: {
+ label: string;
+ value: string;
+ };
+ loading?: boolean;
+ placeholder?: string;
+ custom?: boolean;
+ helperText?: string;
+ label?: string;
+ fetchChoices(value: string);
+ onChange(event);
+}
+
+const decorate = withStyles(theme => ({
+ chip: {
+ margin: `${theme.spacing.unit / 2}px ${theme.spacing.unit / 4}px`
+ },
+ container: {
+ flexGrow: 1,
+ position: "relative" as "relative"
+ },
+ inputRoot: {
+ flexWrap: "wrap" as "wrap"
+ },
+ paper: {
+ left: 0,
+ marginTop: theme.spacing.unit,
+ position: "absolute" as "absolute",
+ right: 0,
+ zIndex: 1
+ }
+}));
+
+export const SingleAutocompleteSelectField = decorate<
+ SingleAutocompleteSelectFieldProps
+>(
+ ({
+ choices,
+ classes,
+ custom,
+ helperText,
+ label,
+ loading,
+ name,
+ placeholder,
+ value,
+ fetchChoices,
+ onChange
+ }) => {
+ const handleChange = item => onChange({ target: { name, value: item } });
+
+ return (
+ <Downshift
+ selectedItem={value}
+ itemToString={item => (item ? item.label : "")}
+ onSelect={handleChange}
+ onInputValueChange={fetchChoices}
+ >
+ {({
+ getInputProps,
+ getItemProps,
+ isOpen,
+ inputValue,
+ selectedItem,
+ highlightedIndex
+ }) => {
+ const isCustom =
+ choices.filter(c => c.value === selectedItem.value).length === 0;
+ return (
+ <div className={classes.container}>
+ <TextField
+ InputProps={{
+ classes: {
+ root: classes.inputRoot
+ },
+ ...getInputProps({
+ placeholder
+ })
+ }}
+ helperText={helperText}
+ label={label}
+ fullWidth={true}
+ />
+ {isOpen && (
+ <Paper className={classes.paper} square>
+ {loading ? (
+ <MenuItem disabled={true} component="div">
+ {i18n.t("Loading...")}
+ </MenuItem>
+ ) : (
+ <>
+ {choices.map((suggestion, index) => (
+ <MenuItem
+ key={suggestion.value}
+ selected={suggestion.value === selectedItem.value}
+ component="div"
+ {...getItemProps({ item: suggestion })}
+ >
+ {suggestion.label}
+ </MenuItem>
+ ))}
+ {custom && (
+ <MenuItem
+ key={"customValue"}
+ selected={isCustom}
+ component="div"
+ {...getItemProps({
+ item: { label: inputValue, value: inputValue }
+ })}
+ >
+ {i18n.t("Add custom value")}
+ </MenuItem>
+ )}
+ </>
+ )}
+ </Paper>
+ )}
+ </div>
+ );
+ }}
+ </Downshift>
+ );
+ }
+);
+export default SingleAutocompleteSelectField;
diff --git a/saleor/static/dashboard-next/components/SingleAutocompleteSelectField/index.ts b/saleor/static/dashboard-next/components/SingleAutocompleteSelectField/index.ts
new file mode 100644
index 0000000000..c1cdf064dc
--- /dev/null
+++ b/saleor/static/dashboard-next/components/SingleAutocompleteSelectField/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./SingleAutocompleteSelectField";
+export * from "./SingleAutocompleteSelectField";
diff --git a/saleor/static/dashboard-next/components/SingleSelectField/SingleSelectField.test.tsx b/saleor/static/dashboard-next/components/SingleSelectField/SingleSelectField.test.tsx
deleted file mode 100644
index e8dae76771..0000000000
--- a/saleor/static/dashboard-next/components/SingleSelectField/SingleSelectField.test.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import SingleSelectField from "./";
-
-const choices = [
- { value: "1", label: "Apparel" },
- { value: "2", label: "Groceries" },
- { value: "3", label: "Books" },
- { value: "4", label: "Accessories" }
-];
-
-describe("<MultiSelectField />", () => {
- it("renders with no value", () => {
- const component = renderer.create(
- <SingleSelectField choices={choices} onChange={() => {}} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with value", () => {
- const component = renderer.create(
- <SingleSelectField
- choices={choices}
- onChange={() => {}}
- value={choices[0].value}
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with label", () => {
- const component = renderer.create(
- <SingleSelectField
- choices={choices}
- onChange={() => {}}
- label="Lorem ipsum"
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with hint", () => {
- const component = renderer.create(
- <SingleSelectField
- choices={choices}
- onChange={() => {}}
- hint="Lorem ipsum"
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with label and hint", () => {
- const component = renderer.create(
- <SingleSelectField
- choices={choices}
- onChange={() => {}}
- label="Lorem"
- hint="Ipsum"
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with value, label and hint", () => {
- const component = renderer.create(
- <SingleSelectField
- choices={choices}
- onChange={() => {}}
- value={choices[0].value}
- label="Lorem"
- hint="Ipsum"
- />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with error hint", () => {
- const component = renderer.create(
- <SingleSelectField
- choices={choices}
- onChange={() => {}}
- hint="Lorem error"
- error={true}
- />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/components/SingleSelectField/__snapshots__/SingleSelectField.test.tsx.snap b/saleor/static/dashboard-next/components/SingleSelectField/__snapshots__/SingleSelectField.test.tsx.snap
deleted file mode 100644
index 3e34682c46..0000000000
--- a/saleor/static/dashboard-next/components/SingleSelectField/__snapshots__/SingleSelectField.test.tsx.snap
+++ /dev/null
@@ -1,498 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<MultiSelectField /> renders with error hint 1`] = `
-<div
- className="MuiFormControl-root-2 Component-formControl-1"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-11 MuiFormLabel-error-14 MuiInputLabel-root-6 MuiInputLabel-formControl-7 MuiInputLabel-animated-10"
- data-shrink={false}
- />
- <div
- className="MuiInput-root-21 MuiInput-error-26 MuiInput-fullWidth-28 MuiInput-formControl-22 MuiInput-underline-25"
- >
- <div
- className="MuiSelect-root-16"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-17 MuiSelect-selectMenu-18 MuiInput-input-29"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={true}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-34 MuiSelect-icon-20"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-44 MuiFormHelperText-error-45"
- >
- Lorem error
- </p>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with hint 1`] = `
-<div
- className="MuiFormControl-root-2 Component-formControl-1"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-11 MuiInputLabel-root-6 MuiInputLabel-formControl-7 MuiInputLabel-animated-10"
- data-shrink={false}
- />
- <div
- className="MuiInput-root-21 MuiInput-fullWidth-28 MuiInput-formControl-22 MuiInput-underline-25"
- >
- <div
- className="MuiSelect-root-16"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-17 MuiSelect-selectMenu-18 MuiInput-input-29"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-34 MuiSelect-icon-20"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-44"
- >
- Lorem ipsum
- </p>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with label 1`] = `
-<div
- className="MuiFormControl-root-2 Component-formControl-1"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-11 MuiInputLabel-root-6 MuiInputLabel-formControl-7 MuiInputLabel-animated-10"
- data-shrink={false}
- >
- Lorem ipsum
- </label>
- <div
- className="MuiInput-root-21 MuiInput-fullWidth-28 MuiInput-formControl-22 MuiInput-underline-25"
- >
- <div
- className="MuiSelect-root-16"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-17 MuiSelect-selectMenu-18 MuiInput-input-29"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-34 MuiSelect-icon-20"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with label and hint 1`] = `
-<div
- className="MuiFormControl-root-2 Component-formControl-1"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-11 MuiInputLabel-root-6 MuiInputLabel-formControl-7 MuiInputLabel-animated-10"
- data-shrink={false}
- >
- Lorem
- </label>
- <div
- className="MuiInput-root-21 MuiInput-fullWidth-28 MuiInput-formControl-22 MuiInput-underline-25"
- >
- <div
- className="MuiSelect-root-16"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-17 MuiSelect-selectMenu-18 MuiInput-input-29"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-34 MuiSelect-icon-20"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-44"
- >
- Ipsum
- </p>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with no value 1`] = `
-<div
- className="MuiFormControl-root-2 Component-formControl-1"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-11 MuiInputLabel-root-6 MuiInputLabel-formControl-7 MuiInputLabel-animated-10"
- data-shrink={false}
- />
- <div
- className="MuiInput-root-21 MuiInput-fullWidth-28 MuiInput-formControl-22 MuiInput-underline-25"
- >
- <div
- className="MuiSelect-root-16"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-17 MuiSelect-selectMenu-18 MuiInput-input-29"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- <span
- dangerouslySetInnerHTML={
- Object {
- "__html": "&#8203",
- }
- }
- />
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value=""
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-34 MuiSelect-icon-20"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with value 1`] = `
-<div
- className="MuiFormControl-root-2 Component-formControl-1"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-11 MuiInputLabel-root-6 MuiInputLabel-formControl-7 MuiInputLabel-animated-10 MuiInputLabel-shrink-9"
- data-shrink={true}
- />
- <div
- className="MuiInput-root-21 MuiInput-fullWidth-28 MuiInput-formControl-22 MuiInput-underline-25"
- >
- <div
- className="MuiSelect-root-16"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-17 MuiSelect-selectMenu-18 MuiInput-input-29"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- Apparel
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value="1"
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-34 MuiSelect-icon-20"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
-</div>
-`;
-
-exports[`<MultiSelectField /> renders with value, label and hint 1`] = `
-<div
- className="MuiFormControl-root-2 Component-formControl-1"
- onBlur={[Function]}
- onFocus={[Function]}
->
- <label
- className="MuiFormLabel-root-11 MuiInputLabel-root-6 MuiInputLabel-formControl-7 MuiInputLabel-animated-10 MuiInputLabel-shrink-9"
- data-shrink={true}
- >
- Lorem
- </label>
- <div
- className="MuiInput-root-21 MuiInput-fullWidth-28 MuiInput-formControl-22 MuiInput-underline-25"
- >
- <div
- className="MuiSelect-root-16"
- >
- <div
- aria-haspopup="true"
- aria-owns={null}
- aria-pressed="false"
- className="MuiSelect-select-17 MuiSelect-selectMenu-18 MuiInput-input-29"
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- role="button"
- tabIndex={0}
- >
- Apparel
- </div>
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- defaultValue={undefined}
- id={undefined}
- name={undefined}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="hidden"
- value="1"
- />
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-34 MuiSelect-icon-20"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M7 10l5 5 5-5z"
- />
- </svg>
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-44"
- >
- Ipsum
- </p>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/components/StatusLabel/StatusLabel.tsx b/saleor/static/dashboard-next/components/StatusLabel/StatusLabel.tsx
new file mode 100644
index 0000000000..051b048fcc
--- /dev/null
+++ b/saleor/static/dashboard-next/components/StatusLabel/StatusLabel.tsx
@@ -0,0 +1,54 @@
+import yellow from "material-ui/colors/yellow";
+import { withStyles } from "material-ui/styles";
+import Typography from "material-ui/Typography";
+import * as React from "react";
+
+interface StatusLabelProps {
+ label: string;
+ status: string;
+}
+
+const decorate = withStyles(theme => {
+ const dot = {
+ borderRadius: "100%",
+ display: "inline-block",
+ height: theme.spacing.unit,
+ marginBottom: 1,
+ marginRight: theme.spacing.unit,
+ width: theme.spacing.unit
+ };
+ return {
+ errorDot: {
+ ...dot,
+ backgroundColor: theme.palette.error.main
+ },
+ neutralDot: {
+ ...dot,
+ backgroundColor: yellow[500]
+ },
+ span: {
+ display: "inline"
+ },
+ successDot: {
+ ...dot,
+ backgroundColor: theme.palette.primary.main
+ }
+ };
+});
+const StatusLabel = decorate<StatusLabelProps>(({ classes, label, status }) => (
+ <>
+ <span
+ className={
+ status === "success"
+ ? classes.successDot
+ : status === "neutral"
+ ? classes.neutralDot
+ : classes.errorDot
+ }
+ />
+ <Typography component="span" className={classes.span}>
+ {label}
+ </Typography>
+ </>
+));
+export default StatusLabel;
diff --git a/saleor/static/dashboard-next/components/StatusLabel/index.ts b/saleor/static/dashboard-next/components/StatusLabel/index.ts
new file mode 100644
index 0000000000..277ccdc273
--- /dev/null
+++ b/saleor/static/dashboard-next/components/StatusLabel/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./StatusLabel";
+export * from "./StatusLabel";
diff --git a/saleor/static/dashboard-next/components/TablePagination/TablePagination.test.tsx b/saleor/static/dashboard-next/components/TablePagination/TablePagination.test.tsx
deleted file mode 100644
index e57cb3f2fc..0000000000
--- a/saleor/static/dashboard-next/components/TablePagination/TablePagination.test.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import Table from "material-ui/Table";
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import TablePagination from "./TablePagination";
-
-describe("<TablePagination />", () => {
- it("renders when no previous / next page are available", () => {
- const component = renderer.create(
- <Table>
- <TablePagination
- colSpan={1}
- hasNextPage={false}
- hasPreviousPage={false}
- onPreviousPage={jest.fn()}
- onNextPage={jest.fn()}
- />
- </Table>
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when previous page is available", () => {
- const component = renderer.create(
- <Table>
- <TablePagination
- colSpan={1}
- hasNextPage={false}
- hasPreviousPage={true}
- onPreviousPage={jest.fn()}
- onNextPage={jest.fn()}
- />
- </Table>
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when next page is available", () => {
- const component = renderer.create(
- <Table>
- <TablePagination
- colSpan={1}
- hasNextPage={true}
- hasPreviousPage={false}
- onPreviousPage={jest.fn()}
- onNextPage={jest.fn()}
- />
- </Table>
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when previous and next pages are available", () => {
- const component = renderer.create(
- <Table>
- <TablePagination
- colSpan={1}
- hasNextPage={true}
- hasPreviousPage={true}
- onPreviousPage={jest.fn()}
- onNextPage={jest.fn()}
- />
- </Table>
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/components/TablePagination/__snapshots__/TablePagination.test.tsx.snap b/saleor/static/dashboard-next/components/TablePagination/__snapshots__/TablePagination.test.tsx.snap
deleted file mode 100644
index 9e025b1b13..0000000000
--- a/saleor/static/dashboard-next/components/TablePagination/__snapshots__/TablePagination.test.tsx.snap
+++ /dev/null
@@ -1,377 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<TablePagination /> renders when next page is available 1`] = `
-<table
- className="MuiTable-root-1"
->
- <td
- aria-sort={null}
- className="MuiTableCell-root-11 MuiTablePagination-root-5"
- colSpan={1}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-19 MuiToolbar-gutters-20 MuiTablePagination-toolbar-10"
- >
- <div
- className="MuiTablePagination-spacer-9"
- />
- <div
- className="MuiTablePaginationActions-root-21"
- >
- <button
- className="MuiButtonBase-root-28 MuiButtonBase-disabled-29 MuiIconButton-root-22 MuiIconButton-disabled-26"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-27"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-30"
- color={undefined}
- 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
- className="MuiButtonBase-root-28 MuiIconButton-root-22"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-27"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-30"
- color={undefined}
- 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
- className="MuiTouchRipple-root-36"
- />
- </button>
- </div>
- </div>
- </td>
-</table>
-`;
-
-exports[`<TablePagination /> renders when no previous / next page are available 1`] = `
-<table
- className="MuiTable-root-1"
->
- <td
- aria-sort={null}
- className="MuiTableCell-root-11 MuiTablePagination-root-5"
- colSpan={1}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-19 MuiToolbar-gutters-20 MuiTablePagination-toolbar-10"
- >
- <div
- className="MuiTablePagination-spacer-9"
- />
- <div
- className="MuiTablePaginationActions-root-21"
- >
- <button
- className="MuiButtonBase-root-28 MuiButtonBase-disabled-29 MuiIconButton-root-22 MuiIconButton-disabled-26"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-27"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-30"
- color={undefined}
- 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
- className="MuiButtonBase-root-28 MuiButtonBase-disabled-29 MuiIconButton-root-22 MuiIconButton-disabled-26"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-27"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-30"
- color={undefined}
- 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>
-</table>
-`;
-
-exports[`<TablePagination /> renders when previous and next pages are available 1`] = `
-<table
- className="MuiTable-root-1"
->
- <td
- aria-sort={null}
- className="MuiTableCell-root-11 MuiTablePagination-root-5"
- colSpan={1}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-19 MuiToolbar-gutters-20 MuiTablePagination-toolbar-10"
- >
- <div
- className="MuiTablePagination-spacer-9"
- />
- <div
- className="MuiTablePaginationActions-root-21"
- >
- <button
- className="MuiButtonBase-root-28 MuiIconButton-root-22"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-27"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-30"
- color={undefined}
- 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>
- <span
- className="MuiTouchRipple-root-36"
- />
- </button>
- <button
- className="MuiButtonBase-root-28 MuiIconButton-root-22"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-27"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-30"
- color={undefined}
- 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
- className="MuiTouchRipple-root-36"
- />
- </button>
- </div>
- </div>
- </td>
-</table>
-`;
-
-exports[`<TablePagination /> renders when previous page is available 1`] = `
-<table
- className="MuiTable-root-1"
->
- <td
- aria-sort={null}
- className="MuiTableCell-root-11 MuiTablePagination-root-5"
- colSpan={1}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-19 MuiToolbar-gutters-20 MuiTablePagination-toolbar-10"
- >
- <div
- className="MuiTablePagination-spacer-9"
- />
- <div
- className="MuiTablePaginationActions-root-21"
- >
- <button
- className="MuiButtonBase-root-28 MuiIconButton-root-22"
- disabled={false}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-27"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-30"
- color={undefined}
- 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>
- <span
- className="MuiTouchRipple-root-36"
- />
- </button>
- <button
- className="MuiButtonBase-root-28 MuiButtonBase-disabled-29 MuiIconButton-root-22 MuiIconButton-disabled-26"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-27"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-30"
- color={undefined}
- 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>
-</table>
-`;
diff --git a/saleor/static/dashboard-next/components/Timeline/Timeline.tsx b/saleor/static/dashboard-next/components/Timeline/Timeline.tsx
new file mode 100644
index 0000000000..c293219c02
--- /dev/null
+++ b/saleor/static/dashboard-next/components/Timeline/Timeline.tsx
@@ -0,0 +1,226 @@
+import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
+import PersonIcon from "@material-ui/icons/Person";
+import * as CRC from "crc-32";
+import Avatar from "material-ui/Avatar";
+import Button from "material-ui/Button";
+import Card, { CardActions, CardContent } from "material-ui/Card";
+import * as colors from "material-ui/colors";
+import grey from "material-ui/colors/grey";
+import ExpansionPanel, {
+ ExpansionPanelDetails,
+ ExpansionPanelSummary
+} from "material-ui/ExpansionPanel";
+import { withStyles } from "material-ui/styles";
+import TextField from "material-ui/TextField";
+import Typography from "material-ui/Typography";
+import * as React from "react";
+
+import DateFormatter from "../DateFormatter";
+import i18n from "../../i18n";
+
+interface TimelineProps {}
+interface TimelineNodeProps {
+ date: string;
+ title: string;
+}
+interface TimelineNoteProps {
+ date: string;
+ user: string;
+ content: string;
+}
+interface TimelineAddNoteProps {
+ user: string;
+ content: string;
+ onChange(event: React.ChangeEvent<any>);
+ onSubmit(event: React.FormEvent<any>);
+}
+
+const decorate = withStyles(theme => ({
+ root: {
+ marginLeft: theme.spacing.unit * 5.5,
+ paddingLeft: theme.spacing.unit * 3,
+ borderStyle: "solid",
+ borderWidth: "0 0 0 2px",
+ borderColor: grey[300]
+ },
+ avatar: {
+ alignSelf: "flex-start" as "flex-start",
+ marginRight: theme.spacing.unit * 5.5
+ },
+ cardActions: {
+ direction: "rtl" as "rtl",
+ maxHeight: 0,
+ transitionDuration: "200ms",
+ overflow: "hidden" as "hidden",
+ display: "block" as "block"
+ },
+ cardActionsExpanded: {
+ maxHeight: theme.spacing.unit * 6
+ },
+ nodeDot: {
+ position: "relative" as "relative",
+ left: -theme.spacing.unit * 4 - 1,
+ width: theme.spacing.unit * 2,
+ height: theme.spacing.unit * 2,
+ backgroundColor: theme.palette.secondary.main,
+ borderRadius: "100%",
+ borderStyle: "solid",
+ borderWidth: 2,
+ borderColor: grey[300]
+ },
+ nodeRoot: {
+ marginBottom: theme.spacing.unit * 3,
+ display: "flex",
+ width: "100%",
+ position: "relative" as "relative",
+ alignItems: "center",
+ minHeight: theme.spacing.unit * 8,
+ "&:last-child:after": {
+ content: "''",
+ position: "absolute" as "absolute",
+ width: "2px",
+ height: `calc(50% - ${theme.spacing.unit}px)`,
+ background: theme.palette.background.default,
+ top: `calc(50% + ${theme.spacing.unit}px)`,
+ left: `${-theme.spacing.unit * 3 - 2}px`
+ }
+ },
+ nodeDate: {
+ position: "absolute" as "absolute",
+ right: theme.spacing.unit * 3
+ },
+ noteRoot: {
+ position: "relative" as "relative",
+ left: -theme.spacing.unit * 8.5 - 1,
+ width: `calc(100% + ${theme.spacing.unit * 8.5}px)`,
+ marginBottom: theme.spacing.unit * 3
+ },
+ noteTitle: {
+ display: "flex" as "flex",
+ alignItems: "center" as "center"
+ },
+ noteUser: {
+ marginLeft: theme.spacing.unit * 5.5
+ },
+ noteDate: {
+ position: "absolute" as "absolute",
+ right: theme.spacing.unit * 7
+ },
+ noteContent: {
+ paddingLeft: theme.spacing.unit * 10.5
+ },
+ panel: {
+ background: "none",
+ width: "100%",
+ "&:before": {
+ display: "none"
+ }
+ },
+ noExpander: {
+ marginLeft: theme.spacing.unit * 3
+ },
+ noExpanderNodeDate: {
+ position: "absolute" as "absolute",
+ right: theme.spacing.unit * 7
+ }
+}));
+const palette = [
+ colors.amber,
+ colors.blue,
+ colors.cyan,
+ colors.deepOrange,
+ colors.deepPurple,
+ colors.green,
+ colors.indigo,
+ colors.lightBlue,
+ colors.lightGreen,
+ colors.lime,
+ colors.orange,
+ colors.pink,
+ colors.purple,
+ colors.red,
+ colors.teal,
+ colors.yellow
+].map(color => color[500]);
+
+export const Timeline = decorate<TimelineProps>(({ classes, children }) => (
+ <div className={classes.root}>{children}</div>
+));
+export const TimelineNode = decorate<TimelineNodeProps>(
+ ({ classes, date, children, title }) => (
+ <div className={classes.nodeRoot}>
+ <span className={classes.nodeDot} />
+ {children ? (
+ <ExpansionPanel className={classes.panel} elevation={0}>
+ <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>
+ <Typography>{title}</Typography>
+ <div className={classes.nodeDate}>
+ <DateFormatter date={date} />
+ </div>
+ </ExpansionPanelSummary>
+ <ExpansionPanelDetails>
+ <Typography>{children}</Typography>
+ </ExpansionPanelDetails>
+ </ExpansionPanel>
+ ) : (
+ <>
+ <Typography className={classes.noExpander}>{title}</Typography>
+ <div className={classes.noExpanderNodeDate}>
+ <DateFormatter date={date} />
+ </div>
+ </>
+ )}
+ </div>
+ )
+);
+export const TimelineNote = decorate<TimelineNoteProps>(
+ ({ classes, date, user, content }) => (
+ <Card className={classes.noteRoot}>
+ <CardContent className={classes.noteTitle}>
+ <Avatar style={{ background: palette[CRC.str(user) % palette.length] }}>
+ <PersonIcon />
+ </Avatar>
+ <Typography className={classes.noteUser}>{user}</Typography>
+ <div className={classes.noteDate}>
+ <DateFormatter date={date} />
+ </div>
+ </CardContent>
+ <CardContent>
+ <Typography className={classes.noteContent}>{content}</Typography>
+ </CardContent>
+ </Card>
+ )
+);
+export const TimelineAddNote = decorate<TimelineAddNoteProps>(
+ ({ classes, user, content, onChange, onSubmit }) => (
+ <div className={classes.noteRoot}>
+ <CardContent className={classes.noteTitle}>
+ <Avatar
+ style={{ background: palette[CRC.str(user) % palette.length] }}
+ className={classes.avatar}
+ >
+ <PersonIcon />
+ </Avatar>
+ <TextField
+ label={i18n.t("Note")}
+ placeholder={i18n.t("Leave your note here...")}
+ onChange={onChange}
+ value={content}
+ name="content"
+ InputLabelProps={{ shrink: true }}
+ fullWidth
+ multiline
+ />
+ </CardContent>
+ <CardActions
+ className={[
+ classes.cardActions,
+ content ? classes.cardActionsExpanded : ""
+ ].join(" ")}
+ >
+ <Button onClick={onSubmit}>{i18n.t("Add note")}</Button>
+ </CardActions>
+ </div>
+ )
+);
+export default Timeline;
diff --git a/saleor/static/dashboard-next/components/Timeline/index.ts b/saleor/static/dashboard-next/components/Timeline/index.ts
new file mode 100644
index 0000000000..a468f26d94
--- /dev/null
+++ b/saleor/static/dashboard-next/components/Timeline/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./Timeline";
+export * from "./Timeline";
diff --git a/saleor/static/dashboard-next/orders/components/OrderAddressEditDialog/OrderAddressEditDialog.tsx b/saleor/static/dashboard-next/orders/components/OrderAddressEditDialog/OrderAddressEditDialog.tsx
new file mode 100644
index 0000000000..dd9f7bdf5c
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderAddressEditDialog/OrderAddressEditDialog.tsx
@@ -0,0 +1,178 @@
+import Button from "material-ui/Button";
+import Dialog, {
+ DialogActions,
+ DialogContent,
+ DialogContentText,
+ DialogProps,
+ DialogTitle
+} from "material-ui/Dialog";
+import { withStyles } from "material-ui/styles";
+import TextField from "material-ui/TextField";
+import * as React from "react";
+
+import FormSpacer from "../../../components/FormSpacer";
+import PhoneField from "../../../components/PhoneField";
+import SingleSelectField from "../../../components/SingleSelectField";
+import i18n from "../../../i18n";
+
+interface OrderAddressEditDialogProps {
+ open: boolean;
+ data: {
+ city: string;
+ cityArea: string;
+ companyName: string;
+ country: string;
+ countryArea: string;
+ firstName: string;
+ id: string;
+ lastName: string;
+ phone_prefix: string;
+ phone_number: string;
+ postalCode: string;
+ streetAddress_1: string;
+ streetAddress_2: string;
+ };
+ variant: string;
+ countries?: Array<{
+ code: string;
+ label: string;
+ }>;
+ prefixes: string[];
+ onChange(event: React.ChangeEvent<any>);
+ onClose?();
+ onConfirm?(event: React.FormEvent<any>);
+}
+
+const decorate = withStyles(theme => ({
+ root: {
+ display: "grid",
+ gridColumnGap: `${theme.spacing.unit * 2}px`,
+ gridTemplateColumns: "1fr 1fr"
+ }
+}));
+const OrderAddressEditDialog = decorate<OrderAddressEditDialogProps>(
+ ({
+ children,
+ classes,
+ open,
+ variant,
+ countries,
+ data,
+ prefixes,
+ onConfirm,
+ onClose,
+ onChange
+ }) => (
+ <Dialog open={open}>
+ <DialogTitle>
+ {variant === "billing"
+ ? i18n.t("Edit billing address", { context: "title" })
+ : i18n.t("Edit shipping address", { context: "title" })}
+ </DialogTitle>
+ <DialogContent>
+ <div className={classes.root}>
+ <div>
+ <TextField
+ label={i18n.t("First name")}
+ name="firstName"
+ onChange={onChange}
+ value={data.firstName}
+ fullWidth
+ />
+ </div>
+ <div>
+ <TextField
+ label={i18n.t("Last name")}
+ name="lastName"
+ onChange={onChange}
+ value={data.lastName}
+ fullWidth
+ />
+ </div>
+ </div>
+ <FormSpacer />
+ <TextField
+ label={i18n.t("Company")}
+ name="companyName"
+ onChange={onChange}
+ value={data.companyName}
+ fullWidth
+ />
+ <FormSpacer />
+ <TextField
+ label={i18n.t("Address")}
+ name="streetAddress_1"
+ onChange={onChange}
+ value={data.streetAddress_1}
+ fullWidth
+ />
+ <FormSpacer />
+ <TextField
+ label={i18n.t("Address")}
+ name="streetAddress_2"
+ onChange={onChange}
+ value={data.streetAddress_2}
+ fullWidth
+ />
+ <FormSpacer />
+ <TextField
+ label={i18n.t("City")}
+ name="city"
+ onChange={onChange}
+ value={data.city}
+ fullWidth
+ />
+ <FormSpacer />
+ <TextField
+ label={i18n.t("City area")}
+ name="cityArea"
+ onChange={onChange}
+ value={data.cityArea}
+ fullWidth
+ />
+ <FormSpacer />
+ <TextField
+ label={i18n.t("Postal code")}
+ name="postalCode"
+ onChange={onChange}
+ value={data.postalCode}
+ fullWidth
+ />
+ <FormSpacer />
+ <SingleSelectField
+ label={i18n.t("Country")}
+ name="country"
+ onChange={onChange}
+ value={data.country}
+ choices={countries.map(c => ({ ...c, value: c.code }))}
+ />
+ <FormSpacer />
+ <TextField
+ label={i18n.t("Country area")}
+ name="countryArea"
+ onChange={onChange}
+ value={data.countryArea}
+ fullWidth
+ />
+ <FormSpacer />
+ <PhoneField
+ label={i18n.t("Phone")}
+ name="phone"
+ prefix={data.phone_prefix}
+ number={data.phone_number}
+ prefixes={prefixes}
+ onChange={onChange}
+ />
+ </DialogContent>
+ <DialogActions>
+ <Button onClick={onClose}>
+ {i18n.t("Cancel", { context: "button" })}
+ </Button>
+ <Button color="primary" variant="raised" onClick={onConfirm}>
+ {i18n.t("Confirm", { context: "button" })}
+ </Button>
+ </DialogActions>
+ </Dialog>
+ )
+);
+export default OrderAddressEditDialog;
diff --git a/saleor/static/dashboard-next/orders/components/OrderAddressEditDialog/index.ts b/saleor/static/dashboard-next/orders/components/OrderAddressEditDialog/index.ts
new file mode 100644
index 0000000000..5ae253bf88
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderAddressEditDialog/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderAddressEditDialog";
+export * from "./OrderAddressEditDialog";
diff --git a/saleor/static/dashboard-next/orders/components/OrderCancelDialog/OrderCancelDialog.tsx b/saleor/static/dashboard-next/orders/components/OrderCancelDialog/OrderCancelDialog.tsx
new file mode 100644
index 0000000000..308ee14258
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderCancelDialog/OrderCancelDialog.tsx
@@ -0,0 +1,59 @@
+import Button from "material-ui/Button";
+import Dialog, {
+ DialogActions,
+ DialogContent,
+ DialogContentText,
+ DialogProps,
+ DialogTitle
+} from "material-ui/Dialog";
+import { withStyles } from "material-ui/styles";
+import * as React from "react";
+
+import i18n from "../../../i18n";
+
+interface OrderCancelDialogProps {
+ open: boolean;
+ id: string;
+ onClose?();
+ onConfirm?(event: React.FormEvent<any>);
+}
+
+const decorate = withStyles(theme => ({
+ deleteButton: {
+ "&:hover": {
+ backgroundColor: theme.palette.error.main
+ },
+ backgroundColor: theme.palette.error.main,
+ color: theme.palette.error.contrastText
+ }
+}));
+const OrderCancelDialog = decorate<OrderCancelDialogProps>(
+ ({ children, classes, id, open, onConfirm, onClose }) => (
+ <Dialog open={open}>
+ <DialogTitle>{i18n.t("Cancel order", { context: "title" })}</DialogTitle>
+ <DialogContent>
+ <DialogContentText
+ dangerouslySetInnerHTML={{
+ __html: i18n.t(
+ "Are you sure you want to cancel <strong>#{{ id }}</strong>?",
+ { id }
+ )
+ }}
+ />
+ </DialogContent>
+ <DialogActions>
+ <Button onClick={onClose}>
+ {i18n.t("Back", { context: "button" })}
+ </Button>
+ <Button
+ className={classes.deleteButton}
+ variant="raised"
+ onClick={onConfirm}
+ >
+ {i18n.t("Cancel order", { context: "button" })}
+ </Button>
+ </DialogActions>
+ </Dialog>
+ )
+);
+export default OrderCancelDialog;
diff --git a/saleor/static/dashboard-next/orders/components/OrderCancelDialog/index.ts b/saleor/static/dashboard-next/orders/components/OrderCancelDialog/index.ts
new file mode 100644
index 0000000000..fb5e9e4cc6
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderCancelDialog/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderCancelDialog";
+export * from "./OrderCancelDialog";
diff --git a/saleor/static/dashboard-next/orders/components/OrderCustomer/OrderCustomer.tsx b/saleor/static/dashboard-next/orders/components/OrderCustomer/OrderCustomer.tsx
new file mode 100644
index 0000000000..cd18322d35
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderCustomer/OrderCustomer.tsx
@@ -0,0 +1,189 @@
+import EditIcon from "@material-ui/icons/Edit";
+import Card, { CardContent } from "material-ui/Card";
+import blue from "material-ui/colors/blue";
+import IconButton from "material-ui/IconButton";
+import { withStyles } from "material-ui/styles";
+import Typography from "material-ui/Typography";
+import * as React from "react";
+
+import PageHeader from "../../../components/PageHeader";
+import Skeleton from "../../../components/Skeleton";
+import i18n from "../../../i18n";
+
+interface AddressType {
+ city: string;
+ cityArea: string;
+ companyName: string;
+ country: string;
+ countryArea: string;
+ firstName: string;
+ id: string;
+ lastName: string;
+ phone: {
+ prefix: string;
+ number: string;
+ };
+ postalCode: string;
+ streetAddress_1: string;
+ streetAddress_2: string;
+}
+interface OrderCustomerProps {
+ client?: {
+ id: string;
+ email: string;
+ name: string;
+ };
+ shippingAddress?: AddressType;
+ billingAddress?: AddressType;
+ editCustomer?: boolean;
+ onCustomerEditClick?();
+ onCustomerEmailClick?(id: string);
+ onBillingAddressEdit?();
+ onShippingAddressEdit?();
+}
+
+const decorate = withStyles(theme => ({
+ hr: {
+ height: 1,
+ display: "block",
+ border: "none",
+ width: "100%",
+ backgroundColor: theme.palette.grey[200]
+ },
+ link: {
+ color: blue[500],
+ cursor: "pointer",
+ textDecoration: "none"
+ }
+}));
+const OrderCustomer = decorate<OrderCustomerProps>(
+ ({
+ classes,
+ client,
+ billingAddress,
+ editCustomer,
+ shippingAddress,
+ onCustomerEditClick,
+ onCustomerEmailClick,
+ onBillingAddressEdit,
+ onShippingAddressEdit
+ }) => (
+ <Card>
+ <PageHeader title={i18n.t("Customer")}>
+ {editCustomer && (
+ <IconButton
+ disabled={!onCustomerEditClick}
+ onClick={onCustomerEditClick}
+ >
+ <EditIcon />
+ </IconButton>
+ )}
+ </PageHeader>
+ <CardContent>
+ {client === undefined || client === null ? (
+ <>
+ <Skeleton />
+ <Skeleton />
+ </>
+ ) : (
+ <>
+ <Typography>{client.name}</Typography>
+ <Typography
+ className={onCustomerEmailClick ? classes.link : ""}
+ onClick={
+ onCustomerEmailClick
+ ? onCustomerEmailClick(client.id)
+ : () => {}
+ }
+ >
+ {client.email}
+ </Typography>
+ </>
+ )}
+ </CardContent>
+ <hr className={classes.hr} />
+
+ <PageHeader title={i18n.t("Shipping Address")}>
+ <IconButton
+ onClick={onShippingAddressEdit}
+ disabled={!onShippingAddressEdit && client === undefined}
+ >
+ <EditIcon />
+ </IconButton>
+ </PageHeader>
+ <CardContent>
+ {client === undefined || client === null ? (
+ <>
+ <Skeleton />
+ </>
+ ) : (
+ <>
+ {shippingAddress.companyName && (
+ <Typography>{shippingAddress.companyName}</Typography>
+ )}
+ <Typography>
+ {shippingAddress.firstName} {shippingAddress.lastName}
+ </Typography>
+ <Typography>
+ {shippingAddress.streetAddress_1}
+ <br />
+ {shippingAddress.streetAddress_2}
+ </Typography>
+ <Typography>
+ {shippingAddress.postalCode} {shippingAddress.city}
+ {shippingAddress.cityArea ? ", " + shippingAddress.cityArea : ""}
+ </Typography>
+ <Typography>
+ {shippingAddress.countryArea
+ ? shippingAddress.countryArea + ", " + shippingAddress.country
+ : shippingAddress.country}
+ </Typography>
+ </>
+ )}
+ </CardContent>
+ <hr className={classes.hr} />
+
+ <PageHeader title={i18n.t("Billing Address")}>
+ <IconButton
+ onClick={onShippingAddressEdit}
+ disabled={!onShippingAddressEdit && client === undefined}
+ >
+ <EditIcon />
+ </IconButton>
+ </PageHeader>
+ <CardContent>
+ {client === undefined || client === null ? (
+ <>
+ <Skeleton />
+ </>
+ ) : shippingAddress.id === billingAddress.id ? (
+ <Typography>{i18n.t("Same as shipping address")}</Typography>
+ ) : (
+ <>
+ {billingAddress.companyName && (
+ <Typography>{billingAddress.companyName}</Typography>
+ )}
+ <Typography>
+ {billingAddress.firstName} {billingAddress.lastName}
+ </Typography>
+ <Typography>
+ {billingAddress.streetAddress_1}
+ <br />
+ {billingAddress.streetAddress_2}
+ </Typography>
+ <Typography>
+ {billingAddress.postalCode} {billingAddress.city}
+ {billingAddress.cityArea ? ", " + billingAddress.cityArea : ""}
+ </Typography>
+ <Typography>
+ {billingAddress.countryArea
+ ? billingAddress.countryArea + ", " + billingAddress.country
+ : billingAddress.country}
+ </Typography>
+ </>
+ )}
+ </CardContent>
+ </Card>
+ )
+);
+export default OrderCustomer;
diff --git a/saleor/static/dashboard-next/orders/components/OrderCustomer/index.ts b/saleor/static/dashboard-next/orders/components/OrderCustomer/index.ts
new file mode 100644
index 0000000000..eb0326b8c3
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderCustomer/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderCustomer";
+export * from "./OrderCustomer";
diff --git a/saleor/static/dashboard-next/orders/components/OrderCustomerEditDialog/OrderCustomerEditDialog.tsx b/saleor/static/dashboard-next/orders/components/OrderCustomerEditDialog/OrderCustomerEditDialog.tsx
new file mode 100644
index 0000000000..166626c000
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderCustomerEditDialog/OrderCustomerEditDialog.tsx
@@ -0,0 +1,96 @@
+import Button from "material-ui/Button";
+import Dialog, {
+ DialogActions,
+ DialogContent,
+ DialogContentText,
+ DialogProps,
+ DialogTitle
+} from "material-ui/Dialog";
+import { InputAdornment } from "material-ui/Input";
+import { withStyles } from "material-ui/styles";
+import TextField from "material-ui/TextField";
+import Typography from "material-ui/Typography";
+import * as React from "react";
+
+import { SingleAutocompleteSelectField } from "../../../components/SingleAutocompleteSelectField";
+import i18n from "../../../i18n";
+
+interface OrderCustomerEditDialogProps {
+ open: boolean;
+ user?: {
+ label: string;
+ value: string;
+ };
+ users?: Array<{
+ id: string;
+ email: string;
+ }>;
+ loading?: boolean;
+ fetchUsers(value: string);
+ onChange(event: React.ChangeEvent<any>);
+ onClose?();
+ onConfirm?(event: React.FormEvent<any>);
+}
+
+const decorate = withStyles(theme => ({
+ dialog: {
+ overflowY: "visible" as "visible"
+ },
+ root: {
+ overflowY: "visible" as "visible",
+ width: theme.breakpoints.values.sm
+ },
+ select: {
+ flex: 1,
+ marginRight: theme.spacing.unit * 2
+ },
+ textRight: {
+ textAlign: "right" as "right"
+ }
+}));
+const OrderCustomerEditDialog = decorate<OrderCustomerEditDialogProps>(
+ ({
+ classes,
+ open,
+ loading,
+ user,
+ users,
+ fetchUsers,
+ onChange,
+ onClose,
+ onConfirm
+ }) => {
+ const choices =
+ !loading && users
+ ? users.map(v => ({
+ label: v.email,
+ value: v.id
+ }))
+ : [];
+ return (
+ <Dialog open={open} classes={{ paper: classes.dialog }}>
+ <DialogTitle>{i18n.t("Edit customer details")}</DialogTitle>
+ <DialogContent className={classes.root}>
+ <SingleAutocompleteSelectField
+ choices={choices}
+ custom
+ loading={loading}
+ name="user"
+ value={user}
+ fetchChoices={fetchUsers}
+ onChange={onChange}
+ />
+ </DialogContent>
+ <DialogActions>
+ <Button onClick={onClose}>
+ {i18n.t("Cancel", { context: "button" })}
+ </Button>
+ <Button color="primary" variant="raised" onClick={onConfirm}>
+ {i18n.t("Confirm", { context: "button" })}
+ </Button>
+ </DialogActions>
+ </Dialog>
+ );
+ }
+);
+export default OrderCustomerEditDialog;
diff --git a/saleor/static/dashboard-next/orders/components/OrderCustomerEditDialog/index.ts b/saleor/static/dashboard-next/orders/components/OrderCustomerEditDialog/index.ts
new file mode 100644
index 0000000000..cb32cf9f6f
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderCustomerEditDialog/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderCustomerEditDialog";
+export * from "./OrderCustomerEditDialog";
diff --git a/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx b/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx
new file mode 100644
index 0000000000..dc44fa8768
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx
@@ -0,0 +1,551 @@
+import PrintIcon from "@material-ui/icons/Print";
+import IconButton from "material-ui/IconButton";
+import { withStyles, WithStyles } from "material-ui/styles";
+import * as React from "react";
+
+import {
+ AddressType,
+ OrderStatus,
+ transformAddressToForm,
+ transformOrderStatus
+} from "../..";
+import { Container } from "../../../components/Container";
+import DateFormatter from "../../../components/DateFormatter";
+import Form from "../../../components/Form";
+import PageHeader from "../../../components/PageHeader";
+import Skeleton from "../../../components/Skeleton";
+import Toggle from "../../../components/Toggle";
+import i18n from "../../../i18n";
+import OrderAddressEditDialog from "../OrderAddressEditDialog";
+import OrderCancelDialog from "../OrderCancelDialog";
+import OrderCustomer from "../OrderCustomer";
+import OrderCustomerEditDialog from "../OrderCustomerEditDialog";
+import OrderFulfillment from "../OrderFulfillment";
+import OrderFulfillmentCancelDialog from "../OrderFulfillmentCancelDialog";
+import OrderFulfillmentDialog from "../OrderFulfillmentDialog";
+import OrderFulfillmentTrackingDialog from "../OrderFulfillmentTrackingDialog";
+import OrderHistory from "../OrderHistory";
+import OrderPaymentDialog from "../OrderPaymentDialog";
+import OrderPaymentReleaseDialog from "../OrderPaymentReleaseDialog";
+import OrderProductAddDialog from "../OrderProductAddDialog";
+import OrderShippingMethodEditDialog from "../OrderShippingMethodEditDialog";
+import OrderSummary from "../OrderSummary";
+
+interface TaxedMoneyType {
+ gross: {
+ amount: number;
+ currency: string;
+ };
+}
+interface MoneyType {
+ amount: number;
+ currency: string;
+}
+interface OrderDetailsPageProps {
+ order?: {
+ id: string;
+ client: {
+ id: string;
+ email: string;
+ name: string;
+ };
+ created: string;
+ status: string;
+ paymentStatus: string;
+ shippingAddress?: AddressType;
+ billingAddress?: AddressType;
+ shippingMethod?: {
+ id: string;
+ };
+ shippingMethodName?: string;
+ shippingMethodPriceGross?: MoneyType;
+ fulfillments: Array<{
+ id: string;
+ status: string;
+ products: Array<{
+ quantity: number;
+ product: {
+ id: string;
+ name: string;
+ thumbnailUrl: string;
+ };
+ }>;
+ trackingCode: string;
+ }>;
+ products?: Array<{
+ id: string;
+ name: string;
+ sku: string;
+ thumbnailUrl: string;
+ price: TaxedMoneyType;
+ quantity: number;
+ }>;
+ unfulfilled: Array<{
+ id: string;
+ name: string;
+ sku: string;
+ thumbnailUrl: string;
+ quantity: number;
+ }>;
+ subtotal: MoneyType;
+ total: MoneyType;
+ events: Array<{
+ id: string;
+ type: string;
+ content: string;
+ date: string;
+ user: string;
+ params?: {};
+ }>;
+ payment: {
+ paid: MoneyType;
+ refunded: MoneyType;
+ net: MoneyType;
+ };
+ };
+ dateNow?: number;
+ shippingMethods?: Array<{
+ id: string;
+ name: string;
+ country: string;
+ }>;
+ user?: string;
+ users?: Array<{
+ id: string;
+ email: string;
+ }>;
+ prefixes?: string[];
+ countries?: Array<{
+ code: string;
+ label: string;
+ }>;
+ variants?: Array<{
+ id: string;
+ name: string;
+ sku: string;
+ stockAllocated;
+ }>;
+ usersLoading?: boolean;
+ variantsLoading?: boolean;
+ fetchUsers?(value: string);
+ fetchShippingMethods?(value: string);
+ fetchVariants?(value: string);
+ onBack();
+ onCreate?();
+ onCustomerEmailClick?(id: string);
+ onOrderLineChange?(id: string): (value: string) => () => void;
+ onOrderLineRemove?(id: string): () => void;
+ onPrintClick?();
+ onProductClick?(id: string);
+ onPackingSlipClick?(id: string);
+ onPaymentRelease?();
+ onOrderCancel?();
+}
+interface OrderDetailsPageState {
+ openedBillingAddressEditDialog: boolean;
+ openedCustomerEditDialog: boolean;
+ openedFulfillmentDialog: boolean;
+ openedOrderCancelDialog: boolean;
+ openedOrderProductAddDialog: boolean;
+ openedPaymentCaptureDialog: boolean;
+ openedPaymentRefundDialog: boolean;
+ openedPaymentReleaseDialog: boolean;
+ openedShippingAddressEditDialog: boolean;
+ openedShippingMethodEditDialog: boolean;
+}
+
+const decorate = withStyles(theme => ({
+ orderDate: {
+ marginBottom: theme.spacing.unit * 2,
+ marginLeft: theme.spacing.unit * 10
+ },
+ root: {
+ display: "grid",
+ gridColumnGap: theme.spacing.unit * 2 + "px",
+ gridTemplateColumns: "3fr 1fr"
+ }
+}));
+class OrderDetailsPageComponent extends React.Component<
+ OrderDetailsPageProps & WithStyles<"orderDate" | "root">,
+ OrderDetailsPageState
+> {
+ state = {
+ openedBillingAddressEditDialog: false,
+ openedCustomerEditDialog: false,
+ openedFulfillmentDialog: false,
+ openedOrderCancelDialog: false,
+ openedOrderProductAddDialog: false,
+ openedPaymentCaptureDialog: false,
+ openedPaymentRefundDialog: false,
+ openedPaymentReleaseDialog: false,
+ openedShippingAddressEditDialog: false,
+ openedShippingMethodEditDialog: false
+ };
+
+ toggleFulfillmentDialog = () =>
+ this.setState(prevState => ({
+ openedFulfillmentDialog: !prevState.openedFulfillmentDialog
+ }));
+ togglePaymentReleaseDialog = () =>
+ this.setState(prevState => ({
+ openedPaymentReleaseDialog: !prevState.openedPaymentReleaseDialog
+ }));
+ togglePaymentCaptureDialog = () =>
+ this.setState(prevState => ({
+ openedPaymentCaptureDialog: !prevState.openedPaymentCaptureDialog
+ }));
+ togglePaymentRefundDialog = () =>
+ this.setState(prevState => ({
+ openedPaymentRefundDialog: !prevState.openedPaymentRefundDialog
+ }));
+ toggleOrderCancelDialog = () =>
+ this.setState(prevState => ({
+ openedOrderCancelDialog: !prevState.openedOrderCancelDialog
+ }));
+ toggleOrderProductAddDialog = () =>
+ this.setState(prevState => ({
+ openedOrderProductAddDialog: !prevState.openedOrderProductAddDialog
+ }));
+ toggleCustomerEditDialog = () =>
+ this.setState(prevState => ({
+ openedCustomerEditDialog: !prevState.openedCustomerEditDialog
+ }));
+ toggleShippingAddressEditDialog = () =>
+ this.setState(prevState => ({
+ openedShippingAddressEditDialog: !prevState.openedShippingAddressEditDialog
+ }));
+ toggleBillingAddressEditDialog = () =>
+ this.setState(prevState => ({
+ openedBillingAddressEditDialog: !prevState.openedBillingAddressEditDialog
+ }));
+ toggleShippingMethodEditDialog = () =>
+ this.setState(prevState => ({
+ openedShippingMethodEditDialog: !prevState.openedShippingMethodEditDialog
+ }));
+
+ render() {
+ const {
+ classes,
+ countries,
+ dateNow,
+ order,
+ prefixes,
+ shippingMethods,
+ user,
+ users,
+ usersLoading,
+ variants,
+ variantsLoading,
+ fetchShippingMethods,
+ fetchUsers,
+ fetchVariants,
+ onBack,
+ onCreate,
+ onCustomerEmailClick,
+ onOrderCancel,
+ onOrderLineChange,
+ onOrderLineRemove,
+ onPackingSlipClick,
+ onPaymentRelease,
+ onPrintClick,
+ onProductClick
+ } = this.props;
+ const {
+ openedBillingAddressEditDialog,
+ openedCustomerEditDialog,
+ openedFulfillmentDialog,
+ openedOrderCancelDialog,
+ openedOrderProductAddDialog,
+ openedPaymentCaptureDialog,
+ openedPaymentRefundDialog,
+ openedPaymentReleaseDialog,
+ openedShippingAddressEditDialog,
+ openedShippingMethodEditDialog
+ } = this.state;
+ const isDraft = order ? order.status === OrderStatus.DRAFT : false;
+ const shippingMethod = order
+ ? {
+ id: order.shippingMethod.id,
+ name: order.shippingMethodName,
+ price: order.shippingMethodPriceGross
+ }
+ : undefined;
+ return (
+ <Container width="md">
+ <PageHeader
+ title={
+ order
+ ? i18n.t("Order #{{ orderId }}", { orderId: order.id })
+ : undefined
+ }
+ onBack={onBack}
+ />
+ {order ? (
+ <div className={classes.orderDate}>
+ <DateFormatter
+ date={order.created}
+ dateNow={dateNow}
+ typography="caption"
+ />
+ </div>
+ ) : (
+ <Skeleton />
+ )}
+ <div className={classes.root}>
+ <div>
+ <OrderSummary
+ net={order ? order.payment.net : undefined}
+ paid={order ? order.payment.paid : undefined}
+ paymentStatus={order ? order.paymentStatus : undefined}
+ products={order ? order.products : undefined}
+ refunded={order ? order.payment.refunded : undefined}
+ shippingMethod={shippingMethod}
+ status={order ? order.status : undefined}
+ subtotal={order ? order.subtotal : undefined}
+ total={order ? order.total : undefined}
+ onCapture={this.togglePaymentCaptureDialog}
+ onCreate={onCreate}
+ onFulfill={this.toggleFulfillmentDialog}
+ onOrderCancel={this.toggleOrderCancelDialog}
+ onOrderLineChange={onOrderLineChange}
+ onOrderLineRemove={onOrderLineRemove}
+ onProductAdd={this.toggleOrderProductAddDialog}
+ onRefund={this.togglePaymentRefundDialog}
+ onRelease={this.togglePaymentReleaseDialog}
+ onRowClick={onProductClick}
+ onShippingMethodClick={this.toggleShippingMethodEditDialog}
+ />
+ {order && (
+ <>
+ <Form
+ initial={
+ order
+ ? order.unfulfilled.reduce((prev, curr) => {
+ prev[curr.id] = curr.quantity;
+ return prev;
+ }, {})
+ : undefined
+ }
+ >
+ {({ data, change, submit }) => (
+ <OrderFulfillmentDialog
+ data={data}
+ open={openedFulfillmentDialog}
+ products={order.unfulfilled}
+ onChange={change}
+ onClose={this.toggleFulfillmentDialog}
+ onConfirm={submit}
+ />
+ )}
+ </Form>
+ <Form initial={{ value: 0 }}>
+ {({ data, change, submit }) => (
+ <OrderPaymentDialog
+ open={openedPaymentCaptureDialog}
+ value={data.value}
+ variant="capture"
+ onChange={change}
+ onClose={this.togglePaymentCaptureDialog}
+ onConfirm={submit}
+ />
+ )}
+ </Form>
+ <Form initial={{ value: 0 }}>
+ {({ data, change, submit }) => (
+ <OrderPaymentDialog
+ open={openedPaymentRefundDialog}
+ value={data.value}
+ variant="refund"
+ onChange={change}
+ onClose={this.togglePaymentRefundDialog}
+ onConfirm={submit}
+ />
+ )}
+ </Form>
+ <Form
+ initial={{
+ quantity: 1,
+ variant: {
+ label: "",
+ value: ""
+ }
+ }}
+ >
+ {({ data, change, submit }) => (
+ <OrderProductAddDialog
+ loading={variantsLoading}
+ open={openedOrderProductAddDialog}
+ quantity={data.quantity}
+ variant={data.variant}
+ variants={variants}
+ fetchVariants={fetchVariants}
+ onChange={change}
+ onClose={this.toggleOrderProductAddDialog}
+ onConfirm={submit}
+ />
+ )}
+ </Form>
+ <Form
+ initial={{
+ shippingMethod: {
+ label: order.shippingMethodName,
+ value: order.shippingMethod.id
+ }
+ }}
+ >
+ {({ change, data, submit }) => (
+ <OrderShippingMethodEditDialog
+ open={openedShippingMethodEditDialog}
+ shippingMethod={data.shippingMethod}
+ shippingMethods={shippingMethods}
+ fetchShippingMethods={fetchShippingMethods}
+ onChange={change}
+ onClose={this.toggleShippingMethodEditDialog}
+ />
+ )}
+ </Form>
+ <OrderCancelDialog
+ id={order.id}
+ open={openedOrderCancelDialog}
+ onClose={this.toggleOrderCancelDialog}
+ onConfirm={onOrderCancel}
+ />
+ <OrderPaymentReleaseDialog
+ open={openedPaymentReleaseDialog}
+ onClose={this.togglePaymentReleaseDialog}
+ onConfirm={onPaymentRelease}
+ />
+ </>
+ )}
+
+ {order ? (
+ !isDraft &&
+ order.fulfillments.map(fulfillment => (
+ <Toggle key={fulfillment.id}>
+ {(openedCancelDialog, { toggle: toggleCancelDialog }) => (
+ <Toggle>
+ {(
+ openedTrackingDialog,
+ { toggle: toggleTrackingDialog }
+ ) => (
+ <>
+ <OrderFulfillment
+ id={fulfillment.id}
+ products={fulfillment.products}
+ status={fulfillment.status}
+ trackingCode={fulfillment.trackingCode}
+ onFulfillmentCancel={toggleCancelDialog}
+ onTrackingCodeAdd={toggleTrackingDialog}
+ onPackingSlipClick={
+ onPackingSlipClick
+ ? onPackingSlipClick(fulfillment.id)
+ : undefined
+ }
+ />
+ <OrderFulfillmentCancelDialog
+ open={openedCancelDialog}
+ id={fulfillment.id}
+ onClose={toggleCancelDialog}
+ />
+ <Form
+ initial={{
+ trackingCode: fulfillment.trackingCode
+ }}
+ >
+ {({ change, data, submit }) => (
+ <OrderFulfillmentTrackingDialog
+ open={openedTrackingDialog}
+ trackingCode={data.trackingCode}
+ variant={
+ fulfillment.trackingCode ? "edit" : "add"
+ }
+ onChange={change}
+ onClose={toggleTrackingDialog}
+ />
+ )}
+ </Form>
+ </>
+ )}
+ </Toggle>
+ )}
+ </Toggle>
+ ))
+ ) : (
+ <OrderFulfillment />
+ )}
+ <OrderHistory
+ history={order ? order.events : undefined}
+ user={user}
+ />
+ </div>
+ <div>
+ <OrderCustomer
+ billingAddress={order ? order.billingAddress : undefined}
+ client={order ? order.client : undefined}
+ editCustomer={isDraft}
+ shippingAddress={order ? order.shippingAddress : undefined}
+ onBillingAddressEdit={this.toggleBillingAddressEditDialog}
+ onCustomerEditClick={this.toggleCustomerEditDialog}
+ onCustomerEmailClick={onCustomerEmailClick}
+ onShippingAddressEdit={this.toggleShippingAddressEditDialog}
+ />
+ {order && (
+ <>
+ <Form
+ initial={{
+ email: order.client
+ ? { label: order.client.email, value: order.client.id }
+ : { label: "", value: "" }
+ }}
+ >
+ {({ change, data, submit }) => (
+ <OrderCustomerEditDialog
+ open={openedCustomerEditDialog}
+ user={data.email}
+ users={users}
+ fetchUsers={fetchUsers}
+ onChange={change}
+ onClose={this.toggleCustomerEditDialog}
+ />
+ )}
+ </Form>
+ <Form initial={transformAddressToForm(order.shippingAddress)}>
+ {({ change, data, submit }) => (
+ <OrderAddressEditDialog
+ countries={countries}
+ data={data}
+ open={openedShippingAddressEditDialog}
+ prefixes={prefixes}
+ variant="shipping"
+ onClose={this.toggleShippingAddressEditDialog}
+ onConfirm={submit}
+ onChange={change}
+ />
+ )}
+ </Form>
+ <Form initial={transformAddressToForm(order.billingAddress)}>
+ {({ change, data, submit }) => (
+ <OrderAddressEditDialog
+ countries={countries}
+ data={data}
+ open={openedBillingAddressEditDialog}
+ prefixes={prefixes}
+ variant="billing"
+ onClose={this.toggleBillingAddressEditDialog}
+ onConfirm={submit}
+ onChange={change}
+ />
+ )}
+ </Form>
+ </>
+ )}
+ </div>
+ </div>
+ </Container>
+ );
+ }
+}
+const OrderDetailsPage = decorate<OrderDetailsPageProps>(
+ OrderDetailsPageComponent
+);
+export default OrderDetailsPage;
diff --git a/saleor/static/dashboard-next/orders/components/OrderDetailsPage/index.ts b/saleor/static/dashboard-next/orders/components/OrderDetailsPage/index.ts
new file mode 100644
index 0000000000..ef87279410
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderDetailsPage/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderDetailsPage";
+export * from "./OrderDetailsPage";
diff --git a/saleor/static/dashboard-next/orders/components/OrderFulfillment/OrderFulfillment.tsx b/saleor/static/dashboard-next/orders/components/OrderFulfillment/OrderFulfillment.tsx
new file mode 100644
index 0000000000..48d4b02c8c
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderFulfillment/OrderFulfillment.tsx
@@ -0,0 +1,138 @@
+import Cached from "@material-ui/icons/Cached";
+import PrintIcon from "@material-ui/icons/Print";
+import Avatar from "material-ui/Avatar";
+import Button from "material-ui/Button";
+import Card, { CardActions, CardContent } from "material-ui/Card";
+import IconButton from "material-ui/IconButton";
+import { withStyles } from "material-ui/styles";
+import Table, {
+ TableBody,
+ TableCell,
+ TableHead,
+ TableRow
+} from "material-ui/Table";
+import * as React from "react";
+
+import { transformFulfillmentStatus } from "../..";
+import PageHeader from "../../../components/PageHeader";
+import Skeleton from "../../../components/Skeleton";
+import StatusLabel from "../../../components/StatusLabel/StatusLabel";
+import i18n from "../../../i18n";
+
+interface OrderFulfillmentProps {
+ id?: string;
+ status?: string;
+ products?: Array<{
+ quantity: number;
+ product: {
+ id: string;
+ name: string;
+ thumbnailUrl: string;
+ };
+ }>;
+ trackingCode?: string;
+ onFulfillmentCancel?();
+ onTrackingCodeAdd?();
+ onPackingSlipClick?();
+}
+
+const decorate = withStyles(theme => ({
+ avatarCell: {
+ paddingLeft: theme.spacing.unit * 2,
+ paddingRight: theme.spacing.unit * 3,
+ width: theme.spacing.unit * 5
+ },
+ root: {
+ marginTop: theme.spacing.unit * 2,
+ [theme.breakpoints.down("sm")]: {
+ marginTop: theme.spacing.unit
+ }
+ },
+ statusBar: {
+ paddingTop: 0
+ },
+ textRight: {
+ textAlign: "right" as "right"
+ }
+}));
+const OrderFulfillment = decorate<OrderFulfillmentProps>(
+ ({
+ classes,
+ id,
+ status,
+ products,
+ trackingCode,
+ onFulfillmentCancel,
+ onTrackingCodeAdd,
+ onPackingSlipClick
+ }) => (
+ <Card className={classes.root}>
+ <PageHeader
+ title={id ? i18n.t("Fulfillment #{{ id }}", { id }) : undefined}
+ >
+ {status !== "cancelled" && (
+ <IconButton
+ disabled={!onPackingSlipClick}
+ onClick={onPackingSlipClick}
+ >
+ <PrintIcon />
+ </IconButton>
+ )}
+ </PageHeader>
+ {status && (
+ <CardContent className={classes.statusBar}>
+ <StatusLabel
+ status={transformFulfillmentStatus(status).status}
+ label={transformFulfillmentStatus(status).localized}
+ />
+ </CardContent>
+ )}
+ <Table>
+ <TableHead>
+ <TableRow>
+ <TableCell />
+ <TableCell>{i18n.t("Product")}</TableCell>
+ </TableRow>
+ </TableHead>
+ <TableBody>
+ {products ? (
+ products.map(productLine => (
+ <TableRow>
+ <TableCell className={classes.avatarCell}>
+ <Avatar src={productLine.product.thumbnailUrl} />
+ </TableCell>
+ <TableCell>
+ {productLine.product.name} x {productLine.quantity}
+ </TableCell>
+ </TableRow>
+ ))
+ ) : (
+ <TableRow>
+ <TableCell className={classes.avatarCell}>
+ <Avatar>
+ <Cached />
+ </Avatar>
+ </TableCell>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ </TableRow>
+ )}
+ </TableBody>
+ </Table>
+ {status !== "cancelled" && (
+ <CardActions>
+ <Button disabled={!onTrackingCodeAdd} onClick={onTrackingCodeAdd}>
+ {trackingCode
+ ? i18n.t("Add tracking number")
+ : i18n.t("Edit tracking number")}
+ </Button>
+ <Button disabled={!onFulfillmentCancel} onClick={onFulfillmentCancel}>
+ {i18n.t("Cancel shipment")}
+ </Button>
+ </CardActions>
+ )}
+ </Card>
+ )
+);
+export default OrderFulfillment;
diff --git a/saleor/static/dashboard-next/orders/components/OrderFulfillment/index.ts b/saleor/static/dashboard-next/orders/components/OrderFulfillment/index.ts
new file mode 100644
index 0000000000..ca836178fc
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderFulfillment/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderFulfillment";
+export * from "./OrderFulfillment";
diff --git a/saleor/static/dashboard-next/orders/components/OrderFulfillmentCancelDialog/OrderFulfillmentCancelDialog.tsx b/saleor/static/dashboard-next/orders/components/OrderFulfillmentCancelDialog/OrderFulfillmentCancelDialog.tsx
new file mode 100644
index 0000000000..5eb131f804
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderFulfillmentCancelDialog/OrderFulfillmentCancelDialog.tsx
@@ -0,0 +1,59 @@
+import Button from "material-ui/Button";
+import Dialog, {
+ DialogActions,
+ DialogContent,
+ DialogContentText,
+ DialogProps,
+ DialogTitle
+} from "material-ui/Dialog";
+import { withStyles } from "material-ui/styles";
+import * as React from "react";
+
+import i18n from "../../../i18n";
+
+interface OrderFulfillmentCancelDialogProps {
+ open: boolean;
+ id: string;
+ onClose?();
+ onConfirm?();
+}
+
+const decorate = withStyles(theme => ({
+ deleteButton: {
+ "&:hover": {
+ backgroundColor: theme.palette.error.main
+ },
+ backgroundColor: theme.palette.error.main,
+ color: theme.palette.error.contrastText
+ }
+}));
+const OrderFulfillmentCancelDialog = decorate<
+ OrderFulfillmentCancelDialogProps
+>(({ children, classes, id, open, onConfirm, onClose }) => (
+ <Dialog open={open}>
+ <DialogTitle>
+ {i18n.t("Cancel fulfillment", { context: "title" })}
+ </DialogTitle>
+ <DialogContent>
+ <DialogContentText
+ dangerouslySetInnerHTML={{
+ __html: i18n.t(
+ "Are you sure you want to cancel <strong>#{{ id }}</strong>?",
+ { id }
+ )
+ }}
+ />
+ </DialogContent>
+ <DialogActions>
+ <Button onClick={onClose}>{i18n.t("Back", { context: "button" })}</Button>
+ <Button
+ className={classes.deleteButton}
+ variant="raised"
+ onClick={onConfirm}
+ >
+ {i18n.t("Cancel fulfillment", { context: "button" })}
+ </Button>
+ </DialogActions>
+ </Dialog>
+));
+export default OrderFulfillmentCancelDialog;
diff --git a/saleor/static/dashboard-next/orders/components/OrderFulfillmentCancelDialog/index.ts b/saleor/static/dashboard-next/orders/components/OrderFulfillmentCancelDialog/index.ts
new file mode 100644
index 0000000000..5243bf630a
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderFulfillmentCancelDialog/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderFulfillmentCancelDialog";
+export * from "./OrderFulfillmentCancelDialog";
diff --git a/saleor/static/dashboard-next/orders/components/OrderFulfillmentDialog/OrderFulfillmentDialog.tsx b/saleor/static/dashboard-next/orders/components/OrderFulfillmentDialog/OrderFulfillmentDialog.tsx
new file mode 100644
index 0000000000..46918ddbf4
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderFulfillmentDialog/OrderFulfillmentDialog.tsx
@@ -0,0 +1,105 @@
+import Avatar from "material-ui/Avatar";
+import Button from "material-ui/Button";
+import Dialog, {
+ DialogActions,
+ DialogContent,
+ DialogContentText,
+ DialogProps,
+ DialogTitle
+} from "material-ui/Dialog";
+import Input from "material-ui/Input";
+import { withStyles } from "material-ui/styles";
+import Table, {
+ TableBody,
+ TableCell,
+ TableHead,
+ TableRow
+} from "material-ui/Table";
+import TextField from "material-ui/TextField";
+import * as React from "react";
+
+import i18n from "../../../i18n";
+
+interface OrderFulfillmentDialogProps {
+ open: boolean;
+ products?: Array<{
+ id: string;
+ name: string;
+ sku: string;
+ quantity: number;
+ thumbnailUrl: string;
+ }>;
+ data: any;
+ onChange(event: React.ChangeEvent<any>);
+ onClose?();
+ onConfirm?(event: React.FormEvent<any>);
+}
+
+const decorate = withStyles(theme => ({
+ avatarCell: {
+ paddingLeft: theme.spacing.unit * 2,
+ paddingRight: theme.spacing.unit * 3,
+ width: theme.spacing.unit * 5
+ },
+ textRight: {
+ textAlign: "right" as "right"
+ },
+ quantityInput: {
+ width: "4rem"
+ },
+ root: {}
+}));
+const OrderFulfillmentDialog = decorate<OrderFulfillmentDialogProps>(
+ ({ classes, open, products, data, onChange, onClose, onConfirm }) => (
+ <Dialog open={open}>
+ <DialogTitle>{i18n.t("Fulfill products")}</DialogTitle>
+ <Table>
+ <TableHead>
+ <TableRow>
+ <TableCell />
+ <TableCell>{i18n.t("Product name")}</TableCell>
+ <TableCell>{i18n.t("SKU")}</TableCell>
+ <TableCell className={classes.textRight}>
+ {i18n.t("Quantity")}
+ </TableCell>
+ </TableRow>
+ </TableHead>
+ <TableBody>
+ {products.map(product => (
+ <TableRow>
+ <TableCell className={classes.avatarCell}>
+ <Avatar src={product.thumbnailUrl} />
+ </TableCell>
+ <TableCell>{product.name}</TableCell>
+ <TableCell>{product.sku}</TableCell>
+ <TableCell className={classes.textRight}>
+ <Input
+ type="number"
+ inputProps={{
+ max: product.quantity,
+ style: { textAlign: "right" }
+ }}
+ className={classes.quantityInput}
+ value={data[product.id]}
+ onChange={onChange}
+ name={product.id}
+ error={product.quantity < data[product.id]}
+ />{" "}
+ / {product.quantity}
+ </TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <DialogActions>
+ <Button onClick={onClose}>
+ {i18n.t("Cancel", { context: "button" })}
+ </Button>
+ <Button color="primary" variant="raised" onClick={onConfirm}>
+ {i18n.t("Confirm", { context: "button" })}
+ </Button>
+ </DialogActions>
+ </Dialog>
+ )
+);
+export default OrderFulfillmentDialog;
diff --git a/saleor/static/dashboard-next/orders/components/OrderFulfillmentDialog/index.ts b/saleor/static/dashboard-next/orders/components/OrderFulfillmentDialog/index.ts
new file mode 100644
index 0000000000..5a977a6c07
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderFulfillmentDialog/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderFulfillmentDialog";
+export * from "./OrderFulfillmentDialog";
diff --git a/saleor/static/dashboard-next/orders/components/OrderFulfillmentTrackingDialog/OrderFulfillmentTrackingDialog.tsx b/saleor/static/dashboard-next/orders/components/OrderFulfillmentTrackingDialog/OrderFulfillmentTrackingDialog.tsx
new file mode 100644
index 0000000000..f4afc09fc2
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderFulfillmentTrackingDialog/OrderFulfillmentTrackingDialog.tsx
@@ -0,0 +1,64 @@
+import Button from "material-ui/Button";
+import Dialog, {
+ DialogActions,
+ DialogContent,
+ DialogContentText,
+ DialogProps,
+ DialogTitle
+} from "material-ui/Dialog";
+import { withStyles } from "material-ui/styles";
+import TextField from "material-ui/TextField";
+import * as React from "react";
+
+import i18n from "../../../i18n";
+
+interface OrderFulfillmentTrackingDialogProps {
+ open: boolean;
+ trackingCode: string;
+ variant: string;
+ onChange(event: React.ChangeEvent<any>);
+ onClose?();
+ onConfirm?();
+}
+
+const decorate = withStyles(theme => ({}));
+const OrderFulfillmentTrackingDialog = decorate<
+ OrderFulfillmentTrackingDialogProps
+>(
+ ({
+ children,
+ classes,
+ open,
+ variant,
+ trackingCode,
+ onConfirm,
+ onClose,
+ onChange
+ }) => (
+ <Dialog open={open}>
+ <DialogTitle>
+ {variant === "edit"
+ ? i18n.t("Edit tracking code", { context: "title" })
+ : i18n.t("Add tracking code", { context: "title" })}
+ </DialogTitle>
+ <DialogContent>
+ <TextField
+ label={i18n.t("Tracking code")}
+ name="trackingCode"
+ onChange={onChange}
+ value={trackingCode}
+ fullWidth
+ />
+ </DialogContent>
+ <DialogActions>
+ <Button onClick={onClose}>
+ {i18n.t("Cancel", { context: "button" })}
+ </Button>
+ <Button color="primary" variant="raised" onClick={onConfirm}>
+ {i18n.t("Confirm", { context: "button" })}
+ </Button>
+ </DialogActions>
+ </Dialog>
+ )
+);
+export default OrderFulfillmentTrackingDialog;
diff --git a/saleor/static/dashboard-next/orders/components/OrderFulfillmentTrackingDialog/index.ts b/saleor/static/dashboard-next/orders/components/OrderFulfillmentTrackingDialog/index.ts
new file mode 100644
index 0000000000..f5b81a5059
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderFulfillmentTrackingDialog/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderFulfillmentTrackingDialog";
+export * from "./OrderFulfillmentTrackingDialog";
diff --git a/saleor/static/dashboard-next/orders/components/OrderHistory/OrderHistory.tsx b/saleor/static/dashboard-next/orders/components/OrderHistory/OrderHistory.tsx
new file mode 100644
index 0000000000..b0b740ef59
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderHistory/OrderHistory.tsx
@@ -0,0 +1,92 @@
+import { withStyles } from "material-ui/styles";
+import Typography from "material-ui/Typography";
+import * as React from "react";
+
+import Form from "../../../components/Form";
+import PageHeader from "../../../components/PageHeader";
+import Skeleton from "../../../components/Skeleton";
+import {
+ Timeline,
+ TimelineAddNote,
+ TimelineNode,
+ TimelineNote
+} from "../../../components/Timeline/Timeline";
+import i18n from "../../../i18n";
+
+interface OrderHistoryProps {
+ history?: Array<{
+ id: string;
+ type: string;
+ content: string;
+ date: string;
+ user: string;
+ params?: any;
+ }>;
+ user?: string;
+}
+
+const decorate = withStyles(theme => ({
+ root: { marginTop: theme.spacing.unit * 2 },
+ user: {
+ marginBottom: theme.spacing.unit
+ }
+}));
+const OrderHistory = decorate<OrderHistoryProps>(
+ ({ classes, history, user }) => (
+ <div className={classes.root}>
+ <PageHeader title={i18n.t("Order history")} />
+ {history ? (
+ <Timeline>
+ <Form initial={{ content: "" }}>
+ {({ change, data, submit }) => (
+ <TimelineAddNote
+ content={data.content}
+ onChange={change}
+ onSubmit={submit}
+ user={user}
+ />
+ )}
+ </Form>
+ {history
+ .slice()
+ .reverse()
+ .map(event => {
+ if (event.type === "note") {
+ return (
+ <TimelineNote
+ user={event.user}
+ date={event.date}
+ content={event.content}
+ />
+ );
+ }
+ if (event.type === "shipped") {
+ return (
+ <TimelineNode date={event.date} title={event.content}>
+ <Typography variant="caption" className={classes.user}>
+ {i18n.t("by {{ user }}", { user: event.user })}
+ </Typography>
+ <Typography
+ dangerouslySetInnerHTML={{
+ __html: event.params.shippingAddress
+ }}
+ />
+ </TimelineNode>
+ );
+ }
+ return (
+ <TimelineNode date={event.date} title={event.content}>
+ <Typography variant="caption">
+ {i18n.t("by {{ user }}", { user: event.user })}
+ </Typography>
+ </TimelineNode>
+ );
+ })}
+ </Timeline>
+ ) : (
+ <Skeleton />
+ )}
+ </div>
+ )
+);
+export default OrderHistory;
diff --git a/saleor/static/dashboard-next/orders/components/OrderHistory/index.ts b/saleor/static/dashboard-next/orders/components/OrderHistory/index.ts
new file mode 100644
index 0000000000..271408ddf1
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderHistory/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderHistory";
+export * from "./OrderHistory";
diff --git a/saleor/static/dashboard-next/orders/components/OrderList/OrderList.tsx b/saleor/static/dashboard-next/orders/components/OrderList/OrderList.tsx
new file mode 100644
index 0000000000..9884a5d78d
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderList/OrderList.tsx
@@ -0,0 +1,168 @@
+import Card from "material-ui/Card";
+import blue from "material-ui/colors/blue";
+import IconButton from "material-ui/IconButton";
+import { withStyles } from "material-ui/styles";
+import Table, {
+ TableBody,
+ TableCell,
+ TableFooter,
+ TableHead,
+ TableRow
+} from "material-ui/Table";
+import * as React from "react";
+
+import DateFormatter from "../../../components/DateFormatter";
+import Skeleton from "../../../components/Skeleton";
+import StatusLabel from "../../../components/StatusLabel";
+import TablePagination from "../../../components/TablePagination";
+import i18n from "../../../i18n";
+
+interface OrderListProps {
+ orders?: Array<{
+ id: string;
+ number: number;
+ orderStatus: {
+ localized: string;
+ status: string;
+ };
+ client: {
+ id: string;
+ email: string;
+ };
+ created: string;
+ paymentStatus: {
+ localized: string;
+ status: string;
+ };
+ price: {
+ amount: number;
+ currency: string;
+ };
+ }>;
+ dateNow?: number;
+ hasPreviousPage?: boolean;
+ hasNextPage?: boolean;
+ onPreviousPage?();
+ onNextPage?();
+ onRowClick?(id: string);
+}
+
+const decorate = withStyles(theme => ({
+ currency: {
+ color: theme.palette.grey[400]
+ },
+ link: {
+ color: blue[500],
+ cursor: "pointer",
+ textDecoration: "none"
+ },
+ textRight: {
+ textAlign: "right" as "right"
+ }
+}));
+export const OrderList = decorate<OrderListProps>(
+ ({
+ classes,
+ dateNow,
+ orders,
+ hasPreviousPage,
+ onPreviousPage,
+ hasNextPage,
+ onNextPage,
+ onRowClick
+ }) => (
+ <Card>
+ <Table>
+ <TableHead>
+ <TableRow>
+ <TableCell>{i18n.t("#", { context: "object" })}</TableCell>
+ <TableCell>
+ {i18n.t("Fulfillment", { context: "object" })}
+ </TableCell>
+ <TableCell>{i18n.t("Client", { context: "object" })}</TableCell>
+ <TableCell>{i18n.t("Created at", { context: "object" })}</TableCell>
+ <TableCell>
+ {i18n.t("Payment status", { context: "object" })}
+ </TableCell>
+ <TableCell className={classes.textRight}>
+ {i18n.t("Price", { context: "object" })}
+ </TableCell>
+ </TableRow>
+ </TableHead>
+ <TableFooter>
+ <TableRow>
+ <TablePagination
+ colSpan={6}
+ hasNextPage={hasNextPage || false}
+ onNextPage={onNextPage}
+ hasPreviousPage={hasPreviousPage || false}
+ onPreviousPage={onPreviousPage}
+ />
+ </TableRow>
+ </TableFooter>
+ <TableBody>
+ {orders === undefined || orders === null ? (
+ <TableRow>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ </TableRow>
+ ) : orders.length > 0 ? (
+ orders.map(order => (
+ <TableRow key={order.id}>
+ <TableCell
+ onClick={onRowClick ? onRowClick(order.id) : undefined}
+ className={onRowClick ? classes.link : ""}
+ >
+ {order.number}
+ </TableCell>
+ <TableCell>
+ <StatusLabel
+ status={order.orderStatus.status}
+ label={order.orderStatus.localized}
+ />
+ </TableCell>
+ <TableCell>{order.client.email}</TableCell>
+ <TableCell>
+ <DateFormatter date={order.created} dateNow={dateNow} />
+ </TableCell>
+ <TableCell>
+ <StatusLabel
+ status={order.paymentStatus.status}
+ label={order.paymentStatus.localized}
+ />
+ </TableCell>
+ <TableCell className={classes.textRight}>
+ {order.price.amount.toFixed(2)}{" "}
+ <span className={classes.currency}>
+ {order.price.currency}
+ </span>
+ </TableCell>
+ </TableRow>
+ ))
+ ) : (
+ <TableRow>
+ <TableCell colSpan={6}>{i18n.t("No orders found")}</TableCell>
+ </TableRow>
+ )}
+ </TableBody>
+ </Table>
+ </Card>
+ )
+);
+export default OrderList;
diff --git a/saleor/static/dashboard-next/orders/components/OrderList/index.ts b/saleor/static/dashboard-next/orders/components/OrderList/index.ts
new file mode 100644
index 0000000000..0dea1ff582
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderList/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderList";
+export * from "./OrderList";
diff --git a/saleor/static/dashboard-next/orders/components/OrderListPage/OrderListPage.tsx b/saleor/static/dashboard-next/orders/components/OrderListPage/OrderListPage.tsx
new file mode 100644
index 0000000000..f7b816de49
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderListPage/OrderListPage.tsx
@@ -0,0 +1,57 @@
+import { withStyles } from "material-ui/styles";
+import * as React from "react";
+
+import { transformOrderStatus, transformPaymentStatus } from "../../";
+import Container from "../../../components/Container";
+import PageHeader from "../../../components/PageHeader";
+import i18n from "../../../i18n";
+import OrderList from "../OrderList";
+
+interface OrderListPageProps {
+ orders?: {
+ edges: Array<{
+ node: {
+ id: string;
+ number: number;
+ status: string;
+ client: {
+ id: string;
+ email: string;
+ };
+ created: string;
+ paymentStatus: string;
+ price: {
+ amount: number;
+ currency: string;
+ };
+ };
+ }>;
+ };
+ dateNow?: number;
+ onBack();
+ onRowClick(id: string);
+}
+
+const decorate = withStyles(theme => ({ root: {} }));
+const OrderListPage = decorate<OrderListPageProps>(
+ ({ classes, dateNow, orders, onBack, onRowClick }) => {
+ const orderList = orders
+ ? orders.edges.map(edge => ({
+ ...edge.node,
+ orderStatus: transformOrderStatus(edge.node.status),
+ paymentStatus: transformPaymentStatus(edge.node.paymentStatus)
+ }))
+ : undefined;
+ return (
+ <Container width="md">
+ <PageHeader title={i18n.t("Orders")} onBack={onBack} />
+ <OrderList
+ dateNow={dateNow}
+ onRowClick={onRowClick}
+ orders={orderList}
+ />
+ </Container>
+ );
+ }
+);
+export default OrderListPage;
diff --git a/saleor/static/dashboard-next/orders/components/OrderListPage/index.ts b/saleor/static/dashboard-next/orders/components/OrderListPage/index.ts
new file mode 100644
index 0000000000..69c5cc4292
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderListPage/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderListPage";
+export * from "./OrderListPage";
diff --git a/saleor/static/dashboard-next/orders/components/OrderPaymentDialog/OrderPaymentDialog.tsx b/saleor/static/dashboard-next/orders/components/OrderPaymentDialog/OrderPaymentDialog.tsx
new file mode 100644
index 0000000000..e25ae519d2
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderPaymentDialog/OrderPaymentDialog.tsx
@@ -0,0 +1,53 @@
+import Button from "material-ui/Button";
+import Dialog, {
+ DialogActions,
+ DialogContent,
+ DialogContentText,
+ DialogProps,
+ DialogTitle
+} from "material-ui/Dialog";
+import { withStyles } from "material-ui/styles";
+import TextField from "material-ui/TextField";
+import * as React from "react";
+
+import i18n from "../../../i18n";
+
+interface OrderPaymentDialogProps {
+ open: boolean;
+ value: number;
+ variant: string;
+ onChange(event: React.ChangeEvent<any>);
+ onClose?();
+ onConfirm?(event: React.FormEvent<any>);
+}
+
+const decorate = withStyles(theme => ({ root: {} }));
+const OrderPaymentDialog = decorate<OrderPaymentDialogProps>(
+ ({ children, classes, open, variant, onConfirm, onClose, onChange }) => (
+ <Dialog open={open}>
+ <DialogTitle>
+ {variant === "capture"
+ ? i18n.t("Capture payment", { context: "title" })
+ : i18n.t("Refund payment", { context: "title" })}
+ </DialogTitle>
+ <DialogContent>
+ <TextField
+ label={i18n.t("Amount")}
+ name="value"
+ onChange={onChange}
+ fullWidth
+ type="number"
+ />
+ </DialogContent>
+ <DialogActions>
+ <Button onClick={onClose}>
+ {i18n.t("Cancel", { context: "button" })}
+ </Button>
+ <Button color="primary" variant="raised" onClick={onConfirm}>
+ {i18n.t("Confirm", { context: "button" })}
+ </Button>
+ </DialogActions>
+ </Dialog>
+ )
+);
+export default OrderPaymentDialog;
diff --git a/saleor/static/dashboard-next/orders/components/OrderPaymentDialog/index.ts b/saleor/static/dashboard-next/orders/components/OrderPaymentDialog/index.ts
new file mode 100644
index 0000000000..b1897f5b55
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderPaymentDialog/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderPaymentDialog";
+export * from "./OrderPaymentDialog";
diff --git a/saleor/static/dashboard-next/orders/components/OrderPaymentReleaseDialog/OrderPaymentReleaseDialog.tsx b/saleor/static/dashboard-next/orders/components/OrderPaymentReleaseDialog/OrderPaymentReleaseDialog.tsx
new file mode 100644
index 0000000000..9529518d5b
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderPaymentReleaseDialog/OrderPaymentReleaseDialog.tsx
@@ -0,0 +1,43 @@
+import Button from "material-ui/Button";
+import Dialog, {
+ DialogActions,
+ DialogContent,
+ DialogContentText,
+ DialogProps,
+ DialogTitle
+} from "material-ui/Dialog";
+import { withStyles } from "material-ui/styles";
+import * as React from "react";
+
+import i18n from "../../../i18n";
+
+interface OrderPaymentReleaseDialogProps {
+ open: boolean;
+ onClose?();
+ onConfirm?();
+}
+
+const decorate = withStyles(theme => ({ root: {} }));
+const OrderPaymentReleaseDialog = decorate<OrderPaymentReleaseDialogProps>(
+ ({ children, classes, open, onConfirm, onClose }) => (
+ <Dialog open={open}>
+ <DialogTitle>
+ {i18n.t("Release payment", { context: "title" })}
+ </DialogTitle>
+ <DialogContent>
+ <DialogContentText>
+ {i18n.t("Are you sure you want to release this payment?")}
+ </DialogContentText>
+ </DialogContent>
+ <DialogActions>
+ <Button onClick={onClose}>
+ {i18n.t("Back", { context: "button" })}
+ </Button>
+ <Button color="primary" variant="raised" onClick={onConfirm}>
+ {i18n.t("Confirm", { context: "button" })}
+ </Button>
+ </DialogActions>
+ </Dialog>
+ )
+);
+export default OrderPaymentReleaseDialog;
diff --git a/saleor/static/dashboard-next/orders/components/OrderPaymentReleaseDialog/index.ts b/saleor/static/dashboard-next/orders/components/OrderPaymentReleaseDialog/index.ts
new file mode 100644
index 0000000000..38627f19c4
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderPaymentReleaseDialog/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderPaymentReleaseDialog";
+export * from "./OrderPaymentReleaseDialog";
diff --git a/saleor/static/dashboard-next/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx b/saleor/static/dashboard-next/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx
new file mode 100644
index 0000000000..92a41f1486
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx
@@ -0,0 +1,128 @@
+import Button from "material-ui/Button";
+import Dialog, {
+ DialogActions,
+ DialogContent,
+ DialogContentText,
+ DialogProps,
+ DialogTitle
+} from "material-ui/Dialog";
+import { InputAdornment } from "material-ui/Input";
+import { withStyles } from "material-ui/styles";
+import TextField from "material-ui/TextField";
+import Typography from "material-ui/Typography";
+import * as React from "react";
+
+import { SingleAutocompleteSelectField } from "../../../components/SingleAutocompleteSelectField";
+import i18n from "../../../i18n";
+
+interface OrderProductAddDialogProps {
+ open: boolean;
+ variant?: {
+ label: string;
+ value: string;
+ };
+ quantity?: number;
+ variants?: Array<{
+ id: string;
+ name: string;
+ sku: string;
+ stockAllocated;
+ }>;
+ loading?: boolean;
+ fetchVariants(value: string);
+ onChange(event: React.ChangeEvent<any>);
+ onClose?();
+ onConfirm?(event: React.FormEvent<any>);
+}
+
+const decorate = withStyles(theme => ({
+ dialog: {
+ overflowY: "visible" as "visible"
+ },
+ select: {
+ flex: 1,
+ marginRight: theme.spacing.unit * 2
+ },
+ root: {
+ display: "grid" as "grid",
+ gridColumnGap: theme.spacing.unit * 2 + "px",
+ gridTemplateColumns: "1fr 6rem",
+ overflowY: "visible" as "visible",
+ width: theme.breakpoints.values.sm
+ },
+ textRight: {
+ textAlign: "right" as "right"
+ }
+}));
+const OrderProductAddDialog = decorate<OrderProductAddDialogProps>(
+ ({
+ classes,
+ open,
+ loading,
+ variant,
+ variants,
+ quantity,
+ fetchVariants,
+ onChange,
+ onClose,
+ onConfirm
+ }) => {
+ const choices =
+ !loading && variants
+ ? variants.map(v => ({
+ label: `${v.sku} ${v.name}`,
+ value: v.id
+ }))
+ : [];
+ const maxQuantity =
+ !loading && variant && variant.value && variants
+ ? variants.filter(v => v.id === variant.value)[0].stockAllocated
+ : 0;
+ return (
+ <Dialog open={open} classes={{ paper: classes.dialog }}>
+ <DialogTitle>{i18n.t("Add product")}</DialogTitle>
+ <DialogContent className={classes.root}>
+ <div className={classes.select}>
+ <SingleAutocompleteSelectField
+ name="variant"
+ value={variant}
+ choices={choices}
+ onChange={onChange}
+ fetchChoices={fetchVariants}
+ loading={loading}
+ />
+ </div>
+ <div>
+ <TextField
+ type="number"
+ inputProps={{
+ max: maxQuantity,
+ style: { textAlign: "right", width: "4rem" }
+ }}
+ value={quantity}
+ onChange={onChange}
+ name="quantity"
+ error={quantity > maxQuantity}
+ InputProps={{
+ endAdornment: (
+ <InputAdornment position="end">
+ {`/ ${maxQuantity}`}
+ </InputAdornment>
+ )
+ }}
+ />
+ </div>
+ </DialogContent>
+ <DialogActions>
+ <Button onClick={onClose}>
+ {i18n.t("Cancel", { context: "button" })}
+ </Button>
+ <Button color="primary" variant="raised" onClick={onConfirm}>
+ {i18n.t("Confirm", { context: "button" })}
+ </Button>
+ </DialogActions>
+ </Dialog>
+ );
+ }
+);
+export default OrderProductAddDialog;
diff --git a/saleor/static/dashboard-next/orders/components/OrderProductAddDialog/index.ts b/saleor/static/dashboard-next/orders/components/OrderProductAddDialog/index.ts
new file mode 100644
index 0000000000..b5eb5f42c4
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderProductAddDialog/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderProductAddDialog";
+export * from "./OrderProductAddDialog";
diff --git a/saleor/static/dashboard-next/orders/components/OrderProducts/OrderProducts.tsx b/saleor/static/dashboard-next/orders/components/OrderProducts/OrderProducts.tsx
new file mode 100644
index 0000000000..d1a12abf27
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderProducts/OrderProducts.tsx
@@ -0,0 +1,294 @@
+import Cached from "@material-ui/icons/Cached";
+import CloseIcon from "@material-ui/icons/Close";
+import Avatar from "material-ui/Avatar";
+import Button from "material-ui/Button";
+import Card, { CardActions, CardContent } from "material-ui/Card";
+import blue from "material-ui/colors/blue";
+import IconButton from "material-ui/IconButton";
+import { withStyles } from "material-ui/styles";
+import Table, {
+ TableBody,
+ TableCell,
+ TableFooter,
+ TableHead,
+ TableRow
+} from "material-ui/Table";
+import Typography from "material-ui/Typography";
+import * as React from "react";
+
+import EditableTableCell from "../../../components/EditableTableCell";
+import Money from "../../../components/Money";
+import PageHeader from "../../../components/PageHeader";
+import Skeleton from "../../../components/Skeleton";
+import i18n from "../../../i18n";
+
+interface TaxedMoneyType {
+ gross: {
+ amount: number;
+ currency: string;
+ };
+}
+interface MoneyType {
+ amount: number;
+ currency: string;
+}
+export interface OrderProductsProps {
+ isDraft?: boolean;
+ net?: MoneyType;
+ paid?: MoneyType;
+ products?: Array<{
+ id: string;
+ name: string;
+ price: TaxedMoneyType;
+ quantity: number;
+ sku: string;
+ thumbnailUrl: string;
+ }>;
+ shippingMethod?: {
+ name: string;
+ price: MoneyType;
+ };
+ refunded?: MoneyType;
+ subtotal?: MoneyType;
+ total?: MoneyType;
+ onOrderLineChange?(id: string): (value: string) => () => void;
+ onOrderLineRemove?(id: string): () => any;
+ onRowClick?(id: string): () => any;
+ onShippingMethodClick?();
+}
+
+const decorate = withStyles(theme => ({
+ avatarCell: {
+ paddingLeft: theme.spacing.unit * 2,
+ paddingRight: theme.spacing.unit * 3,
+ width: theme.spacing.unit * 5
+ },
+ cardActions: {
+ direction: "rtl" as "rtl"
+ },
+ deleteIcon: {
+ height: 40,
+ width: 40
+ },
+ denseTable: {
+ "& td, & th": {
+ paddingRight: theme.spacing.unit * 3
+ }
+ },
+ link: {
+ color: blue[500],
+ cursor: "pointer"
+ },
+ textRight: {
+ textAlign: "right" as "right"
+ },
+ flexBox: {
+ display: "flex",
+ flexDirection: "column" as "column",
+ height: theme.spacing.unit * 12,
+ justifyContent: "space-evenly"
+ }
+}));
+const OrderProducts = decorate<OrderProductsProps>(
+ ({
+ classes,
+ isDraft,
+ net,
+ paid,
+ products,
+ refunded,
+ shippingMethod,
+ subtotal,
+ total,
+ onOrderLineChange,
+ onOrderLineRemove,
+ onRowClick,
+ onShippingMethodClick
+ }) => (
+ <Table className={classes.denseTable}>
+ <TableHead>
+ <TableRow>
+ <TableCell className={classes.avatarCell} />
+ <TableCell>{i18n.t("Name", { context: "object" })}</TableCell>
+ <TableCell>{i18n.t("SKU", { context: "object" })}</TableCell>
+ <TableCell className={classes.textRight}>
+ {i18n.t("Unit price", { context: "object" })}
+ </TableCell>
+ <TableCell className={classes.textRight}>
+ {i18n.t("Quantity", { context: "object" })}
+ </TableCell>
+ <TableCell className={classes.textRight}>
+ {i18n.t("Price", { context: "object" })}
+ </TableCell>
+ </TableRow>
+ </TableHead>
+ <TableBody>
+ {products === undefined || products === null ? (
+ <TableRow>
+ <TableCell className={classes.avatarCell}>
+ <Avatar>
+ <Cached />
+ </Avatar>
+ </TableCell>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ <TableCell>
+ <Skeleton />
+ </TableCell>
+ </TableRow>
+ ) : products.length > 0 ? (
+ products.map(product => (
+ <TableRow key={product.id}>
+ {isDraft ? (
+ <TableCell className={classes.avatarCell}>
+ <IconButton
+ onClick={
+ !!onOrderLineRemove
+ ? onOrderLineRemove(product.id)
+ : undefined
+ }
+ disabled={!onOrderLineRemove}
+ className={classes.deleteIcon}
+ >
+ <CloseIcon />
+ </IconButton>
+ </TableCell>
+ ) : (
+ <TableCell className={classes.avatarCell}>
+ <Avatar src={product.thumbnailUrl} />
+ </TableCell>
+ )}
+ <TableCell>
+ <span
+ onClick={onRowClick ? onRowClick(product.id) : () => {}}
+ className={onRowClick ? classes.link : ""}
+ >
+ {product.name}
+ </span>
+ </TableCell>
+ <TableCell>{product.sku}</TableCell>
+ <TableCell className={classes.textRight}>
+ <Money
+ amount={product.price.gross.amount}
+ currency={product.price.gross.currency}
+ />
+ </TableCell>
+ {isDraft && !!onOrderLineChange ? (
+ <EditableTableCell
+ className={classes.textRight}
+ InputProps={{
+ label: i18n.t("Quantity"),
+ type: "number"
+ }}
+ value={product.quantity.toString()}
+ onConfirm={onOrderLineChange(product.id)}
+ />
+ ) : (
+ <TableCell className={classes.textRight}>
+ {product.quantity}
+ </TableCell>
+ )}
+ <TableCell className={classes.textRight}>
+ <Money
+ amount={product.price.gross.amount * product.quantity}
+ currency={product.price.gross.currency}
+ />
+ </TableCell>
+ </TableRow>
+ ))
+ ) : (
+ <TableRow>
+ <TableCell className={classes.avatarCell} />
+ <TableCell colSpan={2}>{i18n.t("No products found")}</TableCell>
+ </TableRow>
+ )}
+ <TableRow>
+ <TableCell colSpan={5} className={classes.textRight}>
+ <div className={classes.flexBox}>
+ <Typography>{i18n.t("Subtotal")}</Typography>
+ <Typography
+ className={
+ isDraft && !!onShippingMethodClick ? classes.link : ""
+ }
+ onClick={onShippingMethodClick}
+ >
+ {shippingMethod ? shippingMethod.name : i18n.t("Shipping")}
+ </Typography>
+ <Typography>
+ <b>{i18n.t("Total")}</b>
+ </Typography>
+ </div>
+ </TableCell>
+ <TableCell className={classes.textRight}>
+ <div className={classes.flexBox}>
+ {subtotal ? (
+ <Money amount={subtotal.amount} currency={subtotal.currency} />
+ ) : (
+ <Skeleton />
+ )}
+ {shippingMethod && shippingMethod.price ? (
+ <Money
+ amount={shippingMethod.price.amount}
+ currency={shippingMethod.price.currency}
+ />
+ ) : (
+ <Skeleton />
+ )}
+ {total ? (
+ <Money amount={total.amount} currency={total.currency} />
+ ) : (
+ <Skeleton />
+ )}
+ </div>
+ </TableCell>
+ </TableRow>
+ {!isDraft && (
+ <TableRow>
+ <TableCell colSpan={5} className={classes.textRight}>
+ <div className={classes.flexBox}>
+ <Typography>{i18n.t("Paid by customer")}</Typography>
+ <Typography>{i18n.t("Refunded")}</Typography>
+ <Typography>
+ <b>{i18n.t("Net payment")}</b>
+ </Typography>
+ </div>
+ </TableCell>
+ <TableCell className={classes.textRight}>
+ <div className={classes.flexBox}>
+ {paid ? (
+ <Money amount={paid.amount} currency={paid.currency} />
+ ) : (
+ <Skeleton />
+ )}
+ {refunded ? (
+ <Money
+ amount={-refunded.amount}
+ currency={refunded.currency}
+ />
+ ) : (
+ <Skeleton />
+ )}
+ {net ? (
+ <Money amount={net.amount} currency={net.currency} />
+ ) : (
+ <Skeleton />
+ )}
+ </div>
+ </TableCell>
+ </TableRow>
+ )}
+ </TableBody>
+ </Table>
+ )
+);
+export default OrderProducts;
diff --git a/saleor/static/dashboard-next/orders/components/OrderProducts/index.ts b/saleor/static/dashboard-next/orders/components/OrderProducts/index.ts
new file mode 100644
index 0000000000..316f9e5ea7
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderProducts/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderProducts";
+export * from "./OrderProducts";
diff --git a/saleor/static/dashboard-next/orders/components/OrderShippingMethodEditDialog/OrderShippingMethodEditDialog.tsx b/saleor/static/dashboard-next/orders/components/OrderShippingMethodEditDialog/OrderShippingMethodEditDialog.tsx
new file mode 100644
index 0000000000..52c2a7e585
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderShippingMethodEditDialog/OrderShippingMethodEditDialog.tsx
@@ -0,0 +1,98 @@
+import Button from "material-ui/Button";
+import Dialog, {
+ DialogActions,
+ DialogContent,
+ DialogContentText,
+ DialogProps,
+ DialogTitle
+} from "material-ui/Dialog";
+import { InputAdornment } from "material-ui/Input";
+import { withStyles } from "material-ui/styles";
+import TextField from "material-ui/TextField";
+import Typography from "material-ui/Typography";
+import * as React from "react";
+
+import { SingleAutocompleteSelectField } from "../../../components/SingleAutocompleteSelectField";
+import i18n from "../../../i18n";
+
+interface OrderShippingMethodEditDialogProps {
+ open: boolean;
+ shippingMethod?: {
+ label: string;
+ value: string;
+ };
+ shippingMethods?: Array<{
+ id: string;
+ name: string;
+ country: string;
+ }>;
+ loading?: boolean;
+ fetchShippingMethods(value: string);
+ onChange(event: React.ChangeEvent<any>);
+ onClose?();
+ onConfirm?(event: React.FormEvent<any>);
+}
+
+const decorate = withStyles(theme => ({
+ dialog: {
+ overflowY: "visible" as "visible"
+ },
+ root: {
+ overflowY: "visible" as "visible",
+ width: theme.breakpoints.values.sm
+ },
+ select: {
+ flex: 1,
+ marginRight: theme.spacing.unit * 2
+ },
+ textRight: {
+ textAlign: "right" as "right"
+ }
+}));
+const OrderShippingMethodEditDialog = decorate<
+ OrderShippingMethodEditDialogProps
+>(
+ ({
+ classes,
+ open,
+ loading,
+ shippingMethod,
+ shippingMethods,
+ fetchShippingMethods,
+ onChange,
+ onClose,
+ onConfirm
+ }) => {
+ const choices =
+ !loading && shippingMethods
+ ? shippingMethods.map(s => ({
+ label: `${s.name} (${s.country})`,
+ value: s.id
+ }))
+ : [];
+ return (
+ <Dialog open={open} classes={{ paper: classes.dialog }}>
+ <DialogTitle>{i18n.t("Edit customer details")}</DialogTitle>
+ <DialogContent className={classes.root}>
+ <SingleAutocompleteSelectField
+ choices={choices}
+ loading={loading}
+ name="user"
+ value={shippingMethod}
+ fetchChoices={fetchShippingMethods}
+ onChange={onChange}
+ />
+ </DialogContent>
+ <DialogActions>
+ <Button onClick={onClose}>
+ {i18n.t("Cancel", { context: "button" })}
+ </Button>
+ <Button color="primary" variant="raised" onClick={onConfirm}>
+ {i18n.t("Confirm", { context: "button" })}
+ </Button>
+ </DialogActions>
+ </Dialog>
+ );
+ }
+);
+export default OrderShippingMethodEditDialog;
diff --git a/saleor/static/dashboard-next/orders/components/OrderShippingMethodEditDialog/index.ts b/saleor/static/dashboard-next/orders/components/OrderShippingMethodEditDialog/index.ts
new file mode 100644
index 0000000000..d7c8cf9023
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderShippingMethodEditDialog/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderShippingMethodEditDialog";
+export * from "./OrderShippingMethodEditDialog";
diff --git a/saleor/static/dashboard-next/orders/components/OrderSummary/OrderSummary.tsx b/saleor/static/dashboard-next/orders/components/OrderSummary/OrderSummary.tsx
new file mode 100644
index 0000000000..4a24bac3e3
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderSummary/OrderSummary.tsx
@@ -0,0 +1,183 @@
+import AddIcon from "@material-ui/icons/Add";
+import Button from "material-ui/Button";
+import Card, { CardActions, CardContent } from "material-ui/Card";
+import IconButton from "material-ui/IconButton";
+import { withStyles } from "material-ui/styles";
+import * as React from "react";
+
+import {
+ OrderStatus,
+ PaymentStatus,
+ PaymentVariants,
+ transformOrderStatus
+} from "../..";
+import PageHeader from "../../../components/PageHeader";
+import StatusLabel from "../../../components/StatusLabel/StatusLabel";
+import i18n from "../../../i18n";
+import OrderProducts, {
+ OrderProductsProps
+} from "../OrderProducts/OrderProducts";
+
+interface MoneyType {
+ amount: number;
+ currency: string;
+}
+interface OrderSummaryProps extends OrderProductsProps {
+ paymentStatus?: string;
+ paymentVariant?: string;
+ shippingMethod?: {
+ name: string;
+ price: MoneyType;
+ };
+ status?: string;
+ onCapture?();
+ onCreate?();
+ onFulfill?();
+ onOrderCancel?();
+ onOrderLineChange?(id: string): (value: string) => () => void;
+ onOrderLineRemove?(id: string): () => void;
+ onProductAdd?();
+ onRefund?();
+ onRelease?();
+ onShippingMethodClick?();
+}
+
+const decorate = withStyles(theme => ({
+ root: {},
+ hr: {
+ height: 1,
+ display: "block",
+ border: "none",
+ width: "100%",
+ backgroundColor: theme.palette.grey[200]
+ },
+ statusBar: {
+ paddingTop: 0
+ }
+}));
+const OrderSummary = decorate<OrderSummaryProps>(
+ ({
+ classes,
+ net,
+ paid,
+ paymentStatus,
+ paymentVariant,
+ products,
+ refunded,
+ shippingMethod,
+ status,
+ subtotal,
+ total,
+ onCapture,
+ onCreate,
+ onFulfill,
+ onOrderCancel,
+ onOrderLineChange,
+ onOrderLineRemove,
+ onProductAdd,
+ onRefund,
+ onRelease,
+ onRowClick,
+ onShippingMethodClick
+ }) => {
+ const orderStatus = status ? transformOrderStatus(status) : undefined;
+ const canCapture =
+ paymentStatus && status
+ ? paymentStatus === PaymentStatus.PREAUTH &&
+ !([OrderStatus.DRAFT, OrderStatus.CANCELLED] as any).includes(status)
+ : false;
+ const canRelease =
+ paymentStatus && status ? paymentStatus === PaymentStatus.PREAUTH : false;
+ const canRefund =
+ paymentStatus && status
+ ? paymentStatus === PaymentStatus.CONFIRMED &&
+ paymentVariant !== PaymentVariants.MANUAL
+ : false;
+ const canFulfill = ([
+ OrderStatus.UNFULFILLED,
+ OrderStatus.PARTIALLY_FULFILLED
+ ] as any).includes(status);
+ const canCancel = status !== OrderStatus.CANCELLED;
+ const canGetInvoice = paymentStatus === PaymentStatus.CONFIRMED;
+ const isDraft = status === OrderStatus.DRAFT;
+ return (
+ <Card>
+ <PageHeader title={i18n.t("Order Summary")}>
+ {isDraft && (
+ <IconButton disabled={!onProductAdd} onClick={onProductAdd}>
+ <AddIcon />
+ </IconButton>
+ )}
+ </PageHeader>
+ {status && (
+ <CardContent className={classes.statusBar}>
+ <StatusLabel
+ status={orderStatus.status}
+ label={orderStatus.localized}
+ />
+ </CardContent>
+ )}
+ <OrderProducts
+ isDraft={isDraft}
+ net={net}
+ paid={paid}
+ products={products}
+ refunded={refunded}
+ shippingMethod={shippingMethod}
+ subtotal={subtotal}
+ total={total}
+ onOrderLineChange={onOrderLineChange}
+ onOrderLineRemove={onOrderLineRemove}
+ onRowClick={onRowClick}
+ onShippingMethodClick={onShippingMethodClick}
+ />
+ {status &&
+ (canGetInvoice ||
+ canFulfill ||
+ canCapture ||
+ canRefund ||
+ canRelease ||
+ canCancel ||
+ isDraft) && (
+ <CardActions>
+ {isDraft ? (
+ <Button disabled={!onCreate} onClick={onCreate}>
+ {i18n.t("Finalize")}
+ </Button>
+ ) : (
+ <>
+ {canGetInvoice && <Button>{i18n.t("Invoice")}</Button>}
+ {canFulfill && (
+ <Button disabled={!onFulfill} onClick={onFulfill}>
+ {i18n.t("Fulfill")}
+ </Button>
+ )}
+ {canCapture && (
+ <Button disabled={!onCapture} onClick={onCapture}>
+ {i18n.t("Capture")}
+ </Button>
+ )}
+ {canRefund && (
+ <Button disabled={!onRefund} onClick={onRefund}>
+ {i18n.t("Refund")}
+ </Button>
+ )}
+ {canRelease && (
+ <Button disabled={!onRelease} onClick={onRelease}>
+ {i18n.t("Release")}
+ </Button>
+ )}
+ {canCancel && (
+ <Button disabled={!onOrderCancel} onClick={onOrderCancel}>
+ {i18n.t("Cancel order")}
+ </Button>
+ )}
+ </>
+ )}
+ </CardActions>
+ )}
+ </Card>
+ );
+ }
+);
+export default OrderSummary;
diff --git a/saleor/static/dashboard-next/orders/components/OrderSummary/index.ts b/saleor/static/dashboard-next/orders/components/OrderSummary/index.ts
new file mode 100644
index 0000000000..46dac6ba94
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/components/OrderSummary/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./OrderSummary";
+export * from "./OrderSummary";
diff --git a/saleor/static/dashboard-next/orders/fixtures.ts b/saleor/static/dashboard-next/orders/fixtures.ts
new file mode 100644
index 0000000000..9886e1fe45
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/fixtures.ts
@@ -0,0 +1,367 @@
+import { transformOrderStatus, transformPaymentStatus } from "./";
+export const clients = [
+ {
+ id: "c1",
+ },
+ {
+ id: "c2",
+ },
+ {
+ id: "c3",
+ },
+ {
+ id: "c4",
+ }
+];
+export const orders = {
+ edges: [
+ {
+ node: {
+ id: "o1",
+ number: 11,
+ status: "fulfilled",
+ client: clients[0],
+ created: "2018-04-07T11:18:19+00:00",
+ paymentStatus: "confirmed",
+ price: {
+ amount: 19.2,
+ currency: "USD"
+ }
+ }
+ },
+ {
+ node: {
+ id: "o2",
+ number: 10,
+ status: "unfulfilled",
+ client: clients[0],
+ created: "2018-04-07T11:11:19+00:00",
+ paymentStatus: "confirmed",
+ price: {
+ amount: 28.9,
+ currency: "USD"
+ }
+ }
+ },
+ {
+ node: {
+ id: "o3",
+ number: 9,
+ status: "shipped",
+ client: clients[1],
+ created: "2018-04-07T10:44:44+00:00",
+ paymentStatus: "rejected",
+ price: {
+ amount: 289.0,
+ currency: "USD"
+ }
+ }
+ },
+ {
+ node: {
+ id: "o4",
+ number: 9,
+ status: "shipped",
+ client: clients[2],
+ created: "2018-04-07T10:33:19+00:00",
+ paymentStatus: "unknown",
+ price: {
+ amount: 100.05,
+ currency: "USD"
+ }
+ }
+ },
+ {
+ node: {
+ id: "o5",
+ number: 9,
+ status: "shipped",
+ client: clients[3],
+ created: "2018-04-07T07:39:19+00:00",
+ paymentStatus: "waiting",
+ price: {
+ amount: 14.87,
+ currency: "USD"
+ }
+ }
+ },
+ {
+ node: {
+ id: "o6",
+ number: 8,
+ status: "unfulfilled",
+ client: clients[3],
+ created: "2018-04-06T19:18:19+00:00",
+ paymentStatus: "rejected",
+ price: {
+ amount: 14.87,
+ currency: "USD"
+ }
+ }
+ }
+ ]
+};
+export const order = (placeholder, args?) => ({
+ id: "o1",
+ number: 11,
+ status: "partially fulfilled",
+ client: {
+ email: "[email protected]",
+ id: "c1",
+ name: "Test Client"
+ },
+ shippingAddress: {
+ city: "Keithport",
+ cityArea: "",
+ companyName: "",
+ country: "Cyprus",
+ countryArea: "",
+ firstName: "Test",
+ id: "a1",
+ lastName: "Client",
+ phone: {
+ number: "",
+ prefix: ""
+ },
+ postalCode: "95393-6818",
+ streetAddress_1: "9297 Barker Extension",
+ streetAddress_2: ""
+ },
+ billingAddress: {
+ city: "Keithport",
+ cityArea: "",
+ companyName: "",
+ country: "Cyprus",
+ countryArea: "",
+ firstName: "Test",
+ id: "a1",
+ lastName: "Client",
+ phone: {
+ number: "",
+ prefix: ""
+ },
+ postalCode: "95393-6818",
+ streetAddress_1: "9297 Barker Extension",
+ streetAddress_2: ""
+ },
+ created: "2018-04-07T11:18:19+00:00",
+ paymentStatus: "confirmed",
+ price: {
+ amount: 19.2,
+ currency: "USD"
+ },
+ payment: {
+ paid: {
+ amount: 19.2,
+ currency: "USD"
+ },
+ refunded: {
+ amount: 13.2,
+ currency: "USD"
+ },
+ net: {
+ amount: 6,
+ currency: "USD"
+ }
+ },
+ fulfillments: [
+ {
+ id: "f1",
+ status: "fulfilled",
+ products: [
+ {
+ product: {
+ id: "UHJvZHVjdDoy",
+ name: "Gardner and Graham",
+ thumbnailUrl: placeholder
+ },
+ quantity: 1
+ },
+ {
+ product: {
+ id: "UHJvZHVjdDox",
+ name: "Gardner, Graham and King",
+ thumbnailUrl: placeholder
+ },
+ quantity: 1
+ }
+ ],
+ trackingCode: "012391230412131239052"
+ },
+ {
+ id: "f2",
+ status: "cancelled",
+ products: [
+ {
+ product: {
+ id: "UHJvZHVjdDoy",
+ name: "Gardner and Graham",
+ thumbnailUrl: placeholder
+ },
+ quantity: 1
+ }
+ ],
+ trackingCode: "012391230412131239052"
+ }
+ ],
+ unfulfilled: [
+ {
+ id: "UHJvZHVjdDoy",
+ name: "Gardner and Graham",
+ sku: "9123022",
+ thumbnailUrl: placeholder,
+ quantity: 1
+ },
+ {
+ id: "UHJvZHVjdDoz",
+ name: "Gardner and King",
+ sku: "9123023",
+ thumbnailUrl: placeholder,
+ quantity: 7
+ },
+ {
+ id: "UHJvZHVjdDoa",
+ name: "Graham and King",
+ sku: "9123024",
+ thumbnailUrl: placeholder,
+ quantity: 3
+ }
+ ],
+ products: [
+ {
+ id: "UHJvZHVjdDox",
+ name: "Gardner, Graham and King",
+ sku: "9123021",
+ thumbnailUrl: placeholder,
+ price: {
+ gross: {
+ amount: 12.4,
+ currency: "USD"
+ }
+ },
+ quantity: 1
+ },
+ {
+ id: "UHJvZHVjdDoy",
+ name: "Gardner and Graham",
+ sku: "9123022",
+ thumbnailUrl: placeholder,
+ price: {
+ gross: {
+ amount: 11.6,
+ currency: "USD"
+ }
+ },
+ quantity: 2
+ },
+ {
+ id: "UHJvZHVjdDoz",
+ name: "Gardner and King",
+ sku: "9123023",
+ thumbnailUrl: placeholder,
+ price: {
+ gross: {
+ amount: 22.4,
+ currency: "USD"
+ }
+ },
+ quantity: 7
+ },
+ {
+ id: "UHJvZHVjdDoa",
+ name: "Graham and King",
+ sku: "9123024",
+ thumbnailUrl: placeholder,
+ price: {
+ gross: {
+ amount: 9.9,
+ currency: "USD"
+ }
+ },
+ quantity: 3
+ }
+ ],
+ subtotal: {
+ amount: 160.2,
+ currency: "USD"
+ },
+ shippingMethod: {
+ id: "s1"
+ },
+ shippingMethodName: "DHL",
+ shippingMethodPriceGross: {
+ amount: 5.5,
+ currency: "USD"
+ },
+ total: {
+ amount: 165.7,
+ currency: "USD"
+ },
+ events: [
+ {
+ id: "n1",
+ type: "created",
+ content: "Created order",
+ date: "2018-04-07T11:18:19+00:00",
+ },
+ {
+ id: "n1",
+ type: "payment",
+ content: "Received payment",
+ date: "2018-04-07T11:33:19+00:00",
+ params: { amount: 165.7, currency: "USD" }
+ },
+ {
+ id: "n3",
+ type: "shipped",
+ content: "Shipped order",
+ date: "2018-04-07T13:31:19+00:00",
+ params: {
+ shippingAddress:
+ "Test Client<br />9297 Barker Extension<br />95393-6818 Keithport<br />Cyprus"
+ }
+ },
+ {
+ id: "n4",
+ type: "note",
+ content:
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur arcu nisi, dignissim non placerat id, varius imperdiet nisi. Duis lobortis, massa sed feugiat ultricies, massa felis commodo dui, tempor tempus tellus ligula id arcu. Nam erat dui, fermentum sed dui a, tincidunt molestie magna.",
+ date: "2018-04-08T11:18:19+00:00",
+ }
+ ],
+ ...args
+});
+export const flatOrders = orders.edges.map(edge => ({
+ ...edge.node,
+ orderStatus: transformOrderStatus(edge.node.status),
+ paymentStatus: transformPaymentStatus(edge.node.paymentStatus)
+}));
+export const variants = [
+ { id: "p1", name: "Product 1: variant 1", sku: "12345", stockAllocated: 3 },
+ { id: "p2", name: "Product 1: variant 2", sku: "12346", stockAllocated: 1 },
+ { id: "p3", name: "Product 2: variant 1", sku: "12355", stockAllocated: 10 },
+ { id: "p4", name: "Product 3: variant 1", sku: "12445", stockAllocated: 12 },
+ { id: "p5", name: "Product 3: variant 2", sku: "12545", stockAllocated: 7 },
+ { id: "p6", name: "Product 5: variant 1", sku: "13345", stockAllocated: 3 },
+ { id: "p7", name: "Product 5: variant 2", sku: "14345", stockAllocated: 11 }
+];
+export const prefixes = ["01", "02", "41", "49"];
+export const countries = [
+ { code: "AF", label: "Afghanistan" },
+ { code: "AX", label: "Åland Islands" },
+ { code: "AL", label: "Albania" },
+ { code: "DZ", label: "Algeria" },
+ { code: "AS", label: "American Samoa" }
+];
+export const shippingMethods = [
+ { id: "s1", name: "DHL", country: "whole world", price: {} },
+ { id: "s2", name: "UPS", country: "Afghanistan" }
+];
diff --git a/saleor/static/dashboard-next/orders/index.ts b/saleor/static/dashboard-next/orders/index.ts
new file mode 100644
index 0000000000..0047a7dc85
--- /dev/null
+++ b/saleor/static/dashboard-next/orders/index.ts
@@ -0,0 +1,108 @@
+import i18n from "../i18n";
+
+export interface AddressType {
+ city: string;
+ cityArea: string;
+ companyName: string;
+ country: string;
+ countryArea: string;
+ firstName: string;
+ id: string;
+ lastName: string;
+ phone: {
+ prefix: string;
+ number: string;
+ };
+ postalCode: string;
+ streetAddress_1: string;
+ streetAddress_2: string;
+}
+
+export const PaymentStatus = {
+ CONFIRMED: "confirmed",
+ ERROR: "error",
+ INPUT: "input",
+ PREAUTH: "preauth",
+ REFUNDED: "refunded",
+ REJECTED: "rejected",
+ WAITING: "waiting"
+};
+export const OrderStatus = {
+ CANCELLED: "cancelled",
+ DRAFT: "draft",
+ FULFILLED: "fulfilled",
+ PARTIALLY_FULFILLED: "partially fulfilled",
+ UNFULFILLED: "unfulfilled"
+};
+export const FulfillmentStatus = {
+ CANCELLED: "cancelled",
+ FULFILLED: "fulfilled"
+};
+export const PaymentVariants = {
+ MANUAL: "manual"
+};
+
+export const transformPaymentStatus = (status: string) => {
+ switch (status) {
+ case PaymentStatus.CONFIRMED:
+ return { localized: i18n.t("Confirmed"), status: "success" };
+ case PaymentStatus.REFUNDED:
+ return { localized: i18n.t("Refunded"), status: "success" };
+ case PaymentStatus.WAITING:
+ return {
+ localized: i18n.t("Waiting for confirmation"),
+ status: "neutral"
+ };
+ case PaymentStatus.PREAUTH:
+ return { localized: i18n.t("Preauthorized"), status: "neutral" };
+ case PaymentStatus.INPUT:
+ return { localized: i18n.t("Input"), status: "neutral" };
+ case PaymentStatus.REJECTED:
+ return { localized: i18n.t("Rejected"), status: "error" };
+ case PaymentStatus.ERROR:
+ return { localized: i18n.t("Error"), status: "error" };
+ }
+ return {
+ localized: status,
+ status: "error"
+ };
+};
+
+export const transformOrderStatus = (status: string) => {
+ switch (status) {
+ case OrderStatus.FULFILLED:
+ return { localized: i18n.t("Fulfilled"), status: "success" };
+ case OrderStatus.PARTIALLY_FULFILLED:
+ return { localized: i18n.t("Partially fulfilled"), status: "neutral" };
+ case OrderStatus.UNFULFILLED:
+ return { localized: i18n.t("Unfulfilled"), status: "error" };
+ case OrderStatus.CANCELLED:
+ return { localized: i18n.t("Cancelled"), status: "error" };
+ case OrderStatus.DRAFT:
+ return { localized: i18n.t("Draft"), status: "error" };
+ }
+ return {
+ localized: status,
+ status: "error"
+ };
+};
+
+export const transformFulfillmentStatus = (status: string) => {
+ switch (status) {
+ case FulfillmentStatus.FULFILLED:
+ return { localized: i18n.t("Fulfilled"), status: "success" };
+ case FulfillmentStatus.CANCELLED:
+ return { localized: i18n.t("Cancelled"), status: "neutral" };
+ }
+ return {
+ localized: status,
+ status: "error"
+ };
+};
+
+export const transformAddressToForm = (data: AddressType) => ({
+ ...data,
+ phone: undefined,
+ phone_number: data.phone.number,
+ phone_prefix: data.phone.prefix
+});
diff --git a/saleor/static/dashboard-next/page/components/PageBaseForm/PageBaseForm.test.tsx b/saleor/static/dashboard-next/page/components/PageBaseForm/PageBaseForm.test.tsx
deleted file mode 100644
index 88eb65f265..0000000000
--- a/saleor/static/dashboard-next/page/components/PageBaseForm/PageBaseForm.test.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import PageBaseForm from "./";
-
-const page = {
- availableOn: "2018-03-20T16:39:08.850105+00:00",
- content:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt.",
- isVisible: true,
- slug: "lorem-ipsum-dolor",
- title: "Lorem ipsum"
-};
-
-describe("<PageBaseForm />", () => {
- it("renders without 'created' property", () => {
- const component = renderer.create(<PageBaseForm {...page} />);
- expect(component).toMatchSnapshot();
- });
- it("renders with 'created' property", () => {
- const created = "2018-03-20T16:39:08.850105+00:00";
- const component = renderer.create(
- <PageBaseForm {...page} created={created} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders errors", () => {
- const errors = [
- {
- field: "slug",
- message: "To pole jest wymagane."
- },
- {
- field: "title",
- message: "To pole jest wymagane."
- },
- {
- field: "content",
- message: "To pole jest wymagane."
- }
- ];
- const component = renderer.create(
- <PageBaseForm {...page} errors={errors} />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/page/components/PageBaseForm/__snapshots__/PageBaseForm.test.tsx.snap b/saleor/static/dashboard-next/page/components/PageBaseForm/__snapshots__/PageBaseForm.test.tsx.snap
deleted file mode 100644
index 1eaf9dec7a..0000000000
--- a/saleor/static/dashboard-next/page/components/PageBaseForm/__snapshots__/PageBaseForm.test.tsx.snap
+++ /dev/null
@@ -1,873 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<PageBaseForm /> renders errors 1`] = `
-<div
- className="MuiCardContent-root-3"
->
- <div
- className="MuiGrid-container-4 MuiGrid-spacing-xs-16-26"
- >
- <div
- className="MuiGrid-item-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-9-64"
- >
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-94 MuiFormControl-fullWidth-97"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-103 MuiFormLabel-error-106 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- htmlFor={undefined}
- >
- Title
- </label>
- <div
- className="MuiInput-root-108 MuiInput-error-113 MuiInput-fullWidth-115 MuiInput-formControl-109 MuiInput-underline-112"
- >
- <input
- aria-invalid={true}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={true}
- className="MuiInput-input-116"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="title"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value="Lorem ipsum"
- />
- </div>
- <p
- className="MuiFormHelperText-root-125 MuiFormHelperText-error-126"
- id={undefined}
- >
- To pole jest wymagane.
- </p>
- </div>
- <div
- className="Component-spacer-121"
- />
- <div
- className="MuiFormControl-root-94"
- onBlur={[Function]}
- onFocus={[Function]}
- style={
- Object {
- "width": "100%",
- }
- }
- >
- <label
- className="MuiFormLabel-root-103 MuiFormLabel-error-106 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- >
- Content
- </label>
- <div
- className="MuiInput-root-108 MuiInput-error-113 MuiInput-fullWidth-115 MuiInput-formControl-109 MuiInput-multiline-114 MuiInput-underline-112"
- >
- <div
- className="Textarea-root-122"
- style={
- Object {
- "height": 19,
- }
- }
- >
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-124 Textarea-textarea-123"
- readOnly={true}
- rows="1"
- tabIndex={-1}
- value=""
- />
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-124 Textarea-textarea-123"
- defaultValue={undefined}
- readOnly={true}
- rows={1}
- tabIndex={-1}
- value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
- />
- <textarea
- aria-invalid={true}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="Textarea-textarea-123 MuiInput-input-116 MuiInput-inputMultiline-118"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="content"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={1}
- type="text"
- value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
- />
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-125 MuiFormHelperText-error-126"
- >
- To pole jest wymagane.
- </p>
- </div>
- </div>
- <div
- className="MuiGrid-item-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-3-58"
- >
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-94 MuiFormControl-fullWidth-97"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-103 MuiFormLabel-error-106 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- htmlFor={undefined}
- >
- Slug
- </label>
- <div
- className="MuiInput-root-108 MuiInput-error-113 MuiInput-fullWidth-115 MuiInput-formControl-109 MuiInput-underline-112"
- >
- <input
- aria-invalid={true}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-116"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="slug"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value="lorem-ipsum-dolor"
- />
- </div>
- <p
- className="MuiFormHelperText-root-125 MuiFormHelperText-error-126"
- id={undefined}
- >
- To pole jest wymagane.
- </p>
- </div>
- <div
- className="Component-spacer-121"
- />
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-94"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-103 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- htmlFor={undefined}
- >
- Available on
- </label>
- <div
- className="MuiInput-root-108 MuiInput-formControl-109 MuiInput-underline-112"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-116 MuiInput-inputType-119"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="availableOn"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="date"
- value="2018-03-20T16:39:08.850105+00:00"
- />
- </div>
-
- </div>
- <div
- className="Component-spacer-121"
- />
- <div
- className="Component-spacer-121"
- />
- <label
- className="MuiFormControlLabel-root-129"
- >
- <span
- className="MuiButtonBase-root-147 MuiIconButton-root-141 MuiSwitchBase-root-137 MuiCheckbox-root-132 MuiCheckbox-colorSecondary-136 MuiSwitchBase-checked-138 MuiCheckbox-checked-133"
- onBlur={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- role={undefined}
- tabIndex={null}
- >
- <span
- className="MuiIconButton-label-146"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-149"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
- />
- </svg>
- <input
- checked={true}
- className="MuiSwitchBase-input-140"
- disabled={undefined}
- id={undefined}
- name="isVisible"
- onChange={[Function]}
- tabIndex={undefined}
- type="checkbox"
- value={undefined}
- />
- </span>
- <span
- className="MuiTouchRipple-root-155"
- />
- </span>
- <span
- className="MuiTypography-root-162 MuiTypography-body1-171 MuiFormControlLabel-label-131"
- >
- Published
- </span>
- </label>
- </div>
- </div>
-</div>
-`;
-
-exports[`<PageBaseForm /> renders with 'created' property 1`] = `
-<div
- className="MuiCardContent-root-3"
->
- <div
- className="MuiGrid-container-4 MuiGrid-spacing-xs-16-26"
- >
- <div
- className="MuiGrid-item-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-9-64"
- >
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-94 MuiFormControl-fullWidth-97 Component-addHelperTextPadding-1"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-103 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- htmlFor={undefined}
- >
- Title
- </label>
- <div
- className="MuiInput-root-108 MuiInput-fullWidth-115 MuiInput-formControl-109 MuiInput-underline-112"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={true}
- className="MuiInput-input-116"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="title"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value="Lorem ipsum"
- />
- </div>
-
- </div>
- <div
- className="Component-spacer-121"
- />
- <div
- className="MuiFormControl-root-94"
- onBlur={[Function]}
- onFocus={[Function]}
- style={
- Object {
- "width": "100%",
- }
- }
- >
- <label
- className="MuiFormLabel-root-103 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- >
- Content
- </label>
- <div
- className="MuiInput-root-108 MuiInput-fullWidth-115 MuiInput-formControl-109 MuiInput-multiline-114 MuiInput-underline-112"
- >
- <div
- className="Textarea-root-122"
- style={
- Object {
- "height": 19,
- }
- }
- >
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-124 Textarea-textarea-123"
- readOnly={true}
- rows="1"
- tabIndex={-1}
- value=""
- />
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-124 Textarea-textarea-123"
- defaultValue={undefined}
- readOnly={true}
- rows={1}
- tabIndex={-1}
- value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
- />
- <textarea
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="Textarea-textarea-123 MuiInput-input-116 MuiInput-inputMultiline-118"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="content"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={1}
- type="text"
- value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
- />
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-125"
- >
- Select text to enable text-formatting tools.
- </p>
- </div>
- </div>
- <div
- className="MuiGrid-item-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-3-58"
- >
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-94 MuiFormControl-fullWidth-97"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-103 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- htmlFor={undefined}
- >
- Slug
- </label>
- <div
- className="MuiInput-root-108 MuiInput-fullWidth-115 MuiInput-formControl-109 MuiInput-underline-112"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-116"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="slug"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value="lorem-ipsum-dolor"
- />
- </div>
- <p
- className="MuiFormHelperText-root-125"
- id={undefined}
- >
- Slug is being used to create page URL
- </p>
- </div>
- <div
- className="Component-spacer-121"
- />
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-94"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-103 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- htmlFor={undefined}
- >
- Available on
- </label>
- <div
- className="MuiInput-root-108 MuiInput-formControl-109 MuiInput-underline-112"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-116 MuiInput-inputType-119"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="availableOn"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="date"
- value="2018-03-20T16:39:08.850105+00:00"
- />
- </div>
-
- </div>
- <div
- className="Component-spacer-121"
- />
- <p
- className="MuiTypography-root-162 MuiTypography-body1-171"
- >
- Created at:
- 2018-03-20T16:39:08.850105+00:00
- </p>
- <div
- className="Component-spacer-121"
- />
- <label
- className="MuiFormControlLabel-root-129"
- >
- <span
- className="MuiButtonBase-root-147 MuiIconButton-root-141 MuiSwitchBase-root-137 MuiCheckbox-root-132 MuiCheckbox-colorSecondary-136 MuiSwitchBase-checked-138 MuiCheckbox-checked-133"
- onBlur={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- role={undefined}
- tabIndex={null}
- >
- <span
- className="MuiIconButton-label-146"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-149"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
- />
- </svg>
- <input
- checked={true}
- className="MuiSwitchBase-input-140"
- disabled={undefined}
- id={undefined}
- name="isVisible"
- onChange={[Function]}
- tabIndex={undefined}
- type="checkbox"
- value={undefined}
- />
- </span>
- <span
- className="MuiTouchRipple-root-155"
- />
- </span>
- <span
- className="MuiTypography-root-162 MuiTypography-body1-171 MuiFormControlLabel-label-131"
- >
- Published
- </span>
- </label>
- </div>
- </div>
-</div>
-`;
-
-exports[`<PageBaseForm /> renders without 'created' property 1`] = `
-<div
- className="MuiCardContent-root-3"
->
- <div
- className="MuiGrid-container-4 MuiGrid-spacing-xs-16-26"
- >
- <div
- className="MuiGrid-item-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-9-64"
- >
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-94 MuiFormControl-fullWidth-97 Component-addHelperTextPadding-1"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-103 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- htmlFor={undefined}
- >
- Title
- </label>
- <div
- className="MuiInput-root-108 MuiInput-fullWidth-115 MuiInput-formControl-109 MuiInput-underline-112"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={true}
- className="MuiInput-input-116"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="title"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value="Lorem ipsum"
- />
- </div>
-
- </div>
- <div
- className="Component-spacer-121"
- />
- <div
- className="MuiFormControl-root-94"
- onBlur={[Function]}
- onFocus={[Function]}
- style={
- Object {
- "width": "100%",
- }
- }
- >
- <label
- className="MuiFormLabel-root-103 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- >
- Content
- </label>
- <div
- className="MuiInput-root-108 MuiInput-fullWidth-115 MuiInput-formControl-109 MuiInput-multiline-114 MuiInput-underline-112"
- >
- <div
- className="Textarea-root-122"
- style={
- Object {
- "height": 19,
- }
- }
- >
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-124 Textarea-textarea-123"
- readOnly={true}
- rows="1"
- tabIndex={-1}
- value=""
- />
- <textarea
- aria-hidden="true"
- className="Textarea-shadow-124 Textarea-textarea-123"
- defaultValue={undefined}
- readOnly={true}
- rows={1}
- tabIndex={-1}
- value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
- />
- <textarea
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="Textarea-textarea-123 MuiInput-input-116 MuiInput-inputMultiline-118"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="content"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={1}
- type="text"
- value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
- />
- </div>
- </div>
- <p
- className="MuiFormHelperText-root-125"
- >
- Select text to enable text-formatting tools.
- </p>
- </div>
- </div>
- <div
- className="MuiGrid-item-5 MuiGrid-grid-xs-12-41 MuiGrid-grid-md-3-58"
- >
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-94 MuiFormControl-fullWidth-97"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-103 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- htmlFor={undefined}
- >
- Slug
- </label>
- <div
- className="MuiInput-root-108 MuiInput-fullWidth-115 MuiInput-formControl-109 MuiInput-underline-112"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-116"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="slug"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value="lorem-ipsum-dolor"
- />
- </div>
- <p
- className="MuiFormHelperText-root-125"
- id={undefined}
- >
- Slug is being used to create page URL
- </p>
- </div>
- <div
- className="Component-spacer-121"
- />
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-94"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-103 MuiInputLabel-root-98 MuiInputLabel-formControl-99 MuiInputLabel-animated-102 MuiInputLabel-shrink-101"
- data-shrink={true}
- htmlFor={undefined}
- >
- Available on
- </label>
- <div
- className="MuiInput-root-108 MuiInput-formControl-109 MuiInput-underline-112"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-116 MuiInput-inputType-119"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="availableOn"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="date"
- value="2018-03-20T16:39:08.850105+00:00"
- />
- </div>
-
- </div>
- <div
- className="Component-spacer-121"
- />
- <div
- className="Component-spacer-121"
- />
- <label
- className="MuiFormControlLabel-root-129"
- >
- <span
- className="MuiButtonBase-root-147 MuiIconButton-root-141 MuiSwitchBase-root-137 MuiCheckbox-root-132 MuiCheckbox-colorSecondary-136 MuiSwitchBase-checked-138 MuiCheckbox-checked-133"
- onBlur={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- role={undefined}
- tabIndex={null}
- >
- <span
- className="MuiIconButton-label-146"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-149"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <path
- d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
- />
- </svg>
- <input
- checked={true}
- className="MuiSwitchBase-input-140"
- disabled={undefined}
- id={undefined}
- name="isVisible"
- onChange={[Function]}
- tabIndex={undefined}
- type="checkbox"
- value={undefined}
- />
- </span>
- <span
- className="MuiTouchRipple-root-155"
- />
- </span>
- <span
- className="MuiTypography-root-162 MuiTypography-body1-171 MuiFormControlLabel-label-131"
- >
- Published
- </span>
- </label>
- </div>
- </div>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/page/components/PageFilters/PageFilters.test.tsx b/saleor/static/dashboard-next/page/components/PageFilters/PageFilters.test.tsx
deleted file mode 100644
index 0a596a4281..0000000000
--- a/saleor/static/dashboard-next/page/components/PageFilters/PageFilters.test.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import * as React from "react";
-import * as renderer from "react-test-renderer";
-
-import PageFilters from "./";
-
-const pageFilters = {
- title: "title",
- url: "url"
-};
-
-describe("<PageFilters />", () => {
- it("renders without initial state", () => {
- const component = renderer.create(
- <PageFilters handleClear={jest.fn()} handleSubmit={jest.fn()} />
- );
- expect(component).toMatchSnapshot();
- });
- it("renders with initial state", () => {
- const component = renderer.create(
- <PageFilters
- formState={pageFilters}
- handleClear={jest.fn()}
- handleSubmit={jest.fn()}
- />
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/page/components/PageFilters/__snapshots__/PageFilters.test.tsx.snap b/saleor/static/dashboard-next/page/components/PageFilters/__snapshots__/PageFilters.test.tsx.snap
deleted file mode 100644
index 7f3dcad4a4..0000000000
--- a/saleor/static/dashboard-next/page/components/PageFilters/__snapshots__/PageFilters.test.tsx.snap
+++ /dev/null
@@ -1,303 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<PageFilters /> renders with initial state 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <form>
- <div
- className="MuiCardHeader-root-29"
- >
- <div
- className="MuiCardHeader-content-32"
- >
- <span
- className="MuiTypography-root-35 MuiTypography-headline-40 MuiCardHeader-title-33"
- >
- Filters
- </span>
- </div>
- <div
- className="MuiCardHeader-action-31"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <div
- className="MuiCardContent-root-80"
- >
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-81 MuiFormControl-fullWidth-84"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89 MuiInputLabel-shrink-88"
- data-shrink={true}
- htmlFor={undefined}
- >
- Title
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-103"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="title"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value="title"
- />
- </div>
- </div>
- <div
- className="Component-spacer-108"
- />
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-81 MuiFormControl-fullWidth-84"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89 MuiInputLabel-shrink-88"
- data-shrink={true}
- htmlFor={undefined}
- >
- Url
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-103"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="url"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value="url"
- />
- </div>
- </div>
- </div>
- </form>
-</div>
-`;
-
-exports[`<PageFilters /> renders without initial state 1`] = `
-<div
- className="MuiPaper-root-2 MuiPaper-elevation2-6 MuiPaper-rounded-3 MuiCard-root-1"
->
- <form>
- <div
- className="MuiCardHeader-root-29"
- >
- <div
- className="MuiCardHeader-content-32"
- >
- <span
- className="MuiTypography-root-35 MuiTypography-headline-40 MuiCardHeader-title-33"
- >
- Filters
- </span>
- </div>
- <div
- className="MuiCardHeader-action-31"
- >
- <button
- className="MuiButtonBase-root-65 MuiIconButton-root-59"
- disabled={false}
- onBlur={[Function]}
- onClick={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-64"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-67"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-73"
- />
- </button>
- </div>
- </div>
- <div
- className="MuiCardContent-root-80"
- >
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-81 MuiFormControl-fullWidth-84"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89"
- data-shrink={false}
- htmlFor={undefined}
- >
- Title
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-103"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="title"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value=""
- />
- </div>
- </div>
- <div
- className="Component-spacer-108"
- />
- <div
- aria-describedby={undefined}
- className="MuiFormControl-root-81 MuiFormControl-fullWidth-84"
- onBlur={[Function]}
- onFocus={[Function]}
- >
- <label
- className="MuiFormLabel-root-90 MuiInputLabel-root-85 MuiInputLabel-formControl-86 MuiInputLabel-animated-89"
- data-shrink={false}
- htmlFor={undefined}
- >
- Url
- </label>
- <div
- className="MuiInput-root-95 MuiInput-fullWidth-102 MuiInput-formControl-96 MuiInput-underline-99"
- >
- <input
- aria-invalid={false}
- aria-required={false}
- autoComplete={undefined}
- autoFocus={undefined}
- className="MuiInput-input-103"
- defaultValue={undefined}
- disabled={false}
- id={undefined}
- name="url"
- onBlur={[Function]}
- onChange={[Function]}
- onFocus={[Function]}
- onKeyDown={undefined}
- onKeyUp={undefined}
- placeholder={undefined}
- readOnly={undefined}
- required={undefined}
- rows={undefined}
- type="text"
- value=""
- />
- </div>
- </div>
- </div>
- </form>
-</div>
-`;
diff --git a/saleor/static/dashboard-next/page/components/PageList/PageList.test.tsx b/saleor/static/dashboard-next/page/components/PageList/PageList.test.tsx
deleted file mode 100644
index 91e03ef14b..0000000000
--- a/saleor/static/dashboard-next/page/components/PageList/PageList.test.tsx
+++ /dev/null
@@ -1,106 +0,0 @@
-import * as React from "react";
-import { MemoryRouter } from "react-router-dom";
-import * as renderer from "react-test-renderer";
-
-import PageList from "./";
-
-const pageList = [
- {
- cursor: "12345678",
- node: {
- id: "abcd",
- isVisible: true,
- slug: "lorem-ipsum-dolor",
- title: "Lorem ipsum"
- }
- },
- {
- cursor: "12345678",
- node: {
- id: "abcde",
- isVisible: true,
- slug: "lorem-ipsum-consectetur",
- title: "Pellentesque habitant morbi tristique senectus"
- }
- },
- {
- cursor: "12345678",
- node: {
- id: "abcdef",
- isVisible: true,
- slug: "lorem-ipsum-amet",
- title: "Pellentesque metus turpis"
- }
- },
- {
- cursor: "12345678",
- node: {
- id: "abcdefg",
- isVisible: true,
- slug: "lorem-ipsum-sit",
- title: "Nulla blandit ut lectus at placerat"
- }
- }
-];
-
-describe("<PageList />", () => {
- it("renders while data is loading", () => {
- const component = renderer.create(
- <MemoryRouter>
- <PageList
- handlePreviousPage={jest.fn()}
- handleNextPage={jest.fn()}
- onEditClick={jest.fn()}
- onShowPageClick={jest.fn()}
- pageInfo={{
- endCursor: "",
- hasNextPage: false,
- hasPreviousPage: false,
- startCursor: ""
- }}
- />
- </MemoryRouter>
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when data is fully loaded", () => {
- const component = renderer.create(
- <MemoryRouter>
- <PageList
- handlePreviousPage={jest.fn()}
- handleNextPage={jest.fn()}
- pages={pageList}
- onEditClick={jest.fn()}
- onShowPageClick={jest.fn()}
- pageInfo={{
- endCursor: "",
- hasNextPage: false,
- hasPreviousPage: false,
- startCursor: ""
- }}
- />
- </MemoryRouter>
- );
- expect(component).toMatchSnapshot();
- });
- it("renders when category list is empty", () => {
- const component = renderer.create(
- <MemoryRouter>
- <PageList
- handlePreviousPage={jest.fn()}
- handleNextPage={jest.fn()}
- pages={[]}
- onEditClick={jest.fn()}
- onShowPageClick={jest.fn()}
- pageInfo={{
- endCursor: "",
- hasNextPage: false,
- hasPreviousPage: false,
- startCursor: ""
- }}
- />
- </MemoryRouter>
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/saleor/static/dashboard-next/page/components/PageList/__snapshots__/PageList.test.tsx.snap b/saleor/static/dashboard-next/page/components/PageList/__snapshots__/PageList.test.tsx.snap
deleted file mode 100644
index 7b32bf01d2..0000000000
--- a/saleor/static/dashboard-next/page/components/PageList/__snapshots__/PageList.test.tsx.snap
+++ /dev/null
@@ -1,784 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`<PageList /> renders when category list is empty 1`] = `
-<table
- className="MuiTable-root-3"
->
- <thead
- className="MuiTableHead-root-4"
- >
- <tr
- className="MuiTableRow-root-5 MuiTableRow-head-8"
- >
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Name
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Url
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Visibility
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11 Component-textRight-2"
- scope="col"
- >
- Actions
- </th>
- </tr>
- </thead>
- <tfoot>
- <tr
- className="MuiTableRow-root-5 MuiTableRow-footer-9"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-footer-13 MuiTablePagination-root-21"
- colSpan={4}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-27 MuiToolbar-gutters-28 MuiTablePagination-toolbar-26"
- >
- <div
- className="MuiTablePagination-spacer-25"
- />
- <div
- className="MuiTablePaginationActions-root-29"
- >
- <button
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiTableBody-root-44"
- >
- <tr
- className="MuiTableRow-root-5"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- colSpan={3}
- scope={undefined}
- >
- No pages found
- </td>
- </tr>
- </tbody>
-</table>
-`;
-
-exports[`<PageList /> renders when data is fully loaded 1`] = `
-<table
- className="MuiTable-root-3"
->
- <thead
- className="MuiTableHead-root-4"
- >
- <tr
- className="MuiTableRow-root-5 MuiTableRow-head-8"
- >
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Name
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Url
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Visibility
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11 Component-textRight-2"
- scope="col"
- >
- Actions
- </th>
- </tr>
- </thead>
- <tfoot>
- <tr
- className="MuiTableRow-root-5 MuiTableRow-footer-9"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-footer-13 MuiTablePagination-root-21"
- colSpan={4}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-27 MuiToolbar-gutters-28 MuiTablePagination-toolbar-26"
- >
- <div
- className="MuiTablePagination-spacer-25"
- />
- <div
- className="MuiTablePaginationActions-root-29"
- >
- <button
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiTableBody-root-44"
- >
- <tr
- className="MuiTableRow-root-5"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-link-1"
- onClick={undefined}
- scope={undefined}
- >
- Lorem ipsum
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- /lorem-ipsum-dolor
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- Published
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-textRight-2"
- scope={undefined}
- >
- <button
- className="MuiButtonBase-root-36 MuiIconButton-root-30"
- disabled={false}
- onBlur={[Function]}
- onClick={undefined}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-46"
- />
- </button>
- </td>
- </tr>
- <tr
- className="MuiTableRow-root-5"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-link-1"
- onClick={undefined}
- scope={undefined}
- >
- Pellentesque habitant morbi tristique senectus
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- /lorem-ipsum-consectetur
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- Published
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-textRight-2"
- scope={undefined}
- >
- <button
- className="MuiButtonBase-root-36 MuiIconButton-root-30"
- disabled={false}
- onBlur={[Function]}
- onClick={undefined}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-46"
- />
- </button>
- </td>
- </tr>
- <tr
- className="MuiTableRow-root-5"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-link-1"
- onClick={undefined}
- scope={undefined}
- >
- Pellentesque metus turpis
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- /lorem-ipsum-amet
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- Published
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-textRight-2"
- scope={undefined}
- >
- <button
- className="MuiButtonBase-root-36 MuiIconButton-root-30"
- disabled={false}
- onBlur={[Function]}
- onClick={undefined}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-46"
- />
- </button>
- </td>
- </tr>
- <tr
- className="MuiTableRow-root-5"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-link-1"
- onClick={undefined}
- scope={undefined}
- >
- Nulla blandit ut lectus at placerat
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- /lorem-ipsum-sit
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- Published
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-textRight-2"
- scope={undefined}
- >
- <button
- className="MuiButtonBase-root-36 MuiIconButton-root-30"
- disabled={false}
- onBlur={[Function]}
- onClick={undefined}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="0"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"
- />
- </g>
- </svg>
- </span>
- <span
- className="MuiTouchRipple-root-46"
- />
- </button>
- </td>
- </tr>
- </tbody>
-</table>
-`;
-
-exports[`<PageList /> renders while data is loading 1`] = `
-<table
- className="MuiTable-root-3"
->
- <thead
- className="MuiTableHead-root-4"
- >
- <tr
- className="MuiTableRow-root-5 MuiTableRow-head-8"
- >
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Name
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Url
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11"
- scope="col"
- >
- Visibility
- </th>
- <th
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-head-11 Component-textRight-2"
- scope="col"
- >
- Actions
- </th>
- </tr>
- </thead>
- <tfoot>
- <tr
- className="MuiTableRow-root-5 MuiTableRow-footer-9"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-footer-13 MuiTablePagination-root-21"
- colSpan={4}
- scope={undefined}
- >
- <div
- className="MuiToolbar-root-27 MuiToolbar-gutters-28 MuiTablePagination-toolbar-26"
- >
- <div
- className="MuiTablePagination-spacer-25"
- />
- <div
- className="MuiTablePaginationActions-root-29"
- >
- <button
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onClick={[MockFunction]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- 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
- className="MuiTableBody-root-44"
- >
- <tr
- className="MuiTableRow-root-5"
- >
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- <span
- className="Component-skeleton-45"
- style={undefined}
- >
- ‌
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- <span
- className="Component-skeleton-45"
- style={undefined}
- >
- ‌
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12"
- scope={undefined}
- >
- <span
- className="Component-skeleton-45"
- style={undefined}
- >
- ‌
- </span>
- </td>
- <td
- aria-sort={null}
- className="MuiTableCell-root-10 MuiTableCell-body-12 Component-textRight-2"
- scope={undefined}
- >
- <button
- className="MuiButtonBase-root-36 MuiButtonBase-disabled-37 MuiIconButton-root-30 MuiIconButton-disabled-34"
- disabled={true}
- onBlur={[Function]}
- onFocus={[Function]}
- onKeyDown={[Function]}
- onKeyUp={[Function]}
- onMouseDown={[Function]}
- onMouseLeave={[Function]}
- onMouseUp={[Function]}
- onTouchEnd={[Function]}
- onTouchMove={[Function]}
- onTouchStart={[Function]}
- tabIndex="-1"
- type="button"
- >
- <span
- className="MuiIconButton-label-35"
- >
- <svg
- aria-hidden="true"
- className="MuiSvgIcon-root-38"
- color={undefined}
- focusable="false"
- viewBox="0 0 24 24"
- >
- <g>
- <path
- d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"
- />
- </g>
- </svg>
- </span>
- </button>
- </td>
- </tr>
- </tbody>
-</table>
-`;
diff --git a/saleor/static/dashboard-next/products/components/ProductDetailsPage/ProductDetailsPage.tsx b/saleor/static/dashboard-next/products/components/ProductDetailsPage/ProductDetailsPage.tsx
index 42bf5a009f..8925cdaa93 100644
--- a/saleor/static/dashboard-next/products/components/ProductDetailsPage/ProductDetailsPage.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductDetailsPage/ProductDetailsPage.tsx
@@ -106,7 +106,7 @@ const decorate = withStyles(theme => ({
gridTemplateColumns: "100%",
[theme.breakpoints.up("md")]: {
gridGap: theme.spacing.unit * 2 + "px",
- gridTemplateColumns: "3fr 1fr"
+ gridTemplateColumns: "5fr 2fr"
}
}
}));
diff --git a/saleor/static/dashboard-next/products/components/ProductListCard/ProductListCard.tsx b/saleor/static/dashboard-next/products/components/ProductListCard/ProductListCard.tsx
index 90fd44d87b..6b1e753760 100644
--- a/saleor/static/dashboard-next/products/components/ProductListCard/ProductListCard.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductListCard/ProductListCard.tsx
@@ -1,9 +1,10 @@
-import Card from "material-ui/Card";
-import * as React from "react";
-
import FilterListIcon from "@material-ui/icons/FilterList";
+import Card from "material-ui/Card";
import Hidden from "material-ui/Hidden";
import IconButton from "material-ui/IconButton";
+import * as React from "react";
+
+import Container from "../../../components/Container";
import PageHeader from "../../../components/PageHeader";
import ProductList from "../../../components/ProductList";
import i18n from "../../../i18n";
@@ -36,7 +37,7 @@ export const ProductListCard: React.StatelessComponent<
onPreviousPage,
onRowClick
}) => (
- <Card>
+ <Container width="md">
<PageHeader title={i18n.t("Product list")}>
<Hidden mdUp>
<IconButton onClick={onFilter}>
@@ -44,15 +45,17 @@ export const ProductListCard: React.StatelessComponent<
</IconButton>
</Hidden>
</PageHeader>
- <ProductList
- products={products}
- hasNextPage={hasNextPage}
- hasPreviousPage={hasPreviousPage}
- onNextPage={onNextPage}
- onPreviousPage={onPreviousPage}
- onRowClick={onRowClick}
- />
- </Card>
+ <Card>
+ <ProductList
+ products={products}
+ hasNextPage={hasNextPage}
+ hasPreviousPage={hasPreviousPage}
+ onNextPage={onNextPage}
+ onPreviousPage={onPreviousPage}
+ onRowClick={onRowClick}
+ />
+ </Card>
+ </Container>
);
export default ProductListCard;
diff --git a/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx b/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx
index 806653eba9..021abbcea8 100644
--- a/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx
@@ -137,7 +137,7 @@ export const ProductVariants = decorate<ProductVariantsProps>(
: fallbackPrice}
</TableCell>
<TableCell className={classes.alignRightText}>
- {variant.margin}
+ {variant.margin.toFixed(2)}%
</TableCell>
</Hidden>
</TableRow>
diff --git a/saleor/static/dashboard-next/products/fixtures.ts b/saleor/static/dashboard-next/products/fixtures.ts
index b428cf8871..dde93437fa 100644
--- a/saleor/static/dashboard-next/products/fixtures.ts
+++ b/saleor/static/dashboard-next/products/fixtures.ts
@@ -95,7 +95,8 @@ export const product = {
sku: "2-1337",
name: "XXL",
priceOverride: null,
- stockQuantity: 5
+ stockQuantity: 5,
+ margin: 20
}
},
{
@@ -104,7 +105,8 @@ export const product = {
sku: "2-1338",
name: "XL",
priceOverride: null,
- stockQuantity: 0
+ stockQuantity: 0,
+ margin: 20
}
},
{
@@ -113,7 +115,8 @@ export const product = {
sku: "2-1339",
name: "L",
priceOverride: null,
- stockQuantity: 15
+ stockQuantity: 15,
+ margin: 20
}
},
{
@@ -122,7 +125,8 @@ export const product = {
sku: "2-1340",
name: "M",
priceOverride: null,
- stockQuantity: 33
+ stockQuantity: 33,
+ margin: 20
}
},
{
@@ -131,7 +135,8 @@ export const product = {
sku: "2-1341",
name: "S",
priceOverride: null,
- stockQuantity: 0
+ stockQuantity: 0,
+ margin: 20
}
},
{
@@ -140,7 +145,8 @@ export const product = {
sku: "2-1342",
name: "XS",
priceOverride: null,
- stockQuantity: 0
+ stockQuantity: 0,
+ margin: 20
}
}
]
diff --git a/saleor/static/dashboard-next/storybook/Decorator.tsx b/saleor/static/dashboard-next/storybook/Decorator.tsx
new file mode 100644
index 0000000000..1dece638b7
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/Decorator.tsx
@@ -0,0 +1,13 @@
+import CssBaseline from "material-ui/CssBaseline";
+import MuiThemeProvider from "material-ui/styles/MuiThemeProvider";
+import * as React from "react";
+
+import theme from "../theme";
+
+export const Decorator = storyFn => (
+ <MuiThemeProvider theme={theme}>
+ <CssBaseline />
+ {storyFn()}
+ </MuiThemeProvider>
+);
+export default Decorator;
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 c1a061aab8..10aa64c7b7 100644
--- a/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap
+++ b/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap
@@ -622,6 +622,55 @@ exports[`Storyshots Categories / RootCategoryList without initial data 1`] = `
</WithStyles(Card)>
`;
+exports[`Storyshots Generics / DateFormatter default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ date="2018-04-07T10:44:44+00:00"
+ />,
+]
+`;
+
+exports[`Storyshots Generics / DateFormatter humanized 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ date="2018-05-27T22:44:44+00:00"
+ dateNow={1527521275866}
+ />,
+]
+`;
+
+exports[`Storyshots Generics / DateFormatter humanized without tooltip 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ date="2018-05-27T22:44:44+00:00"
+ dateNow={1527521275866}
+ showTooltip={false}
+ />,
+]
+`;
+
+exports[`Storyshots Generics / DateFormatter with custom format 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ date="01.04.1999 14:30"
+ inputFormat="DD.MM.YYYY HH:mm"
+ outputFormat="MM/DD/YYYY"
+ showTooltip={false}
+ />,
+]
+`;
+
+exports[`Storyshots Generics / EditableTableCell default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Table) />,
+]
+`;
+
exports[`Storyshots Generics / ErrorMessageCard default 1`] = `
<WithStyles(Card)>
<WithStyles(CardContent)>
@@ -640,6 +689,16 @@ exports[`Storyshots Generics / ErrorMessageCard default 1`] = `
</WithStyles(Card)>
`;
+exports[`Storyshots Generics / Money default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ amount={14}
+ currency="$"
+ />,
+]
+`;
+
exports[`Storyshots Generics / MultiSelectField with error hint 1`] = `
<Component
choices={
@@ -983,6 +1042,26 @@ exports[`Storyshots Generics / PageHeader without title 1`] = `
/>
`;
+exports[`Storyshots Generics / PhoneField default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ name="phone"
+ number="123 987 456"
+ onChange={[Function]}
+ prefix="41"
+ prefixes={
+ Array [
+ "01",
+ "02",
+ "41",
+ "49",
+ ]
+ }
+ />,
+]
+`;
+
exports[`Storyshots Generics / PriceField disabled 1`] = `
<Component
classes={
@@ -1300,6 +1379,54 @@ exports[`Storyshots Generics / PriceRangeField with value, label, currency symbo
/>
`;
+exports[`Storyshots Generics / SingleAutocompleteSelectField with custom option 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <Form
+ initial={
+ Object {
+ "country": Object {
+ "label": "Afghanistan",
+ "value": "afghanistan",
+ },
+ }
+ }
+ />,
+]
+`;
+
+exports[`Storyshots Generics / SingleAutocompleteSelectField with loaded data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <Form
+ initial={
+ Object {
+ "country": Object {
+ "label": "Afghanistan",
+ "value": "afghanistan",
+ },
+ }
+ }
+ />,
+]
+`;
+
+exports[`Storyshots Generics / SingleAutocompleteSelectField with loading data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <Form
+ initial={
+ Object {
+ "country": Object {
+ "label": "Afghanistan",
+ "value": "afghanistan",
+ },
+ }
+ }
+ />,
+]
+`;
+
exports[`Storyshots Generics / SingleSelectField with error hint 1`] = `
<Component
choices={
@@ -1542,6 +1669,36 @@ exports[`Storyshots Generics / Skeleton default 1`] = `
/>
`;
+exports[`Storyshots Generics / StatusLabel when error 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ label="Example label"
+ status="error"
+ />,
+]
+`;
+
+exports[`Storyshots Generics / StatusLabel when neutral 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ label="Example label"
+ status="neutral"
+ />,
+]
+`;
+
+exports[`Storyshots Generics / StatusLabel when success 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ label="Example label"
+ status="success"
+ />,
+]
+`;
+
exports[`Storyshots Generics / TablePagination both previous and next pages are available 1`] = `
<Table
classes={
@@ -1626,1679 +1783,5354 @@ exports[`Storyshots Generics / TablePagination previous page available 1`] = `
</Table>
`;
-exports[`Storyshots Pages / PageBaseForm with 'created' property 1`] = `
-<Component
- availableOn="2018-03-20T16:39:08.850105+00:00"
- classes={
- Object {
- "addHelperTextPadding": "Component-addHelperTextPadding-23",
- "cardActions": "Component-cardActions-24",
- }
- }
- content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
- created="2018-03-20T16:39:08.850105+00:00"
- isVisible={true}
- slug="lorem-ipsum-dolor"
- title="Lorem ipsum"
-/>
+exports[`Storyshots Generics / Timeline default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component) />,
+]
`;
-exports[`Storyshots Pages / PageBaseForm with 'errors' property 1`] = `
-<Component
- availableOn="2018-03-20T16:39:08.850105+00:00"
- classes={
- Object {
- "addHelperTextPadding": "Component-addHelperTextPadding-23",
- "cardActions": "Component-cardActions-24",
- }
- }
- content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
- errors={
- Array [
- Object {
- "field": "slug",
- "message": "To pole jest wymagane.",
- },
- Object {
- "field": "title",
- "message": "To pole jest wymagane.",
- },
- Object {
- "field": "content",
- "message": "To pole jest wymagane.",
- },
- ]
- }
- isVisible={true}
- slug="lorem-ipsum-dolor"
- title="Lorem ipsum"
-/>
+exports[`Storyshots Generics / Timeline with expansion panels 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component) />,
+]
`;
-exports[`Storyshots Pages / PageBaseForm with initial data 1`] = `
-<Component
- availableOn="2018-03-20T16:39:08.850105+00:00"
- classes={
- Object {
- "addHelperTextPadding": "Component-addHelperTextPadding-23",
- "cardActions": "Component-cardActions-24",
- }
- }
- content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
- isVisible={true}
- slug="lorem-ipsum-dolor"
- title="Lorem ipsum"
-/>
+exports[`Storyshots Generics / Timeline with order notes 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component) />,
+]
`;
-exports[`Storyshots Pages / PageDeleteDialog default 1`] = `
-<Component
- classes={
- Object {
- "deleteButton": "Component-deleteButton-25",
+exports[`Storyshots Orders / OrderAddressEditDialog billing address 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ countries={
+ Array [
+ Object {
+ "code": "AF",
+ "label": "Afghanistan",
+ },
+ Object {
+ "code": "AX",
+ "label": "Åland Islands",
+ },
+ Object {
+ "code": "AL",
+ "label": "Albania",
+ },
+ Object {
+ "code": "DZ",
+ "label": "Algeria",
+ },
+ Object {
+ "code": "AS",
+ "label": "American Samoa",
+ },
+ ]
}
- }
- opened={true}
->
- <WithStyles(DialogContentText)>
- Do you really want to delete this page?
- </WithStyles(DialogContentText)>
-</Component>
+ data={
+ Object {
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a1",
+ "lastName": "Client",
+ "phone": undefined,
+ "phone_number": "",
+ "phone_prefix": "",
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
+ }
+ }
+ onChange={[Function]}
+ open={true}
+ prefixes={
+ Array [
+ "01",
+ "02",
+ "41",
+ "49",
+ ]
+ }
+ variant="billing"
+ />,
+]
`;
-exports[`Storyshots Pages / PageFilters with initial data 1`] = `
-<FilterCard
- handleClear={[Function]}
->
- <TextField
- fullWidth={true}
- label="Title"
- name="title"
- onChange={[Function]}
- required={false}
- select={false}
- value="Initial title"
- />
- <WithStyles(Component) />
- <TextField
- fullWidth={true}
- label="Url"
- name="url"
+exports[`Storyshots Orders / OrderAddressEditDialog shipping address 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ countries={
+ Array [
+ Object {
+ "code": "AF",
+ "label": "Afghanistan",
+ },
+ Object {
+ "code": "AX",
+ "label": "Åland Islands",
+ },
+ Object {
+ "code": "AL",
+ "label": "Albania",
+ },
+ Object {
+ "code": "DZ",
+ "label": "Algeria",
+ },
+ Object {
+ "code": "AS",
+ "label": "American Samoa",
+ },
+ ]
+ }
+ data={
+ Object {
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a1",
+ "lastName": "Client",
+ "phone": undefined,
+ "phone_number": "",
+ "phone_prefix": "",
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
+ }
+ }
onChange={[Function]}
- required={false}
- select={false}
- value="initial-url"
- />
-</FilterCard>
+ open={true}
+ prefixes={
+ Array [
+ "01",
+ "02",
+ "41",
+ "49",
+ ]
+ }
+ variant="shipping"
+ />,
+]
`;
-exports[`Storyshots Pages / PageFilters without initial data 1`] = `
-<FilterCard
- handleClear={[Function]}
->
- <TextField
- fullWidth={true}
- label="Title"
- name="title"
- onChange={[Function]}
- required={false}
- select={false}
- value=""
- />
- <WithStyles(Component) />
- <TextField
- fullWidth={true}
- label="Url"
- name="url"
- onChange={[Function]}
- required={false}
- select={false}
- value=""
- />
-</FilterCard>
+exports[`Storyshots Orders / OrderCancelDialog default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ id="123"
+ onClose={[Function]}
+ onConfirm={[Function]}
+ open={true}
+ />,
+]
`;
-exports[`Storyshots Pages / PageList when loading data 1`] = `
-<Card
- classes={
- Object {
- "root": "MuiCard-root-26",
- }
- }
- raised={false}
->
+exports[`Storyshots Orders / OrderCustomer when loaded data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
<WithStyles(Component)
- handleNextPage={[Function]}
- handlePreviousPage={[Function]}
- onEditClick={[Function]}
- onShowPageClick={[Function]}
- pageInfo={
+ billingAddress={
Object {
- "endCursor": "YXJyYXljb25uZWN0aW9uOjE=",
- "hasNextPage": false,
- "hasPreviousPage": false,
- "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a1",
+ "lastName": "Client",
+ "phone": Object {
+ "number": "",
+ "prefix": "",
+ },
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
}
}
- />
-</Card>
-`;
-
-exports[`Storyshots Pages / PageList with data 1`] = `
-<Card
- classes={
- Object {
- "root": "MuiCard-root-26",
+ client={
+ Object {
+ "email": "[email protected]",
+ "id": "c1",
+ "name": "Test Client",
+ }
}
- }
- raised={false}
->
- <WithStyles(Component)
- handleNextPage={[Function]}
- handlePreviousPage={[Function]}
- onEditClick={[Function]}
- onShowPageClick={[Function]}
- pageInfo={
+ onBillingAddressEdit={[Function]}
+ onShippingAddressEdit={[Function]}
+ shippingAddress={
Object {
- "endCursor": "YXJyYXljb25uZWN0aW9uOjE=",
- "hasNextPage": false,
- "hasPreviousPage": false,
- "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a1",
+ "lastName": "Client",
+ "phone": Object {
+ "number": "",
+ "prefix": "",
+ },
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
}
}
- pages={
- Array [
+ />,
+]
+`;
+
+exports[`Storyshots Orders / OrderCustomer when loading data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component) />,
+]
+`;
+
+exports[`Storyshots Orders / OrderCustomer with different addresses 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ billingAddress={
+ Object {
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a2",
+ "lastName": "Client",
+ "phone": Object {
+ "number": "",
+ "prefix": "",
+ },
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
+ }
+ }
+ client={
+ Object {
+ "email": "[email protected]",
+ "id": "c1",
+ "name": "Test Client",
+ }
+ }
+ onBillingAddressEdit={[Function]}
+ onShippingAddressEdit={[Function]}
+ shippingAddress={
+ Object {
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a1",
+ "lastName": "Client",
+ "phone": Object {
+ "number": "",
+ "prefix": "",
+ },
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
+ }
+ }
+ />,
+]
+`;
+
+exports[`Storyshots Orders / OrderCustomerEditDialog default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ fetchUsers={[Function]}
+ onChange={[Function]}
+ onClose={[Function]}
+ onConfirm={[Function]}
+ open={true}
+ user={
+ Object {
+ "label": "[email protected]",
+ "value": "c1",
+ }
+ }
+ users={
+ Array [
Object {
- "cursor": "YXJyYXljb25uZWN0aW9uOjA=",
- "node": Object {
- "id": "UGFnZTox",
- "isVisible": true,
- "slug": "about",
- "title": "About",
+ "email": "[email protected]",
+ "id": "c1",
+ },
+ Object {
+ "email": "[email protected]",
+ "id": "c2",
+ },
+ Object {
+ "email": "[email protected]",
+ "id": "c3",
+ },
+ Object {
+ "email": "[email protected]",
+ "id": "c4",
+ },
+ ]
+ }
+ />,
+]
+`;
+
+exports[`Storyshots Orders / OrderFulfillmentCancelDialog default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ id="123"
+ onClose={[Function]}
+ onConfirm={[Function]}
+ open={true}
+ />,
+]
+`;
+
+exports[`Storyshots Orders / OrderFulfillmentDialog default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ data={Object {}}
+ onChange={[Function]}
+ open={true}
+ products={
+ Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
},
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
},
Object {
- "cursor": "YXJyYXljb25uZWN0aW9uOjE=",
- "node": Object {
- "id": "UGFnZToy",
- "isVisible": false,
- "slug": "terms-of-use",
- "title": "Terms of use",
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
},
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
},
]
}
- />
-</Card>
+ />,
+]
`;
-exports[`Storyshots Pages / PageList without data 1`] = `
-<Card
- classes={
- Object {
- "root": "MuiCard-root-26",
- }
- }
- raised={false}
->
+exports[`Storyshots Orders / OrderFulfillmentTrackingDialog add code 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
<WithStyles(Component)
- handleNextPage={[Function]}
- handlePreviousPage={[Function]}
- onEditClick={[Function]}
- onShowPageClick={[Function]}
- pageInfo={
- Object {
- "endCursor": "YXJyYXljb25uZWN0aW9uOjE=",
- "hasNextPage": false,
- "hasPreviousPage": false,
- "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
- }
+ onChange={[Function]}
+ onClose={[Function]}
+ onConfirm={[Function]}
+ open={true}
+ trackingCode="123"
+ variant="add"
+ />,
+]
+`;
+
+exports[`Storyshots Orders / OrderFulfillmentTrackingDialog edit code 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ onChange={[Function]}
+ onClose={[Function]}
+ onConfirm={[Function]}
+ open={true}
+ trackingCode="123"
+ variant="edit"
+ />,
+]
+`;
+
+exports[`Storyshots Orders / OrderHistory default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ history={
+ Array [
+ Object {
+ "content": "Created order",
+ "date": "2018-04-07T11:18:19+00:00",
+ "id": "n1",
+ "type": "created",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Received payment",
+ "date": "2018-04-07T11:33:19+00:00",
+ "id": "n1",
+ "params": Object {
+ "amount": 165.7,
+ "currency": "USD",
+ },
+ "type": "payment",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Shipped order",
+ "date": "2018-04-07T13:31:19+00:00",
+ "id": "n3",
+ "params": Object {
+ "shippingAddress": "Test Client<br />9297 Barker Extension<br />95393-6818 Keithport<br />Cyprus",
+ },
+ "type": "shipped",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur arcu nisi, dignissim non placerat id, varius imperdiet nisi. Duis lobortis, massa sed feugiat ultricies, massa felis commodo dui, tempor tempus tellus ligula id arcu. Nam erat dui, fermentum sed dui a, tincidunt molestie magna.",
+ "date": "2018-04-08T11:18:19+00:00",
+ "id": "n4",
+ "type": "note",
+ "user": "[email protected]",
+ },
+ ]
}
- pages={Array []}
- />
-</Card>
+ />,
+]
`;
-exports[`Storyshots Products / ProductAttributesForm when data loaded 1`] = `
-<Component
- attributes={
- Array [
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZToz",
- "name": "Brand",
- "slug": "brand",
- "values": Array [
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjQw",
- "name": "dominikibrand",
- "slug": "dominikibrand",
+exports[`Storyshots Orders / OrderList when loaded data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ orders={
+ Array [
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c1",
},
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM5",
- "name": "superbrand",
- "slug": "superbrand",
+ "created": "2018-04-07T11:18:19+00:00",
+ "id": "o1",
+ "number": 11,
+ "orderStatus": Object {
+ "localized": "Fulfilled",
+ "status": "success",
},
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM4",
- "name": "Mirumee",
- "slug": "mirumee",
+ "paymentStatus": Object {
+ "localized": "Confirmed",
+ "status": "success",
},
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjY=",
- "name": "Saleor",
- "slug": "saleor",
+ "price": Object {
+ "amount": 19.2,
+ "currency": "USD",
},
- ],
- },
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZToy",
- "name": "Collar",
- "slug": "collar",
- "values": Array [
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjU=",
- "name": "Polo",
- "slug": "polo",
+ "status": "fulfilled",
+ },
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c1",
},
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjQ=",
- "name": "V-Neck",
- "slug": "v-neck",
+ "created": "2018-04-07T11:11:19+00:00",
+ "id": "o2",
+ "number": 10,
+ "orderStatus": Object {
+ "localized": "Unfulfilled",
+ "status": "error",
},
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM=",
- "name": "Round",
- "slug": "round",
+ "paymentStatus": Object {
+ "localized": "Confirmed",
+ "status": "success",
},
- ],
- },
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZTox",
- "name": "Color",
- "slug": "color",
- "values": Array [
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI=",
- "name": "White",
- "slug": "white",
+ "price": Object {
+ "amount": 28.9,
+ "currency": "USD",
},
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE=",
- "name": "Blue",
- "slug": "blue",
+ "status": "unfulfilled",
+ },
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c2",
},
- ],
- },
- ]
- }
- classes={Object {}}
- onChange={[Function]}
- productAttributes={
- Array [
- Object {
- "name": "brand",
- "value": "superbrand",
- },
- Object {
- "name": "collar",
- "value": "round",
- },
- Object {
- "name": "color",
- "value": "blue",
- },
- ]
- }
-/>
+ "created": "2018-04-07T10:44:44+00:00",
+ "id": "o3",
+ "number": 9,
+ "orderStatus": Object {
+ "localized": "shipped",
+ "status": "error",
+ },
+ "paymentStatus": Object {
+ "localized": "Rejected",
+ "status": "error",
+ },
+ "price": Object {
+ "amount": 289,
+ "currency": "USD",
+ },
+ "status": "shipped",
+ },
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c3",
+ },
+ "created": "2018-04-07T10:33:19+00:00",
+ "id": "o4",
+ "number": 9,
+ "orderStatus": Object {
+ "localized": "shipped",
+ "status": "error",
+ },
+ "paymentStatus": Object {
+ "localized": "unknown",
+ "status": "error",
+ },
+ "price": Object {
+ "amount": 100.05,
+ "currency": "USD",
+ },
+ "status": "shipped",
+ },
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c4",
+ },
+ "created": "2018-04-07T07:39:19+00:00",
+ "id": "o5",
+ "number": 9,
+ "orderStatus": Object {
+ "localized": "shipped",
+ "status": "error",
+ },
+ "paymentStatus": Object {
+ "localized": "Waiting for confirmation",
+ "status": "neutral",
+ },
+ "price": Object {
+ "amount": 14.87,
+ "currency": "USD",
+ },
+ "status": "shipped",
+ },
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c4",
+ },
+ "created": "2018-04-06T19:18:19+00:00",
+ "id": "o6",
+ "number": 8,
+ "orderStatus": Object {
+ "localized": "Unfulfilled",
+ "status": "error",
+ },
+ "paymentStatus": Object {
+ "localized": "Rejected",
+ "status": "error",
+ },
+ "price": Object {
+ "amount": 14.87,
+ "currency": "USD",
+ },
+ "status": "unfulfilled",
+ },
+ ]
+ }
+ />,
+]
`;
-exports[`Storyshots Products / ProductAttributesForm when loading data 1`] = `
-<Component
- classes={Object {}}
- loading={true}
- onChange={[Function]}
-/>
+exports[`Storyshots Orders / OrderList when loading data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component) />,
+]
`;
-exports[`Storyshots Products / ProductAvailabilityForm when loading data 1`] = `
-<Component
- classes={
- Object {
- "root": "Component-root-27",
- }
- }
- onChange={[Function]}
-/>
+exports[`Storyshots Orders / OrderList when no data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ orders={Array []}
+ />,
+]
`;
-exports[`Storyshots Products / ProductAvailabilityForm with loaded data 1`] = `
-<Component
- available={true}
- availableOn="04-10-2010"
- classes={
- Object {
- "root": "Component-root-27",
- }
- }
- onChange={[Function]}
-/>
+exports[`Storyshots Orders / OrderList with clickable rows 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ onRowClick={[Function]}
+ orders={
+ Array [
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c1",
+ },
+ "created": "2018-04-07T11:18:19+00:00",
+ "id": "o1",
+ "number": 11,
+ "orderStatus": Object {
+ "localized": "Fulfilled",
+ "status": "success",
+ },
+ "paymentStatus": Object {
+ "localized": "Confirmed",
+ "status": "success",
+ },
+ "price": Object {
+ "amount": 19.2,
+ "currency": "USD",
+ },
+ "status": "fulfilled",
+ },
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c1",
+ },
+ "created": "2018-04-07T11:11:19+00:00",
+ "id": "o2",
+ "number": 10,
+ "orderStatus": Object {
+ "localized": "Unfulfilled",
+ "status": "error",
+ },
+ "paymentStatus": Object {
+ "localized": "Confirmed",
+ "status": "success",
+ },
+ "price": Object {
+ "amount": 28.9,
+ "currency": "USD",
+ },
+ "status": "unfulfilled",
+ },
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c2",
+ },
+ "created": "2018-04-07T10:44:44+00:00",
+ "id": "o3",
+ "number": 9,
+ "orderStatus": Object {
+ "localized": "shipped",
+ "status": "error",
+ },
+ "paymentStatus": Object {
+ "localized": "Rejected",
+ "status": "error",
+ },
+ "price": Object {
+ "amount": 289,
+ "currency": "USD",
+ },
+ "status": "shipped",
+ },
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c3",
+ },
+ "created": "2018-04-07T10:33:19+00:00",
+ "id": "o4",
+ "number": 9,
+ "orderStatus": Object {
+ "localized": "shipped",
+ "status": "error",
+ },
+ "paymentStatus": Object {
+ "localized": "unknown",
+ "status": "error",
+ },
+ "price": Object {
+ "amount": 100.05,
+ "currency": "USD",
+ },
+ "status": "shipped",
+ },
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c4",
+ },
+ "created": "2018-04-07T07:39:19+00:00",
+ "id": "o5",
+ "number": 9,
+ "orderStatus": Object {
+ "localized": "shipped",
+ "status": "error",
+ },
+ "paymentStatus": Object {
+ "localized": "Waiting for confirmation",
+ "status": "neutral",
+ },
+ "price": Object {
+ "amount": 14.87,
+ "currency": "USD",
+ },
+ "status": "shipped",
+ },
+ Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c4",
+ },
+ "created": "2018-04-06T19:18:19+00:00",
+ "id": "o6",
+ "number": 8,
+ "orderStatus": Object {
+ "localized": "Unfulfilled",
+ "status": "error",
+ },
+ "paymentStatus": Object {
+ "localized": "Rejected",
+ "status": "error",
+ },
+ "price": Object {
+ "amount": 14.87,
+ "currency": "USD",
+ },
+ "status": "unfulfilled",
+ },
+ ]
+ }
+ />,
+]
`;
-exports[`Storyshots Products / ProductCategoryAndCollectionsForm when data is loaded 1`] = `
-<Component
- categories={
- Array [
- Object {
- "label": "Lorem ipsum dolor",
- "value": "123123",
- },
- Object {
- "label": "Mauris vehicula tortor vulputate",
- "value": "876752",
- },
- ]
- }
- category="876752"
- classes={Object {}}
- collections={
- Array [
- Object {
- "label": "Winter collection",
- "value": "1",
- },
- Object {
- "label": "Emperor's choice",
- "value": "2",
- },
- ]
- }
- onChange={[Function]}
- productCollections={
- Array [
- "1",
- ]
- }
-/>
+exports[`Storyshots Orders / OrderPaymentDialog capture payment 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ onChange={[Function]}
+ open={true}
+ value={120}
+ variant="capture"
+ />,
+]
`;
-exports[`Storyshots Products / ProductCategoryAndCollectionsForm while loading data 1`] = `
-<Component
- classes={Object {}}
- loading={true}
- onChange={[Function]}
-/>
+exports[`Storyshots Orders / OrderPaymentDialog refund payment 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ onChange={[Function]}
+ open={true}
+ value={140}
+ variant="refund"
+ />,
+]
`;
-exports[`Storyshots Products / ProductCollections when loading data 1`] = `
-<Component
- classes={
- Object {
- "card": "Component-card-28",
- "link": "Component-link-29",
- }
- }
- onRowClick={[Function]}
-/>
+exports[`Storyshots Orders / OrderPaymentReleaseDialog default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ onClose={[Function]}
+ onConfirm={[Function]}
+ open={true}
+ />,
+]
`;
-exports[`Storyshots Products / ProductCollections with collections 1`] = `
-<Component
- classes={
- Object {
- "card": "Component-card-28",
- "link": "Component-link-29",
- }
- }
- collections={
- Array [
- Object {
- "id": "collection-1",
- "name": "Winter Collection",
- },
+exports[`Storyshots Orders / OrderProductAddDialog default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <Form
+ initial={
Object {
- "id": "collection-2",
- "name": "Summer Collection",
- },
- ]
- }
- onRowClick={[Function]}
-/>
+ "quantity": 0,
+ "variant": Object {
+ "label": "",
+ "value": "",
+ },
+ }
+ }
+ />,
+]
`;
-exports[`Storyshots Products / ProductCollections with no collections 1`] = `
-<Component
- classes={
- Object {
- "card": "Component-card-28",
- "link": "Component-link-29",
+exports[`Storyshots Orders / OrderShippingMethodEditDialog default 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ fetchShippingMethods={[Function]}
+ onChange={[Function]}
+ onClose={[Function]}
+ onConfirm={[Function]}
+ open={true}
+ shippingMethod={
+ Object {
+ "label": "DHL",
+ "value": "s1",
+ }
}
- }
- collections={Array []}
- onRowClick={[Function]}
-/>
+ shippingMethods={
+ Array [
+ Object {
+ "country": "whole world",
+ "id": "s1",
+ "name": "DHL",
+ "price": Object {},
+ },
+ Object {
+ "country": "Afghanistan",
+ "id": "s2",
+ "name": "UPS",
+ },
+ ]
+ }
+ />,
+]
`;
-exports[`Storyshots Products / ProductDescription when loading data 1`] = `
-<WithStyles(Card)>
+exports[`Storyshots Orders / OrderSummary order cancelled 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
<WithStyles(Component)
- onBack={[Function]}
- >
- <WithStyles(IconButton)
- disabled={true}
- onClick={[Function]}
- >
- <pure(Visibility) />
- </WithStyles(IconButton)>
- <WithStyles(IconButton)
- disabled={true}
- onClick={[Function]}
- >
- <pure(Edit) />
- </WithStyles(IconButton)>
- <WithStyles(IconButton)
- disabled={true}
- onClick={[Function]}
- >
- <pure(Delete) />
- </WithStyles(IconButton)>
- </WithStyles(Component)>
- <WithStyles(CardContent)>
- <WithStyles(Typography)>
- <WithStyles(Component) />
- </WithStyles(Typography)>
- </WithStyles(CardContent)>
-</WithStyles(Card)>
+ net={
+ Object {
+ "amount": 6,
+ "currency": "USD",
+ }
+ }
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
+ onRowClick={[Function]}
+ paid={
+ Object {
+ "amount": 19.2,
+ "currency": "USD",
+ }
+ }
+ paymentStatus="confirmed"
+ products={
+ Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
+ },
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ]
+ }
+ refunded={
+ Object {
+ "amount": 13.2,
+ "currency": "USD",
+ }
+ }
+ status="cancelled"
+ subtotal={
+ Object {
+ "amount": 160.2,
+ "currency": "USD",
+ }
+ }
+ total={
+ Object {
+ "amount": 165.7,
+ "currency": "USD",
+ }
+ }
+ />,
+]
`;
-exports[`Storyshots Products / ProductDescription with description 1`] = `
-<WithStyles(Card)>
+exports[`Storyshots Orders / OrderSummary order draft 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
<WithStyles(Component)
- onBack={[Function]}
- title="Stewart-Barrera"
- >
- <WithStyles(IconButton)
- disabled={false}
- >
- <pure(Visibility) />
- </WithStyles(IconButton)>
- <WithStyles(IconButton)
- disabled={false}
- >
- <pure(Edit) />
- </WithStyles(IconButton)>
- <WithStyles(IconButton)
- disabled={false}
- >
- <pure(Delete) />
- </WithStyles(IconButton)>
- </WithStyles(Component)>
- <WithStyles(CardContent)>
- <WithStyles(Typography)>
- Light light office style present life military. Enough executive coach cause own.
-
-Care season wrong fly. Example age between discuss assume.
-
-Their third build might strong account. Worry enter room note level air.
-
-Weight director mother. Because find task with now enter tree management.
-
-Soon name recently ground green. There owner sport box them red information.
- </WithStyles(Typography)>
- </WithStyles(CardContent)>
-</WithStyles(Card)>
-`;
-
-exports[`Storyshots Products / ProductDescription with no description 1`] = `
-<WithStyles(Card)>
- <WithStyles(Component)
- onBack={[Function]}
- title="Stewart-Barrera"
- >
- <WithStyles(IconButton)
- disabled={false}
- >
- <pure(Visibility) />
- </WithStyles(IconButton)>
- <WithStyles(IconButton)
- disabled={false}
- >
- <pure(Edit) />
- </WithStyles(IconButton)>
- <WithStyles(IconButton)
- disabled={false}
- >
- <pure(Delete) />
- </WithStyles(IconButton)>
- </WithStyles(Component)>
- <WithStyles(CardContent)>
- <WithStyles(Typography)>
- No description
- </WithStyles(Typography)>
- </WithStyles(CardContent)>
-</WithStyles(Card)>
-`;
-
-exports[`Storyshots Products / ProductDetailsForm when loading data 1`] = `
-<Component
- classes={
- Object {
- "root": "Component-root-30",
- }
- }
- loading={true}
- onBack={[Function]}
- onChange={[Function]}
-/>
-`;
-
-exports[`Storyshots Products / ProductDetailsForm with initial data 1`] = `
-<Component
- classes={
- Object {
- "root": "Component-root-30",
- }
- }
- currencySymbol="USD"
- description="Aenean sit amet malesuada nibh. Proin nisi lorem, facilisis at tortor vel, convallis ornare nibh. In nec ipsum porta, varius leo eu, condimentum quam. Donec gravida euismod ipsum, at consequat orci efficitur nec. Phasellus lectus arcu, auctor eget porttitor eget, venenatis a lacus. Suspendisse quis urna rhoncus, commodo justo at, tempor nisl."
- name="Our totally awesome book"
- onBack={[Function]}
- onChange={[Function]}
- price="300"
-/>
-`;
-
-exports[`Storyshots Products / ProductDetailsForm with no initial data 1`] = `
-<Component
- classes={
- Object {
- "root": "Component-root-30",
+ net={
+ Object {
+ "amount": 6,
+ "currency": "USD",
+ }
}
- }
- onBack={[Function]}
- onChange={[Function]}
-/>
-`;
-
-exports[`Storyshots Products / ProductDetailsPage when loaded data 1`] = `
-<Component
- classes={
- Object {
- "root": "Component-root-31",
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
+ onRowClick={[Function]}
+ paid={
+ Object {
+ "amount": 19.2,
+ "currency": "USD",
+ }
}
- }
- onBack={[Function]}
- onCollectionShow={[Function]}
- onDelete={[Function]}
- onEdit={[Function]}
- onImageEdit={[Function]}
- onImageReorder={[Function]}
- onImageUpload={[Function]}
- onProductPublish={[Function]}
- onProductShow={[Function]}
- onVariantShow={[Function]}
- placeholderImage="placeholder255x255.png"
- product={
- Object {
- "availability": Object {
- "available": true,
- "priceRange": Object {
- "start": Object {
- "net": Object {
- "localized": "55,14 USD",
+ paymentStatus="confirmed"
+ products={
+ Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
},
},
- "stop": Object {
- "net": Object {
- "localized": "88,36 USD",
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
},
},
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
},
- },
- "collections": Object {
- "edges": Array [
- Object {
- "node": Object {
- "id": "collection-1",
- "name": "Winter Collection",
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
},
},
- Object {
- "node": Object {
- "id": "collection-2",
- "name": "Summer Collection",
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
},
},
- ],
- },
- "description": "Light light office style present life military. Enough executive coach cause own.
-
-Care season wrong fly. Example age between discuss assume.
-
-Their third build might strong account. Worry enter room note level air.
-
-Weight director mother. Because find task with now enter tree management.
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ]
+ }
+ refunded={
+ Object {
+ "amount": 13.2,
+ "currency": "USD",
+ }
+ }
+ status="draft"
+ subtotal={
+ Object {
+ "amount": 160.2,
+ "currency": "USD",
+ }
+ }
+ total={
+ Object {
+ "amount": 165.7,
+ "currency": "USD",
+ }
+ }
+ />,
+]
+`;
-Soon name recently ground green. There owner sport box them red information.",
- "grossMargin": Array [
+exports[`Storyshots Orders / OrderSummary order fulfilled 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ net={
+ Object {
+ "amount": 6,
+ "currency": "USD",
+ }
+ }
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
+ onRowClick={[Function]}
+ paid={
+ Object {
+ "amount": 19.2,
+ "currency": "USD",
+ }
+ }
+ paymentStatus="confirmed"
+ products={
+ Array [
Object {
- "start": 56,
- "stop": 98,
- },
- ],
- "id": "UHJvZHVjdDoyOA==",
- "images": Object {
- "edges": Array [
- Object {
- "node": Object {
- "alt": "",
- "id": "UHJvZHVjdEltYWdlOjY2",
- "order": 0,
- "url": "placeholder255x255.png",
- },
- },
- Object {
- "node": Object {
- "alt": "",
- "id": "UHJvZHVjdEltYWdlOjY3",
- "order": 1,
- "url": "placeholder255x255.png",
- },
- },
- Object {
- "node": Object {
- "alt": "",
- "id": "UHJvZHVjdEltYWdlOjY4",
- "order": 2,
- "url": "placeholder255x255.png",
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
},
},
- ],
- },
- "isPublished": true,
- "name": "Stewart-Barrera",
- "price": Object {
- "localized": "95,47 USD",
- },
- "productType": Object {
- "id": "UHJvZHVjdFR5cGU6Mw==",
- "name": "Coffee",
- },
- "purchaseCost": Object {
- "start": Object {
- "gross": Object {
- "localized": "1,88 USD",
- },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
},
- "stop": Object {
- "gross": Object {
- "localized": "48,10 USD",
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
},
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
},
- },
- "url": "/pl/products/stewart-barrera-28/",
- "variants": Object {
- "edges": Array [
- Object {
- "node": Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6Nw==",
- "name": "XXL",
- "priceOverride": null,
- "sku": "2-1337",
- "stockQuantity": 5,
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
},
},
- Object {
- "node": Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6OA==",
- "name": "XL",
- "priceOverride": null,
- "sku": "2-1338",
- "stockQuantity": 0,
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
},
},
- Object {
- "node": Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6OQ==",
- "name": "L",
- "priceOverride": null,
- "sku": "2-1339",
- "stockQuantity": 15,
- },
- },
- Object {
- "node": Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6MTA=",
- "name": "M",
- "priceOverride": null,
- "sku": "2-1340",
- "stockQuantity": 33,
- },
- },
- Object {
- "node": Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6MTE=",
- "name": "S",
- "priceOverride": null,
- "sku": "2-1341",
- "stockQuantity": 0,
- },
- },
- Object {
- "node": Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6MTI=",
- "name": "XS",
- "priceOverride": null,
- "sku": "2-1342",
- "stockQuantity": 0,
- },
- },
- ],
- },
- }
- }
-/>
-`;
-
-exports[`Storyshots Products / ProductDetailsPage when loading data 1`] = `
-<Component
- classes={
- Object {
- "root": "Component-root-31",
- }
- }
- onBack={[Function]}
- onCollectionShow={[Function]}
- onDelete={[Function]}
- onEdit={[Function]}
- onImageEdit={[Function]}
- onImageReorder={[Function]}
- onImageUpload={[Function]}
- onProductPublish={[Function]}
- onProductShow={[Function]}
- onVariantShow={[Function]}
- placeholderImage="placeholder255x255.png"
-/>
-`;
-
-exports[`Storyshots Products / ProductImagePage data loaded 1`] = `
-<Component
- classes={
- Object {
- "image": "Component-image-33",
- "root": "Component-root-32",
- }
- }
- image="placeholder255x255.png"
- onBack={[Function]}
- onSubmit={[Function]}
-/>
-`;
-
-exports[`Storyshots Products / ProductImagePage loading 1`] = `
-<Component
- classes={
- Object {
- "image": "Component-image-33",
- "root": "Component-root-32",
- }
- }
- loading={true}
- onBack={[Function]}
- onSubmit={[Function]}
-/>
-`;
-
-exports[`Storyshots Products / ProductImages when loading data 1`] = `
-<Component
- classes={
- Object {
- "card": "Component-card-35",
- "fileField": "Component-fileField-38",
- "gridElement": "Component-gridElement-36",
- "icon": "Component-icon-37",
- "root": "Component-root-34",
- }
- }
- onImageReorder={[Function]}
- onImageUpload={[Function]}
- placeholderImage="placeholder255x255.png"
-/>
-`;
-
-exports[`Storyshots Products / ProductImages with data 1`] = `
-<Component
- classes={
- Object {
- "card": "Component-card-35",
- "fileField": "Component-fileField-38",
- "gridElement": "Component-gridElement-36",
- "icon": "Component-icon-37",
- "root": "Component-root-34",
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ]
}
- }
- images={
- Array [
+ refunded={
Object {
- "alt": "",
- "id": "UHJvZHVjdEltYWdlOjY2",
- "order": 0,
- "url": "placeholder255x255.png",
- },
+ "amount": 13.2,
+ "currency": "USD",
+ }
+ }
+ status="fulfilled"
+ subtotal={
Object {
- "alt": "",
- "id": "UHJvZHVjdEltYWdlOjY3",
- "order": 1,
- "url": "placeholder255x255.png",
- },
+ "amount": 160.2,
+ "currency": "USD",
+ }
+ }
+ total={
Object {
- "alt": "",
- "id": "UHJvZHVjdEltYWdlOjY4",
- "order": 2,
- "url": "placeholder255x255.png",
- },
- ]
- }
- onImageReorder={[Function]}
- onImageUpload={[Function]}
-/>
-`;
-
-exports[`Storyshots Products / ProductImages without data 1`] = `
-<Component
- classes={
- Object {
- "card": "Component-card-35",
- "fileField": "Component-fileField-38",
- "gridElement": "Component-gridElement-36",
- "icon": "Component-icon-37",
- "root": "Component-root-34",
+ "amount": 165.7,
+ "currency": "USD",
+ }
}
- }
- images={Array []}
- onImageReorder={[Function]}
- onImageUpload={[Function]}
-/>
-`;
-
-exports[`Storyshots Products / ProductListCard when loading data 1`] = `
-<WithStyles(Card)>
- <WithStyles(Component)
- title="Product list"
- >
- <Hidden
- implementation="js"
- lgDown={false}
- lgUp={false}
- mdDown={false}
- mdUp={true}
- smDown={false}
- smUp={false}
- xlDown={false}
- xlUp={false}
- xsDown={false}
- xsUp={false}
- >
- <WithStyles(IconButton)
- onClick={[Function]}
- >
- <pure(FilterList) />
- </WithStyles(IconButton)>
- </Hidden>
- </WithStyles(Component)>
- <WithStyles(Component)
- hasNextPage={true}
- hasPreviousPage={false}
- onNextPage={[Function]}
- onPreviousPage={[Function]}
- />
-</WithStyles(Card)>
+ />,
+]
`;
-exports[`Storyshots Products / ProductListCard with clickable rows 1`] = `
-<WithStyles(Card)>
- <WithStyles(Component)
- title="Product list"
- >
- <Hidden
- implementation="js"
- lgDown={false}
- lgUp={false}
- mdDown={false}
- mdUp={true}
- smDown={false}
- smUp={false}
- xlDown={false}
- xlUp={false}
- xsDown={false}
- xsUp={false}
- >
- <WithStyles(IconButton)
- onClick={[Function]}
- >
- <pure(FilterList) />
- </WithStyles(IconButton)>
- </Hidden>
- </WithStyles(Component)>
+exports[`Storyshots Orders / OrderSummary order partially fulfilled 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
<WithStyles(Component)
- hasNextPage={true}
- hasPreviousPage={false}
- onNextPage={[Function]}
- onPreviousPage={[Function]}
+ net={
+ Object {
+ "amount": 6,
+ "currency": "USD",
+ }
+ }
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
onRowClick={[Function]}
+ paid={
+ Object {
+ "amount": 19.2,
+ "currency": "USD",
+ }
+ }
+ paymentStatus="confirmed"
products={
Array [
Object {
"id": "UHJvZHVjdDox",
"name": "Gardner, Graham and King",
- "productType": Object {
- "id": "1",
- "name": "T-Shirt",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
},
- "thumbnailUrl": "placeholder255x255.png",
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
},
Object {
"id": "UHJvZHVjdDoy",
- "name": "Gardner, Graham and King",
- "productType": Object {
- "id": "1",
- "name": "T-Shirt",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
},
- "thumbnailUrl": "placeholder255x255.png",
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
},
Object {
"id": "UHJvZHVjdDoz",
- "name": "Gardner, Graham and King",
- "productType": Object {
- "id": "1",
- "name": "T-Shirt",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
},
- "thumbnailUrl": "placeholder255x255.png",
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
},
Object {
"id": "UHJvZHVjdDoa",
- "name": "Gardner, Graham and King",
- "productType": Object {
- "id": "1",
- "name": "T-Shirt",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
},
- "thumbnailUrl": "placeholder255x255.png",
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
},
]
}
- />
-</WithStyles(Card)>
+ refunded={
+ Object {
+ "amount": 13.2,
+ "currency": "USD",
+ }
+ }
+ status="partially fulfilled"
+ subtotal={
+ Object {
+ "amount": 160.2,
+ "currency": "USD",
+ }
+ }
+ total={
+ Object {
+ "amount": 165.7,
+ "currency": "USD",
+ }
+ }
+ />,
+]
`;
-exports[`Storyshots Products / ProductListCard with initial data 1`] = `
-<WithStyles(Card)>
- <WithStyles(Component)
- title="Product list"
- >
- <Hidden
- implementation="js"
- lgDown={false}
- lgUp={false}
- mdDown={false}
- mdUp={true}
- smDown={false}
- smUp={false}
- xlDown={false}
- xlUp={false}
- xsDown={false}
- xsUp={false}
- >
- <WithStyles(IconButton)
- onClick={[Function]}
- >
- <pure(FilterList) />
- </WithStyles(IconButton)>
- </Hidden>
- </WithStyles(Component)>
+exports[`Storyshots Orders / OrderSummary order unfulfilled 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
<WithStyles(Component)
- hasNextPage={true}
- hasPreviousPage={false}
- onNextPage={[Function]}
- onPreviousPage={[Function]}
+ net={
+ Object {
+ "amount": 6,
+ "currency": "USD",
+ }
+ }
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
+ onRowClick={[Function]}
+ paid={
+ Object {
+ "amount": 19.2,
+ "currency": "USD",
+ }
+ }
+ paymentStatus="confirmed"
products={
Array [
Object {
"id": "UHJvZHVjdDox",
"name": "Gardner, Graham and King",
- "productType": Object {
- "id": "1",
- "name": "T-Shirt",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
},
- "thumbnailUrl": "placeholder255x255.png",
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
},
Object {
"id": "UHJvZHVjdDoy",
- "name": "Gardner, Graham and King",
- "productType": Object {
- "id": "1",
- "name": "T-Shirt",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
},
- "thumbnailUrl": "placeholder255x255.png",
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
},
Object {
"id": "UHJvZHVjdDoz",
- "name": "Gardner, Graham and King",
- "productType": Object {
- "id": "1",
- "name": "T-Shirt",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
},
- "thumbnailUrl": "placeholder255x255.png",
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
},
Object {
"id": "UHJvZHVjdDoa",
- "name": "Gardner, Graham and King",
- "productType": Object {
- "id": "1",
- "name": "T-Shirt",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
},
- "thumbnailUrl": "placeholder255x255.png",
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
},
]
}
- />
-</WithStyles(Card)>
-`;
-
-exports[`Storyshots Products / ProductListCard without initial data 1`] = `
-<WithStyles(Card)>
- <WithStyles(Component)
- title="Product list"
- >
- <Hidden
- implementation="js"
- lgDown={false}
- lgUp={false}
- mdDown={false}
- mdUp={true}
- smDown={false}
- smUp={false}
- xlDown={false}
- xlUp={false}
- xsDown={false}
- xsUp={false}
- >
- <WithStyles(IconButton)
- onClick={[Function]}
- >
- <pure(FilterList) />
- </WithStyles(IconButton)>
- </Hidden>
- </WithStyles(Component)>
- <WithStyles(Component)
- hasNextPage={true}
- hasPreviousPage={false}
- onNextPage={[Function]}
- onPreviousPage={[Function]}
- products={Array []}
- />
-</WithStyles(Card)>
-`;
-
-exports[`Storyshots Products / ProductPriceAndAvailability when loading data 1`] = `
-<Component
- classes={
- Object {
- "greenText": "Component-greenText-39",
- "leftCell": "Component-leftCell-40",
- "redText": "Component-redText-41",
- "rightCell": "Component-rightCell-42",
- }
- }
- onPublish={[Function]}
-/>
-`;
-
-exports[`Storyshots Products / ProductPriceAndAvailability when product is available 1`] = `
-<Component
- classes={
- Object {
- "greenText": "Component-greenText-39",
- "leftCell": "Component-leftCell-40",
- "redText": "Component-redText-41",
- "rightCell": "Component-rightCell-42",
- }
- }
- grossMargin={
- Object {
- "start": 56,
- "stop": 98,
- }
- }
- isAvailable={true}
- onPublish={[Function]}
- purchaseCost={
- Object {
- "start": "1,88 USD",
- "stop": "48,10 USD",
- }
- }
- salePrice={
- Object {
- "start": "55,14 USD",
- "stop": "88,36 USD",
- }
- }
-/>
-`;
-
-exports[`Storyshots Products / ProductPriceAndAvailability when product is not available 1`] = `
-<Component
- classes={
- Object {
- "greenText": "Component-greenText-39",
- "leftCell": "Component-leftCell-40",
- "redText": "Component-redText-41",
- "rightCell": "Component-rightCell-42",
- }
- }
- grossMargin={
- Object {
- "start": 56,
- "stop": 98,
+ refunded={
+ Object {
+ "amount": 13.2,
+ "currency": "USD",
+ }
}
- }
- isAvailable={false}
- onPublish={[Function]}
- purchaseCost={
- Object {
- "start": "1,88 USD",
- "stop": "48,10 USD",
+ status="unfulfilled"
+ subtotal={
+ Object {
+ "amount": 160.2,
+ "currency": "USD",
+ }
}
- }
- salePrice={
- Object {
- "start": "55,14 USD",
- "stop": "88,36 USD",
+ total={
+ Object {
+ "amount": 165.7,
+ "currency": "USD",
+ }
}
- }
-/>
+ />,
+]
`;
-exports[`Storyshots Products / ProductUpdatePage when data is fully loaded 1`] = `
-<Component
- categories={
- Array [
- Object {
- "id": "123123",
- "name": "Lorem ipsum dolor",
- },
+exports[`Storyshots Orders / OrderSummary payment confirmed 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ net={
Object {
- "id": "876752",
- "name": "Mauris vehicula tortor vulputate",
- },
- ]
- }
- classes={
- Object {
- "cardContainer": "Component-cardContainer-45",
- "grid": "Component-grid-44",
- "root": "Component-root-43",
+ "amount": 6,
+ "currency": "USD",
+ }
}
- }
- collections={
- Array [
- Object {
- "id": "1",
- "name": "Winter collection",
- },
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
+ onRowClick={[Function]}
+ paid={
Object {
- "id": "2",
- "name": "Emperor's choice",
- },
- ]
- }
- onBack={[Function]}
- onSubmit={[Function]}
- product={
- Object {
- "attributes": Array [
+ "amount": 19.2,
+ "currency": "USD",
+ }
+ }
+ paymentStatus="confirmed"
+ products={
+ Array [
Object {
- "name": "brand",
- "value": "superbrand",
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
},
Object {
- "name": "collar",
- "value": "round",
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
},
Object {
- "name": "color",
- "value": "blue",
- },
- ],
- "available": true,
- "availableOn": "23-01-2006",
- "category": Object {
- "id": "123123",
- },
- "collections": Object {
- "edges": Array [
- Object {
- "node": Object {
- "id": "1",
- "name": "Winter collection",
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
},
},
- ],
- },
- "description": "Aenean sit amet malesuada nibh. Proin nisi lorem, facilisis at tortor vel, convallis ornare nibh. In nec ipsum porta, varius leo eu, condimentum quam. Donec gravida euismod ipsum, at consequat orci efficitur nec. Phasellus lectus arcu, auctor eget porttitor eget, venenatis a lacus. Suspendisse quis urna rhoncus, commodo justo at, tempor nisl.",
- "id": "1231u",
- "name": "Our awesome book",
- "price": Object {
- "currencySymbol": "$",
- "net": 3000.1,
- },
- "productType": Object {
- "name": "Book",
- "productAttributes": Object {
- "edges": Array [
- Object {
- "node": Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZToz",
- "name": "Brand",
- "slug": "brand",
- "values": Array [
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjQw",
- "name": "dominikibrand",
- "slug": "dominikibrand",
- },
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM5",
- "name": "superbrand",
- "slug": "superbrand",
- },
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM4",
- "name": "Mirumee",
- "slug": "mirumee",
- },
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjY=",
- "name": "Saleor",
- "slug": "saleor",
- },
- ],
- },
- },
- Object {
- "node": Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZToy",
- "name": "Collar",
- "slug": "collar",
- "values": Array [
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjU=",
- "name": "Polo",
- "slug": "polo",
- },
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjQ=",
- "name": "V-Neck",
- "slug": "v-neck",
- },
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM=",
- "name": "Round",
- "slug": "round",
- },
- ],
- },
- },
- Object {
- "node": Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZTox",
- "name": "Color",
- "slug": "color",
- "values": Array [
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI=",
- "name": "White",
- "slug": "white",
- },
- Object {
- "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE=",
- "name": "Blue",
- "slug": "blue",
- },
- ],
- },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
},
- ],
+ },
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
},
- },
- "seo": Object {
- "description": "Order our awesome book right now!",
- "title": "Buy our awesome book now!",
- },
- "slug": "our-awesome-book-1231u",
+ ]
}
- }
-/>
-`;
-
-exports[`Storyshots Products / ProductUpdatePage when loading data 1`] = `
-<Component
- classes={
- Object {
- "cardContainer": "Component-cardContainer-45",
- "grid": "Component-grid-44",
- "root": "Component-root-43",
+ refunded={
+ Object {
+ "amount": 13.2,
+ "currency": "USD",
+ }
}
- }
- loading={true}
- onBack={[Function]}
- onSubmit={[Function]}
-/>
+ status="partially fulfilled"
+ subtotal={
+ Object {
+ "amount": 160.2,
+ "currency": "USD",
+ }
+ }
+ total={
+ Object {
+ "amount": 165.7,
+ "currency": "USD",
+ }
+ }
+ />,
+]
`;
-exports[`Storyshots Products / ProductVariantAttributes when loaded data 1`] = `
-<Component
- attributes={
- Array [
+exports[`Storyshots Orders / OrderSummary payment error 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ net={
Object {
- "attribute": Object {
- "name": "Cover",
- "slug": "cover",
- "values": Array [
- "hard",
- "soft",
- ],
- },
- "value": "hard",
- },
+ "amount": 6,
+ "currency": "USD",
+ }
+ }
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
+ onRowClick={[Function]}
+ paid={
Object {
- "attribute": Object {
- "name": "Version",
- "slug": "version",
- "values": Array [
- "regular",
- "extended",
- ],
+ "amount": 19.2,
+ "currency": "USD",
+ }
+ }
+ paymentStatus="error"
+ products={
+ Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
},
- "value": "extended",
- },
- ]
- }
- classes={
- Object {
- "grid": "Component-grid-46",
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
+ },
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ]
}
- }
- onChange={[Function]}
-/>
-`;
-
-exports[`Storyshots Products / ProductVariantAttributes when loading data 1`] = `
-<Component
- classes={
- Object {
- "grid": "Component-grid-46",
+ refunded={
+ Object {
+ "amount": 13.2,
+ "currency": "USD",
+ }
}
- }
- loading={true}
- onChange={[Function]}
-/>
-`;
-
-exports[`Storyshots Products / ProductVariantDeleteDialog default 1`] = `
-<Component
- classes={
- Object {
- "deleteButton": "Component-deleteButton-47",
+ status="partially fulfilled"
+ subtotal={
+ Object {
+ "amount": 160.2,
+ "currency": "USD",
+ }
}
- }
- name="Extended Hard"
- open={true}
-/>
+ total={
+ Object {
+ "amount": 165.7,
+ "currency": "USD",
+ }
+ }
+ />,
+]
`;
-exports[`Storyshots Products / ProductVariantImageSelectDialog default 1`] = `
-<ProductVariantImageSelectDialogComponent
- classes={
- Object {
- "gridElement": "ProductVariantImageSelectDialogComponent-gridElement-49",
- "icon": "ProductVariantImageSelectDialogComponent-icon-50",
- "iconChecked": "ProductVariantImageSelectDialogComponent-iconChecked-51",
- "root": "ProductVariantImageSelectDialogComponent-root-48",
+exports[`Storyshots Orders / OrderSummary payment input 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ net={
+ Object {
+ "amount": 6,
+ "currency": "USD",
+ }
}
- }
- images={
- Array [
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
+ onRowClick={[Function]}
+ paid={
Object {
- "alt": "Front",
- "id": "img1",
- "order": 1,
- "url": "placeholder255x255.png",
- },
+ "amount": 19.2,
+ "currency": "USD",
+ }
+ }
+ paymentStatus="input"
+ products={
+ Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
+ },
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ]
+ }
+ refunded={
Object {
- "alt": "Back",
- "id": "img2",
- "order": 4,
- "url": "placeholder255x255.png",
- },
+ "amount": 13.2,
+ "currency": "USD",
+ }
+ }
+ status="partially fulfilled"
+ subtotal={
Object {
- "alt": "Right side",
- "id": "img3",
- "order": 2,
- "url": "placeholder255x255.png",
- },
+ "amount": 160.2,
+ "currency": "USD",
+ }
+ }
+ total={
Object {
- "alt": "Left side",
- "id": "img4",
- "order": 3,
- "url": "placeholder255x255.png",
- },
+ "amount": 165.7,
+ "currency": "USD",
+ }
+ }
+ />,
+]
+`;
+
+exports[`Storyshots Orders / OrderSummary payment preauth 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ net={
Object {
- "alt": "Paper",
- "id": "img5",
- "order": 0,
- "url": "placeholder255x255.png",
- },
+ "amount": 6,
+ "currency": "USD",
+ }
+ }
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
+ onRowClick={[Function]}
+ paid={
Object {
- "alt": "Hard cover",
- "id": "img6",
- "order": 1,
- "url": "placeholder255x255.png",
- },
+ "amount": 19.2,
+ "currency": "USD",
+ }
+ }
+ paymentStatus="preauth"
+ products={
+ Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
+ },
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ]
+ }
+ refunded={
Object {
- "alt": "Extended version",
- "id": "img7",
- "order": 0,
- "url": "placeholder255x255.png",
- },
+ "amount": 13.2,
+ "currency": "USD",
+ }
+ }
+ status="partially fulfilled"
+ subtotal={
Object {
- "alt": "Cut version",
- "id": "img8",
- "order": 2,
- "url": "placeholder255x255.png",
- },
+ "amount": 160.2,
+ "currency": "USD",
+ }
+ }
+ total={
Object {
- "alt": "Soft cover",
- "id": "img9",
- "order": 2,
- "url": "placeholder255x255.png",
- },
- ]
- }
- open={true}
- selectedImages={
- Array [
+ "amount": 165.7,
+ "currency": "USD",
+ }
+ }
+ />,
+]
+`;
+
+exports[`Storyshots Orders / OrderSummary payment refunded 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ net={
Object {
- "id": "img1",
- },
+ "amount": 6,
+ "currency": "USD",
+ }
+ }
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
+ onRowClick={[Function]}
+ paid={
Object {
- "id": "img2",
- },
+ "amount": 19.2,
+ "currency": "USD",
+ }
+ }
+ paymentStatus="refunded"
+ products={
+ Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
+ },
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ]
+ }
+ refunded={
Object {
- "id": "img7",
- },
+ "amount": 13.2,
+ "currency": "USD",
+ }
+ }
+ status="partially fulfilled"
+ subtotal={
+ Object {
+ "amount": 160.2,
+ "currency": "USD",
+ }
+ }
+ total={
+ Object {
+ "amount": 165.7,
+ "currency": "USD",
+ }
+ }
+ />,
+]
+`;
+
+exports[`Storyshots Orders / OrderSummary payment rejected 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ net={
+ Object {
+ "amount": 6,
+ "currency": "USD",
+ }
+ }
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
+ onRowClick={[Function]}
+ paid={
+ Object {
+ "amount": 19.2,
+ "currency": "USD",
+ }
+ }
+ paymentStatus="rejected"
+ products={
+ Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
+ },
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ]
+ }
+ refunded={
+ Object {
+ "amount": 13.2,
+ "currency": "USD",
+ }
+ }
+ status="partially fulfilled"
+ subtotal={
+ Object {
+ "amount": 160.2,
+ "currency": "USD",
+ }
+ }
+ total={
+ Object {
+ "amount": 165.7,
+ "currency": "USD",
+ }
+ }
+ />,
+]
+`;
+
+exports[`Storyshots Orders / OrderSummary payment waiting 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ net={
+ Object {
+ "amount": 6,
+ "currency": "USD",
+ }
+ }
+ onCapture={[Function]}
+ onCreate={[Function]}
+ onFulfill={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onRefund={[Function]}
+ onRelease={[Function]}
+ onRowClick={[Function]}
+ paid={
+ Object {
+ "amount": 19.2,
+ "currency": "USD",
+ }
+ }
+ paymentStatus="waiting"
+ products={
+ Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
+ },
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ]
+ }
+ refunded={
+ Object {
+ "amount": 13.2,
+ "currency": "USD",
+ }
+ }
+ status="partially fulfilled"
+ subtotal={
+ Object {
+ "amount": 160.2,
+ "currency": "USD",
+ }
+ }
+ total={
+ Object {
+ "amount": 165.7,
+ "currency": "USD",
+ }
+ }
+ />,
+]
+`;
+
+exports[`Storyshots Orders / OrderSummary when loading data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component) />,
+]
+`;
+
+exports[`Storyshots Pages / PageBaseForm with 'created' property 1`] = `
+<Component
+ availableOn="2018-03-20T16:39:08.850105+00:00"
+ classes={
+ Object {
+ "addHelperTextPadding": "Component-addHelperTextPadding-23",
+ "cardActions": "Component-cardActions-24",
+ }
+ }
+ content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
+ created="2018-03-20T16:39:08.850105+00:00"
+ isVisible={true}
+ slug="lorem-ipsum-dolor"
+ title="Lorem ipsum"
+/>
+`;
+
+exports[`Storyshots Pages / PageBaseForm with 'errors' property 1`] = `
+<Component
+ availableOn="2018-03-20T16:39:08.850105+00:00"
+ classes={
+ Object {
+ "addHelperTextPadding": "Component-addHelperTextPadding-23",
+ "cardActions": "Component-cardActions-24",
+ }
+ }
+ content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
+ errors={
+ Array [
+ Object {
+ "field": "slug",
+ "message": "To pole jest wymagane.",
+ },
+ Object {
+ "field": "title",
+ "message": "To pole jest wymagane.",
+ },
+ Object {
+ "field": "content",
+ "message": "To pole jest wymagane.",
+ },
+ ]
+ }
+ isVisible={true}
+ slug="lorem-ipsum-dolor"
+ title="Lorem ipsum"
+/>
+`;
+
+exports[`Storyshots Pages / PageBaseForm with initial data 1`] = `
+<Component
+ availableOn="2018-03-20T16:39:08.850105+00:00"
+ classes={
+ Object {
+ "addHelperTextPadding": "Component-addHelperTextPadding-23",
+ "cardActions": "Component-cardActions-24",
+ }
+ }
+ content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin bibendum et justo sit amet viverra. Maecenas euismod auctor nisi et tincidunt. Maecenas ante urna, aliquet at odio sed, gravida efficitur purus. Morbi ut dapibus ante. Nulla eu neque sit amet odio tincidunt porttitor eu quis purus. Aliquam at diam sit amet turpis varius semper vitae non lectus. Vivamus lectus ligula, molestie eu augue eu, cursus tincidunt sem. Nam ornare egestas tincidunt."
+ isVisible={true}
+ slug="lorem-ipsum-dolor"
+ title="Lorem ipsum"
+/>
+`;
+
+exports[`Storyshots Pages / PageDeleteDialog default 1`] = `
+<Component
+ classes={
+ Object {
+ "deleteButton": "Component-deleteButton-25",
+ }
+ }
+ opened={true}
+>
+ <WithStyles(DialogContentText)>
+ Do you really want to delete this page?
+ </WithStyles(DialogContentText)>
+</Component>
+`;
+
+exports[`Storyshots Pages / PageFilters with initial data 1`] = `
+<FilterCard
+ handleClear={[Function]}
+>
+ <TextField
+ fullWidth={true}
+ label="Title"
+ name="title"
+ onChange={[Function]}
+ required={false}
+ select={false}
+ value="Initial title"
+ />
+ <WithStyles(Component) />
+ <TextField
+ fullWidth={true}
+ label="Url"
+ name="url"
+ onChange={[Function]}
+ required={false}
+ select={false}
+ value="initial-url"
+ />
+</FilterCard>
+`;
+
+exports[`Storyshots Pages / PageFilters without initial data 1`] = `
+<FilterCard
+ handleClear={[Function]}
+>
+ <TextField
+ fullWidth={true}
+ label="Title"
+ name="title"
+ onChange={[Function]}
+ required={false}
+ select={false}
+ value=""
+ />
+ <WithStyles(Component) />
+ <TextField
+ fullWidth={true}
+ label="Url"
+ name="url"
+ onChange={[Function]}
+ required={false}
+ select={false}
+ value=""
+ />
+</FilterCard>
+`;
+
+exports[`Storyshots Pages / PageList when loading data 1`] = `
+<Card
+ classes={
+ Object {
+ "root": "MuiCard-root-26",
+ }
+ }
+ raised={false}
+>
+ <WithStyles(Component)
+ handleNextPage={[Function]}
+ handlePreviousPage={[Function]}
+ onEditClick={[Function]}
+ onShowPageClick={[Function]}
+ pageInfo={
+ Object {
+ "endCursor": "YXJyYXljb25uZWN0aW9uOjE=",
+ "hasNextPage": false,
+ "hasPreviousPage": false,
+ "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
+ }
+ }
+ />
+</Card>
+`;
+
+exports[`Storyshots Pages / PageList with data 1`] = `
+<Card
+ classes={
+ Object {
+ "root": "MuiCard-root-26",
+ }
+ }
+ raised={false}
+>
+ <WithStyles(Component)
+ handleNextPage={[Function]}
+ handlePreviousPage={[Function]}
+ onEditClick={[Function]}
+ onShowPageClick={[Function]}
+ pageInfo={
+ Object {
+ "endCursor": "YXJyYXljb25uZWN0aW9uOjE=",
+ "hasNextPage": false,
+ "hasPreviousPage": false,
+ "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
+ }
+ }
+ pages={
+ Array [
+ Object {
+ "cursor": "YXJyYXljb25uZWN0aW9uOjA=",
+ "node": Object {
+ "id": "UGFnZTox",
+ "isVisible": true,
+ "slug": "about",
+ "title": "About",
+ },
+ },
+ Object {
+ "cursor": "YXJyYXljb25uZWN0aW9uOjE=",
+ "node": Object {
+ "id": "UGFnZToy",
+ "isVisible": false,
+ "slug": "terms-of-use",
+ "title": "Terms of use",
+ },
+ },
+ ]
+ }
+ />
+</Card>
+`;
+
+exports[`Storyshots Pages / PageList without data 1`] = `
+<Card
+ classes={
+ Object {
+ "root": "MuiCard-root-26",
+ }
+ }
+ raised={false}
+>
+ <WithStyles(Component)
+ handleNextPage={[Function]}
+ handlePreviousPage={[Function]}
+ onEditClick={[Function]}
+ onShowPageClick={[Function]}
+ pageInfo={
+ Object {
+ "endCursor": "YXJyYXljb25uZWN0aW9uOjE=",
+ "hasNextPage": false,
+ "hasPreviousPage": false,
+ "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
+ }
+ }
+ pages={Array []}
+ />
+</Card>
+`;
+
+exports[`Storyshots Products / ProductAttributesForm when data loaded 1`] = `
+<Component
+ attributes={
+ Array [
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZToz",
+ "name": "Brand",
+ "slug": "brand",
+ "values": Array [
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjQw",
+ "name": "dominikibrand",
+ "slug": "dominikibrand",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM5",
+ "name": "superbrand",
+ "slug": "superbrand",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM4",
+ "name": "Mirumee",
+ "slug": "mirumee",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjY=",
+ "name": "Saleor",
+ "slug": "saleor",
+ },
+ ],
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZToy",
+ "name": "Collar",
+ "slug": "collar",
+ "values": Array [
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjU=",
+ "name": "Polo",
+ "slug": "polo",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjQ=",
+ "name": "V-Neck",
+ "slug": "v-neck",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM=",
+ "name": "Round",
+ "slug": "round",
+ },
+ ],
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZTox",
+ "name": "Color",
+ "slug": "color",
+ "values": Array [
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI=",
+ "name": "White",
+ "slug": "white",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE=",
+ "name": "Blue",
+ "slug": "blue",
+ },
+ ],
+ },
+ ]
+ }
+ classes={Object {}}
+ onChange={[Function]}
+ productAttributes={
+ Array [
+ Object {
+ "name": "brand",
+ "value": "superbrand",
+ },
+ Object {
+ "name": "collar",
+ "value": "round",
+ },
+ Object {
+ "name": "color",
+ "value": "blue",
+ },
+ ]
+ }
+/>
+`;
+
+exports[`Storyshots Products / ProductAttributesForm when loading data 1`] = `
+<Component
+ classes={Object {}}
+ loading={true}
+ onChange={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductAvailabilityForm when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "root": "Component-root-27",
+ }
+ }
+ onChange={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductAvailabilityForm with loaded data 1`] = `
+<Component
+ available={true}
+ availableOn="04-10-2010"
+ classes={
+ Object {
+ "root": "Component-root-27",
+ }
+ }
+ onChange={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductCategoryAndCollectionsForm when data is loaded 1`] = `
+<Component
+ categories={
+ Array [
+ Object {
+ "label": "Lorem ipsum dolor",
+ "value": "123123",
+ },
+ Object {
+ "label": "Mauris vehicula tortor vulputate",
+ "value": "876752",
+ },
+ ]
+ }
+ category="876752"
+ classes={Object {}}
+ collections={
+ Array [
+ Object {
+ "label": "Winter collection",
+ "value": "1",
+ },
+ Object {
+ "label": "Emperor's choice",
+ "value": "2",
+ },
+ ]
+ }
+ onChange={[Function]}
+ productCollections={
+ Array [
+ "1",
+ ]
+ }
+/>
+`;
+
+exports[`Storyshots Products / ProductCategoryAndCollectionsForm while loading data 1`] = `
+<Component
+ classes={Object {}}
+ loading={true}
+ onChange={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductCollections when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "card": "Component-card-28",
+ "link": "Component-link-29",
+ }
+ }
+ onRowClick={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductCollections with collections 1`] = `
+<Component
+ classes={
+ Object {
+ "card": "Component-card-28",
+ "link": "Component-link-29",
+ }
+ }
+ collections={
+ Array [
+ Object {
+ "id": "collection-1",
+ "name": "Winter Collection",
+ },
+ Object {
+ "id": "collection-2",
+ "name": "Summer Collection",
+ },
+ ]
+ }
+ onRowClick={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductCollections with no collections 1`] = `
+<Component
+ classes={
+ Object {
+ "card": "Component-card-28",
+ "link": "Component-link-29",
+ }
+ }
+ collections={Array []}
+ onRowClick={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductDescription when loading data 1`] = `
+<WithStyles(Card)>
+ <WithStyles(Component)
+ onBack={[Function]}
+ >
+ <WithStyles(IconButton)
+ disabled={true}
+ onClick={[Function]}
+ >
+ <pure(Visibility) />
+ </WithStyles(IconButton)>
+ <WithStyles(IconButton)
+ disabled={true}
+ onClick={[Function]}
+ >
+ <pure(Edit) />
+ </WithStyles(IconButton)>
+ <WithStyles(IconButton)
+ disabled={true}
+ onClick={[Function]}
+ >
+ <pure(Delete) />
+ </WithStyles(IconButton)>
+ </WithStyles(Component)>
+ <WithStyles(CardContent)>
+ <WithStyles(Typography)>
+ <WithStyles(Component) />
+ </WithStyles(Typography)>
+ </WithStyles(CardContent)>
+</WithStyles(Card)>
+`;
+
+exports[`Storyshots Products / ProductDescription with description 1`] = `
+<WithStyles(Card)>
+ <WithStyles(Component)
+ onBack={[Function]}
+ title="Stewart-Barrera"
+ >
+ <WithStyles(IconButton)
+ disabled={false}
+ >
+ <pure(Visibility) />
+ </WithStyles(IconButton)>
+ <WithStyles(IconButton)
+ disabled={false}
+ >
+ <pure(Edit) />
+ </WithStyles(IconButton)>
+ <WithStyles(IconButton)
+ disabled={false}
+ >
+ <pure(Delete) />
+ </WithStyles(IconButton)>
+ </WithStyles(Component)>
+ <WithStyles(CardContent)>
+ <WithStyles(Typography)>
+ Light light office style present life military. Enough executive coach cause own.
+
+Care season wrong fly. Example age between discuss assume.
+
+Their third build might strong account. Worry enter room note level air.
+
+Weight director mother. Because find task with now enter tree management.
+
+Soon name recently ground green. There owner sport box them red information.
+ </WithStyles(Typography)>
+ </WithStyles(CardContent)>
+</WithStyles(Card)>
+`;
+
+exports[`Storyshots Products / ProductDescription with no description 1`] = `
+<WithStyles(Card)>
+ <WithStyles(Component)
+ onBack={[Function]}
+ title="Stewart-Barrera"
+ >
+ <WithStyles(IconButton)
+ disabled={false}
+ >
+ <pure(Visibility) />
+ </WithStyles(IconButton)>
+ <WithStyles(IconButton)
+ disabled={false}
+ >
+ <pure(Edit) />
+ </WithStyles(IconButton)>
+ <WithStyles(IconButton)
+ disabled={false}
+ >
+ <pure(Delete) />
+ </WithStyles(IconButton)>
+ </WithStyles(Component)>
+ <WithStyles(CardContent)>
+ <WithStyles(Typography)>
+ No description
+ </WithStyles(Typography)>
+ </WithStyles(CardContent)>
+</WithStyles(Card)>
+`;
+
+exports[`Storyshots Products / ProductDetailsForm when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "root": "Component-root-30",
+ }
+ }
+ loading={true}
+ onBack={[Function]}
+ onChange={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductDetailsForm with initial data 1`] = `
+<Component
+ classes={
+ Object {
+ "root": "Component-root-30",
+ }
+ }
+ currencySymbol="USD"
+ description="Aenean sit amet malesuada nibh. Proin nisi lorem, facilisis at tortor vel, convallis ornare nibh. In nec ipsum porta, varius leo eu, condimentum quam. Donec gravida euismod ipsum, at consequat orci efficitur nec. Phasellus lectus arcu, auctor eget porttitor eget, venenatis a lacus. Suspendisse quis urna rhoncus, commodo justo at, tempor nisl."
+ name="Our totally awesome book"
+ onBack={[Function]}
+ onChange={[Function]}
+ price="300"
+/>
+`;
+
+exports[`Storyshots Products / ProductDetailsForm with no initial data 1`] = `
+<Component
+ classes={
+ Object {
+ "root": "Component-root-30",
+ }
+ }
+ onBack={[Function]}
+ onChange={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductImagePage data loaded 1`] = `
+<Component
+ classes={
+ Object {
+ "image": "Component-image-33",
+ "root": "Component-root-32",
+ }
+ }
+ image="placeholder255x255.png"
+ onBack={[Function]}
+ onSubmit={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductImagePage loading 1`] = `
+<Component
+ classes={
+ Object {
+ "image": "Component-image-33",
+ "root": "Component-root-32",
+ }
+ }
+ loading={true}
+ onBack={[Function]}
+ onSubmit={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductImages when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "card": "Component-card-35",
+ "fileField": "Component-fileField-38",
+ "gridElement": "Component-gridElement-36",
+ "icon": "Component-icon-37",
+ "root": "Component-root-34",
+ }
+ }
+ onImageReorder={[Function]}
+ onImageUpload={[Function]}
+ placeholderImage="placeholder255x255.png"
+/>
+`;
+
+exports[`Storyshots Products / ProductImages with data 1`] = `
+<Component
+ classes={
+ Object {
+ "card": "Component-card-35",
+ "fileField": "Component-fileField-38",
+ "gridElement": "Component-gridElement-36",
+ "icon": "Component-icon-37",
+ "root": "Component-root-34",
+ }
+ }
+ images={
+ Array [
+ Object {
+ "alt": "",
+ "id": "UHJvZHVjdEltYWdlOjY2",
+ "order": 0,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "",
+ "id": "UHJvZHVjdEltYWdlOjY3",
+ "order": 1,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "",
+ "id": "UHJvZHVjdEltYWdlOjY4",
+ "order": 2,
+ "url": "placeholder255x255.png",
+ },
+ ]
+ }
+ onImageReorder={[Function]}
+ onImageUpload={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductImages without data 1`] = `
+<Component
+ classes={
+ Object {
+ "card": "Component-card-35",
+ "fileField": "Component-fileField-38",
+ "gridElement": "Component-gridElement-36",
+ "icon": "Component-icon-37",
+ "root": "Component-root-34",
+ }
+ }
+ images={Array []}
+ onImageReorder={[Function]}
+ onImageUpload={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductPriceAndAvailability when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "greenText": "Component-greenText-39",
+ "leftCell": "Component-leftCell-40",
+ "redText": "Component-redText-41",
+ "rightCell": "Component-rightCell-42",
+ }
+ }
+ onPublish={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductPriceAndAvailability when product is available 1`] = `
+<Component
+ classes={
+ Object {
+ "greenText": "Component-greenText-39",
+ "leftCell": "Component-leftCell-40",
+ "redText": "Component-redText-41",
+ "rightCell": "Component-rightCell-42",
+ }
+ }
+ grossMargin={
+ Object {
+ "start": 56,
+ "stop": 98,
+ }
+ }
+ isAvailable={true}
+ onPublish={[Function]}
+ purchaseCost={
+ Object {
+ "start": "1,88 USD",
+ "stop": "48,10 USD",
+ }
+ }
+ salePrice={
+ Object {
+ "start": "55,14 USD",
+ "stop": "88,36 USD",
+ }
+ }
+/>
+`;
+
+exports[`Storyshots Products / ProductPriceAndAvailability when product is not available 1`] = `
+<Component
+ classes={
+ Object {
+ "greenText": "Component-greenText-39",
+ "leftCell": "Component-leftCell-40",
+ "redText": "Component-redText-41",
+ "rightCell": "Component-rightCell-42",
+ }
+ }
+ grossMargin={
+ Object {
+ "start": 56,
+ "stop": 98,
+ }
+ }
+ isAvailable={false}
+ onPublish={[Function]}
+ purchaseCost={
+ Object {
+ "start": "1,88 USD",
+ "stop": "48,10 USD",
+ }
+ }
+ salePrice={
+ Object {
+ "start": "55,14 USD",
+ "stop": "88,36 USD",
+ }
+ }
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantAttributes when loaded data 1`] = `
+<Component
+ attributes={
+ Array [
+ Object {
+ "attribute": Object {
+ "name": "Cover",
+ "slug": "cover",
+ "values": Array [
+ "hard",
+ "soft",
+ ],
+ },
+ "value": "hard",
+ },
+ Object {
+ "attribute": Object {
+ "name": "Version",
+ "slug": "version",
+ "values": Array [
+ "regular",
+ "extended",
+ ],
+ },
+ "value": "extended",
+ },
+ ]
+ }
+ classes={
+ Object {
+ "grid": "Component-grid-46",
+ }
+ }
+ onChange={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantAttributes when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "grid": "Component-grid-46",
+ }
+ }
+ loading={true}
+ onChange={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantDeleteDialog default 1`] = `
+<Component
+ classes={
+ Object {
+ "deleteButton": "Component-deleteButton-47",
+ }
+ }
+ name="Extended Hard"
+ open={true}
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantImageSelectDialog default 1`] = `
+<ProductVariantImageSelectDialogComponent
+ classes={
+ Object {
+ "gridElement": "ProductVariantImageSelectDialogComponent-gridElement-49",
+ "icon": "ProductVariantImageSelectDialogComponent-icon-50",
+ "iconChecked": "ProductVariantImageSelectDialogComponent-iconChecked-51",
+ "root": "ProductVariantImageSelectDialogComponent-root-48",
+ }
+ }
+ images={
+ Array [
+ Object {
+ "alt": "Front",
+ "id": "img1",
+ "order": 1,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Back",
+ "id": "img2",
+ "order": 4,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Right side",
+ "id": "img3",
+ "order": 2,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Left side",
+ "id": "img4",
+ "order": 3,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Paper",
+ "id": "img5",
+ "order": 0,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Hard cover",
+ "id": "img6",
+ "order": 1,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Extended version",
+ "id": "img7",
+ "order": 0,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Cut version",
+ "id": "img8",
+ "order": 2,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Soft cover",
+ "id": "img9",
+ "order": 2,
+ "url": "placeholder255x255.png",
+ },
+ ]
+ }
+ open={true}
+ selectedImages={
+ Array [
+ Object {
+ "id": "img1",
+ },
+ Object {
+ "id": "img2",
+ },
+ Object {
+ "id": "img7",
+ },
+ Object {
+ "id": "img8",
+ },
+ ]
+ }
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantImages when loaded data 1`] = `
+<Component
+ classes={
+ Object {
+ "card": "Component-card-53",
+ "gridElement": "Component-gridElement-54",
+ "root": "Component-root-52",
+ }
+ }
+ images={
+ Array [
+ Object {
+ "alt": "Front",
+ "id": "img1",
+ "order": 1,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Back",
+ "id": "img2",
+ "order": 4,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Right side",
+ "id": "img3",
+ "order": 2,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Left side",
+ "id": "img4",
+ "order": 3,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Paper",
+ "id": "img5",
+ "order": 0,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Hard cover",
+ "id": "img6",
+ "order": 1,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Extended version",
+ "id": "img7",
+ "order": 0,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Cut version",
+ "id": "img8",
+ "order": 2,
+ "url": "placeholder255x255.png",
+ },
+ Object {
+ "alt": "Soft cover",
+ "id": "img9",
+ "order": 2,
+ "url": "placeholder255x255.png",
+ },
+ ]
+ }
+ onImageAdd={[Function]}
+ placeholderImage="placeholder255x255.png"
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantImages when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "card": "Component-card-53",
+ "gridElement": "Component-gridElement-54",
+ "root": "Component-root-52",
+ }
+ }
+ loading={true}
+ onImageAdd={[Function]}
+ placeholderImage="placeholder255x255.png"
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantNavigation when loaded data 1`] = `
+<Component
+ classes={
+ Object {
+ "card": "Component-card-55",
+ "link": "Component-link-56",
+ }
+ }
+ variants={
+ Array [
+ Object {
+ "id": "var2",
+ "name": "Extended Soft",
+ },
+ Object {
+ "id": "var3",
+ "name": "Normal Hard",
+ },
+ Object {
+ "id": "var4",
+ "name": "Normal Soft",
+ },
+ ]
+ }
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantNavigation when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "card": "Component-card-55",
+ "link": "Component-link-56",
+ }
+ }
+ loading={true}
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantNavigation with clickable rows 1`] = `
+<Component
+ classes={
+ Object {
+ "card": "Component-card-55",
+ "link": "Component-link-56",
+ }
+ }
+ onRowClick={[Function]}
+ variants={
+ Array [
+ Object {
+ "id": "var2",
+ "name": "Extended Soft",
+ },
+ Object {
+ "id": "var3",
+ "name": "Normal Hard",
+ },
+ Object {
+ "id": "var4",
+ "name": "Normal Soft",
+ },
+ ]
+ }
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantPrice when loaded data 1`] = `
+<Component
+ classes={
+ Object {
+ "grid": "Component-grid-59",
+ "root": "Component-root-58",
+ }
+ }
+ costPrice={100}
+ currencySymbol="USD"
+ onChange={[Function]}
+ priceOverride={100}
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantPrice when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "grid": "Component-grid-59",
+ "root": "Component-root-58",
+ }
+ }
+ loading={true}
+ onChange={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantProduct when loaded data 1`] = `
+<Component
+ classes={
+ Object {
+ "root": "Component-root-60",
+ }
+ }
+ product={
+ Object {
+ "id": "prod1",
+ "images": Object {
+ "edges": Array [
+ Object {
+ "node": Object {
+ "alt": "Front",
+ "id": "img1",
+ "order": 1,
+ "url": "placeholder60x60.png",
+ },
+ },
+ Object {
+ "node": Object {
+ "alt": "Back",
+ "id": "img2",
+ "order": 4,
+ "url": "placeholder60x60.png",
+ },
+ },
+ Object {
+ "node": Object {
+ "alt": "Right side",
+ "id": "img3",
+ "order": 2,
+ "url": "placeholder60x60.png",
+ },
+ },
+ Object {
+ "node": Object {
+ "alt": "Left side",
+ "id": "img4",
+ "order": 3,
+ "url": "placeholder60x60.png",
+ },
+ },
+ Object {
+ "node": Object {
+ "alt": "Paper",
+ "id": "img5",
+ "order": 0,
+ "url": "placeholder60x60.png",
+ },
+ },
+ Object {
+ "node": Object {
+ "alt": "Hard cover",
+ "id": "img6",
+ "order": 1,
+ "url": "placeholder60x60.png",
+ },
+ },
+ Object {
+ "node": Object {
+ "alt": "Extended version",
+ "id": "img7",
+ "order": 0,
+ "url": "placeholder60x60.png",
+ },
+ },
+ Object {
+ "node": Object {
+ "alt": "Cut version",
+ "id": "img8",
+ "order": 2,
+ "url": "placeholder60x60.png",
+ },
+ },
+ Object {
+ "node": Object {
+ "alt": "Soft cover",
+ "id": "img9",
+ "order": 2,
+ "url": "placeholder60x60.png",
+ },
+ },
+ ],
+ },
+ "name": "Our Awesome Book",
+ "thumbnailUrl": "placeholder60x60.png",
+ "variants": Object {
+ "edges": Array [
+ Object {
+ "node": Object {
+ "id": "var2",
+ "name": "Extended Soft",
+ },
+ },
+ Object {
+ "node": Object {
+ "id": "var3",
+ "name": "Normal Hard",
+ },
+ },
+ Object {
+ "node": Object {
+ "id": "var4",
+ "name": "Normal Soft",
+ },
+ },
+ ],
+ "totalCount": 11,
+ },
+ }
+ }
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantProduct when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "root": "Component-root-60",
+ }
+ }
+ loading={true}
+ placeholderImage="placeholder60x60.png"
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantStock when loaded data 1`] = `
+<Component
+ classes={
+ Object {
+ "grid": "Component-grid-62",
+ "root": "Component-root-61",
+ }
+ }
+ onChange={[Function]}
+ sku="1230959124123"
+ stock={49}
+ stockAllocated={12}
+/>
+`;
+
+exports[`Storyshots Products / ProductVariantStock when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "grid": "Component-grid-62",
+ "root": "Component-root-61",
+ }
+ }
+ loading={true}
+ onChange={[Function]}
+/>
+`;
+
+exports[`Storyshots Products / ProductVariants when loading data 1`] = `
+<Component
+ classes={
+ Object {
+ "alignRightText": "Component-alignRightText-63",
+ "greenDot": "Component-greenDot-64",
+ "link": "Component-link-65",
+ "redDot": "Component-redDot-66",
+ }
+ }
+/>
+`;
+
+exports[`Storyshots Products / ProductVariants when product has no variants 1`] = `
+<Component
+ classes={
+ Object {
+ "alignRightText": "Component-alignRightText-63",
+ "greenDot": "Component-greenDot-64",
+ "link": "Component-link-65",
+ "redDot": "Component-redDot-66",
+ }
+ }
+ variants={Array []}
+/>
+`;
+
+exports[`Storyshots Products / ProductVariants when product has variants 1`] = `
+<Component
+ classes={
+ Object {
+ "alignRightText": "Component-alignRightText-63",
+ "greenDot": "Component-greenDot-64",
+ "link": "Component-link-65",
+ "redDot": "Component-redDot-66",
+ }
+ }
+ fallbackGross="80%"
+ fallbackPrice="90.00 USD"
+ variants={
+ Array [
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6Nw==",
+ "margin": 20,
+ "name": "XXL",
+ "priceOverride": null,
+ "sku": "2-1337",
+ "stockQuantity": 5,
+ },
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6OA==",
+ "margin": 20,
+ "name": "XL",
+ "priceOverride": null,
+ "sku": "2-1338",
+ "stockQuantity": 0,
+ },
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6OQ==",
+ "margin": 20,
+ "name": "L",
+ "priceOverride": null,
+ "sku": "2-1339",
+ "stockQuantity": 15,
+ },
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6MTA=",
+ "margin": 20,
+ "name": "M",
+ "priceOverride": null,
+ "sku": "2-1340",
+ "stockQuantity": 33,
+ },
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6MTE=",
+ "margin": 20,
+ "name": "S",
+ "priceOverride": null,
+ "sku": "2-1341",
+ "stockQuantity": 0,
+ },
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6MTI=",
+ "margin": 20,
+ "name": "XS",
+ "priceOverride": null,
+ "sku": "2-1342",
+ "stockQuantity": 0,
+ },
+ ]
+ }
+/>
+`;
+
+exports[`Storyshots Products / ProductVariants with clickable rows 1`] = `
+<Component
+ classes={
+ Object {
+ "alignRightText": "Component-alignRightText-63",
+ "greenDot": "Component-greenDot-64",
+ "link": "Component-link-65",
+ "redDot": "Component-redDot-66",
+ }
+ }
+ fallbackGross="80%"
+ fallbackPrice="90.00 USD"
+ onRowClick={[Function]}
+ variants={
+ Array [
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6Nw==",
+ "margin": 20,
+ "name": "XXL",
+ "priceOverride": null,
+ "sku": "2-1337",
+ "stockQuantity": 5,
+ },
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6OA==",
+ "margin": 20,
+ "name": "XL",
+ "priceOverride": null,
+ "sku": "2-1338",
+ "stockQuantity": 0,
+ },
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6OQ==",
+ "margin": 20,
+ "name": "L",
+ "priceOverride": null,
+ "sku": "2-1339",
+ "stockQuantity": 15,
+ },
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6MTA=",
+ "margin": 20,
+ "name": "M",
+ "priceOverride": null,
+ "sku": "2-1340",
+ "stockQuantity": 33,
+ },
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6MTE=",
+ "margin": 20,
+ "name": "S",
+ "priceOverride": null,
+ "sku": "2-1341",
+ "stockQuantity": 0,
+ },
+ Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6MTI=",
+ "margin": 20,
+ "name": "XS",
+ "priceOverride": null,
+ "sku": "2-1342",
+ "stockQuantity": 0,
+ },
+ ]
+ }
+/>
+`;
+
+exports[`Storyshots Views / Orders / Order details as a draft 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(OrderDetailsPageComponent)
+ countries={
+ Array [
+ Object {
+ "code": "AF",
+ "label": "Afghanistan",
+ },
+ Object {
+ "code": "AX",
+ "label": "Åland Islands",
+ },
+ Object {
+ "code": "AL",
+ "label": "Albania",
+ },
+ Object {
+ "code": "DZ",
+ "label": "Algeria",
+ },
+ Object {
+ "code": "AS",
+ "label": "American Samoa",
+ },
+ ]
+ }
+ fetchShippingMethods={[Function]}
+ fetchUsers={[Function]}
+ fetchVariants={[Function]}
+ onBack={[Function]}
+ onCreate={[Function]}
+ onCustomerEmailClick={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onPackingSlipClick={[Function]}
+ onPaymentRelease={[Function]}
+ onPrintClick={[Function]}
+ onProductClick={[Function]}
+ order={
+ Object {
+ "billingAddress": Object {
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a1",
+ "lastName": "Client",
+ "phone": Object {
+ "number": "",
+ "prefix": "",
+ },
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
+ },
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c1",
+ "name": "Test Client",
+ },
+ "created": "2018-04-07T11:18:19+00:00",
+ "events": Array [
+ Object {
+ "content": "Created order",
+ "date": "2018-04-07T11:18:19+00:00",
+ "id": "n1",
+ "type": "created",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Received payment",
+ "date": "2018-04-07T11:33:19+00:00",
+ "id": "n1",
+ "params": Object {
+ "amount": 165.7,
+ "currency": "USD",
+ },
+ "type": "payment",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Shipped order",
+ "date": "2018-04-07T13:31:19+00:00",
+ "id": "n3",
+ "params": Object {
+ "shippingAddress": "Test Client<br />9297 Barker Extension<br />95393-6818 Keithport<br />Cyprus",
+ },
+ "type": "shipped",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur arcu nisi, dignissim non placerat id, varius imperdiet nisi. Duis lobortis, massa sed feugiat ultricies, massa felis commodo dui, tempor tempus tellus ligula id arcu. Nam erat dui, fermentum sed dui a, tincidunt molestie magna.",
+ "date": "2018-04-08T11:18:19+00:00",
+ "id": "n4",
+ "type": "note",
+ "user": "[email protected]",
+ },
+ ],
+ "fulfillments": Array [
+ Object {
+ "id": "f1",
+ "products": Array [
+ Object {
+ "product": Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ "quantity": 1,
+ },
+ Object {
+ "product": Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ "quantity": 1,
+ },
+ ],
+ "status": "fulfilled",
+ "trackingCode": "012391230412131239052",
+ },
+ Object {
+ "id": "f2",
+ "products": Array [
+ Object {
+ "product": Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ "quantity": 1,
+ },
+ ],
+ "status": "cancelled",
+ "trackingCode": "012391230412131239052",
+ },
+ ],
+ "id": "o1",
+ "number": 11,
+ "payment": Object {
+ "net": Object {
+ "amount": 6,
+ "currency": "USD",
+ },
+ "paid": Object {
+ "amount": 19.2,
+ "currency": "USD",
+ },
+ "refunded": Object {
+ "amount": 13.2,
+ "currency": "USD",
+ },
+ },
+ "paymentStatus": "confirmed",
+ "price": Object {
+ "amount": 19.2,
+ "currency": "USD",
+ },
+ "products": Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
+ },
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ],
+ "shippingAddress": Object {
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a1",
+ "lastName": "Client",
+ "phone": Object {
+ "number": "",
+ "prefix": "",
+ },
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
+ },
+ "shippingMethod": Object {
+ "id": "s1",
+ },
+ "shippingMethodName": "DHL",
+ "shippingMethodPriceGross": Object {
+ "amount": 5.5,
+ "currency": "USD",
+ },
+ "status": "draft",
+ "subtotal": Object {
+ "amount": 160.2,
+ "currency": "USD",
+ },
+ "total": Object {
+ "amount": 165.7,
+ "currency": "USD",
+ },
+ "unfulfilled": Array [
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "quantity": 1,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ],
+ }
+ }
+ prefixes={
+ Array [
+ "01",
+ "02",
+ "41",
+ "49",
+ ]
+ }
+ shippingMethods={
+ Array [
+ Object {
+ "country": "whole world",
+ "id": "s1",
+ "name": "DHL",
+ "price": Object {},
+ },
+ Object {
+ "country": "Afghanistan",
+ "id": "s2",
+ "name": "UPS",
+ },
+ ]
+ }
+ users={
+ Array [
+ Object {
+ "email": "[email protected]",
+ "id": "c1",
+ },
+ Object {
+ "email": "[email protected]",
+ "id": "c2",
+ },
+ Object {
+ "email": "[email protected]",
+ "id": "c3",
+ },
+ Object {
+ "email": "[email protected]",
+ "id": "c4",
+ },
+ ]
+ }
+ variants={
+ Array [
+ Object {
+ "id": "p1",
+ "name": "Product 1: variant 1",
+ "sku": "12345",
+ "stockAllocated": 3,
+ },
+ Object {
+ "id": "p2",
+ "name": "Product 1: variant 2",
+ "sku": "12346",
+ "stockAllocated": 1,
+ },
+ Object {
+ "id": "p3",
+ "name": "Product 2: variant 1",
+ "sku": "12355",
+ "stockAllocated": 10,
+ },
+ Object {
+ "id": "p4",
+ "name": "Product 3: variant 1",
+ "sku": "12445",
+ "stockAllocated": 12,
+ },
+ Object {
+ "id": "p5",
+ "name": "Product 3: variant 2",
+ "sku": "12545",
+ "stockAllocated": 7,
+ },
+ Object {
+ "id": "p6",
+ "name": "Product 5: variant 1",
+ "sku": "13345",
+ "stockAllocated": 3,
+ },
+ Object {
+ "id": "p7",
+ "name": "Product 5: variant 2",
+ "sku": "14345",
+ "stockAllocated": 11,
+ },
+ ]
+ }
+ variantsLoading={false}
+ />,
+]
+`;
+
+exports[`Storyshots Views / Orders / Order details as a unpaid order 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(OrderDetailsPageComponent)
+ countries={
+ Array [
+ Object {
+ "code": "AF",
+ "label": "Afghanistan",
+ },
+ Object {
+ "code": "AX",
+ "label": "Åland Islands",
+ },
+ Object {
+ "code": "AL",
+ "label": "Albania",
+ },
+ Object {
+ "code": "DZ",
+ "label": "Algeria",
+ },
+ Object {
+ "code": "AS",
+ "label": "American Samoa",
+ },
+ ]
+ }
+ fetchShippingMethods={[Function]}
+ fetchUsers={[Function]}
+ fetchVariants={[Function]}
+ onBack={[Function]}
+ onCreate={[Function]}
+ onCustomerEmailClick={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onPackingSlipClick={[Function]}
+ onPaymentRelease={[Function]}
+ onPrintClick={[Function]}
+ onProductClick={[Function]}
+ order={
+ Object {
+ "billingAddress": Object {
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a1",
+ "lastName": "Client",
+ "phone": Object {
+ "number": "",
+ "prefix": "",
+ },
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
+ },
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c1",
+ "name": "Test Client",
+ },
+ "created": "2018-04-07T11:18:19+00:00",
+ "events": Array [
+ Object {
+ "content": "Created order",
+ "date": "2018-04-07T11:18:19+00:00",
+ "id": "n1",
+ "type": "created",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Received payment",
+ "date": "2018-04-07T11:33:19+00:00",
+ "id": "n1",
+ "params": Object {
+ "amount": 165.7,
+ "currency": "USD",
+ },
+ "type": "payment",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Shipped order",
+ "date": "2018-04-07T13:31:19+00:00",
+ "id": "n3",
+ "params": Object {
+ "shippingAddress": "Test Client<br />9297 Barker Extension<br />95393-6818 Keithport<br />Cyprus",
+ },
+ "type": "shipped",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur arcu nisi, dignissim non placerat id, varius imperdiet nisi. Duis lobortis, massa sed feugiat ultricies, massa felis commodo dui, tempor tempus tellus ligula id arcu. Nam erat dui, fermentum sed dui a, tincidunt molestie magna.",
+ "date": "2018-04-08T11:18:19+00:00",
+ "id": "n4",
+ "type": "note",
+ "user": "[email protected]",
+ },
+ ],
+ "fulfillments": Array [
+ Object {
+ "id": "f1",
+ "products": Array [
+ Object {
+ "product": Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ "quantity": 1,
+ },
+ Object {
+ "product": Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ "quantity": 1,
+ },
+ ],
+ "status": "fulfilled",
+ "trackingCode": "012391230412131239052",
+ },
+ Object {
+ "id": "f2",
+ "products": Array [
+ Object {
+ "product": Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ "quantity": 1,
+ },
+ ],
+ "status": "cancelled",
+ "trackingCode": "012391230412131239052",
+ },
+ ],
+ "id": "o1",
+ "number": 11,
+ "payment": Object {
+ "net": Object {
+ "amount": 6,
+ "currency": "USD",
+ },
+ "paid": Object {
+ "amount": 19.2,
+ "currency": "USD",
+ },
+ "refunded": Object {
+ "amount": 13.2,
+ "currency": "USD",
+ },
+ },
+ "paymentStatus": "preauth",
+ "price": Object {
+ "amount": 19.2,
+ "currency": "USD",
+ },
+ "products": Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
+ },
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ],
+ "shippingAddress": Object {
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a1",
+ "lastName": "Client",
+ "phone": Object {
+ "number": "",
+ "prefix": "",
+ },
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
+ },
+ "shippingMethod": Object {
+ "id": "s1",
+ },
+ "shippingMethodName": "DHL",
+ "shippingMethodPriceGross": Object {
+ "amount": 5.5,
+ "currency": "USD",
+ },
+ "status": "partially fulfilled",
+ "subtotal": Object {
+ "amount": 160.2,
+ "currency": "USD",
+ },
+ "total": Object {
+ "amount": 165.7,
+ "currency": "USD",
+ },
+ "unfulfilled": Array [
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "quantity": 1,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ],
+ }
+ }
+ prefixes={
+ Array [
+ "01",
+ "02",
+ "41",
+ "49",
+ ]
+ }
+ shippingMethods={
+ Array [
+ Object {
+ "country": "whole world",
+ "id": "s1",
+ "name": "DHL",
+ "price": Object {},
+ },
+ Object {
+ "country": "Afghanistan",
+ "id": "s2",
+ "name": "UPS",
+ },
+ ]
+ }
+ users={
+ Array [
+ Object {
+ "email": "[email protected]",
+ "id": "c1",
+ },
+ Object {
+ "email": "[email protected]",
+ "id": "c2",
+ },
+ Object {
+ "email": "[email protected]",
+ "id": "c3",
+ },
+ Object {
+ "email": "[email protected]",
+ "id": "c4",
+ },
+ ]
+ }
+ variants={
+ Array [
+ Object {
+ "id": "p1",
+ "name": "Product 1: variant 1",
+ "sku": "12345",
+ "stockAllocated": 3,
+ },
+ Object {
+ "id": "p2",
+ "name": "Product 1: variant 2",
+ "sku": "12346",
+ "stockAllocated": 1,
+ },
+ Object {
+ "id": "p3",
+ "name": "Product 2: variant 1",
+ "sku": "12355",
+ "stockAllocated": 10,
+ },
+ Object {
+ "id": "p4",
+ "name": "Product 3: variant 1",
+ "sku": "12445",
+ "stockAllocated": 12,
+ },
+ Object {
+ "id": "p5",
+ "name": "Product 3: variant 2",
+ "sku": "12545",
+ "stockAllocated": 7,
+ },
+ Object {
+ "id": "p6",
+ "name": "Product 5: variant 1",
+ "sku": "13345",
+ "stockAllocated": 3,
+ },
+ Object {
+ "id": "p7",
+ "name": "Product 5: variant 2",
+ "sku": "14345",
+ "stockAllocated": 11,
+ },
+ ]
+ }
+ variantsLoading={false}
+ />,
+]
+`;
+
+exports[`Storyshots Views / Orders / Order details when loaded data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(OrderDetailsPageComponent)
+ countries={
+ Array [
+ Object {
+ "code": "AF",
+ "label": "Afghanistan",
+ },
+ Object {
+ "code": "AX",
+ "label": "Åland Islands",
+ },
+ Object {
+ "code": "AL",
+ "label": "Albania",
+ },
+ Object {
+ "code": "DZ",
+ "label": "Algeria",
+ },
+ Object {
+ "code": "AS",
+ "label": "American Samoa",
+ },
+ ]
+ }
+ onBack={[Function]}
+ onCreate={[Function]}
+ onCustomerEmailClick={[Function]}
+ onOrderCancel={[Function]}
+ onOrderLineChange={[Function]}
+ onOrderLineRemove={[Function]}
+ onPackingSlipClick={[Function]}
+ onPaymentRelease={[Function]}
+ onPrintClick={[Function]}
+ onProductClick={[Function]}
+ order={
+ Object {
+ "billingAddress": Object {
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a1",
+ "lastName": "Client",
+ "phone": Object {
+ "number": "",
+ "prefix": "",
+ },
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
+ },
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c1",
+ "name": "Test Client",
+ },
+ "created": "2018-04-07T11:18:19+00:00",
+ "events": Array [
+ Object {
+ "content": "Created order",
+ "date": "2018-04-07T11:18:19+00:00",
+ "id": "n1",
+ "type": "created",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Received payment",
+ "date": "2018-04-07T11:33:19+00:00",
+ "id": "n1",
+ "params": Object {
+ "amount": 165.7,
+ "currency": "USD",
+ },
+ "type": "payment",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Shipped order",
+ "date": "2018-04-07T13:31:19+00:00",
+ "id": "n3",
+ "params": Object {
+ "shippingAddress": "Test Client<br />9297 Barker Extension<br />95393-6818 Keithport<br />Cyprus",
+ },
+ "type": "shipped",
+ "user": "[email protected]",
+ },
+ Object {
+ "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur arcu nisi, dignissim non placerat id, varius imperdiet nisi. Duis lobortis, massa sed feugiat ultricies, massa felis commodo dui, tempor tempus tellus ligula id arcu. Nam erat dui, fermentum sed dui a, tincidunt molestie magna.",
+ "date": "2018-04-08T11:18:19+00:00",
+ "id": "n4",
+ "type": "note",
+ "user": "[email protected]",
+ },
+ ],
+ "fulfillments": Array [
+ Object {
+ "id": "f1",
+ "products": Array [
+ Object {
+ "product": Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ "quantity": 1,
+ },
+ Object {
+ "product": Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ "quantity": 1,
+ },
+ ],
+ "status": "fulfilled",
+ "trackingCode": "012391230412131239052",
+ },
+ Object {
+ "id": "f2",
+ "products": Array [
+ Object {
+ "product": Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ "quantity": 1,
+ },
+ ],
+ "status": "cancelled",
+ "trackingCode": "012391230412131239052",
+ },
+ ],
+ "id": "o1",
+ "number": 11,
+ "payment": Object {
+ "net": Object {
+ "amount": 6,
+ "currency": "USD",
+ },
+ "paid": Object {
+ "amount": 19.2,
+ "currency": "USD",
+ },
+ "refunded": Object {
+ "amount": 13.2,
+ "currency": "USD",
+ },
+ },
+ "paymentStatus": "confirmed",
+ "price": Object {
+ "amount": 19.2,
+ "currency": "USD",
+ },
+ "products": Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 12.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 1,
+ "sku": "9123021",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "price": Object {
+ "gross": Object {
+ "amount": 11.6,
+ "currency": "USD",
+ },
+ },
+ "quantity": 2,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 22.4,
+ "currency": "USD",
+ },
+ },
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "price": Object {
+ "gross": Object {
+ "amount": 9.9,
+ "currency": "USD",
+ },
+ },
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ],
+ "shippingAddress": Object {
+ "city": "Keithport",
+ "cityArea": "",
+ "companyName": "",
+ "country": "Cyprus",
+ "countryArea": "",
+ "firstName": "Test",
+ "id": "a1",
+ "lastName": "Client",
+ "phone": Object {
+ "number": "",
+ "prefix": "",
+ },
+ "postalCode": "95393-6818",
+ "streetAddress_1": "9297 Barker Extension",
+ "streetAddress_2": "",
+ },
+ "shippingMethod": Object {
+ "id": "s1",
+ },
+ "shippingMethodName": "DHL",
+ "shippingMethodPriceGross": Object {
+ "amount": 5.5,
+ "currency": "USD",
+ },
+ "status": "partially fulfilled",
+ "subtotal": Object {
+ "amount": 160.2,
+ "currency": "USD",
+ },
+ "total": Object {
+ "amount": 165.7,
+ "currency": "USD",
+ },
+ "unfulfilled": Array [
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner and Graham",
+ "quantity": 1,
+ "sku": "9123022",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner and King",
+ "quantity": 7,
+ "sku": "9123023",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Graham and King",
+ "quantity": 3,
+ "sku": "9123024",
+ "thumbnailUrl": "placeholder60x60.png",
+ },
+ ],
+ }
+ }
+ prefixes={
+ Array [
+ "01",
+ "02",
+ "41",
+ "49",
+ ]
+ }
+ />,
+]
+`;
+
+exports[`Storyshots Views / Orders / Order details when loading data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(OrderDetailsPageComponent)
+ onBack={[Function]}
+ />,
+]
+`;
+
+exports[`Storyshots Views / Orders / Order list when loaded data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ onBack={[Function]}
+ onRowClick={[Function]}
+ />,
+]
+`;
+
+exports[`Storyshots Views / Orders / Order list when loading data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ onBack={[Function]}
+ onRowClick={[Function]}
+ orders={
+ Object {
+ "edges": Array [
+ Object {
+ "node": Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c1",
+ },
+ "created": "2018-04-07T11:18:19+00:00",
+ "id": "o1",
+ "number": 11,
+ "paymentStatus": "confirmed",
+ "price": Object {
+ "amount": 19.2,
+ "currency": "USD",
+ },
+ "status": "fulfilled",
+ },
+ },
+ Object {
+ "node": Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c1",
+ },
+ "created": "2018-04-07T11:11:19+00:00",
+ "id": "o2",
+ "number": 10,
+ "paymentStatus": "confirmed",
+ "price": Object {
+ "amount": 28.9,
+ "currency": "USD",
+ },
+ "status": "unfulfilled",
+ },
+ },
+ Object {
+ "node": Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c2",
+ },
+ "created": "2018-04-07T10:44:44+00:00",
+ "id": "o3",
+ "number": 9,
+ "paymentStatus": "rejected",
+ "price": Object {
+ "amount": 289,
+ "currency": "USD",
+ },
+ "status": "shipped",
+ },
+ },
+ Object {
+ "node": Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c3",
+ },
+ "created": "2018-04-07T10:33:19+00:00",
+ "id": "o4",
+ "number": 9,
+ "paymentStatus": "unknown",
+ "price": Object {
+ "amount": 100.05,
+ "currency": "USD",
+ },
+ "status": "shipped",
+ },
+ },
+ Object {
+ "node": Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c4",
+ },
+ "created": "2018-04-07T07:39:19+00:00",
+ "id": "o5",
+ "number": 9,
+ "paymentStatus": "waiting",
+ "price": Object {
+ "amount": 14.87,
+ "currency": "USD",
+ },
+ "status": "shipped",
+ },
+ },
+ Object {
+ "node": Object {
+ "client": Object {
+ "email": "[email protected]",
+ "id": "c4",
+ },
+ "created": "2018-04-06T19:18:19+00:00",
+ "id": "o6",
+ "number": 8,
+ "paymentStatus": "rejected",
+ "price": Object {
+ "amount": 14.87,
+ "currency": "USD",
+ },
+ "status": "unfulfilled",
+ },
+ },
+ ],
+ }
+ }
+ />,
+]
+`;
+
+exports[`Storyshots Views / Orders / Order list when no data 1`] = `
+Array [
+ <WithStyles(CssBaseline) />,
+ <WithStyles(Component)
+ onBack={[Function]}
+ onRowClick={[Function]}
+ orders={
Object {
- "id": "img8",
- },
- ]
- }
-/>
+ "edges": Array [],
+ }
+ }
+ />,
+]
`;
-exports[`Storyshots Products / ProductVariantImages when loaded data 1`] = `
+exports[`Storyshots Views / Products / Product details when loaded data 1`] = `
<Component
classes={
Object {
- "card": "Component-card-53",
- "gridElement": "Component-gridElement-54",
- "root": "Component-root-52",
+ "root": "Component-root-31",
}
}
- images={
- Array [
- Object {
- "alt": "Front",
- "id": "img1",
- "order": 1,
- "url": "placeholder255x255.png",
- },
- Object {
- "alt": "Back",
- "id": "img2",
- "order": 4,
- "url": "placeholder255x255.png",
- },
- Object {
- "alt": "Right side",
- "id": "img3",
- "order": 2,
- "url": "placeholder255x255.png",
+ onBack={[Function]}
+ onCollectionShow={[Function]}
+ onDelete={[Function]}
+ onEdit={[Function]}
+ onImageEdit={[Function]}
+ onImageReorder={[Function]}
+ onImageUpload={[Function]}
+ onProductPublish={[Function]}
+ onProductShow={[Function]}
+ onVariantShow={[Function]}
+ placeholderImage="placeholder255x255.png"
+ product={
+ Object {
+ "availability": Object {
+ "available": true,
+ "priceRange": Object {
+ "start": Object {
+ "net": Object {
+ "localized": "55,14 USD",
+ },
+ },
+ "stop": Object {
+ "net": Object {
+ "localized": "88,36 USD",
+ },
+ },
+ },
},
- Object {
- "alt": "Left side",
- "id": "img4",
- "order": 3,
- "url": "placeholder255x255.png",
+ "collections": Object {
+ "edges": Array [
+ Object {
+ "node": Object {
+ "id": "collection-1",
+ "name": "Winter Collection",
+ },
+ },
+ Object {
+ "node": Object {
+ "id": "collection-2",
+ "name": "Summer Collection",
+ },
+ },
+ ],
},
- Object {
- "alt": "Paper",
- "id": "img5",
- "order": 0,
- "url": "placeholder255x255.png",
+ "description": "Light light office style present life military. Enough executive coach cause own.
+
+Care season wrong fly. Example age between discuss assume.
+
+Their third build might strong account. Worry enter room note level air.
+
+Weight director mother. Because find task with now enter tree management.
+
+Soon name recently ground green. There owner sport box them red information.",
+ "grossMargin": Array [
+ Object {
+ "start": 56,
+ "stop": 98,
+ },
+ ],
+ "id": "UHJvZHVjdDoyOA==",
+ "images": Object {
+ "edges": Array [
+ Object {
+ "node": Object {
+ "alt": "",
+ "id": "UHJvZHVjdEltYWdlOjY2",
+ "order": 0,
+ "url": "placeholder255x255.png",
+ },
+ },
+ Object {
+ "node": Object {
+ "alt": "",
+ "id": "UHJvZHVjdEltYWdlOjY3",
+ "order": 1,
+ "url": "placeholder255x255.png",
+ },
+ },
+ Object {
+ "node": Object {
+ "alt": "",
+ "id": "UHJvZHVjdEltYWdlOjY4",
+ "order": 2,
+ "url": "placeholder255x255.png",
+ },
+ },
+ ],
},
- Object {
- "alt": "Hard cover",
- "id": "img6",
- "order": 1,
- "url": "placeholder255x255.png",
+ "isPublished": true,
+ "name": "Stewart-Barrera",
+ "price": Object {
+ "localized": "95,47 USD",
},
- Object {
- "alt": "Extended version",
- "id": "img7",
- "order": 0,
- "url": "placeholder255x255.png",
+ "productType": Object {
+ "id": "UHJvZHVjdFR5cGU6Mw==",
+ "name": "Coffee",
},
- Object {
- "alt": "Cut version",
- "id": "img8",
- "order": 2,
- "url": "placeholder255x255.png",
+ "purchaseCost": Object {
+ "start": Object {
+ "gross": Object {
+ "localized": "1,88 USD",
+ },
+ },
+ "stop": Object {
+ "gross": Object {
+ "localized": "48,10 USD",
+ },
+ },
},
- Object {
- "alt": "Soft cover",
- "id": "img9",
- "order": 2,
- "url": "placeholder255x255.png",
+ "url": "/pl/products/stewart-barrera-28/",
+ "variants": Object {
+ "edges": Array [
+ Object {
+ "node": Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6Nw==",
+ "margin": 20,
+ "name": "XXL",
+ "priceOverride": null,
+ "sku": "2-1337",
+ "stockQuantity": 5,
+ },
+ },
+ Object {
+ "node": Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6OA==",
+ "margin": 20,
+ "name": "XL",
+ "priceOverride": null,
+ "sku": "2-1338",
+ "stockQuantity": 0,
+ },
+ },
+ Object {
+ "node": Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6OQ==",
+ "margin": 20,
+ "name": "L",
+ "priceOverride": null,
+ "sku": "2-1339",
+ "stockQuantity": 15,
+ },
+ },
+ Object {
+ "node": Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6MTA=",
+ "margin": 20,
+ "name": "M",
+ "priceOverride": null,
+ "sku": "2-1340",
+ "stockQuantity": 33,
+ },
+ },
+ Object {
+ "node": Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6MTE=",
+ "margin": 20,
+ "name": "S",
+ "priceOverride": null,
+ "sku": "2-1341",
+ "stockQuantity": 0,
+ },
+ },
+ Object {
+ "node": Object {
+ "id": "UHJvZHVjdFZhcmlhbnQ6MTI=",
+ "margin": 20,
+ "name": "XS",
+ "priceOverride": null,
+ "sku": "2-1342",
+ "stockQuantity": 0,
+ },
+ },
+ ],
},
- ]
+ }
}
- onImageAdd={[Function]}
- placeholderImage="placeholder255x255.png"
/>
`;
-exports[`Storyshots Products / ProductVariantImages when loading data 1`] = `
+exports[`Storyshots Views / Products / Product details when loading data 1`] = `
<Component
classes={
Object {
- "card": "Component-card-53",
- "gridElement": "Component-gridElement-54",
- "root": "Component-root-52",
+ "root": "Component-root-31",
}
}
- loading={true}
- onImageAdd={[Function]}
+ onBack={[Function]}
+ onCollectionShow={[Function]}
+ onDelete={[Function]}
+ onEdit={[Function]}
+ onImageEdit={[Function]}
+ onImageReorder={[Function]}
+ onImageUpload={[Function]}
+ onProductPublish={[Function]}
+ onProductShow={[Function]}
+ onVariantShow={[Function]}
placeholderImage="placeholder255x255.png"
/>
`;
-exports[`Storyshots Products / ProductVariantNavigation when loaded data 1`] = `
+exports[`Storyshots Views / Products / Product edit when data is fully loaded 1`] = `
<Component
+ categories={
+ Array [
+ Object {
+ "id": "123123",
+ "name": "Lorem ipsum dolor",
+ },
+ Object {
+ "id": "876752",
+ "name": "Mauris vehicula tortor vulputate",
+ },
+ ]
+ }
classes={
Object {
- "card": "Component-card-55",
- "link": "Component-link-56",
+ "cardContainer": "Component-cardContainer-45",
+ "grid": "Component-grid-44",
+ "root": "Component-root-43",
}
}
- variants={
+ collections={
Array [
Object {
- "id": "var2",
- "name": "Extended Soft",
- },
- Object {
- "id": "var3",
- "name": "Normal Hard",
+ "id": "1",
+ "name": "Winter collection",
},
Object {
- "id": "var4",
- "name": "Normal Soft",
+ "id": "2",
+ "name": "Emperor's choice",
},
]
}
+ onBack={[Function]}
+ onSubmit={[Function]}
+ product={
+ Object {
+ "attributes": Array [
+ Object {
+ "name": "brand",
+ "value": "superbrand",
+ },
+ Object {
+ "name": "collar",
+ "value": "round",
+ },
+ Object {
+ "name": "color",
+ "value": "blue",
+ },
+ ],
+ "available": true,
+ "availableOn": "23-01-2006",
+ "category": Object {
+ "id": "123123",
+ },
+ "collections": Object {
+ "edges": Array [
+ Object {
+ "node": Object {
+ "id": "1",
+ "name": "Winter collection",
+ },
+ },
+ ],
+ },
+ "description": "Aenean sit amet malesuada nibh. Proin nisi lorem, facilisis at tortor vel, convallis ornare nibh. In nec ipsum porta, varius leo eu, condimentum quam. Donec gravida euismod ipsum, at consequat orci efficitur nec. Phasellus lectus arcu, auctor eget porttitor eget, venenatis a lacus. Suspendisse quis urna rhoncus, commodo justo at, tempor nisl.",
+ "id": "1231u",
+ "name": "Our awesome book",
+ "price": Object {
+ "currencySymbol": "$",
+ "net": 3000.1,
+ },
+ "productType": Object {
+ "name": "Book",
+ "productAttributes": Object {
+ "edges": Array [
+ Object {
+ "node": Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZToz",
+ "name": "Brand",
+ "slug": "brand",
+ "values": Array [
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjQw",
+ "name": "dominikibrand",
+ "slug": "dominikibrand",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM5",
+ "name": "superbrand",
+ "slug": "superbrand",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM4",
+ "name": "Mirumee",
+ "slug": "mirumee",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjY=",
+ "name": "Saleor",
+ "slug": "saleor",
+ },
+ ],
+ },
+ },
+ Object {
+ "node": Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZToy",
+ "name": "Collar",
+ "slug": "collar",
+ "values": Array [
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjU=",
+ "name": "Polo",
+ "slug": "polo",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjQ=",
+ "name": "V-Neck",
+ "slug": "v-neck",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM=",
+ "name": "Round",
+ "slug": "round",
+ },
+ ],
+ },
+ },
+ Object {
+ "node": Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZTox",
+ "name": "Color",
+ "slug": "color",
+ "values": Array [
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI=",
+ "name": "White",
+ "slug": "white",
+ },
+ Object {
+ "id": "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE=",
+ "name": "Blue",
+ "slug": "blue",
+ },
+ ],
+ },
+ },
+ ],
+ },
+ },
+ "seo": Object {
+ "description": "Order our awesome book right now!",
+ "title": "Buy our awesome book now!",
+ },
+ "slug": "our-awesome-book-1231u",
+ }
+ }
/>
`;
-exports[`Storyshots Products / ProductVariantNavigation when loading data 1`] = `
+exports[`Storyshots Views / Products / Product edit when loading data 1`] = `
<Component
classes={
Object {
- "card": "Component-card-55",
- "link": "Component-link-56",
+ "cardContainer": "Component-cardContainer-45",
+ "grid": "Component-grid-44",
+ "root": "Component-root-43",
}
}
loading={true}
+ onBack={[Function]}
+ onSubmit={[Function]}
/>
`;
-exports[`Storyshots Products / ProductVariantNavigation with clickable rows 1`] = `
-<Component
- classes={
- Object {
- "card": "Component-card-55",
- "link": "Component-link-56",
- }
- }
- onRowClick={[Function]}
- variants={
- Array [
- Object {
- "id": "var2",
- "name": "Extended Soft",
- },
- Object {
- "id": "var3",
- "name": "Normal Hard",
- },
- Object {
- "id": "var4",
- "name": "Normal Soft",
- },
- ]
- }
-/>
+exports[`Storyshots Views / Products / Product list when loading data 1`] = `
+<WithStyles(Component)
+ width="md"
+>
+ <WithStyles(Component)
+ title="Product list"
+ >
+ <Hidden
+ implementation="js"
+ lgDown={false}
+ lgUp={false}
+ mdDown={false}
+ mdUp={true}
+ smDown={false}
+ smUp={false}
+ xlDown={false}
+ xlUp={false}
+ xsDown={false}
+ xsUp={false}
+ >
+ <WithStyles(IconButton)
+ onClick={[Function]}
+ >
+ <pure(FilterList) />
+ </WithStyles(IconButton)>
+ </Hidden>
+ </WithStyles(Component)>
+ <WithStyles(Card)>
+ <WithStyles(Component)
+ hasNextPage={true}
+ hasPreviousPage={false}
+ onNextPage={[Function]}
+ onPreviousPage={[Function]}
+ />
+ </WithStyles(Card)>
+</WithStyles(Component)>
+`;
+
+exports[`Storyshots Views / Products / Product list with clickable rows 1`] = `
+<WithStyles(Component)
+ width="md"
+>
+ <WithStyles(Component)
+ title="Product list"
+ >
+ <Hidden
+ implementation="js"
+ lgDown={false}
+ lgUp={false}
+ mdDown={false}
+ mdUp={true}
+ smDown={false}
+ smUp={false}
+ xlDown={false}
+ xlUp={false}
+ xsDown={false}
+ xsUp={false}
+ >
+ <WithStyles(IconButton)
+ onClick={[Function]}
+ >
+ <pure(FilterList) />
+ </WithStyles(IconButton)>
+ </Hidden>
+ </WithStyles(Component)>
+ <WithStyles(Card)>
+ <WithStyles(Component)
+ hasNextPage={true}
+ hasPreviousPage={false}
+ onNextPage={[Function]}
+ onPreviousPage={[Function]}
+ onRowClick={[Function]}
+ products={
+ Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "productType": Object {
+ "id": "1",
+ "name": "T-Shirt",
+ },
+ "thumbnailUrl": "placeholder255x255.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner, Graham and King",
+ "productType": Object {
+ "id": "1",
+ "name": "T-Shirt",
+ },
+ "thumbnailUrl": "placeholder255x255.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner, Graham and King",
+ "productType": Object {
+ "id": "1",
+ "name": "T-Shirt",
+ },
+ "thumbnailUrl": "placeholder255x255.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Gardner, Graham and King",
+ "productType": Object {
+ "id": "1",
+ "name": "T-Shirt",
+ },
+ "thumbnailUrl": "placeholder255x255.png",
+ },
+ ]
+ }
+ />
+ </WithStyles(Card)>
+</WithStyles(Component)>
+`;
+
+exports[`Storyshots Views / Products / Product list with initial data 1`] = `
+<WithStyles(Component)
+ width="md"
+>
+ <WithStyles(Component)
+ title="Product list"
+ >
+ <Hidden
+ implementation="js"
+ lgDown={false}
+ lgUp={false}
+ mdDown={false}
+ mdUp={true}
+ smDown={false}
+ smUp={false}
+ xlDown={false}
+ xlUp={false}
+ xsDown={false}
+ xsUp={false}
+ >
+ <WithStyles(IconButton)
+ onClick={[Function]}
+ >
+ <pure(FilterList) />
+ </WithStyles(IconButton)>
+ </Hidden>
+ </WithStyles(Component)>
+ <WithStyles(Card)>
+ <WithStyles(Component)
+ hasNextPage={true}
+ hasPreviousPage={false}
+ onNextPage={[Function]}
+ onPreviousPage={[Function]}
+ products={
+ Array [
+ Object {
+ "id": "UHJvZHVjdDox",
+ "name": "Gardner, Graham and King",
+ "productType": Object {
+ "id": "1",
+ "name": "T-Shirt",
+ },
+ "thumbnailUrl": "placeholder255x255.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoy",
+ "name": "Gardner, Graham and King",
+ "productType": Object {
+ "id": "1",
+ "name": "T-Shirt",
+ },
+ "thumbnailUrl": "placeholder255x255.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoz",
+ "name": "Gardner, Graham and King",
+ "productType": Object {
+ "id": "1",
+ "name": "T-Shirt",
+ },
+ "thumbnailUrl": "placeholder255x255.png",
+ },
+ Object {
+ "id": "UHJvZHVjdDoa",
+ "name": "Gardner, Graham and King",
+ "productType": Object {
+ "id": "1",
+ "name": "T-Shirt",
+ },
+ "thumbnailUrl": "placeholder255x255.png",
+ },
+ ]
+ }
+ />
+ </WithStyles(Card)>
+</WithStyles(Component)>
+`;
+
+exports[`Storyshots Views / Products / Product list without initial data 1`] = `
+<WithStyles(Component)
+ width="md"
+>
+ <WithStyles(Component)
+ title="Product list"
+ >
+ <Hidden
+ implementation="js"
+ lgDown={false}
+ lgUp={false}
+ mdDown={false}
+ mdUp={true}
+ smDown={false}
+ smUp={false}
+ xlDown={false}
+ xlUp={false}
+ xsDown={false}
+ xsUp={false}
+ >
+ <WithStyles(IconButton)
+ onClick={[Function]}
+ >
+ <pure(FilterList) />
+ </WithStyles(IconButton)>
+ </Hidden>
+ </WithStyles(Component)>
+ <WithStyles(Card)>
+ <WithStyles(Component)
+ hasNextPage={true}
+ hasPreviousPage={false}
+ onNextPage={[Function]}
+ onPreviousPage={[Function]}
+ products={Array []}
+ />
+ </WithStyles(Card)>
+</WithStyles(Component)>
`;
-exports[`Storyshots Products / ProductVariantPage when loaded data 1`] = `
+exports[`Storyshots Views / Products / Product variant details when loaded data 1`] = `
<Component
classes={
Object {
@@ -3424,403 +7256,69 @@ exports[`Storyshots Products / ProductVariantPage when loaded data 1`] = `
"url": "placeholder60x60.png",
},
},
- Object {
- "node": Object {
- "alt": "Cut version",
- "id": "img8",
- "order": 2,
- "url": "placeholder60x60.png",
- },
- },
- Object {
- "node": Object {
- "alt": "Soft cover",
- "id": "img9",
- "order": 2,
- "url": "placeholder60x60.png",
- },
- },
- ],
- },
- "name": "Our Awesome Book",
- "thumbnailUrl": "placeholder60x60.png",
- "variants": Object {
- "edges": Array [
- Object {
- "node": Object {
- "id": "var2",
- "name": "Extended Soft",
- },
- },
- Object {
- "node": Object {
- "id": "var3",
- "name": "Normal Hard",
- },
- },
- Object {
- "node": Object {
- "id": "var4",
- "name": "Normal Soft",
- },
- },
- ],
- "totalCount": 11,
- },
- },
- "sku": "1230959124123",
- "stock": 49,
- "stockAllocated": 12,
- }
- }
-/>
-`;
-
-exports[`Storyshots Products / ProductVariantPage when loading data 1`] = `
-<Component
- classes={
- Object {
- "root": "Component-root-57",
- }
- }
- loading={true}
- onBack={[Function]}
- onDelete={[Function]}
- onImageSelect={[Function]}
- placeholderImage="placeholder60x60.png"
-/>
-`;
-
-exports[`Storyshots Products / ProductVariantPrice when loaded data 1`] = `
-<Component
- classes={
- Object {
- "grid": "Component-grid-59",
- "root": "Component-root-58",
- }
- }
- costPrice={100}
- currencySymbol="USD"
- onChange={[Function]}
- priceOverride={100}
-/>
-`;
-
-exports[`Storyshots Products / ProductVariantPrice when loading data 1`] = `
-<Component
- classes={
- Object {
- "grid": "Component-grid-59",
- "root": "Component-root-58",
- }
- }
- loading={true}
- onChange={[Function]}
-/>
-`;
-
-exports[`Storyshots Products / ProductVariantProduct when loaded data 1`] = `
-<Component
- classes={
- Object {
- "root": "Component-root-60",
- }
- }
- product={
- Object {
- "id": "prod1",
- "images": Object {
- "edges": Array [
- Object {
- "node": Object {
- "alt": "Front",
- "id": "img1",
- "order": 1,
- "url": "placeholder60x60.png",
- },
- },
- Object {
- "node": Object {
- "alt": "Back",
- "id": "img2",
- "order": 4,
- "url": "placeholder60x60.png",
- },
- },
- Object {
- "node": Object {
- "alt": "Right side",
- "id": "img3",
- "order": 2,
- "url": "placeholder60x60.png",
- },
- },
- Object {
- "node": Object {
- "alt": "Left side",
- "id": "img4",
- "order": 3,
- "url": "placeholder60x60.png",
- },
- },
- Object {
- "node": Object {
- "alt": "Paper",
- "id": "img5",
- "order": 0,
- "url": "placeholder60x60.png",
- },
- },
- Object {
- "node": Object {
- "alt": "Hard cover",
- "id": "img6",
- "order": 1,
- "url": "placeholder60x60.png",
- },
- },
- Object {
- "node": Object {
- "alt": "Extended version",
- "id": "img7",
- "order": 0,
- "url": "placeholder60x60.png",
- },
- },
- Object {
- "node": Object {
- "alt": "Cut version",
- "id": "img8",
- "order": 2,
- "url": "placeholder60x60.png",
+ Object {
+ "node": Object {
+ "alt": "Cut version",
+ "id": "img8",
+ "order": 2,
+ "url": "placeholder60x60.png",
+ },
},
- },
- Object {
- "node": Object {
- "alt": "Soft cover",
- "id": "img9",
- "order": 2,
- "url": "placeholder60x60.png",
+ Object {
+ "node": Object {
+ "alt": "Soft cover",
+ "id": "img9",
+ "order": 2,
+ "url": "placeholder60x60.png",
+ },
},
- },
- ],
- },
- "name": "Our Awesome Book",
- "thumbnailUrl": "placeholder60x60.png",
- "variants": Object {
- "edges": Array [
- Object {
- "node": Object {
- "id": "var2",
- "name": "Extended Soft",
+ ],
+ },
+ "name": "Our Awesome Book",
+ "thumbnailUrl": "placeholder60x60.png",
+ "variants": Object {
+ "edges": Array [
+ Object {
+ "node": Object {
+ "id": "var2",
+ "name": "Extended Soft",
+ },
},
- },
- Object {
- "node": Object {
- "id": "var3",
- "name": "Normal Hard",
+ Object {
+ "node": Object {
+ "id": "var3",
+ "name": "Normal Hard",
+ },
},
- },
- Object {
- "node": Object {
- "id": "var4",
- "name": "Normal Soft",
+ Object {
+ "node": Object {
+ "id": "var4",
+ "name": "Normal Soft",
+ },
},
- },
- ],
- "totalCount": 11,
+ ],
+ "totalCount": 11,
+ },
},
+ "sku": "1230959124123",
+ "stock": 49,
+ "stockAllocated": 12,
}
}
/>
`;
-exports[`Storyshots Products / ProductVariantProduct when loading data 1`] = `
+exports[`Storyshots Views / Products / Product variant details when loading data 1`] = `
<Component
classes={
Object {
- "root": "Component-root-60",
+ "root": "Component-root-57",
}
}
loading={true}
+ onBack={[Function]}
+ onDelete={[Function]}
+ onImageSelect={[Function]}
placeholderImage="placeholder60x60.png"
/>
`;
-
-exports[`Storyshots Products / ProductVariantStock when loaded data 1`] = `
-<Component
- classes={
- Object {
- "grid": "Component-grid-62",
- "root": "Component-root-61",
- }
- }
- onChange={[Function]}
- sku="1230959124123"
- stock={49}
- stockAllocated={12}
-/>
-`;
-
-exports[`Storyshots Products / ProductVariantStock when loading data 1`] = `
-<Component
- classes={
- Object {
- "grid": "Component-grid-62",
- "root": "Component-root-61",
- }
- }
- loading={true}
- onChange={[Function]}
-/>
-`;
-
-exports[`Storyshots Products / ProductVariants when loading data 1`] = `
-<Component
- classes={
- Object {
- "alignRightText": "Component-alignRightText-63",
- "greenDot": "Component-greenDot-64",
- "link": "Component-link-65",
- "redDot": "Component-redDot-66",
- }
- }
-/>
-`;
-
-exports[`Storyshots Products / ProductVariants when product has no variants 1`] = `
-<Component
- classes={
- Object {
- "alignRightText": "Component-alignRightText-63",
- "greenDot": "Component-greenDot-64",
- "link": "Component-link-65",
- "redDot": "Component-redDot-66",
- }
- }
- variants={Array []}
-/>
-`;
-
-exports[`Storyshots Products / ProductVariants when product has variants 1`] = `
-<Component
- classes={
- Object {
- "alignRightText": "Component-alignRightText-63",
- "greenDot": "Component-greenDot-64",
- "link": "Component-link-65",
- "redDot": "Component-redDot-66",
- }
- }
- fallbackGross="80%"
- fallbackPrice="90.00 USD"
- variants={
- Array [
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6Nw==",
- "name": "XXL",
- "priceOverride": null,
- "sku": "2-1337",
- "stockQuantity": 5,
- },
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6OA==",
- "name": "XL",
- "priceOverride": null,
- "sku": "2-1338",
- "stockQuantity": 0,
- },
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6OQ==",
- "name": "L",
- "priceOverride": null,
- "sku": "2-1339",
- "stockQuantity": 15,
- },
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6MTA=",
- "name": "M",
- "priceOverride": null,
- "sku": "2-1340",
- "stockQuantity": 33,
- },
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6MTE=",
- "name": "S",
- "priceOverride": null,
- "sku": "2-1341",
- "stockQuantity": 0,
- },
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6MTI=",
- "name": "XS",
- "priceOverride": null,
- "sku": "2-1342",
- "stockQuantity": 0,
- },
- ]
- }
-/>
-`;
-
-exports[`Storyshots Products / ProductVariants with clickable rows 1`] = `
-<Component
- classes={
- Object {
- "alignRightText": "Component-alignRightText-63",
- "greenDot": "Component-greenDot-64",
- "link": "Component-link-65",
- "redDot": "Component-redDot-66",
- }
- }
- fallbackGross="80%"
- fallbackPrice="90.00 USD"
- onRowClick={[Function]}
- variants={
- Array [
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6Nw==",
- "name": "XXL",
- "priceOverride": null,
- "sku": "2-1337",
- "stockQuantity": 5,
- },
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6OA==",
- "name": "XL",
- "priceOverride": null,
- "sku": "2-1338",
- "stockQuantity": 0,
- },
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6OQ==",
- "name": "L",
- "priceOverride": null,
- "sku": "2-1339",
- "stockQuantity": 15,
- },
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6MTA=",
- "name": "M",
- "priceOverride": null,
- "sku": "2-1340",
- "stockQuantity": 33,
- },
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6MTE=",
- "name": "S",
- "priceOverride": null,
- "sku": "2-1341",
- "stockQuantity": 0,
- },
- Object {
- "id": "UHJvZHVjdFZhcmlhbnQ6MTI=",
- "name": "XS",
- "priceOverride": null,
- "sku": "2-1342",
- "stockQuantity": 0,
- },
- ]
- }
-/>
-`;
diff --git a/saleor/static/dashboard-next/storybook/config.js b/saleor/static/dashboard-next/storybook/config.js
index 46d4383612..5734951124 100644
--- a/saleor/static/dashboard-next/storybook/config.js
+++ b/saleor/static/dashboard-next/storybook/config.js
@@ -3,13 +3,20 @@ import { configure } from "@storybook/react";
function loadStories() {
// Components
+ require("./stories/components/DateFormatter");
+ require("./stories/components/EditableTableCell");
require("./stories/components/ErrorMessageCard");
+ require("./stories/components/Money");
require("./stories/components/MultiSelectField");
require("./stories/components/PageHeader");
+ require("./stories/components/PhoneField");
require("./stories/components/PriceField");
+ require("./stories/components/SingleAutocompleteSelectField");
require("./stories/components/SingleSelectField");
require("./stories/components/Skeleton");
+ require("./stories/components/StatusLabel");
require("./stories/components/TablePagination");
+ require("./stories/components/Timeline");
// Categories
require("./stories/categories/CategoryBaseForm");
@@ -47,6 +54,24 @@ function loadStories() {
require("./stories/products/ProductVariantProduct");
require("./stories/products/ProductVariantStock");
require("./stories/products/ProductVariants");
+
+ // Orders
+ require("./stories/orders/OrderAddressEditDialog");
+ require("./stories/orders/OrderCancelDialog");
+ require("./stories/orders/OrderCustomer");
+ require("./stories/orders/OrderCustomerEditDialog");
+ require("./stories/orders/OrderDetailsPage");
+ require("./stories/orders/OrderFulfillmentCancelDialog");
+ require("./stories/orders/OrderFulfillmentDialog");
+ require("./stories/orders/OrderFulfillmentTrackingDialog");
+ require("./stories/orders/OrderHistory");
+ require("./stories/orders/OrderList");
+ require("./stories/orders/OrderListPage");
+ require("./stories/orders/OrderPaymentDialog");
+ require("./stories/orders/OrderPaymentReleaseDialog");
+ require("./stories/orders/OrderProductAddDialog");
+ require("./stories/orders/OrderShippingMethodEditDialog");
+ require("./stories/orders/OrderSummary");
}
configure(loadStories, module);
diff --git a/saleor/static/dashboard-next/storybook/mock.tsx b/saleor/static/dashboard-next/storybook/mock.tsx
new file mode 100644
index 0000000000..9ad3eddf3b
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/mock.tsx
@@ -0,0 +1,78 @@
+import * as React from "react";
+
+interface ChoiceProviderProps {
+ children:
+ | ((
+ props: {
+ choices: Array<{
+ label: string;
+ value: string;
+ }>;
+ loading: boolean;
+ fetchChoices(value: string);
+ }
+ ) => React.ReactElement<any>)
+ | React.ReactNode;
+ choices: Array<{
+ label: string;
+ value: string;
+ }>;
+}
+interface ChoiceProviderState {
+ choices: Array<{
+ label: string;
+ value: string;
+ }>;
+ loading: boolean;
+ timeout: any;
+}
+
+export class ChoiceProvider extends React.Component<
+ ChoiceProviderProps,
+ ChoiceProviderState
+> {
+ state = { choices: [], loading: false, timeout: null };
+
+ handleChange = inputValue => {
+ if (this.state.loading) {
+ clearTimeout(this.state.timeout);
+ }
+ const timeout = setTimeout(() => this.fetchChoices(inputValue), 500);
+ this.setState({
+ loading: true,
+ timeout
+ });
+ };
+
+ fetchChoices = inputValue => {
+ let count = 0;
+ this.setState({
+ choices: this.props.choices.filter(suggestion => {
+ const keep =
+ (!inputValue ||
+ suggestion.label.toLowerCase().indexOf(inputValue.toLowerCase()) !==
+ -1) &&
+ count < 5;
+
+ if (keep) {
+ count += 1;
+ }
+
+ return keep;
+ }),
+ loading: false,
+ timeout: null
+ });
+ };
+
+ render() {
+ if (typeof this.props.children === "function") {
+ return this.props.children({
+ choices: this.state.choices,
+ fetchChoices: this.handleChange,
+ loading: this.state.loading
+ });
+ }
+ return this.props.children;
+ }
+}
diff --git a/saleor/static/dashboard-next/storybook/stories/components/DateFormatter.tsx b/saleor/static/dashboard-next/storybook/stories/components/DateFormatter.tsx
new file mode 100644
index 0000000000..be88ebe814
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/components/DateFormatter.tsx
@@ -0,0 +1,27 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import DateFormatter from "../../../components/DateFormatter";
+import Decorator from "../../Decorator";
+
+storiesOf("Generics / DateFormatter", module)
+ .addDecorator(Decorator)
+ .add("default", () => <DateFormatter date="2018-04-07T10:44:44+00:00" />)
+ .add("humanized", () => (
+ <DateFormatter date={"2018-05-27T22:44:44+00:00"} dateNow={1527521275866} />
+ ))
+ .add("humanized without tooltip", () => (
+ <DateFormatter
+ date={"2018-05-27T22:44:44+00:00"}
+ dateNow={1527521275866}
+ showTooltip={false}
+ />
+ ))
+ .add("with custom format", () => (
+ <DateFormatter
+ date="01.04.1999 14:30"
+ showTooltip={false}
+ inputFormat="DD.MM.YYYY HH:mm"
+ outputFormat="MM/DD/YYYY"
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/components/EditableTableCell.tsx b/saleor/static/dashboard-next/storybook/stories/components/EditableTableCell.tsx
new file mode 100644
index 0000000000..3a51eeb580
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/components/EditableTableCell.tsx
@@ -0,0 +1,34 @@
+import { storiesOf } from "@storybook/react";
+import Card from "material-ui/Card";
+import Table, {
+ TableBody,
+ TableCell,
+ TableHead,
+ TableRow
+} from "material-ui/Table";
+import * as React from "react";
+
+import EditableTableCell from "../../../components/EditableTableCell";
+import Decorator from "../../Decorator";
+
+storiesOf("Generics / EditableTableCell", module)
+ .addDecorator(Decorator)
+ .add("default", () => (
+ <Table>
+ <TableHead>
+ <TableCell>Some header</TableCell>
+ <TableCell>Some header</TableCell>
+ <TableCell>Some header</TableCell>
+ </TableHead>
+ <TableBody>
+ <TableRow>
+ <TableCell>Some value</TableCell>
+ <EditableTableCell
+ value={"Some editable text"}
+ onConfirm={() => () => {}}
+ />
+ <TableCell>Some value</TableCell>
+ </TableRow>
+ </TableBody>
+ </Table>
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/components/Money.tsx b/saleor/static/dashboard-next/storybook/stories/components/Money.tsx
new file mode 100644
index 0000000000..c9dcafd9e4
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/components/Money.tsx
@@ -0,0 +1,9 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import Money from "../../../components/Money";
+import Decorator from "../../Decorator";
+
+storiesOf("Generics / Money", module)
+ .addDecorator(Decorator)
+ .add("default", () => <Money amount={14} currency="$" />);
diff --git a/saleor/static/dashboard-next/storybook/stories/components/PhoneField.tsx b/saleor/static/dashboard-next/storybook/stories/components/PhoneField.tsx
new file mode 100644
index 0000000000..4602b22d85
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/components/PhoneField.tsx
@@ -0,0 +1,18 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import PhoneField from "../../../components/PhoneField";
+import { prefixes } from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+storiesOf("Generics / PhoneField", module)
+ .addDecorator(Decorator)
+ .add("default", () => (
+ <PhoneField
+ prefixes={prefixes}
+ name="phone"
+ prefix="41"
+ number="123 987 456"
+ onChange={() => {}}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/components/SingleAutocompleteSelectField.tsx b/saleor/static/dashboard-next/storybook/stories/components/SingleAutocompleteSelectField.tsx
new file mode 100644
index 0000000000..5d9adc807a
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/components/SingleAutocompleteSelectField.tsx
@@ -0,0 +1,313 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import Form from "../../../components/Form";
+import SingleAutocompleteSelectField from "../../../components/SingleAutocompleteSelectField";
+import Decorator from "../../Decorator";
+import { ChoiceProvider } from "../../mock";
+
+const suggestions = [
+ "Afghanistan",
+ "Åland Islands",
+ "Albania",
+ "Algeria",
+ "American Samoa",
+ "Andorra",
+ "Angola",
+ "Anguilla",
+ "Antigua and Barbuda",
+ "Argentina",
+ "Armenia",
+ "Aruba",
+ "Australia",
+ "Austria",
+ "Azerbaijan",
+ "Bangladesh",
+ "Barbados",
+ "Bahamas",
+ "Bahrain",
+ "Belarus",
+ "Belgium",
+ "Belize",
+ "Benin",
+ "Bermuda",
+ "Bhutan",
+ "Bolivia",
+ "Bosnia and Herzegovina",
+ "Botswana",
+ "Brazil",
+ "British Indian Ocean Territory",
+ "British Virgin Islands",
+ "Brunei Darussalam",
+ "Bulgaria",
+ "Burkina Faso",
+ "Burma",
+ "Burundi",
+ "Cambodia",
+ "Cameroon",
+ "Canada",
+ "Cape Verde",
+ "Cayman Islands",
+ "Central African Republic",
+ "Chad",
+ "Chile",
+ "China",
+ "Christmas Island",
+ "Cocos (Keeling) Islands",
+ "Colombia",
+ "Comoros",
+ "Congo-Brazzaville",
+ "Congo-Kinshasa",
+ "Cook Islands",
+ "Costa Rica",
+ "$_[",
+ "Croatia",
+ "Curaçao",
+ "Cyprus",
+ "Czech Republic",
+ "Denmark",
+ "Djibouti",
+ "Dominica",
+ "Dominican Republic",
+ "East Timor",
+ "Ecuador",
+ "El Salvador",
+ "Egypt",
+ "Equatorial Guinea",
+ "Eritrea",
+ "Estonia",
+ "Ethiopia",
+ "Falkland Islands",
+ "Faroe Islands",
+ "Federated States of Micronesia",
+ "Fiji",
+ "Finland",
+ "France",
+ "French Guiana",
+ "French Polynesia",
+ "French Southern Lands",
+ "Gabon",
+ "Gambia",
+ "Georgia",
+ "Germany",
+ "Ghana",
+ "Gibraltar",
+ "Greece",
+ "Greenland",
+ "Grenada",
+ "Guadeloupe",
+ "Guam",
+ "Guatemala",
+ "Guernsey",
+ "Guinea",
+ "Guinea-Bissau",
+ "Guyana",
+ "Haiti",
+ "Heard and McDonald Islands",
+ "Honduras",
+ "Hong Kong",
+ "Hungary",
+ "Iceland",
+ "India",
+ "Indonesia",
+ "Iraq",
+ "Ireland",
+ "Isle of Man",
+ "Israel",
+ "Italy",
+ "Jamaica",
+ "Japan",
+ "Jersey",
+ "Jordan",
+ "Kazakhstan",
+ "Kenya",
+ "Kiribati",
+ "Kuwait",
+ "Kyrgyzstan",
+ "Laos",
+ "Latvia",
+ "Lebanon",
+ "Lesotho",
+ "Liberia",
+ "Libya",
+ "Liechtenstein",
+ "Lithuania",
+ "Luxembourg",
+ "Macau",
+ "Macedonia",
+ "Madagascar",
+ "Malawi",
+ "Malaysia",
+ "Maldives",
+ "Mali",
+ "Malta",
+ "Marshall Islands",
+ "Martinique",
+ "Mauritania",
+ "Mauritius",
+ "Mayotte",
+ "Mexico",
+ "Moldova",
+ "Monaco",
+ "Mongolia",
+ "Montenegro",
+ "Montserrat",
+ "Morocco",
+ "Mozambique",
+ "Namibia",
+ "Nauru",
+ "Nepal",
+ "Netherlands",
+ "New Caledonia",
+ "New Zealand",
+ "Nicaragua",
+ "Niger",
+ "Nigeria",
+ "Niue",
+ "Norfolk Island",
+ "Northern Mariana Islands",
+ "Norway",
+ "Oman",
+ "Pakistan",
+ "Palau",
+ "Panama",
+ "Papua New Guinea",
+ "Paraguay",
+ "Peru",
+ "Philippines",
+ "Pitcairn Islands",
+ "Poland",
+ "Portugal",
+ "Puerto Rico",
+ "Qatar",
+ "Réunion",
+ "Romania",
+ "Russia",
+ "Rwanda",
+ "Saint Barthélemy",
+ "Saint Helena",
+ "Saint Kitts and Nevis",
+ "Saint Lucia",
+ "Saint Martin",
+ "Saint Pierre and Miquelon",
+ "Saint Vincent",
+ "Samoa",
+ "San Marino",
+ "São Tomé and Príncipe",
+ "Saudi Arabia",
+ "Senegal",
+ "Serbia",
+ "Seychelles",
+ "Sierra Leone",
+ "Singapore",
+ "Sint Maarten",
+ "Slovakia",
+ "Slovenia",
+ "Solomon Islands",
+ "Somalia",
+ "South Africa",
+ "South Georgia",
+ "South Korea",
+ "Spain",
+ "Sri Lanka",
+ "Sudan",
+ "Suriname",
+ "Svalbard and Jan Mayen",
+ "Sweden",
+ "Swaziland",
+ "Switzerland",
+ "Syria",
+ "Taiwan",
+ "Tajikistan",
+ "Tanzania",
+ "Thailand",
+ "Togo",
+ "Tokelau",
+ "Tonga",
+ "Trinidad and Tobago",
+ "Tunisia",
+ "Turkey",
+ "Turkmenistan",
+ "Turks and Caicos Islands",
+ "Tuvalu",
+ "Uganda",
+ "Ukraine",
+ "United Arab Emirates",
+ "United Kingdom",
+ "United States",
+ "Uruguay",
+ "Uzbekistan",
+ "Vanuatu",
+ "Vatican City",
+ "Vietnam",
+ "Venezuela",
+ "Wallis and Futuna",
+ "Western Sahara",
+ "Yemen",
+ "Zambia",
+ "Zimbabwe"
+].map(c => ({ label: c, value: c.toLocaleLowerCase().replace(/\s+/, "_") }));
+
+storiesOf("Generics / SingleAutocompleteSelectField", module)
+ .addDecorator(Decorator)
+ .add("with loading data", () => (
+ <Form initial={{ country: suggestions[0] }}>
+ {({ change, data }) => (
+ <ChoiceProvider choices={suggestions}>
+ {({ choices, fetchChoices }) => (
+ <SingleAutocompleteSelectField
+ choices={choices}
+ fetchChoices={fetchChoices}
+ helperText={`Value: ${data.country.value}`}
+ loading={true}
+ name="country"
+ onChange={change}
+ placeholder="Select country"
+ value={data.country}
+ />
+ )}
+ </ChoiceProvider>
+ )}
+ </Form>
+ ))
+ .add("with loaded data", () => (
+ <Form initial={{ country: suggestions[0] }}>
+ {({ change, data }) => (
+ <ChoiceProvider choices={suggestions}>
+ {({ choices, fetchChoices }) => (
+ <SingleAutocompleteSelectField
+ choices={choices}
+ fetchChoices={fetchChoices}
+ helperText={`Value: ${data.country.value}`}
+ loading={false}
+ name="country"
+ onChange={change}
+ placeholder="Select country"
+ value={data.country}
+ />
+ )}
+ </ChoiceProvider>
+ )}
+ </Form>
+ ))
+ .add("with custom option", () => (
+ <Form initial={{ country: suggestions[0] }}>
+ {({ change, data }) => (
+ <ChoiceProvider choices={suggestions}>
+ {({ choices, fetchChoices, loading }) => (
+ <SingleAutocompleteSelectField
+ choices={choices}
+ custom={true}
+ fetchChoices={fetchChoices}
+ helperText={`Value: ${data.country.value}`}
+ loading={loading}
+ name="country"
+ onChange={change}
+ placeholder="Select country"
+ value={data.country}
+ />
+ )}
+ </ChoiceProvider>
+ )}
+ </Form>
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/components/StatusLabel.tsx b/saleor/static/dashboard-next/storybook/stories/components/StatusLabel.tsx
new file mode 100644
index 0000000000..86d01912ae
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/components/StatusLabel.tsx
@@ -0,0 +1,17 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import StatusLabel from "../../../components/StatusLabel";
+import Decorator from "../../Decorator";
+
+storiesOf("Generics / StatusLabel", module)
+ .addDecorator(Decorator)
+ .add("when success", () => (
+ <StatusLabel label="Example label" status="success" />
+ ))
+ .add("when neutral", () => (
+ <StatusLabel label="Example label" status="neutral" />
+ ))
+ .add("when error", () => (
+ <StatusLabel label="Example label" status="error" />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/components/Timeline.tsx b/saleor/static/dashboard-next/storybook/stories/components/Timeline.tsx
new file mode 100644
index 0000000000..dbe60eda77
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/components/Timeline.tsx
@@ -0,0 +1,67 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import Timeline, {
+ TimelineNode,
+ TimelineNote
+} from "../../../components/Timeline";
+import Decorator from "../../Decorator";
+
+storiesOf("Generics / Timeline", module)
+ .addDecorator(Decorator)
+ .add("default", () => (
+ <Timeline>
+ <TimelineNode
+ date="2018-05-07T16:58:02+00:00"
+ title="Expansion panel 1"
+ />
+ <TimelineNode
+ date="2018-05-07T16:48:02+00:00"
+ title="Expansion panel 2"
+ />
+ <TimelineNode
+ date="2018-05-06T16:58:02+00:00"
+ title="Expansion panel 3"
+ />
+ </Timeline>
+ ))
+ .add("with expansion panels", () => (
+ <Timeline>
+ <TimelineNode date="2018-05-07T16:58:02+00:00" title="Expansion panel 1">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
+ malesuada lacus ex, sit amet blandit leo lobortis eget.
+ </TimelineNode>
+ <TimelineNode date="2018-05-07T16:48:02+00:00" title="Expansion panel 2">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
+ malesuada lacus ex, sit amet blandit leo lobortis eget.
+ </TimelineNode>
+ <TimelineNode date="2018-05-06T16:58:02+00:00" title="Expansion panel 3">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
+ malesuada lacus ex, sit amet blandit leo lobortis eget.
+ </TimelineNode>
+ </Timeline>
+ ))
+ .add("with order notes", () => (
+ <Timeline>
+ <TimelineNode date="2018-05-07T16:58:02+00:00" title="Expansion panel 1">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
+ malesuada lacus ex, sit amet blandit leo lobortis eget.
+ </TimelineNode>
+ <TimelineNote
+ date="2018-05-07T16:58:02+00:00"
+ content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
+ malesuada lacus ex, sit amet blandit leo lobortis eget."
+ />
+ <TimelineNote
+ date="2018-05-07T16:58:02+00:00"
+ content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
+ malesuada lacus ex, sit amet blandit leo lobortis eget."
+ />
+ <TimelineNode date="2018-05-06T16:58:02+00:00" title="Expansion panel 3">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
+ malesuada lacus ex, sit amet blandit leo lobortis eget.
+ </TimelineNode>
+ </Timeline>
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderAddressEditDialog.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderAddressEditDialog.tsx
new file mode 100644
index 0000000000..bd32d663c7
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderAddressEditDialog.tsx
@@ -0,0 +1,36 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import { transformAddressToForm } from "../../../orders";
+import OrderAddressEditDialog from "../../../orders/components/OrderAddressEditDialog";
+import {
+ countries,
+ order as orderFixture,
+ prefixes
+} from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+const order = orderFixture("");
+
+storiesOf("Orders / OrderAddressEditDialog", module)
+ .addDecorator(Decorator)
+ .add("shipping address", () => (
+ <OrderAddressEditDialog
+ open={true}
+ variant="shipping"
+ data={transformAddressToForm(order.shippingAddress)}
+ onChange={() => {}}
+ countries={countries}
+ prefixes={prefixes}
+ />
+ ))
+ .add("billing address", () => (
+ <OrderAddressEditDialog
+ open={true}
+ variant="billing"
+ data={transformAddressToForm(order.billingAddress)}
+ onChange={() => {}}
+ prefixes={prefixes}
+ countries={countries}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderCancelDialog.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderCancelDialog.tsx
new file mode 100644
index 0000000000..a400bb8b40
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderCancelDialog.tsx
@@ -0,0 +1,16 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderCancelDialog from "../../../orders/components/OrderCancelDialog";
+import Decorator from "../../Decorator";
+
+storiesOf("Orders / OrderCancelDialog", module)
+ .addDecorator(Decorator)
+ .add("default", () => (
+ <OrderCancelDialog
+ open={true}
+ id="123"
+ onConfirm={() => {}}
+ onClose={() => {}}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderCustomer.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderCustomer.tsx
new file mode 100644
index 0000000000..69932de5d8
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderCustomer.tsx
@@ -0,0 +1,30 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderCustomer from "../../../orders/components/OrderCustomer";
+import { order } from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+const differentAddress = { ...order("").billingAddress, id: "a2" };
+
+storiesOf("Orders / OrderCustomer", module)
+ .addDecorator(Decorator)
+ .add("when loading data", () => <OrderCustomer />)
+ .add("when loaded data", () => (
+ <OrderCustomer
+ client={order("").client}
+ shippingAddress={order("").shippingAddress}
+ billingAddress={order("").billingAddress}
+ onBillingAddressEdit={() => {}}
+ onShippingAddressEdit={() => {}}
+ />
+ ))
+ .add("with different addresses", () => (
+ <OrderCustomer
+ client={order("").client}
+ shippingAddress={order("").shippingAddress}
+ billingAddress={differentAddress}
+ onBillingAddressEdit={() => {}}
+ onShippingAddressEdit={() => {}}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderCustomerEditDialog.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderCustomerEditDialog.tsx
new file mode 100644
index 0000000000..9f82d314a3
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderCustomerEditDialog.tsx
@@ -0,0 +1,25 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderCustomerEditDialog from "../../../orders/components/OrderCustomerEditDialog";
+import { clients as users } from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+const user = users[0];
+
+storiesOf("Orders / OrderCustomerEditDialog", module)
+ .addDecorator(Decorator)
+ .add("default", () => (
+ <OrderCustomerEditDialog
+ fetchUsers={() => {}}
+ onChange={() => {}}
+ onClose={() => {}}
+ onConfirm={() => {}}
+ open={true}
+ user={{
+ label: user.email,
+ value: user.id
+ }}
+ users={users}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderDetailsPage.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderDetailsPage.tsx
new file mode 100644
index 0000000000..725914c6a3
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderDetailsPage.tsx
@@ -0,0 +1,81 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import * as placeholderImage from "../../../../images/placeholder60x60.png";
+import { OrderStatus, PaymentStatus } from "../../../orders";
+import OrderDetailsPage from "../../../orders/components/OrderDetailsPage";
+import {
+ clients,
+ countries,
+ order as orderFixture,
+ prefixes,
+ shippingMethods,
+ variants
+} from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+const order = orderFixture(placeholderImage);
+const orderDraft = orderFixture(placeholderImage, {
+ status: OrderStatus.DRAFT
+});
+const orderWithoutPayment = orderFixture(placeholderImage, {
+ paymentStatus: PaymentStatus.PREAUTH
+});
+
+const callbacks = {
+ onBack: () => {},
+ onCreate: () => {},
+ onCustomerEmailClick: id => () => {},
+ onOrderCancel: () => {},
+ onOrderLineChange: () => () => () => {},
+ onOrderLineRemove: () => () => {},
+ onPackingSlipClick: () => () => {},
+ onPaymentRelease: () => {},
+ onPrintClick: () => {},
+ onProductClick: () => {}
+};
+
+storiesOf("Views / Orders / Order details", module)
+ .addDecorator(Decorator)
+ .add("when loading data", () => <OrderDetailsPage onBack={() => {}} />)
+ .add("when loaded data", () => (
+ <OrderDetailsPage
+ countries={countries}
+ order={order}
+ prefixes={prefixes}
+ {...callbacks}
+ />
+ ))
+ .add("as a draft", () => (
+ <OrderDetailsPage
+ countries={countries}
+ order={orderDraft}
+ prefixes={prefixes}
+ shippingMethods={shippingMethods}
+ users={clients}
+ variants={variants}
+ variantsLoading={false}
+ fetchShippingMethods={() => {}}
+ fetchUsers={() => {}}
+ fetchVariants={() => {}}
+ {...callbacks}
+ />
+ ))
+ .add("as a unpaid order", () => (
+ <OrderDetailsPage
+ countries={countries}
+ order={orderWithoutPayment}
+ prefixes={prefixes}
+ shippingMethods={shippingMethods}
+ users={clients}
+ variants={variants}
+ variantsLoading={false}
+ fetchShippingMethods={() => {}}
+ fetchUsers={() => {}}
+ fetchVariants={() => {}}
+ {...callbacks}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillment.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillment.tsx
new file mode 100644
index 0000000000..ac18a3fd99
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillment.tsx
@@ -0,0 +1,10 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderFulfillment from "../../../orders/components/OrderFulfillment";
+import Decorator from "../../Decorator";
+
+storiesOf("Orders / OrderFulfillment", module)
+ .addDecorator(Decorator)
+ .add("default", () => <OrderFulfillment />)
+ .add("other", () => <OrderFulfillment />);
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillmentCancelDialog.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillmentCancelDialog.tsx
new file mode 100644
index 0000000000..89c626e3eb
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillmentCancelDialog.tsx
@@ -0,0 +1,16 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderFulfillmentCancelDialog from "../../../orders/components/OrderFulfillmentCancelDialog";
+import Decorator from "../../Decorator";
+
+storiesOf("Orders / OrderFulfillmentCancelDialog", module)
+ .addDecorator(Decorator)
+ .add("default", () => (
+ <OrderFulfillmentCancelDialog
+ open={true}
+ id="123"
+ onConfirm={() => {}}
+ onClose={() => {}}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillmentDialog.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillmentDialog.tsx
new file mode 100644
index 0000000000..fa9f50439a
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillmentDialog.tsx
@@ -0,0 +1,20 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import * as placeholderImage from "../../../../images/placeholder60x60.png";
+import OrderFulfillmentDialog from "../../../orders/components/OrderFulfillmentDialog";
+import { order as orderFixture } from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+const order = orderFixture(placeholderImage);
+
+storiesOf("Orders / OrderFulfillmentDialog", module)
+ .addDecorator(Decorator)
+ .add("default", () => (
+ <OrderFulfillmentDialog
+ open={true}
+ products={order.products}
+ onChange={() => {}}
+ data={{}}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillmentTrackingDialog.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillmentTrackingDialog.tsx
new file mode 100644
index 0000000000..5174f9541c
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderFulfillmentTrackingDialog.tsx
@@ -0,0 +1,28 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderFulfillmentTrackingDialog from "../../../orders/components/OrderFulfillmentTrackingDialog";
+import Decorator from "../../Decorator";
+
+storiesOf("Orders / OrderFulfillmentTrackingDialog", module)
+ .addDecorator(Decorator)
+ .add("add code", () => (
+ <OrderFulfillmentTrackingDialog
+ open={true}
+ variant="add"
+ onChange={() => {}}
+ onConfirm={() => {}}
+ onClose={() => {}}
+ trackingCode="123"
+ />
+ ))
+ .add("edit code", () => (
+ <OrderFulfillmentTrackingDialog
+ open={true}
+ variant="edit"
+ onChange={() => {}}
+ onConfirm={() => {}}
+ onClose={() => {}}
+ trackingCode="123"
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderHistory.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderHistory.tsx
new file mode 100644
index 0000000000..9dd140a60c
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderHistory.tsx
@@ -0,0 +1,14 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderHistory from "../../../orders/components/OrderHistory";
+import { order as orderFixture } from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+const order = orderFixture("");
+
+storiesOf("Orders / OrderHistory", module)
+ .addDecorator(Decorator)
+ .add("default", () => (
+ <OrderHistory user="[email protected]" history={order.events} />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderList.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderList.tsx
new file mode 100644
index 0000000000..3e6189d5b1
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderList.tsx
@@ -0,0 +1,15 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderList from "../../../orders/components/OrderList";
+import { flatOrders } from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+storiesOf("Orders / OrderList", module)
+ .addDecorator(Decorator)
+ .add("when loading data", () => <OrderList />)
+ .add("when loaded data", () => <OrderList orders={flatOrders} />)
+ .add("with clickable rows", () => (
+ <OrderList orders={flatOrders} onRowClick={() => {}} />
+ ))
+ .add("when no data", () => <OrderList orders={[]} />);
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderListPage.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderListPage.tsx
new file mode 100644
index 0000000000..5de2c77890
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderListPage.tsx
@@ -0,0 +1,22 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderListPage from "../../../orders/components/OrderListPage";
+import { orders } from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+storiesOf("Views / Orders / Order list", module)
+ .addDecorator(Decorator)
+ .add("when loaded data", () => (
+ <OrderListPage onBack={() => {}} onRowClick={() => {}} />
+ ))
+ .add("when loading data", () => (
+ <OrderListPage onBack={() => {}} orders={orders} onRowClick={() => {}} />
+ ))
+ .add("when no data", () => (
+ <OrderListPage
+ onBack={() => {}}
+ orders={{ edges: [] }}
+ onRowClick={() => {}}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderPaymentDialog.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderPaymentDialog.tsx
new file mode 100644
index 0000000000..b6309fd2af
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderPaymentDialog.tsx
@@ -0,0 +1,24 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderPaymentDialog from "../../../orders/components/OrderPaymentDialog";
+import Decorator from "../../Decorator";
+
+storiesOf("Orders / OrderPaymentDialog", module)
+ .addDecorator(Decorator)
+ .add("capture payment", () => (
+ <OrderPaymentDialog
+ variant="capture"
+ open={true}
+ onChange={() => {}}
+ value={120}
+ />
+ ))
+ .add("refund payment", () => (
+ <OrderPaymentDialog
+ variant="refund"
+ open={true}
+ onChange={() => {}}
+ value={140}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderPaymentReleaseDialog.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderPaymentReleaseDialog.tsx
new file mode 100644
index 0000000000..a41785dd1a
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderPaymentReleaseDialog.tsx
@@ -0,0 +1,15 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderPaymentReleaseDialog from "../../../orders/components/OrderPaymentReleaseDialog";
+import Decorator from "../../Decorator";
+
+storiesOf("Orders / OrderPaymentReleaseDialog", module)
+ .addDecorator(Decorator)
+ .add("default", () => (
+ <OrderPaymentReleaseDialog
+ open={true}
+ onConfirm={() => {}}
+ onClose={() => {}}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderProductAddDialog.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderProductAddDialog.tsx
new file mode 100644
index 0000000000..a558f34109
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderProductAddDialog.tsx
@@ -0,0 +1,26 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import Form from "../../../components/Form";
+import OrderProductAddDialog from "../../../orders/components/OrderProductAddDialog";
+import { variants } from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+storiesOf("Orders / OrderProductAddDialog", module)
+ .addDecorator(Decorator)
+ .add("default", () => (
+ <Form initial={{ quantity: 0, variant: { label: "", value: "" } }}>
+ {({ change, data }) => (
+ <OrderProductAddDialog
+ open={true}
+ onChange={change}
+ onConfirm={() => {}}
+ onClose={() => {}}
+ variants={variants}
+ fetchVariants={() => {}}
+ quantity={data.quantity}
+ variant={data.variant}
+ />
+ )}
+ </Form>
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderProducts.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderProducts.tsx
new file mode 100644
index 0000000000..a31face608
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderProducts.tsx
@@ -0,0 +1,10 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderProducts from "../../../orders/components/OrderProducts";
+import Decorator from "../../Decorator";
+
+storiesOf("Orders / OrderProducts", module)
+ .addDecorator(Decorator)
+ .add("default", () => <OrderProducts />)
+ .add("other", () => <OrderProducts />);
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderShippingMethodEditDialog.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderShippingMethodEditDialog.tsx
new file mode 100644
index 0000000000..5db15d81c3
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderShippingMethodEditDialog.tsx
@@ -0,0 +1,28 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import OrderShippingMethodEditDialog from "../../../orders/components/OrderShippingMethodEditDialog";
+import {
+ order as orderFixture,
+ shippingMethods
+} from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+const order = orderFixture("");
+
+storiesOf("Orders / OrderShippingMethodEditDialog", module)
+ .addDecorator(Decorator)
+ .add("default", () => (
+ <OrderShippingMethodEditDialog
+ fetchShippingMethods={() => {}}
+ onChange={() => {}}
+ onClose={() => {}}
+ onConfirm={() => {}}
+ open={true}
+ shippingMethod={{
+ label: order.shippingMethodName,
+ value: order.shippingMethod.id
+ }}
+ shippingMethods={shippingMethods}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderSummary.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderSummary.tsx
new file mode 100644
index 0000000000..6c4fc88a1b
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderSummary.tsx
@@ -0,0 +1,184 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import * as placeholderImage from "../../../../images/placeholder60x60.png";
+import OrderSummary from "../../../orders/components/OrderSummary";
+import {
+ countries,
+ order as orderFixture,
+ prefixes
+} from "../../../orders/fixtures";
+import Decorator from "../../Decorator";
+
+const order = orderFixture(placeholderImage);
+const callbacks = {
+ onCapture: () => {},
+ onCreate: () => {},
+ onFulfill: () => {},
+ onOrderCancel: () => {},
+ onOrderLineChange: () => () => () => {},
+ onOrderLineRemove: () => () => {},
+ onRefund: () => {},
+ onRelease: () => {},
+ onRowClick: () => () => {}
+};
+
+storiesOf("Orders / OrderSummary", module)
+ .addDecorator(Decorator)
+ .add("when loading data", () => <OrderSummary />)
+ .add("order unfulfilled", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus={order.paymentStatus}
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={"unfulfilled"}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ))
+ .add("order partially fulfilled", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus={order.paymentStatus}
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={"partially fulfilled"}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ))
+ .add("order fulfilled", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus={order.paymentStatus}
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={"fulfilled"}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ))
+ .add("order cancelled", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus={order.paymentStatus}
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={"cancelled"}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ))
+ .add("order draft", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus={order.paymentStatus}
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={"draft"}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ))
+ .add("payment confirmed", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus="confirmed"
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={order.status}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ))
+ .add("payment error", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus="error"
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={order.status}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ))
+ .add("payment input", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus="input"
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={order.status}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ))
+ .add("payment preauth", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus="preauth"
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={order.status}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ))
+ .add("payment refunded", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus="refunded"
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={order.status}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ))
+ .add("payment rejected", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus="rejected"
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={order.status}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ))
+ .add("payment waiting", () => (
+ <OrderSummary
+ net={order.payment.net}
+ paid={order.payment.paid}
+ paymentStatus="waiting"
+ products={order.products}
+ refunded={order.payment.refunded}
+ status={order.status}
+ subtotal={order.subtotal}
+ total={order.total}
+ {...callbacks}
+ />
+ ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductDetailsPage.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductDetailsPage.tsx
index bd3103e440..5b3c9598bb 100644
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductDetailsPage.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/products/ProductDetailsPage.tsx
@@ -10,7 +10,7 @@ product.images.edges = product.images.edges.map(edge => ({
node: { ...edge.node, url: placeholder }
}));
-storiesOf("Products / ProductDetailsPage", module)
+storiesOf("Views / Products / Product details", module)
.add("when loading data", () => (
<ProductDetailsPage
placeholderImage={placeholder}
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
index c90d68bb6c..0169dc206b 100644
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
@@ -58,7 +58,7 @@ const products = [
}
];
-storiesOf("Products / ProductListCard", module)
+storiesOf("Views / Products / Product list", module)
.add("without initial data", () => (
<ProductListCard
hasNextPage={true}
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductUpdatePage.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductUpdatePage.tsx
index 98e9539236..71f7353652 100644
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductUpdatePage.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/products/ProductUpdatePage.tsx
@@ -132,7 +132,7 @@ const categories = [
}
];
-storiesOf("Products / ProductUpdatePage", module)
+storiesOf("Views / Products / Product edit", module)
.add("when loading data", () => (
<ProductUpdatePage onBack={() => {}} onSubmit={() => {}} loading={true} />
))
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantPage.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductVariantPage.tsx
index 1fb706a3be..411098f1df 100644
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantPage.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/products/ProductVariantPage.tsx
@@ -7,7 +7,7 @@ import { variant as variantFixture } from "../../../products/fixtures";
const variant = variantFixture(placeholderImage);
-storiesOf("Products / ProductVariantPage", module)
+storiesOf("Views / Products / Product variant details", module)
.add("when loading data", () => (
<ProductVariantPage
loading={true}
diff --git a/saleor/static/dashboard-next/theme.ts b/saleor/static/dashboard-next/theme.ts
index fcd48879f0..e9dbcfe691 100644
--- a/saleor/static/dashboard-next/theme.ts
+++ b/saleor/static/dashboard-next/theme.ts
@@ -46,6 +46,14 @@ export default createMuiTheme({
},
minWidth: 64
}
+ },
+ MuiTableCell: {
+ root: {
+ paddingLeft: 0,
+ "&:first-child": {
+ paddingLeft: 24 + "px"
+ }
+ }
}
},
palette: {