Merge branch 'master' into fix/column-picker
This commit is contained in:
commit
9a42438ee0
7 changed files with 1885 additions and 5 deletions
|
@ -29,6 +29,7 @@ All notable, unreleased changes to this project will be documented in this file.
|
|||
- Add filtering to views - #361 by @dominik-zeglen
|
||||
- Do not render password change if authenticating - #378 by @dominik-zeglen
|
||||
- Fix crash when one product is selected - #391 by @dominik-zeglen
|
||||
- Improve product update form error handling - #392 by @dominik-zeglen
|
||||
- Fix column picker errors - #393 by @dominik-zeglen
|
||||
|
||||
## 2.0.0
|
||||
|
|
15
Dockerfile.dev
Normal file
15
Dockerfile.dev
Normal file
|
@ -0,0 +1,15 @@
|
|||
FROM node:10
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
ARG APP_MOUNT_URI
|
||||
ARG API_URI
|
||||
ARG STATIC_URL
|
||||
ENV API_URI ${API_URI:-http://localhost:8000/graphql/}
|
||||
ENV APP_MOUNT_URI ${APP_MOUNT_URI:-/dashboard/}
|
||||
ENV STATIC_URL ${STATIC_URL:-/dashboard/}
|
||||
|
||||
EXPOSE 9000
|
||||
CMD npm start -- --host 0.0.0.0
|
18
README.md
18
README.md
|
@ -35,6 +35,24 @@ Enter the project directory:
|
|||
$ cd saleor-dashboard
|
||||
```
|
||||
|
||||
#### Using stable release
|
||||
|
||||
To use the official stable release, checkout to a release tag:
|
||||
|
||||
```
|
||||
$ git checkout v2.0.0
|
||||
```
|
||||
|
||||
See the list of all releases here: https://github.com/mirumee/saleor-dashboard/releases/
|
||||
|
||||
#### Using development version
|
||||
|
||||
If you want to use the latest development version, checkout to the `master` branch:
|
||||
|
||||
```
|
||||
$ git checkout master
|
||||
```
|
||||
|
||||
Install NPM dependencies:
|
||||
|
||||
```
|
||||
|
|
|
@ -8,7 +8,9 @@ import { useIntl } from "react-intl";
|
|||
|
||||
import CardTitle from "@saleor/components/CardTitle";
|
||||
import RadioSwitchField from "@saleor/components/RadioSwitchField";
|
||||
import { FormErrors } from "@saleor/types";
|
||||
import { DateContext } from "../Date/DateContext";
|
||||
import FormSpacer from "../FormSpacer";
|
||||
|
||||
const useStyles = makeStyles(
|
||||
theme => ({
|
||||
|
@ -50,7 +52,7 @@ interface VisibilityCardProps {
|
|||
isPublished: boolean;
|
||||
publicationDate: string;
|
||||
};
|
||||
errors: { [key: string]: string };
|
||||
errors: FormErrors<"isPublished" | "publicationDate">;
|
||||
disabled?: boolean;
|
||||
hiddenMessage: string;
|
||||
onChange: (event: React.ChangeEvent<any>) => void;
|
||||
|
@ -99,6 +101,7 @@ export const VisibilityCard: React.FC<VisibilityCardProps> = props => {
|
|||
<CardContent>
|
||||
<RadioSwitchField
|
||||
disabled={disabled}
|
||||
error={!!errors.isPublished}
|
||||
firstOptionLabel={
|
||||
<>
|
||||
<p className={classes.label}>
|
||||
|
@ -157,6 +160,12 @@ export const VisibilityCard: React.FC<VisibilityCardProps> = props => {
|
|||
)}
|
||||
</>
|
||||
)}
|
||||
{errors.isPublished && (
|
||||
<>
|
||||
<FormSpacer />
|
||||
<Typography color="error">{errors.isPublished}</Typography>
|
||||
</>
|
||||
)}
|
||||
<div className={classes.children}>{children}</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
|
|
@ -206,10 +206,16 @@ export const ProductUpdate: React.FC<ProductUpdateProps> = ({ id, params }) => {
|
|||
() => searchCollectionsOpts.data.search.edges,
|
||||
[]
|
||||
).map(edge => edge.node);
|
||||
const errors = maybe(
|
||||
() => updateProduct.opts.data.productUpdate.errors,
|
||||
[]
|
||||
);
|
||||
const errors = [
|
||||
...maybe(
|
||||
() => updateProduct.opts.data.productUpdate.errors,
|
||||
[]
|
||||
),
|
||||
...maybe(
|
||||
() => updateSimpleProduct.opts.data.productUpdate.errors,
|
||||
[]
|
||||
)
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -8,6 +8,8 @@ import ProductUpdatePage, {
|
|||
ProductUpdatePageProps
|
||||
} from "@saleor/products/components/ProductUpdatePage";
|
||||
import { product as productFixture } from "@saleor/products/fixtures";
|
||||
import { ProductUpdatePageFormData } from "@saleor/products/utils/data";
|
||||
import { formError } from "@saleor/storybook/misc";
|
||||
import Decorator from "../../Decorator";
|
||||
|
||||
const product = productFixture(placeholderImage);
|
||||
|
@ -83,4 +85,23 @@ storiesOf("Views / Products / Product edit", module)
|
|||
attributes: []
|
||||
}}
|
||||
/>
|
||||
))
|
||||
.add("form errors", () => (
|
||||
<ProductUpdatePage
|
||||
{...props}
|
||||
errors={([
|
||||
"basePrice",
|
||||
"category",
|
||||
"chargeTaxes",
|
||||
"collections",
|
||||
"description",
|
||||
"isPublished",
|
||||
"name",
|
||||
"publicationDate",
|
||||
"seoDescription",
|
||||
"seoTitle",
|
||||
"sku",
|
||||
"stockQuantity"
|
||||
] as Array<keyof ProductUpdatePageFormData>).map(formError)}
|
||||
/>
|
||||
));
|
||||
|
|
Loading…
Reference in a new issue