Improve descriptions

This commit is contained in:
dominik-zeglen 2019-08-20 11:29:49 +02:00
parent e75413b962
commit 50cbfa1e17
5 changed files with 12 additions and 18 deletions

View file

@ -122,21 +122,20 @@ const CategoryList = withStyles(styles, { name: "CategoryList" })(
<TableCell className={classes.colName}> <TableCell className={classes.colName}>
<FormattedMessage <FormattedMessage
defaultMessage="Category Name" defaultMessage="Category Name"
description="category list: name column header"
id="categoryListNameColumnHeader" id="categoryListNameColumnHeader"
/> />
</TableCell> </TableCell>
<TableCell className={classes.colSubcategories}> <TableCell className={classes.colSubcategories}>
<FormattedMessage <FormattedMessage
defaultMessage="Subcategories" defaultMessage="Subcategories"
description="category list: subcategories column header" description="number of subcategories"
id="categoryListSubcategoriesColumnHeader" id="categoryListSubcategoriesColumnHeader"
/> />
</TableCell> </TableCell>
<TableCell className={classes.colProducts}> <TableCell className={classes.colProducts}>
<FormattedMessage <FormattedMessage
defaultMessage="No. Products" defaultMessage="No. Products"
description="category list: number of products column header" description="number of products in category"
id="categoryListNumberOfProductsColumnHeader" id="categoryListNumberOfProductsColumnHeader"
/> />
</TableCell> </TableCell>

View file

@ -89,14 +89,14 @@ export const ProductList = withStyles(styles, { name: "ProductList" })(
<TableCell className={classes.textLeft}> <TableCell className={classes.textLeft}>
<FormattedMessage <FormattedMessage
defaultMessage="Name" defaultMessage="Name"
description="product list: product name column header" description="product name"
id="categoryProductsNameHeader" id="categoryProductsNameHeader"
/> />
</TableCell> </TableCell>
<TableCell> <TableCell>
<FormattedMessage <FormattedMessage
defaultMessage="Type" defaultMessage="Type"
description="product list: product type column header" description="product type"
id="categoryProductsTypeHeader" id="categoryProductsTypeHeader"
/> />
</TableCell> </TableCell>

View file

@ -37,7 +37,7 @@ export const CategoryProductsCard: React.StatelessComponent<
title={intl.formatMessage( title={intl.formatMessage(
{ {
defaultMessage: "Products in {name}", defaultMessage: "Products in {name}",
description: "products in category section header", description: "products in category, section header",
id: "categoryProductsCardHeader" id: "categoryProductsCardHeader"
}, },
{ {

View file

@ -164,7 +164,7 @@ export const CategoryUpdatePage: React.StatelessComponent<
> >
<FormattedMessage <FormattedMessage
defaultMessage="Subcategories" defaultMessage="Subcategories"
description="category list: number of subcategories column header" description="number of subcategories in category"
id="categoryUpdatePageSubcategoriesColumnHeader" id="categoryUpdatePageSubcategoriesColumnHeader"
/> />
</CategoriesTab> </CategoriesTab>
@ -174,7 +174,7 @@ export const CategoryUpdatePage: React.StatelessComponent<
> >
<FormattedMessage <FormattedMessage
defaultMessage="Products" defaultMessage="Products"
description="category list: number of products column header" description="number of products in category"
id="categoryUpdatePageProductsColumnHeader" id="categoryUpdatePageProductsColumnHeader"
/> />
</ProductsTab> </ProductsTab>

View file

@ -12,6 +12,7 @@ import useNotifier from "@saleor/hooks/useNotifier";
import usePaginator, { import usePaginator, {
createPaginationState createPaginationState
} from "@saleor/hooks/usePaginator"; } from "@saleor/hooks/usePaginator";
import { commonMessages } from "@saleor/intl";
import { PAGINATE_BY } from "../../config"; import { PAGINATE_BY } from "../../config";
import { getMutationState, maybe } from "../../misc"; import { getMutationState, maybe } from "../../misc";
import { TypedProductBulkDeleteMutation } from "../../products/mutations"; import { TypedProductBulkDeleteMutation } from "../../products/mutations";
@ -65,8 +66,8 @@ export const CategoryDetails: React.StatelessComponent<
if (data.categoryDelete.errors.length === 0) { if (data.categoryDelete.errors.length === 0) {
notify({ notify({
text: intl.formatMessage({ text: intl.formatMessage({
defaultMessage: "Category deleted", defaultMessage: "Category removed",
id: "categoryDetailsCategoryDeleted" id: "categoryDetailsCategoryRemoved"
}) })
}); });
navigate(categoryListUrl()); navigate(categoryListUrl());
@ -142,10 +143,7 @@ export const CategoryDetails: React.StatelessComponent<
if (data.categoryBulkDelete.errors.length === 0) { if (data.categoryBulkDelete.errors.length === 0) {
closeModal(); closeModal();
notify({ notify({
text: intl.formatMessage({ text: intl.formatMessage(commonMessages.savedChanges)
defaultMessage: "Categories removed",
id: "categoryDetailsCategoriesRemoved"
})
}); });
refetch(); refetch();
reset(); reset();
@ -156,10 +154,7 @@ export const CategoryDetails: React.StatelessComponent<
if (data.productBulkDelete.errors.length === 0) { if (data.productBulkDelete.errors.length === 0) {
closeModal(); closeModal();
notify({ notify({
text: intl.formatMessage({ text: intl.formatMessage(commonMessages.savedChanges)
defaultMessage: "Products removed",
id: "categoryDetailsProductsRemoved"
})
}); });
refetch(); refetch();
reset(); reset();