Use prettier

This commit is contained in:
dominik-zeglen 2019-08-22 18:25:55 +02:00
parent a472c8cd1a
commit 8a71976c4b
27 changed files with 110 additions and 165 deletions

View file

@ -24,9 +24,10 @@ const AttributeBulkDeleteDialog: React.StatelessComponent<
confirmButtonState={confirmButtonState} confirmButtonState={confirmButtonState}
onClose={onClose} onClose={onClose}
onConfirm={onConfirm} onConfirm={onConfirm}
title={intl.formatMessage({defaultMessage: "Delete attributes", title={intl.formatMessage({
description: "dialog title", defaultMessage: "Delete attributes",
})} description: "dialog title"
})}
variant="delete" variant="delete"
> >
<DialogContentText> <DialogContentText>

View file

@ -29,9 +29,10 @@ const AttributeDeleteDialog: React.FC<AttributeDeleteDialogProps> = ({
confirmButtonState={confirmButtonState} confirmButtonState={confirmButtonState}
onConfirm={onConfirm} onConfirm={onConfirm}
variant="delete" variant="delete"
title={intl.formatMessage({defaultMessage: "Delete attribute", title={intl.formatMessage({
description: "dialog title", defaultMessage: "Delete attribute",
})} description: "dialog title"
})}
> >
<DialogContentText> <DialogContentText>
<FormattedMessage <FormattedMessage

View file

@ -32,15 +32,17 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({
const intl = useIntl(); const intl = useIntl();
const inputTypeChoices = [ const inputTypeChoices = [
{ {
label: intl.formatMessage({defaultMessage: "Dropdown", label: intl.formatMessage({
description: "product attribute type", defaultMessage: "Dropdown",
}), description: "product attribute type"
}),
value: AttributeInputTypeEnum.DROPDOWN value: AttributeInputTypeEnum.DROPDOWN
}, },
{ {
label: intl.formatMessage({defaultMessage: "Multiple Select", label: intl.formatMessage({
description: "product attribute type", defaultMessage: "Multiple Select",
}), description: "product attribute type"
}),
value: AttributeInputTypeEnum.MULTISELECT value: AttributeInputTypeEnum.MULTISELECT
} }
]; ];
@ -54,9 +56,10 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({
<TextField <TextField
disabled={disabled} disabled={disabled}
error={!!errors.name} error={!!errors.name}
label={intl.formatMessage({defaultMessage: "Default Label", label={intl.formatMessage({
description: "attribute's label", defaultMessage: "Default Label",
})} description: "attribute's label"
})}
name={"name" as keyof AttributePageFormData} name={"name" as keyof AttributePageFormData}
fullWidth fullWidth
helperText={errors.name} helperText={errors.name}
@ -67,18 +70,20 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({
<TextField <TextField
disabled={disabled} disabled={disabled}
error={!!errors.slug} error={!!errors.slug}
label={intl.formatMessage({defaultMessage: "Attribute Code", label={intl.formatMessage({
description: "attribute's slug short code label", defaultMessage: "Attribute Code",
})} description: "attribute's slug short code label"
})}
name={"slug" as keyof AttributePageFormData} name={"slug" as keyof AttributePageFormData}
placeholder={slugify(data.name).toLowerCase()} placeholder={slugify(data.name).toLowerCase()}
fullWidth fullWidth
helperText={ helperText={
errors.slug || errors.slug ||
intl.formatMessage({defaultMessage: intl.formatMessage({
defaultMessage:
"This is used internally. Make sure you dont use spaces", "This is used internally. Make sure you dont use spaces",
description: "attribute slug input field helper text", description: "attribute slug input field helper text"
}) })
} }
value={data.slug} value={data.slug}
onChange={onChange} onChange={onChange}
@ -89,9 +94,10 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({
disabled={disabled || !canChangeType} disabled={disabled || !canChangeType}
error={!!errors.inputType} error={!!errors.inputType}
hint={errors.inputType} hint={errors.inputType}
label={intl.formatMessage({defaultMessage: "Catalog Input type for Store Owner", label={intl.formatMessage({
description: "attribute's editor component", defaultMessage: "Catalog Input type for Store Owner",
})} description: "attribute's editor component"
})}
name="inputType" name="inputType"
onChange={onChange} onChange={onChange}
value={data.inputType} value={data.inputType}
@ -99,9 +105,10 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({
<FormSpacer /> <FormSpacer />
<ControlledSwitch <ControlledSwitch
checked={data.valueRequired} checked={data.valueRequired}
label={intl.formatMessage({defaultMessage: "Value Required", label={intl.formatMessage({
description: "check to require attribute to have value", defaultMessage: "Value Required",
})} description: "check to require attribute to have value"
})}
name={"valueRequired" as keyof AttributePageFormData} name={"valueRequired" as keyof AttributePageFormData}
onChange={onChange} onChange={onChange}
/> />

View file

@ -83,37 +83,30 @@ const AttributeList: React.StatelessComponent<AttributeListProps> = ({
toolbar={toolbar} toolbar={toolbar}
> >
<TableCell className={classes.colSlug}> <TableCell className={classes.colSlug}>
<FormattedMessage <FormattedMessage defaultMessage="Attribute Code" />
defaultMessage="Attribute Code"
/>
</TableCell> </TableCell>
<TableCell className={classes.colName}> <TableCell className={classes.colName}>
<FormattedMessage <FormattedMessage
defaultMessage="Default Label" defaultMessage="Default Label"
description="attribute's label'" description="attribute's label'"
/> />
</TableCell> </TableCell>
<TableCell className={classes.colVisible}> <TableCell className={classes.colVisible}>
<FormattedMessage <FormattedMessage
defaultMessage="Visible" defaultMessage="Visible"
description="attribute is visible" description="attribute is visible"
/> />
</TableCell> </TableCell>
<TableCell className={classes.colSearchable}> <TableCell className={classes.colSearchable}>
<FormattedMessage <FormattedMessage
defaultMessage="Searchable" defaultMessage="Searchable"
description="attribute can be searched in dashboard" description="attribute can be searched in dashboard"
/> />
</TableCell> </TableCell>
<TableCell className={classes.colFaceted}> <TableCell className={classes.colFaceted}>
<FormattedMessage <FormattedMessage
defaultMessage="Use in faceted search" defaultMessage="Use in faceted search"
description="attribute can be searched in storefront" description="attribute can be searched in storefront"
/> />
</TableCell> </TableCell>
</TableHead> </TableHead>
@ -185,10 +178,7 @@ const AttributeList: React.StatelessComponent<AttributeListProps> = ({
() => ( () => (
<TableRow> <TableRow>
<TableCell colSpan={numberOfColumns}> <TableCell colSpan={numberOfColumns}>
<FormattedMessage <FormattedMessage defaultMessage="No attributes found" />
defaultMessage="No attributes found"
/>
</TableCell> </TableCell>
</TableRow> </TableRow>
) )

View file

@ -119,8 +119,7 @@ const AttributePage: React.FC<AttributePageProps> = ({
attribute === null attribute === null
? intl.formatMessage({ ? intl.formatMessage({
defaultMessage: "Create New Attribute", defaultMessage: "Create New Attribute",
description: "page title", description: "page title"
}) })
: maybe(() => attribute.name) : maybe(() => attribute.name)
} }

View file

@ -35,15 +35,13 @@ const AttributeValueDeleteDialog: React.FC<AttributeValueDeleteDialogProps> = ({
variant="delete" variant="delete"
title={intl.formatMessage({ title={intl.formatMessage({
defaultMessage: "Delete attribute value", defaultMessage: "Delete attribute value",
description: "dialog title", description: "dialog title"
})} })}
> >
<DialogContentText> <DialogContentText>
{useName ? ( {useName ? (
<FormattedMessage <FormattedMessage
defaultMessage='Are you sure you want to delete "{ name }" value? If you delete it you wont be able to assign it to any of the products with "{ attributeName }" attribute.' defaultMessage='Are you sure you want to delete "{ name }" value? If you delete it you wont be able to assign it to any of the products with "{ attributeName }" attribute.'
values={{ values={{
attributeName, attributeName,
name name
@ -53,7 +51,6 @@ const AttributeValueDeleteDialog: React.FC<AttributeValueDeleteDialogProps> = ({
<FormattedMessage <FormattedMessage
defaultMessage='Are you sure you want to delete "{ name }" value?' defaultMessage='Are you sure you want to delete "{ name }" value?'
description="delete attribute value" description="delete attribute value"
values={{ values={{
name name
}} }}

View file

@ -54,13 +54,11 @@ const AttributeValueEditDialog: React.StatelessComponent<
<FormattedMessage <FormattedMessage
defaultMessage="Add Value" defaultMessage="Add Value"
description="add attribute value" description="add attribute value"
/> />
) : ( ) : (
<FormattedMessage <FormattedMessage
defaultMessage="Edit Value" defaultMessage="Edit Value"
description="edit attribute value" description="edit attribute value"
/> />
)} )}
</DialogTitle> </DialogTitle>
@ -77,8 +75,7 @@ const AttributeValueEditDialog: React.StatelessComponent<
name={"name" as keyof AttributeValueEditDialogFormData} name={"name" as keyof AttributeValueEditDialogFormData}
label={intl.formatMessage({ label={intl.formatMessage({
defaultMessage: "Name", defaultMessage: "Name",
description: "attribute name", description: "attribute name"
})} })}
value={data.name} value={data.name}
onChange={change} onChange={change}

View file

@ -70,15 +70,13 @@ const AttributeValues: React.FC<AttributeValuesProps> = ({
<CardTitle <CardTitle
title={intl.formatMessage({ title={intl.formatMessage({
defaultMessage: "Attribute Values", defaultMessage: "Attribute Values",
description: "section header", description: "section header"
})} })}
toolbar={ toolbar={
<Button color="primary" variant="text" onClick={onValueAdd}> <Button color="primary" variant="text" onClick={onValueAdd}>
<FormattedMessage <FormattedMessage
defaultMessage="Add value" defaultMessage="Add value"
description="add attribute value button" description="add attribute value button"
/> />
</Button> </Button>
} }
@ -91,14 +89,12 @@ const AttributeValues: React.FC<AttributeValuesProps> = ({
<FormattedMessage <FormattedMessage
defaultMessage="Admin" defaultMessage="Admin"
description="attribute values list: slug column header" description="attribute values list: slug column header"
/> />
</TableCell> </TableCell>
<TableCell className={classes.columnStore}> <TableCell className={classes.columnStore}>
<FormattedMessage <FormattedMessage
defaultMessage="Default Store View" defaultMessage="Default Store View"
description="attribute values list: name column header" description="attribute values list: name column header"
/> />
</TableCell> </TableCell>
<TableCell /> <TableCell />
@ -137,7 +133,6 @@ const AttributeValues: React.FC<AttributeValuesProps> = ({
<FormattedMessage <FormattedMessage
defaultMessage="No values found" defaultMessage="No values found"
description="No attribute values found" description="No attribute values found"
/> />
</TableCell> </TableCell>
</TableRow> </TableRow>

View file

@ -67,8 +67,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ id, params }) => {
if (data.attributeDelete.errors.length === 0) { if (data.attributeDelete.errors.length === 0) {
notify({ notify({
text: intl.formatMessage({ text: intl.formatMessage({
defaultMessage: "Attribute deleted", defaultMessage: "Attribute deleted"
}) })
}); });
navigate(attributeListUrl()); navigate(attributeListUrl());
@ -79,8 +78,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ id, params }) => {
notify({ notify({
text: intl.formatMessage({ text: intl.formatMessage({
defaultMessage: "Value deleted", defaultMessage: "Value deleted",
description: "attribute value deleted", description: "attribute value deleted"
}) })
}); });
closeModal(); closeModal();
@ -102,8 +100,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ id, params }) => {
notify({ notify({
text: intl.formatMessage({ text: intl.formatMessage({
defaultMessage: "Added new value", defaultMessage: "Added new value",
description: "added new attribute value", description: "added new attribute value"
}) })
}); });
closeModal(); closeModal();

View file

@ -74,8 +74,7 @@ const AttributeList: React.FC<AttributeListProps> = ({ params }) => {
notify({ notify({
text: intl.formatMessage({ text: intl.formatMessage({
defaultMessage: "Attributes successfully delete", defaultMessage: "Attributes successfully delete",
description: "deleted multiple attributes", description: "deleted multiple attributes"
}) })
}); });
reset(); reset();

View file

@ -61,8 +61,7 @@ const CategoryBackground: React.FC<CategoryBackgroundProps> = props => {
<CardTitle <CardTitle
title={intl.formatMessage({ title={intl.formatMessage({
defaultMessage: "Background image (optional)", defaultMessage: "Background image (optional)",
description: "section header", description: "section header"
})} })}
toolbar={ toolbar={
<> <>

View file

@ -61,8 +61,7 @@ export const CategoryCreatePage: React.StatelessComponent<
<PageHeader <PageHeader
title={intl.formatMessage({ title={intl.formatMessage({
defaultMessage: "Create New Category", defaultMessage: "Create New Category",
description: "page header", description: "page header"
})} })}
/> />
<div> <div>
@ -76,8 +75,7 @@ export const CategoryCreatePage: React.StatelessComponent<
<SeoForm <SeoForm
helperText={intl.formatMessage({ helperText={intl.formatMessage({
defaultMessage: defaultMessage:
"Add search engine title and description to make this category easier to find", "Add search engine title and description to make this category easier to find"
})} })}
title={data.seoTitle} title={data.seoTitle}
titlePlaceholder={data.name} titlePlaceholder={data.name}

View file

@ -41,7 +41,6 @@ const CategoryDeleteDialog = withStyles(styles, {
<FormattedMessage <FormattedMessage
defaultMessage="Delete category" defaultMessage="Delete category"
description="dialog title" description="dialog title"
/> />
</DialogTitle> </DialogTitle>
<DialogContent> <DialogContent>
@ -49,7 +48,6 @@ const CategoryDeleteDialog = withStyles(styles, {
<FormattedMessage <FormattedMessage
defaultMessage="Are you sure you want to delete {categoryName}?" defaultMessage="Are you sure you want to delete {categoryName}?"
description="delete category" description="delete category"
values={{ values={{
categoryName: <strong>{name}</strong> categoryName: <strong>{name}</strong>
}} }}

View file

@ -54,8 +54,7 @@ export const CategoryDetailsForm = withStyles(styles, {
<TextField <TextField
classes={{ root: classes.root }} classes={{ root: classes.root }}
label={intl.formatMessage({ label={intl.formatMessage({
defaultMessage: "Category Name", defaultMessage: "Category Name"
})} })}
name="name" name="name"
disabled={disabled} disabled={disabled}
@ -71,8 +70,7 @@ export const CategoryDetailsForm = withStyles(styles, {
error={!!errors.descriptionJson} error={!!errors.descriptionJson}
helperText={errors.descriptionJson} helperText={errors.descriptionJson}
label={intl.formatMessage({ label={intl.formatMessage({
defaultMessage: "Category Description", defaultMessage: "Category Description"
})} })}
initial={maybe(() => JSON.parse(category.descriptionJson))} initial={maybe(() => JSON.parse(category.descriptionJson))}
name="description" name="description"

View file

@ -96,15 +96,13 @@ const CategoryList = withStyles(styles, { name: "CategoryList" })(
<CardTitle <CardTitle
title={intl.formatMessage({ title={intl.formatMessage({
defaultMessage: "All Subcategories", defaultMessage: "All Subcategories",
description: "section header", description: "section header"
})} })}
toolbar={ toolbar={
<Button color="primary" variant="text" onClick={onAdd}> <Button color="primary" variant="text" onClick={onAdd}>
<FormattedMessage <FormattedMessage
defaultMessage="Add subcategory" defaultMessage="Add subcategory"
description="button" description="button"
/> />
</Button> </Button>
} }
@ -120,23 +118,18 @@ const CategoryList = withStyles(styles, { name: "CategoryList" })(
toolbar={toolbar} toolbar={toolbar}
> >
<TableCell className={classes.colName}> <TableCell className={classes.colName}>
<FormattedMessage <FormattedMessage defaultMessage="Category Name" />
defaultMessage="Category Name"
/>
</TableCell> </TableCell>
<TableCell className={classes.colSubcategories}> <TableCell className={classes.colSubcategories}>
<FormattedMessage <FormattedMessage
defaultMessage="Subcategories" defaultMessage="Subcategories"
description="number of subcategories" description="number of subcategories"
/> />
</TableCell> </TableCell>
<TableCell className={classes.colProducts}> <TableCell className={classes.colProducts}>
<FormattedMessage <FormattedMessage
defaultMessage="No. of Products" defaultMessage="No. of Products"
description="number of products" description="number of products"
/> />
</TableCell> </TableCell>
</TableHead> </TableHead>
@ -207,15 +200,9 @@ const CategoryList = withStyles(styles, { name: "CategoryList" })(
<TableRow> <TableRow>
<TableCell colSpan={numberOfColumns}> <TableCell colSpan={numberOfColumns}>
{isRoot ? ( {isRoot ? (
<FormattedMessage <FormattedMessage defaultMessage="No categories found" />
defaultMessage="No categories found"
/>
) : ( ) : (
<FormattedMessage <FormattedMessage defaultMessage="No subcategories found" />
defaultMessage="No subcategories found"
/>
)} )}
</TableCell> </TableCell>
</TableRow> </TableRow>

View file

@ -46,7 +46,6 @@ export const CategoryListPage: React.StatelessComponent<CategoryTableProps> = ({
<FormattedMessage <FormattedMessage
defaultMessage="Add category" defaultMessage="Add category"
description="button" description="button"
/> />
<AddIcon /> <AddIcon />
</Button> </Button>

View file

@ -69,15 +69,13 @@ export const ProductList = withStyles(styles, { name: "ProductList" })(
<CardTitle <CardTitle
title={intl.formatMessage({ title={intl.formatMessage({
defaultMessage: "Products", defaultMessage: "Products",
description: "section header", description: "section header"
})} })}
toolbar={ toolbar={
<Button variant="text" color="primary" onClick={onAddProduct}> <Button variant="text" color="primary" onClick={onAddProduct}>
<FormattedMessage <FormattedMessage
defaultMessage="Add product" defaultMessage="Add product"
description="button" description="button"
/> />
</Button> </Button>
} }
@ -90,13 +88,13 @@ export const ProductList = withStyles(styles, { name: "ProductList" })(
<FormattedMessage <FormattedMessage
defaultMessage="Name" defaultMessage="Name"
description="product name" description="product name"
/> />
</TableCell> </TableCell>
<TableCell> <TableCell>
<FormattedMessage defaultMessage="Type" <FormattedMessage
defaultMessage="Type"
description="product type" description="product type"
/> />
</TableCell> </TableCell>
</TableRow> </TableRow>
</TableHead> </TableHead>
@ -143,8 +141,7 @@ export const ProductList = withStyles(styles, { name: "ProductList" })(
() => ( () => (
<TableRow> <TableRow>
<TableCell colSpan={3}> <TableCell colSpan={3}>
<FormattedMessage defaultMessage="No products found" <FormattedMessage defaultMessage="No products found" />
/>
</TableCell> </TableCell>
</TableRow> </TableRow>
) )

View file

@ -145,8 +145,7 @@ export const CategoryUpdatePage: React.StatelessComponent<
<SeoForm <SeoForm
helperText={intl.formatMessage({ helperText={intl.formatMessage({
defaultMessage: defaultMessage:
"Add search engine title and description to make this category easier to find", "Add search engine title and description to make this category easier to find"
})} })}
title={data.seoTitle} title={data.seoTitle}
titlePlaceholder={data.name} titlePlaceholder={data.name}
@ -162,17 +161,19 @@ export const CategoryUpdatePage: React.StatelessComponent<
isActive={currentTab === CategoryPageTab.categories} isActive={currentTab === CategoryPageTab.categories}
changeTab={changeTab} changeTab={changeTab}
> >
<FormattedMessage defaultMessage="Subcategories" <FormattedMessage
defaultMessage="Subcategories"
description="number of subcategories in category" description="number of subcategories in category"
/> />
</CategoriesTab> </CategoriesTab>
<ProductsTab <ProductsTab
isActive={currentTab === CategoryPageTab.products} isActive={currentTab === CategoryPageTab.products}
changeTab={changeTab} changeTab={changeTab}
> >
<FormattedMessage defaultMessage="Products" <FormattedMessage
defaultMessage="Products"
description="number of products in category" description="number of products in category"
/> />
</ProductsTab> </ProductsTab>
</TabContainer> </TabContainer>
<CardSpacer /> <CardSpacer />

View file

@ -25,8 +25,7 @@ export const CategoryCreateView: React.StatelessComponent<
if (data.categoryCreate.errors.length === 0) { if (data.categoryCreate.errors.length === 0) {
notify({ notify({
text: intl.formatMessage({ text: intl.formatMessage({
defaultMessage: "Category created", defaultMessage: "Category created"
}) })
}); });
navigate(categoryUrl(data.categoryCreate.category.id)); navigate(categoryUrl(data.categoryCreate.category.id));
@ -51,8 +50,7 @@ export const CategoryCreateView: React.StatelessComponent<
<WindowTitle <WindowTitle
title={intl.formatMessage({ title={intl.formatMessage({
defaultMessage: "Create category", defaultMessage: "Create category",
description: "window title", description: "window title"
})} })}
/> />
<CategoryCreatePage <CategoryCreatePage

View file

@ -77,8 +77,7 @@ const CollectionCreatePage: React.StatelessComponent<
<PageHeader <PageHeader
title={intl.formatMessage({ title={intl.formatMessage({
defaultMessage: "Add collection", defaultMessage: "Add collection",
description: "page header", description: "page header"
})} })}
/> />
<Grid> <Grid>
@ -132,8 +131,7 @@ const CollectionCreatePage: React.StatelessComponent<
descriptionPlaceholder="" descriptionPlaceholder=""
helperText={intl.formatMessage({ helperText={intl.formatMessage({
defaultMessage: defaultMessage:
"Add search engine title and description to make this collection easier to find", "Add search engine title and description to make this collection easier to find"
})} })}
title={data.seoTitle} title={data.seoTitle}
titlePlaceholder={data.name} titlePlaceholder={data.name}

View file

@ -52,8 +52,7 @@ const CollectionDetails = withStyles(styles, { name: "CollectionDetails" })(
classes={{ root: classes.name }} classes={{ root: classes.name }}
label={intl.formatMessage({ label={intl.formatMessage({
defaultMessage: "Name", defaultMessage: "Name",
description: "collection name", description: "collection name"
})} })}
name="name" name="name"
disabled={disabled} disabled={disabled}

View file

@ -111,8 +111,7 @@ const CollectionDetailsPage: React.StatelessComponent<
descriptionPlaceholder="" descriptionPlaceholder=""
helperText={intl.formatMessage({ helperText={intl.formatMessage({
defaultMessage: defaultMessage:
"Add search engine title and description to make this collection easier to find", "Add search engine title and description to make this collection easier to find"
})} })}
title={data.seoTitle} title={data.seoTitle}
titlePlaceholder={maybe(() => collection.name)} titlePlaceholder={maybe(() => collection.name)}
@ -134,8 +133,7 @@ const CollectionDetailsPage: React.StatelessComponent<
onChange={change} onChange={change}
label={intl.formatMessage({ label={intl.formatMessage({
defaultMessage: "Feature on Homepage", defaultMessage: "Feature on Homepage",
description: "switch button", description: "switch button"
})} })}
/> />
</VisibilityCard> </VisibilityCard>

View file

@ -81,8 +81,7 @@ export const CollectionImage = withStyles(styles)(
<CardTitle <CardTitle
title={intl.formatMessage({ title={intl.formatMessage({
defaultMessage: "Background image (optional)", defaultMessage: "Background image (optional)",
description: "section header", description: "section header"
})} })}
toolbar={ toolbar={
<> <>

View file

@ -83,17 +83,16 @@ const CollectionList = withStyles(styles, { name: "CollectionList" })(
toolbar={toolbar} toolbar={toolbar}
> >
<TableCell className={classes.colName}> <TableCell className={classes.colName}>
<FormattedMessage defaultMessage="Category Name" <FormattedMessage defaultMessage="Category Name" />
/>
</TableCell> </TableCell>
<TableCell className={classes.colProducts}> <TableCell className={classes.colProducts}>
<FormattedMessage defaultMessage="No. of Products" <FormattedMessage defaultMessage="No. of Products" />
/>
</TableCell> </TableCell>
<TableCell className={classes.colAvailability}> <TableCell className={classes.colAvailability}>
<FormattedMessage defaultMessage="Availability" <FormattedMessage
defaultMessage="Availability"
description="collection availability" description="collection availability"
/> />
</TableCell> </TableCell>
</TableHead> </TableHead>
<TableFooter> <TableFooter>
@ -159,13 +158,11 @@ const CollectionList = withStyles(styles, { name: "CollectionList" })(
collection.isPublished collection.isPublished
? intl.formatMessage({ ? intl.formatMessage({
defaultMessage: "Published", defaultMessage: "Published",
description: "collection is published", description: "collection is published"
}) })
: intl.formatMessage({ : intl.formatMessage({
defaultMessage: "Not published", defaultMessage: "Not published",
description: "collection is not published", description: "collection is not published"
}) })
} }
/> />
@ -179,8 +176,7 @@ const CollectionList = withStyles(styles, { name: "CollectionList" })(
() => ( () => (
<TableRow> <TableRow>
<TableCell colSpan={numberOfColumns}> <TableCell colSpan={numberOfColumns}>
<FormattedMessage defaultMessage="No collections found" <FormattedMessage defaultMessage="No collections found" />
/>
</TableCell> </TableCell>
</TableRow> </TableRow>
) )

View file

@ -30,9 +30,10 @@ const CollectionListPage: React.StatelessComponent<CollectionListPageProps> = ({
variant="contained" variant="contained"
onClick={onAdd} onClick={onAdd}
> >
<FormattedMessage defaultMessage="Add collection" <FormattedMessage
defaultMessage="Add collection"
description="button" description="button"
/> />
<AddIcon /> <AddIcon />
</Button> </Button>
</PageHeader> </PageHeader>

View file

@ -31,30 +31,28 @@ import {
} from "../types/UnassignCollectionProduct"; } from "../types/UnassignCollectionProduct";
interface CollectionUpdateOperationsProps { interface CollectionUpdateOperationsProps {
children: ( children: (props: {
props: { updateCollectionWithHomepage: PartialMutationProviderOutput<
updateCollectionWithHomepage: PartialMutationProviderOutput< CollectionUpdateWithHomepage,
CollectionUpdateWithHomepage, CollectionUpdateWithHomepageVariables
CollectionUpdateWithHomepageVariables >;
>; assignProduct: PartialMutationProviderOutput<
assignProduct: PartialMutationProviderOutput< CollectionAssignProduct,
CollectionAssignProduct, CollectionAssignProductVariables
CollectionAssignProductVariables >;
>; unassignProduct: PartialMutationProviderOutput<
unassignProduct: PartialMutationProviderOutput< UnassignCollectionProduct,
UnassignCollectionProduct, UnassignCollectionProductVariables
UnassignCollectionProductVariables >;
>; updateCollection: PartialMutationProviderOutput<
updateCollection: PartialMutationProviderOutput< CollectionUpdate,
CollectionUpdate, CollectionUpdateVariables
CollectionUpdateVariables >;
>; removeCollection: PartialMutationProviderOutput<
removeCollection: PartialMutationProviderOutput< RemoveCollection,
RemoveCollection, RemoveCollectionVariables
RemoveCollectionVariables >;
>; }) => React.ReactNode;
}
) => React.ReactNode;
onUpdate: (data: CollectionUpdate) => void; onUpdate: (data: CollectionUpdate) => void;
onProductAssign: (data: CollectionAssignProduct) => void; onProductAssign: (data: CollectionAssignProduct) => void;
onProductUnassign: (data: UnassignCollectionProduct) => void; onProductUnassign: (data: UnassignCollectionProduct) => void;

View file

@ -20,8 +20,7 @@ export const CollectionCreate: React.FC = () => {
if (data.collectionCreate.errors.length === 0) { if (data.collectionCreate.errors.length === 0) {
notify({ notify({
text: intl.formatMessage({ text: intl.formatMessage({
defaultMessage: "Created collection", defaultMessage: "Created collection"
}) })
}); });
navigate(collectionUrl(data.collectionCreate.collection.id)); navigate(collectionUrl(data.collectionCreate.collection.id));
@ -50,8 +49,7 @@ export const CollectionCreate: React.FC = () => {
<WindowTitle <WindowTitle
title={intl.formatMessage({ title={intl.formatMessage({
defaultMessage: "Create collection", defaultMessage: "Create collection",
description: "window title", description: "window title"
})} })}
/> />
<CollectionCreatePage <CollectionCreatePage