Remove ids

This commit is contained in:
dominik-zeglen 2019-08-22 18:19:16 +02:00
parent e790ee615f
commit a472c8cd1a
37 changed files with 363 additions and 511 deletions

File diff suppressed because it is too large Load diff

View file

@ -24,11 +24,9 @@ const AttributeBulkDeleteDialog: React.StatelessComponent<
confirmButtonState={confirmButtonState}
onClose={onClose}
onConfirm={onConfirm}
title={intl.formatMessage({
defaultMessage: "Delete attributes",
title={intl.formatMessage({defaultMessage: "Delete attributes",
description: "dialog title",
id: "attributeBulkDeleteDialogTitle"
})}
})}
variant="delete"
>
<DialogContentText>
@ -38,7 +36,6 @@ const AttributeBulkDeleteDialog: React.StatelessComponent<
other {{displayQuantity} attributes}
}?"
description="dialog content"
id="attributeBulkDeleteDialogContent"
values={{
counter: quantity,
displayQuantity: <strong>{quantity}</strong>

View file

@ -29,17 +29,14 @@ const AttributeDeleteDialog: React.FC<AttributeDeleteDialogProps> = ({
confirmButtonState={confirmButtonState}
onConfirm={onConfirm}
variant="delete"
title={intl.formatMessage({
defaultMessage: "Delete attribute",
title={intl.formatMessage({defaultMessage: "Delete attribute",
description: "dialog title",
id: "attributeDeleteDialogTitle"
})}
})}
>
<DialogContentText>
<FormattedMessage
defaultMessage="Are you sure you want to delete {attributeName}?"
description="dialog content"
id="attributeDeleteDialogContent"
values={{
attributeName: <strong>{name}</strong>
}}

View file

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

View file

@ -85,35 +85,35 @@ const AttributeList: React.StatelessComponent<AttributeListProps> = ({
<TableCell className={classes.colSlug}>
<FormattedMessage
defaultMessage="Attribute Code"
id="attributeListSlugColumnHeader"
/>
</TableCell>
<TableCell className={classes.colName}>
<FormattedMessage
defaultMessage="Default Label"
description="attribute's label'"
id="attributeListNameColumnHeader"
/>
</TableCell>
<TableCell className={classes.colVisible}>
<FormattedMessage
defaultMessage="Visible"
description="attribute is visible"
id="attributeListVisibilityColumnHeader"
/>
</TableCell>
<TableCell className={classes.colSearchable}>
<FormattedMessage
defaultMessage="Searchable"
description="attribute can be searched in dashboard"
id="attributeListSearchableColumnHeader"
/>
</TableCell>
<TableCell className={classes.colFaceted}>
<FormattedMessage
defaultMessage="Use in faceted search"
description="attribute can be searched in storefront"
id="attributeListFacetedColumnHeader"
/>
</TableCell>
</TableHead>
@ -187,7 +187,7 @@ const AttributeList: React.StatelessComponent<AttributeListProps> = ({
<TableCell colSpan={numberOfColumns}>
<FormattedMessage
defaultMessage="No attributes found"
id="AttributeListNoAttributes"
/>
</TableCell>
</TableRow>

View file

@ -23,14 +23,11 @@ const AttributeListPage: React.FC<AttributeListPageProps> = ({
return (
<Container>
<PageHeader
title={intl.formatMessage(sectionNames.attributes)}
>
<PageHeader title={intl.formatMessage(sectionNames.attributes)}>
<Button onClick={onAdd} color="primary" variant="contained">
<FormattedMessage
defaultMessage="Add attribute"
description="button"
id="attributeListPageAddAttribute"
/>
<AddIcon />
</Button>

View file

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

View file

@ -37,7 +37,7 @@ const AttributeProperties: React.FC<AttributePropertiesProps> = ({
<FormattedMessage
defaultMessage="General Properties"
description="attribute general properties section"
id="attributePropertiesGeneralSectionTitle"
/>
</Typography>
<Hr />
@ -51,12 +51,12 @@ const AttributeProperties: React.FC<AttributePropertiesProps> = ({
<FormattedMessage
defaultMessage="Variant Attribute"
description="attribute is variant-only"
id="attributePropertiesVariantOnly"
/>
<Typography variant="caption">
<FormattedMessage
defaultMessage="If enabled, you'll be able to use this attribute to create product variants"
id="attributePropertiesVariantOnlyHelperText"
/>
</Typography>
</>
@ -68,7 +68,6 @@ const AttributeProperties: React.FC<AttributePropertiesProps> = ({
<FormattedMessage
defaultMessage="Storefront Properties"
description="attribute properties regarding storefront"
id="attributePropertiesStorefront"
/>
</Typography>
<Hr />
@ -78,8 +77,7 @@ const AttributeProperties: React.FC<AttributePropertiesProps> = ({
disabled={disabled}
label={intl.formatMessage({
defaultMessage: "Use in faceted navigation",
description: "attribute is filterable in storefront",
id: "attributePropertiesUseInFacetedNavigation"
description: "attribute is filterable in storefront"
})}
onChange={onChange}
/>
@ -92,8 +90,7 @@ const AttributeProperties: React.FC<AttributePropertiesProps> = ({
name={"storefrontSearchPosition" as keyof AttributePageFormData}
label={intl.formatMessage({
defaultMessage: "Position in faceted navigation",
description: "attribute position in storefront filters",
id: "attributePropertiesFacetedNavigationPosition"
description: "attribute position in storefront filters"
})}
value={data.storefrontSearchPosition}
onChange={onChange}
@ -106,8 +103,7 @@ const AttributeProperties: React.FC<AttributePropertiesProps> = ({
disabled={disabled}
label={intl.formatMessage({
defaultMessage: "Visible on Product Page in Storefront",
description: "attribute",
id: "attributePropertiesVisibility"
description: "attribute"
})}
onChange={onChange}
/>
@ -116,7 +112,6 @@ const AttributeProperties: React.FC<AttributePropertiesProps> = ({
<FormattedMessage
defaultMessage="Dashboard Properties"
description="attribute properties regarding dashboard"
id="attributePropertiesDashboard"
/>
</Typography>
<Hr />
@ -127,8 +122,7 @@ const AttributeProperties: React.FC<AttributePropertiesProps> = ({
disabled={disabled}
label={intl.formatMessage({
defaultMessage: "Use in Filtering",
description: "use attribute in filtering",
id: "attributePropertiesDashboardFiltering"
description: "use attribute in filtering"
})}
secondLabel={
<Typography variant="caption">

View file

@ -36,14 +36,14 @@ const AttributeValueDeleteDialog: React.FC<AttributeValueDeleteDialogProps> = ({
title={intl.formatMessage({
defaultMessage: "Delete attribute value",
description: "dialog title",
id: "attributeValueDeleteDialogTitle"
})}
>
<DialogContentText>
{useName ? (
<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.'
id="attributeValueDeleteDialogContentWithAttributeName"
values={{
attributeName,
name
@ -53,7 +53,7 @@ const AttributeValueDeleteDialog: React.FC<AttributeValueDeleteDialogProps> = ({
<FormattedMessage
defaultMessage='Are you sure you want to delete "{ name }" value?'
description="delete attribute value"
id="attributeValueDeleteDialogContentWithoutAttributeName"
values={{
name
}}

View file

@ -54,13 +54,13 @@ const AttributeValueEditDialog: React.StatelessComponent<
<FormattedMessage
defaultMessage="Add Value"
description="add attribute value"
id="attributeValueEditDialogTitleNewValue"
/>
) : (
<FormattedMessage
defaultMessage="Edit Value"
description="edit attribute value"
id="attributeValueEditDialogTitle"
/>
)}
</DialogTitle>
@ -78,7 +78,7 @@ const AttributeValueEditDialog: React.StatelessComponent<
label={intl.formatMessage({
defaultMessage: "Name",
description: "attribute name",
id: "attributeValueEditDialogNameField"
})}
value={data.name}
onChange={change}

View file

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

View file

@ -78,8 +78,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ params }) => {
if (data.attributeCreate.errors.length === 0) {
notify({
text: intl.formatMessage({
defaultMessage: "Successfully created attribute",
id: "attributeCreateAttributeCreateSuccess"
defaultMessage: "Successfully created attribute"
})
});
navigate(attributeUrl(data.attributeCreate.attribute.id));
@ -93,8 +92,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ params }) => {
message: intl.formatMessage(
{
defaultMessage: "A value named { name } already exists",
description: "attribute value edit error",
id: "attributeCreateErrorExists"
description: "attribute value edit error"
},
{
name: input.name
@ -115,8 +113,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ params }) => {
message: intl.formatMessage(
{
defaultMessage: "A value named { name } already exists",
description: "attribute value edit error",
id: "attributeCreateErrorExists"
description: "attribute value edit error"
},
{
name: input.name

View file

@ -68,7 +68,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ id, params }) => {
notify({
text: intl.formatMessage({
defaultMessage: "Attribute deleted",
id: "attributeDetailsAttributeRemoveSuccess"
})
});
navigate(attributeListUrl());
@ -80,7 +80,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ id, params }) => {
text: intl.formatMessage({
defaultMessage: "Value deleted",
description: "attribute value deleted",
id: "attributeDetailsAttributeValueDeleteSuccess"
})
});
closeModal();
@ -103,7 +103,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ id, params }) => {
text: intl.formatMessage({
defaultMessage: "Added new value",
description: "added new attribute value",
id: "attributeDetailsAttributeValueCreateSuccess"
})
});
closeModal();

View file

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

View file

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

View file

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

View file

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

View file

@ -55,7 +55,7 @@ export const CategoryDetailsForm = withStyles(styles, {
classes={{ root: classes.root }}
label={intl.formatMessage({
defaultMessage: "Category Name",
id: "categoryDetailsFormNameInputLabel"
})}
name="name"
disabled={disabled}
@ -72,7 +72,7 @@ export const CategoryDetailsForm = withStyles(styles, {
helperText={errors.descriptionJson}
label={intl.formatMessage({
defaultMessage: "Category Description",
id: "categoryDetailsFormDescriptionInputLabel"
})}
initial={maybe(() => JSON.parse(category.descriptionJson))}
name="description"

View file

@ -97,14 +97,14 @@ const CategoryList = withStyles(styles, { name: "CategoryList" })(
title={intl.formatMessage({
defaultMessage: "All Subcategories",
description: "section header",
id: "categoryListSubcategoriesSectionHeader"
})}
toolbar={
<Button color="primary" variant="text" onClick={onAdd}>
<FormattedMessage
defaultMessage="Add subcategory"
description="button"
id="categoryListAddSubcategoryButton"
/>
</Button>
}
@ -122,21 +122,21 @@ const CategoryList = withStyles(styles, { name: "CategoryList" })(
<TableCell className={classes.colName}>
<FormattedMessage
defaultMessage="Category Name"
id="categoryListNameColumnHeader"
/>
</TableCell>
<TableCell className={classes.colSubcategories}>
<FormattedMessage
defaultMessage="Subcategories"
description="number of subcategories"
id="categoryListSubcategoriesColumnHeader"
/>
</TableCell>
<TableCell className={classes.colProducts}>
<FormattedMessage
defaultMessage="No. of Products"
description="number of products"
id="categoryListNumberOfProductsColumnHeader"
/>
</TableCell>
</TableHead>
@ -209,12 +209,12 @@ const CategoryList = withStyles(styles, { name: "CategoryList" })(
{isRoot ? (
<FormattedMessage
defaultMessage="No categories found"
id="categoryListNoCategories"
/>
) : (
<FormattedMessage
defaultMessage="No subcategories found"
id="categoryListNoSubcategories"
/>
)}
</TableCell>

View file

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

View file

@ -70,14 +70,14 @@ export const ProductList = withStyles(styles, { name: "ProductList" })(
title={intl.formatMessage({
defaultMessage: "Products",
description: "section header",
id: "categoryProductsHeader"
})}
toolbar={
<Button variant="text" color="primary" onClick={onAddProduct}>
<FormattedMessage
defaultMessage="Add product"
description="button"
id="categoryProductsAddProductButton"
/>
</Button>
}
@ -90,15 +90,13 @@ export const ProductList = withStyles(styles, { name: "ProductList" })(
<FormattedMessage
defaultMessage="Name"
description="product name"
id="categoryProductsNameHeader"
/>
</TableCell>
<TableCell>
<FormattedMessage
defaultMessage="Type"
<FormattedMessage defaultMessage="Type"
description="product type"
id="categoryProductsTypeHeader"
/>
/>
</TableCell>
</TableRow>
</TableHead>
@ -145,10 +143,8 @@ export const ProductList = withStyles(styles, { name: "ProductList" })(
() => (
<TableRow>
<TableCell colSpan={3}>
<FormattedMessage
defaultMessage="No products found"
id="categoryProductsNoProducts"
/>
<FormattedMessage defaultMessage="No products found"
/>
</TableCell>
</TableRow>
)

View file

@ -38,8 +38,7 @@ export const CategoryProductsCard: React.StatelessComponent<
title={intl.formatMessage(
{
defaultMessage: "Products in {categoryName}",
description: "section header",
id: "categoryProductsCardHeader"
description: "section header"
},
{
categoryName
@ -50,7 +49,6 @@ export const CategoryProductsCard: React.StatelessComponent<
<FormattedMessage
defaultMessage="Add product"
description="button"
id="categoryProductsCardAddProductButton"
/>
</Button>
}

View file

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

View file

@ -26,7 +26,7 @@ export const CategoryCreateView: React.StatelessComponent<
notify({
text: intl.formatMessage({
defaultMessage: "Category created",
id: "categoryCreateCategoryCreated"
})
});
navigate(categoryUrl(data.categoryCreate.category.id));
@ -52,7 +52,7 @@ export const CategoryCreateView: React.StatelessComponent<
title={intl.formatMessage({
defaultMessage: "Create category",
description: "window title",
id: "categoryCreateWindowTitle"
})}
/>
<CategoryCreatePage

View file

@ -66,8 +66,7 @@ export const CategoryDetails: React.StatelessComponent<
if (data.categoryDelete.errors.length === 0) {
notify({
text: intl.formatMessage({
defaultMessage: "Category deleted",
id: "categoryDetailsCategoryDeleted"
defaultMessage: "Category deleted"
})
});
navigate(categoryListUrl());
@ -324,16 +323,13 @@ export const CategoryDetails: React.StatelessComponent<
open={params.action === "delete"}
title={intl.formatMessage({
defaultMessage: "Delete category",
description: "dialog title",
id:
"categoryDetailsDeleteCategoryDialogTitle"
description: "dialog title"
})}
variant="delete"
>
<DialogContentText>
<FormattedMessage
defaultMessage="Are you sure you want to delete {categoryName}?"
id="categoryDetailsDeleteCategoryDialogContent"
values={{
categoryName: (
<strong>
@ -347,10 +343,7 @@ export const CategoryDetails: React.StatelessComponent<
/>
</DialogContentText>
<DialogContentText>
<FormattedMessage
defaultMessage="Remember this will also delete all products assigned to this category."
id="categoryDetailsDeleteCategoryDialogContentAdditionalText"
/>
<FormattedMessage defaultMessage="Remember this will also delete all products assigned to this category." />
</DialogContentText>
</ActionDialog>
<ActionDialog
@ -369,9 +362,7 @@ export const CategoryDetails: React.StatelessComponent<
}
title={intl.formatMessage({
defaultMessage: "Delete categories",
description: "dialog title",
id:
"categoryDetailsDeleteSubcategoriesDialogTitle"
description: "dialog title"
})}
variant="delete"
>
@ -381,7 +372,6 @@ export const CategoryDetails: React.StatelessComponent<
one {this attribute}
other {{displayQuantity} categories}
}?"
id="categoryDetailsDeleteCategoriesDialogContent"
values={{
counter: maybe(
() => params.ids.length
@ -395,10 +385,7 @@ export const CategoryDetails: React.StatelessComponent<
/>
</DialogContentText>
<DialogContentText>
<FormattedMessage
defaultMessage="Remember this will also delete all products assigned to this category."
id="categoryDetailsDeleteCategoriesDialogContentAdditionalText"
/>
<FormattedMessage defaultMessage="Remember this will also delete all products assigned to this category." />
</DialogContentText>
</ActionDialog>
<ActionDialog
@ -414,9 +401,7 @@ export const CategoryDetails: React.StatelessComponent<
}
title={intl.formatMessage({
defaultMessage: "Delete products",
description: "dialog title",
id:
"categoryDetailsDeleteProductsDialogTitle"
description: "dialog title"
})}
variant="delete"
>
@ -427,7 +412,6 @@ export const CategoryDetails: React.StatelessComponent<
one {this attribute}
other {{displayQuantity} products}
}?"
id="categoryDetailsDeleteProductsDialogContent"
values={{
counter: maybe(
() => params.ids.length

View file

@ -128,8 +128,7 @@ export const CategoryList: React.StatelessComponent<CategoryListProps> = ({
open={params.action === "delete"}
title={intl.formatMessage({
defaultMessage: "Delete categories",
description: "dialog title",
id: "categoryListDeleteSubcategoriesDialogTitle"
description: "dialog title"
})}
variant="delete"
>
@ -138,7 +137,6 @@ export const CategoryList: React.StatelessComponent<CategoryListProps> = ({
one {this attribute}
other {{displayQuantity} categories}
}?"
id="categoryListDeleteCategoriesDialogContent"
values={{
counter: maybe(() => params.ids.length),
displayQuantity: (
@ -147,10 +145,7 @@ export const CategoryList: React.StatelessComponent<CategoryListProps> = ({
}}
/>
<DialogContentText>
<FormattedMessage
defaultMessage="Remember this will also delete all products assigned to this category."
id="categoryListDeleteCategoriesDialogContentAdditionalText"
/>
<FormattedMessage defaultMessage="Remember this will also delete all products assigned to this category." />
</DialogContentText>
</ActionDialog>
</>

View file

@ -78,7 +78,7 @@ const CollectionCreatePage: React.StatelessComponent<
title={intl.formatMessage({
defaultMessage: "Add collection",
description: "page header",
id: "collectionCreatePageHeader"
})}
/>
<Grid>
@ -133,7 +133,7 @@ const CollectionCreatePage: React.StatelessComponent<
helperText={intl.formatMessage({
defaultMessage:
"Add search engine title and description to make this collection easier to find",
id: "collectionSeo"
})}
title={data.seoTitle}
titlePlaceholder={data.name}

View file

@ -53,7 +53,7 @@ const CollectionDetails = withStyles(styles, { name: "CollectionDetails" })(
label={intl.formatMessage({
defaultMessage: "Name",
description: "collection name",
id: "collectionDetailsNameInputLabel"
})}
name="name"
disabled={disabled}

View file

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

View file

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

View file

@ -83,23 +83,17 @@ const CollectionList = withStyles(styles, { name: "CollectionList" })(
toolbar={toolbar}
>
<TableCell className={classes.colName}>
<FormattedMessage
defaultMessage="Category Name"
id="collectionListNameColumnHeader"
/>
<FormattedMessage defaultMessage="Category Name"
/>
</TableCell>
<TableCell className={classes.colProducts}>
<FormattedMessage
defaultMessage="No. of Products"
id="collectionListProductsColumnHeader"
/>
<FormattedMessage defaultMessage="No. of Products"
/>
</TableCell>
<TableCell className={classes.colAvailability}>
<FormattedMessage
defaultMessage="Availability"
<FormattedMessage defaultMessage="Availability"
description="collection availability"
id="collectionListAvailabilityColumnHeader"
/>
/>
</TableCell>
</TableHead>
<TableFooter>
@ -166,12 +160,12 @@ const CollectionList = withStyles(styles, { name: "CollectionList" })(
? intl.formatMessage({
defaultMessage: "Published",
description: "collection is published",
id: "collectionListPublished"
})
: intl.formatMessage({
defaultMessage: "Not published",
description: "collection is not published",
id: "collectionListNotPublished"
})
}
/>
@ -185,10 +179,8 @@ const CollectionList = withStyles(styles, { name: "CollectionList" })(
() => (
<TableRow>
<TableCell colSpan={numberOfColumns}>
<FormattedMessage
defaultMessage="No collections found"
id="collectionListNoCollections"
/>
<FormattedMessage defaultMessage="No collections found"
/>
</TableCell>
</TableRow>
)

View file

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

View file

@ -93,8 +93,7 @@ const CollectionProducts = withStyles(styles, { name: "CollectionProducts" })(
!!collection ? (
intl.formatMessage({
defaultMessage: "Products in {name}",
description: "products in collection",
id: "collectionProductsHeader"
description: "products in collection"
})
) : (
<Skeleton />
@ -110,7 +109,6 @@ const CollectionProducts = withStyles(styles, { name: "CollectionProducts" })(
<FormattedMessage
defaultMessage="Assign product"
description="button"
id="collectionProductsAssignProductButton"
/>
</Button>
}
@ -131,7 +129,6 @@ const CollectionProducts = withStyles(styles, { name: "CollectionProducts" })(
<FormattedMessage
defaultMessage="Name"
description="product name"
id="collectionProductsNameColumnHeader"
/>
</span>
</TableCell>
@ -139,14 +136,12 @@ const CollectionProducts = withStyles(styles, { name: "CollectionProducts" })(
<FormattedMessage
defaultMessage="Type"
description="product type"
id="collectionProductsTypeProductList"
/>
</TableCell>
<TableCell className={classes.colPublished}>
<FormattedMessage
defaultMessage="Published"
description="product is published"
id="collectionPublishedColumnHeader"
/>
</TableCell>
<TableCell className={classes.colActions} />
@ -204,13 +199,11 @@ const CollectionProducts = withStyles(styles, { name: "CollectionProducts" })(
product.isPublished
? intl.formatMessage({
defaultMessage: "Published",
description: "product is published",
id: "collectionProductsPublished"
description: "product is published"
})
: intl.formatMessage({
defaultMessage: "Not published",
description: "product is not published",
id: "collectionProductsNotPublished"
description: "product is not published"
})
}
status={product.isPublished ? "success" : "error"}
@ -234,10 +227,7 @@ const CollectionProducts = withStyles(styles, { name: "CollectionProducts" })(
<TableRow>
<TableCell />
<TableCell colSpan={numberOfColumns}>
<FormattedMessage
defaultMessage="No products found"
id="collectionProductsNoProducts"
/>
<FormattedMessage defaultMessage="No products found" />
</TableCell>
</TableRow>
)

View file

@ -21,7 +21,7 @@ export const CollectionCreate: React.FC = () => {
notify({
text: intl.formatMessage({
defaultMessage: "Created collection",
id: "collectionCreateCreatedCollection"
})
});
navigate(collectionUrl(data.collectionCreate.collection.id));
@ -51,7 +51,7 @@ export const CollectionCreate: React.FC = () => {
title={intl.formatMessage({
defaultMessage: "Create collection",
description: "window title",
id: "collectionCreateWindowTitle"
})}
/>
<CollectionCreatePage

View file

@ -99,8 +99,7 @@ export const CollectionDetails: React.StatelessComponent<
if (data.collectionAddProducts.errors.length === 0) {
notify({
text: intl.formatMessage({
defaultMessage: "Added product to collection",
id: "collectionDetailsAddedProduct"
defaultMessage: "Added product to collection"
})
});
navigate(collectionUrl(id), true);
@ -111,8 +110,7 @@ export const CollectionDetails: React.StatelessComponent<
if (data.collectionRemoveProducts.errors.length === 0) {
notify({
text: intl.formatMessage({
defaultMessage: "Deleted product from collection",
id: "collectionDetailsDeletedProduct"
defaultMessage: "Deleted product from collection"
})
});
reset();
@ -124,8 +122,7 @@ export const CollectionDetails: React.StatelessComponent<
if (data.collectionDelete.errors.length === 0) {
notify({
text: intl.formatMessage({
defaultMessage: "Deleted collection",
id: "collectionDetailsDeletedCollection"
defaultMessage: "Deleted collection"
})
});
navigate(collectionListUrl());
@ -278,7 +275,6 @@ export const CollectionDetails: React.StatelessComponent<
<FormattedMessage
defaultMessage="Unassign"
description="unassign product from collection, button"
id="collectionDetailsUnassignButton"
/>
</Button>
}
@ -317,15 +313,13 @@ export const CollectionDetails: React.StatelessComponent<
open={params.action === "remove"}
title={intl.formatMessage({
defaultMessage: "Delete Collection",
description: "dialog title",
id: "collectionDetailsDeleteCollectionDialogTitle"
description: "dialog title"
})}
variant="delete"
>
<DialogContentText>
<FormattedMessage
defaultMessage="Are you sure you want to delete {collectionName}?"
id="collectionDetailsDeleteCollectionDialogContent"
values={{
collectionName: (
<strong>
@ -349,8 +343,7 @@ export const CollectionDetails: React.StatelessComponent<
open={params.action === "unassign"}
title={intl.formatMessage({
defaultMessage: "Unassign products from collection",
description: "dialog title",
id: "collectionDetailsUnassignProductsDialogTitle"
description: "dialog title"
})}
>
<DialogContentText>
@ -359,7 +352,6 @@ export const CollectionDetails: React.StatelessComponent<
one {this product}
other {{displayQuantity} products}
}?"
id="collectionDetailsUnassignProductsDialogContent"
values={{
counter: maybe(() => params.ids.length),
displayQuantity: (
@ -383,16 +375,12 @@ export const CollectionDetails: React.StatelessComponent<
open={params.action === "removeImage"}
title={intl.formatMessage({
defaultMessage: "Delete image",
description: "dialog title",
id: "collectionDetailsDeleteImageTitle"
description: "dialog title"
})}
variant="delete"
>
<DialogContentText>
<FormattedMessage
defaultMessage="Are you sure you want to delete collection's image?"
id="collectionDetailsDeleteImageContent"
/>
<FormattedMessage defaultMessage="Are you sure you want to delete collection's image?" />
</DialogContentText>
</ActionDialog>
</>

View file

@ -152,7 +152,6 @@ export const CollectionList: React.StatelessComponent<CollectionListProps> = ({
<FormattedMessage
defaultMessage="Unpublish"
description="unpublish collections"
id="collectionListUnpublish"
/>
</Button>
<Button
@ -162,7 +161,6 @@ export const CollectionList: React.StatelessComponent<CollectionListProps> = ({
<FormattedMessage
defaultMessage="Publish"
description="publish collections"
id="collectionListPublish"
/>
</Button>
<IconButton
@ -196,8 +194,7 @@ export const CollectionList: React.StatelessComponent<CollectionListProps> = ({
variant="default"
title={intl.formatMessage({
defaultMessage: "Publish collections",
description: "dialog title",
id: "collectionListPublishCollectionsDialogTitle"
description: "dialog title"
})}
>
<DialogContentText>
@ -206,7 +203,6 @@ export const CollectionList: React.StatelessComponent<CollectionListProps> = ({
one {this collection}
other {{displayQuantity} collections}
}?"
id="collectionListPublishCollectionsDialogContent"
values={{
counter: maybe(() => params.ids.length),
displayQuantity: (
@ -236,8 +232,7 @@ export const CollectionList: React.StatelessComponent<CollectionListProps> = ({
variant="default"
title={intl.formatMessage({
defaultMessage: "Unpublish collections",
description: "dialog title",
id: "collectionListUnpublishCollectionsDialogTitle"
description: "dialog title"
})}
>
<DialogContentText>
@ -246,7 +241,6 @@ export const CollectionList: React.StatelessComponent<CollectionListProps> = ({
one {this collection}
other {{displayQuantity} collections}
}?"
id="collectionListUnpublishCollectionsDialogContent"
values={{
counter: maybe(() => params.ids.length),
displayQuantity: (
@ -275,8 +269,7 @@ export const CollectionList: React.StatelessComponent<CollectionListProps> = ({
variant="delete"
title={intl.formatMessage({
defaultMessage: "Delete collections",
description: "dialog title",
id: "collectionListDeleteCollectionsDialogTitle"
description: "dialog title"
})}
>
<DialogContentText>
@ -285,7 +278,6 @@ export const CollectionList: React.StatelessComponent<CollectionListProps> = ({
one {this collection}
other {{displayQuantity} collections}
}?"
id="collectionListDeleteCollectionsDialogContent"
values={{
counter: maybe(() => params.ids.length),
displayQuantity: (

View file

@ -2,63 +2,50 @@ import { defineMessages } from "react-intl";
export const commonMessages = defineMessages({
availability: {
defaultMessage: "Availability",
id: "availability"
defaultMessage: "Availability"
},
cancel: {
defaultMessage: "Cancel",
id: "cancel"
defaultMessage: "Cancel"
},
confirm: {
defaultMessage: "Confirm",
id: "confirm"
defaultMessage: "Confirm"
},
description: {
defaultMessage: "Description",
id: "description"
defaultMessage: "Description"
},
generalInformations: {
defaultMessage: "General Informations",
id: "generalInformations"
defaultMessage: "General Informations"
},
optionalField: {
defaultMessage: "Optional",
description: "field is optional",
id: "optionalField"
description: "field is optional"
},
properties: {
defaultMessage: "Properties",
id: "properties"
defaultMessage: "Properties"
},
save: {
defaultMessage: "save",
id: "save"
defaultMessage: "save"
},
savedChanges: {
defaultMessage: "Saved changes",
id: "savedChanges"
defaultMessage: "Saved changes"
},
uploadImage: {
defaultMessage: "Upload image",
description: "button",
id: "uploadImage"
description: "button"
}
});
export const sectionNames = defineMessages({
attributes: {
defaultMessage: "Attributes",
description: "attributes section name",
id: "attributes"
description: "attributes section name"
},
categories: {
defaultMessage: "Categories",
description: "categories section name",
id: "categories"
description: "categories section name"
},
collections: {
defaultMessage: "Collections",
description: "collections section name",
id: "collections"
description: "collections section name"
}
});