Fix issues
This commit is contained in:
parent
a5762f8e0d
commit
2e488f9436
10 changed files with 48 additions and 55 deletions
|
@ -144,7 +144,7 @@ const AttributeProperties: React.FC<AttributePropertiesProps> = ({
|
||||||
description="add attribute as column in product list table"
|
description="add attribute as column in product list table"
|
||||||
/>
|
/>
|
||||||
<Typography variant="caption">
|
<Typography variant="caption">
|
||||||
<FormattedMessage defaultMessage="If enable this attribute can be used as a column in product table." />
|
<FormattedMessage defaultMessage="If enabled this attribute can be used as a column in product table." />
|
||||||
</Typography>
|
</Typography>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,6 +150,7 @@ const CollectionCreatePage: React.StatelessComponent<
|
||||||
errors={formErrors}
|
errors={formErrors}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onChange={change}
|
onChange={change}
|
||||||
|
translate="collection"
|
||||||
/>
|
/>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
|
@ -125,6 +125,7 @@ const CollectionDetailsPage: React.StatelessComponent<
|
||||||
errors={formErrors}
|
errors={formErrors}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onChange={change}
|
onChange={change}
|
||||||
|
translate="collection"
|
||||||
>
|
>
|
||||||
<ControlledCheckbox
|
<ControlledCheckbox
|
||||||
name={"isFeatured" as keyof CollectionDetailsPageFormData}
|
name={"isFeatured" as keyof CollectionDetailsPageFormData}
|
||||||
|
|
|
@ -18,6 +18,9 @@ export interface AppHeaderProps {
|
||||||
|
|
||||||
const styles = (theme: Theme) =>
|
const styles = (theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
|
backArrow: {
|
||||||
|
fontSize: 30
|
||||||
|
},
|
||||||
menuButton: {
|
menuButton: {
|
||||||
flex: "0 0 auto",
|
flex: "0 0 auto",
|
||||||
marginLeft: theme.spacing.unit * -2,
|
marginLeft: theme.spacing.unit * -2,
|
||||||
|
@ -25,9 +28,6 @@ const styles = (theme: Theme) =>
|
||||||
marginTop: -theme.spacing.unit * 2
|
marginTop: -theme.spacing.unit * 2
|
||||||
},
|
},
|
||||||
root: {
|
root: {
|
||||||
"& svg": {
|
|
||||||
fontSize: 30
|
|
||||||
},
|
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
color: theme.typography.body2.color
|
color: theme.typography.body2.color
|
||||||
},
|
},
|
||||||
|
@ -60,7 +60,7 @@ const AppHeader = withStyles(styles, { name: "AppHeader" })(
|
||||||
anchor ? (
|
anchor ? (
|
||||||
<Portal container={anchor.current}>
|
<Portal container={anchor.current}>
|
||||||
<div className={classes.root} onClick={onBack}>
|
<div className={classes.root} onClick={onBack}>
|
||||||
<ArrowBackIcon />
|
<ArrowBackIcon className={classes.backArrow} />
|
||||||
{children ? (
|
{children ? (
|
||||||
<Typography className={classes.title}>{children}</Typography>
|
<Typography className={classes.title}>{children}</Typography>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
@ -45,12 +45,10 @@ const styles = (theme: Theme) =>
|
||||||
backgroundColor: fade(theme.palette.primary.main, 0.2)
|
backgroundColor: fade(theme.palette.primary.main, 0.2)
|
||||||
},
|
},
|
||||||
backgroundColor: "transparent"
|
backgroundColor: "transparent"
|
||||||
}
|
},
|
||||||
|
padding: 6
|
||||||
},
|
},
|
||||||
root: {
|
root: {
|
||||||
"& button": {
|
|
||||||
padding: 6
|
|
||||||
},
|
|
||||||
color: theme.palette.text.secondary,
|
color: theme.palette.text.secondary,
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
margin: `0 ${theme.spacing.unit * 2.5}px`
|
margin: `0 ${theme.spacing.unit * 2.5}px`
|
||||||
|
|
|
@ -43,6 +43,7 @@ interface VisibilityCardProps extends WithStyles<typeof styles> {
|
||||||
errors: { [key: string]: string };
|
errors: { [key: string]: string };
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
onChange(event: any);
|
onChange(event: any);
|
||||||
|
translate: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const VisibilityCard = withStyles(styles, {
|
export const VisibilityCard = withStyles(styles, {
|
||||||
|
@ -54,7 +55,8 @@ export const VisibilityCard = withStyles(styles, {
|
||||||
data: { isPublished, publicationDate },
|
data: { isPublished, publicationDate },
|
||||||
errors,
|
errors,
|
||||||
disabled,
|
disabled,
|
||||||
onChange
|
onChange,
|
||||||
|
translate
|
||||||
}: VisibilityCardProps) => {
|
}: VisibilityCardProps) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const [isPublicationDate, setPublicationDate] = React.useState(
|
const [isPublicationDate, setPublicationDate] = React.useState(
|
||||||
|
@ -75,7 +77,8 @@ export const VisibilityCard = withStyles(styles, {
|
||||||
defaultMessage: "since {date}"
|
defaultMessage: "since {date}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
date: localizeDate(publicationDate)
|
date: localizeDate(publicationDate),
|
||||||
|
description: translate
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
: null
|
: null
|
||||||
|
@ -89,7 +92,8 @@ export const VisibilityCard = withStyles(styles, {
|
||||||
defaultMessage: "will be visible from {date}"
|
defaultMessage: "will be visible from {date}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
date: localizeDate(publicationDate)
|
date: localizeDate(publicationDate),
|
||||||
|
description: translate
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
: null
|
: null
|
||||||
|
|
|
@ -23,50 +23,36 @@ export interface SaleInfoProps {
|
||||||
onChange: (event: React.ChangeEvent<any>) => void;
|
onChange: (event: React.ChangeEvent<any>) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = (theme: Theme) =>
|
const SaleInfo: React.FC<SaleInfoProps> = ({
|
||||||
createStyles({
|
data,
|
||||||
root: {
|
disabled,
|
||||||
display: "grid",
|
errors,
|
||||||
gridColumnGap: theme.spacing.unit * 2 + "px",
|
onChange
|
||||||
gridTemplateColumns: "1fr"
|
}) => {
|
||||||
}
|
const intl = useIntl();
|
||||||
});
|
|
||||||
|
|
||||||
const SaleInfo = withStyles(styles, {
|
return (
|
||||||
name: "SaleInfo"
|
<Card>
|
||||||
})(
|
<CardTitle
|
||||||
({
|
title={intl.formatMessage(commonMessages.generalInformations)}
|
||||||
classes,
|
/>
|
||||||
data,
|
<CardContent>
|
||||||
disabled,
|
<TextField
|
||||||
errors,
|
disabled={disabled}
|
||||||
onChange
|
error={!!errors.name}
|
||||||
}: SaleInfoProps & WithStyles<typeof styles>) => {
|
helperText={errors.name}
|
||||||
const intl = useIntl();
|
name={"name" as keyof FormData}
|
||||||
|
onChange={onChange}
|
||||||
return (
|
label={intl.formatMessage({
|
||||||
<Card>
|
defaultMessage: "Name",
|
||||||
<CardTitle
|
description: "sale name"
|
||||||
title={intl.formatMessage(commonMessages.generalInformations)}
|
})}
|
||||||
|
value={data.name}
|
||||||
|
fullWidth
|
||||||
/>
|
/>
|
||||||
<CardContent className={classes.root}>
|
</CardContent>
|
||||||
<TextField
|
</Card>
|
||||||
disabled={disabled}
|
);
|
||||||
error={!!errors.name}
|
};
|
||||||
helperText={errors.name}
|
|
||||||
name={"name" as keyof FormData}
|
|
||||||
onChange={onChange}
|
|
||||||
label={intl.formatMessage({
|
|
||||||
defaultMessage: "Name",
|
|
||||||
description: "sale name"
|
|
||||||
})}
|
|
||||||
value={data.name}
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
SaleInfo.displayName = "SaleInfo";
|
SaleInfo.displayName = "SaleInfo";
|
||||||
export default SaleInfo;
|
export default SaleInfo;
|
||||||
|
|
|
@ -124,6 +124,7 @@ const PageDetailsPage: React.StatelessComponent<PageDetailsPageProps> = ({
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
errors={formErrors}
|
errors={formErrors}
|
||||||
onChange={change}
|
onChange={change}
|
||||||
|
translate="product"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
@ -281,6 +281,7 @@ export const ProductCreatePage: React.StatelessComponent<
|
||||||
errors={errors}
|
errors={errors}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onChange={change}
|
onChange={change}
|
||||||
|
translate="page"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
@ -291,6 +291,7 @@ export const ProductUpdatePage: React.FC<ProductUpdatePageProps> = ({
|
||||||
errors={errors}
|
errors={errors}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onChange={change}
|
onChange={change}
|
||||||
|
translate="product"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
Loading…
Reference in a new issue