Refactor translations in product type section (#126)
This commit is contained in:
parent
63e4f9bd34
commit
9abc98bdff
19 changed files with 921 additions and 429 deletions
|
@ -1,6 +1,6 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"POT-Creation-Date: 2019-08-26T17:50:42.071Z\n"
|
"POT-Creation-Date: 2019-08-26T17:55:41.507Z\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -223,6 +223,14 @@ msgctxt "button"
|
||||||
msgid "Add product"
|
msgid "Add product"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.json
|
||||||
|
#. [src.productTypes.components.ProductTypeListPage.889729490] - button
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Add product type
|
||||||
|
msgctxt "button"
|
||||||
|
msgid "Add product type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/orders/components/OrderDraftDetails/OrderDraftDetails.json
|
#: build/locale/src/orders/components/OrderDraftDetails/OrderDraftDetails.json
|
||||||
#. [src.orders.components.OrderDraftDetails.2528459381] - button
|
#. [src.orders.components.OrderDraftDetails.2528459381] - button
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -615,6 +623,14 @@ msgctxt "dialog content"
|
||||||
msgid "Are you sure you want to delete {counter,plural,one{this page} other{{displayQuantity} pages}}?"
|
msgid "Are you sure you want to delete {counter,plural,one{this page} other{{displayQuantity} pages}}?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/views/ProductTypeList.json
|
||||||
|
#. [src.productTypes.views.2294091098] - dialog content
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Are you sure you want to delete {counter,plural,one{this product type} other{{displayQuantity} product types}}?
|
||||||
|
msgctxt "dialog content"
|
||||||
|
msgid "Are you sure you want to delete {counter,plural,one{this product type} other{{displayQuantity} product types}}?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/products/views/ProductList/ProductList.json
|
#: build/locale/src/products/views/ProductList/ProductList.json
|
||||||
#. [src.products.views.ProductList.2742463171] - dialog content
|
#. [src.products.views.ProductList.2742463171] - dialog content
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -679,6 +695,14 @@ msgctxt "delete product"
|
||||||
msgid "Are you sure you want to delete {name}?"
|
msgid "Are you sure you want to delete {name}?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeDeleteDialog/ProductTypeDeleteDialog.json
|
||||||
|
#. [src.productTypes.components.ProductTypeDeleteDialog.2297471173] - delete product type
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Are you sure you want to delete {name}?
|
||||||
|
msgctxt "delete product type"
|
||||||
|
msgid "Are you sure you want to delete {name}?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/views/SaleDetails.json
|
#: build/locale/src/discounts/views/SaleDetails.json
|
||||||
#. [src.discounts.views.1457489953] - dialog content
|
#. [src.discounts.views.1457489953] - dialog content
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -759,6 +783,22 @@ msgctxt "description"
|
||||||
msgid "Are you sure you want to remove this image?"
|
msgid "Are you sure you want to remove this image?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeAttributeUnassignDialog/ProductTypeAttributeUnassignDialog.json
|
||||||
|
#. [src.productTypes.components.ProductTypeAttributeUnassignDialog.722498450]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Are you sure you want to unassign {attributeName} from {productTypeName}?
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Are you sure you want to unassign {attributeName} from {productTypeName}?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeBulkAttributeUnassignDialog/ProductTypeBulkAttributeUnassignDialog.json
|
||||||
|
#. [src.productTypes.components.ProductTypeBulkAttributeUnassignDialog.2500510112] - unassign multiple attributes from product type
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Are you sure you want to unassign {counter,plural,one{this attribute} other{{displayQuantity} attributes}} from {productTypeName}?
|
||||||
|
msgctxt "unassign multiple attributes from product type"
|
||||||
|
msgid "Are you sure you want to unassign {counter,plural,one{this attribute} other{{displayQuantity} attributes}} from {productTypeName}?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/views/SaleDetails.json
|
#: build/locale/src/discounts/views/SaleDetails.json
|
||||||
#. [src.discounts.views.376977560] - dialog content
|
#. [src.discounts.views.376977560] - dialog content
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -835,6 +875,14 @@ msgctxt "description"
|
||||||
msgid "Are you sure you want to void this payment?"
|
msgid "Are you sure you want to void this payment?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/AssignAttributeDialog/AssignAttributeDialog.json
|
||||||
|
#. [src.productTypes.components.AssignAttributeDialog.3922579741] - dialog header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Assign Attribute
|
||||||
|
msgctxt "dialog header"
|
||||||
|
msgid "Assign Attribute"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json
|
#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json
|
||||||
#. [src.discounts.components.DiscountCountrySelectDialog.1585396479] - dialog header
|
#. [src.discounts.components.DiscountCountrySelectDialog.1585396479] - dialog header
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -843,6 +891,22 @@ msgctxt "dialog header"
|
||||||
msgid "Assign Countries"
|
msgid "Assign Countries"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.json
|
||||||
|
#. [src.productTypes.components.ProductTypeAttributes.1656462109] - button
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Assign attribute
|
||||||
|
msgctxt "button"
|
||||||
|
msgid "Assign attribute"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/AssignAttributeDialog/AssignAttributeDialog.json
|
||||||
|
#. [src.productTypes.components.AssignAttributeDialog.2173976534] - button
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Assign attributes
|
||||||
|
msgctxt "button"
|
||||||
|
msgid "Assign attributes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/components/DiscountCategories/DiscountCategories.json
|
#: build/locale/src/discounts/components/DiscountCategories/DiscountCategories.json
|
||||||
#. [src.discounts.components.DiscountCategories.3973677075] - button
|
#. [src.discounts.components.DiscountCategories.3973677075] - button
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -915,6 +979,26 @@ msgctxt "description"
|
||||||
msgid "Attribute deleted"
|
msgid "Attribute deleted"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeAttributeEditDialog/ProductTypeAttributeEditDialog.json
|
||||||
|
#. [src.productTypes.components.ProductTypeAttributeEditDialog.1228425832]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Attribute name
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.json
|
||||||
|
#. [src.productTypes.components.ProductTypeAttributes.1228425832]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Attribute name
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Attribute name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeAttributeEditDialog/ProductTypeAttributeEditDialog.json
|
||||||
|
#. [src.productTypes.components.ProductTypeAttributeEditDialog.335542212]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Attribute values
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Attribute values"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/intl.json
|
#: build/locale/src/intl.json
|
||||||
#. [src.attributes] - attributes section name
|
#. [src.attributes] - attributes section name
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -1279,6 +1363,14 @@ msgctxt "product is configurable"
|
||||||
msgid "Configurable"
|
msgid "Configurable"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeList/ProductTypeList.json
|
||||||
|
#. [src.productTypes.components.ProductTypeList.2754779425] - product type
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Configurable
|
||||||
|
msgctxt "product type"
|
||||||
|
msgid "Configurable"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/intl.json
|
#: build/locale/src/intl.json
|
||||||
#. [src.configuration] - configuration section name
|
#. [src.configuration] - configuration section name
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -1439,6 +1531,22 @@ msgctxt "window title"
|
||||||
msgid "Create Product"
|
msgid "Create Product"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/views/ProductTypeCreate.json
|
||||||
|
#. [productTypeCreateHeader] - window title
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Create Product Type
|
||||||
|
msgctxt "window title"
|
||||||
|
msgid "Create Product Type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/views/ProductTypeCreate.json
|
||||||
|
#. [productTypeCreatePageHeader] - header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Create Product Type
|
||||||
|
msgctxt "header"
|
||||||
|
msgid "Create Product Type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/components/SaleCreatePage/SaleCreatePage.json
|
#: build/locale/src/discounts/components/SaleCreatePage/SaleCreatePage.json
|
||||||
#. [src.discounts.components.SaleCreatePage.3866518732] - page header
|
#. [src.discounts.components.SaleCreatePage.3866518732] - page header
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -1779,6 +1887,22 @@ msgctxt "dialog header"
|
||||||
msgid "Delete Product"
|
msgid "Delete Product"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeDeleteDialog/ProductTypeDeleteDialog.json
|
||||||
|
#. [src.productTypes.components.ProductTypeDeleteDialog.924066985] - dialog header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Delete Product Type
|
||||||
|
msgctxt "dialog header"
|
||||||
|
msgid "Delete Product Type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/views/ProductTypeList.json
|
||||||
|
#. [src.productTypes.views.4080551769] - dialog header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Delete Product Types
|
||||||
|
msgctxt "dialog header"
|
||||||
|
msgid "Delete Product Types"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/products/views/ProductUpdate/ProductUpdate.json
|
#: build/locale/src/products/views/ProductUpdate/ProductUpdate.json
|
||||||
#. [src.products.views.ProductUpdate.1454532689] - dialog header
|
#. [src.products.views.ProductUpdate.1454532689] - dialog header
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -2007,6 +2131,14 @@ msgctxt "description"
|
||||||
msgid "Determine attributes used to create product types"
|
msgid "Determine attributes used to create product types"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeList/ProductTypeList.json
|
||||||
|
#. [src.productTypes.components.ProductTypeList.881286562] - product type
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Digital
|
||||||
|
msgctxt "product type"
|
||||||
|
msgid "Digital"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/home/components/HomeScreen.json
|
#: build/locale/src/home/components/HomeScreen.json
|
||||||
#. [homeScreenDisclaimer] - header
|
#. [homeScreenDisclaimer] - header
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -2503,6 +2635,14 @@ msgctxt "product variant stock"
|
||||||
msgid "Inventory"
|
msgid "Inventory"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeShipping/ProductTypeShipping.json
|
||||||
|
#. [src.productTypes.components.ProductTypeShipping.2143413921] - switch button
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Is this product shippable?
|
||||||
|
msgctxt "switch button"
|
||||||
|
msgid "Is this product shippable?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/navigation/components/MenuList/MenuList.json
|
#: build/locale/src/navigation/components/MenuList/MenuList.json
|
||||||
#. [menuListItems] - number of menu items
|
#. [menuListItems] - number of menu items
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -2867,6 +3007,10 @@ msgstr ""
|
||||||
#. [src.attributes.components.AttributeList.1192828581]
|
#. [src.attributes.components.AttributeList.1192828581]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
#. No attributes found
|
#. No attributes found
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.json
|
||||||
|
#. [src.productTypes.components.ProductTypeAttributes.1192828581]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. No attributes found
|
||||||
msgctxt "description"
|
msgctxt "description"
|
||||||
msgid "No attributes found"
|
msgid "No attributes found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -2971,6 +3115,14 @@ msgctxt "description"
|
||||||
msgid "No payments waiting for capture"
|
msgid "No payments waiting for capture"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeList/ProductTypeList.json
|
||||||
|
#. [src.productTypes.components.ProductTypeList.1126553969]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. No product types found
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "No product types found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/categories/components/CategoryProducts/CategoryProducts.json
|
#: build/locale/src/categories/components/CategoryProducts/CategoryProducts.json
|
||||||
#. [src.categories.components.CategoryProducts.1657559629]
|
#. [src.categories.components.CategoryProducts.1657559629]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -3007,6 +3159,14 @@ msgctxt "description"
|
||||||
msgid "No products out of stock"
|
msgid "No products out of stock"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/AssignAttributeDialog/AssignAttributeDialog.json
|
||||||
|
#. [src.productTypes.components.AssignAttributeDialog.4205644805]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. No results found
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "No results found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/components/SaleList/SaleList.json
|
#: build/locale/src/discounts/components/SaleList/SaleList.json
|
||||||
#. [src.discounts.components.SaleList.4101565527]
|
#. [src.discounts.components.SaleList.4101565527]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -3543,6 +3703,14 @@ msgctxt "section header"
|
||||||
msgid "Photo View"
|
msgid "Photo View"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeList/ProductTypeList.json
|
||||||
|
#. [src.productTypes.components.ProductTypeList.966610541] - product type
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Physical
|
||||||
|
msgctxt "product type"
|
||||||
|
msgid "Physical"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/attributes/components/AttributeProperties/AttributeProperties.json
|
#: build/locale/src/attributes/components/AttributeProperties/AttributeProperties.json
|
||||||
#. [src.attributes.components.AttributeProperties.3590282519] - attribute position in storefront filters
|
#. [src.attributes.components.AttributeProperties.3590282519] - attribute position in storefront filters
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -3659,6 +3827,14 @@ msgctxt "product name"
|
||||||
msgid "Product"
|
msgid "Product"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.json
|
||||||
|
#. [src.productTypes.components.ProductTypeAttributes.3559259966] - section header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Product Attributes
|
||||||
|
msgctxt "section header"
|
||||||
|
msgid "Product Attributes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/components/DiscountProducts/DiscountProducts.json
|
#: build/locale/src/discounts/components/DiscountProducts/DiscountProducts.json
|
||||||
#. [src.discounts.components.DiscountProducts.2697405188]
|
#. [src.discounts.components.DiscountProducts.2697405188]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -3679,6 +3855,14 @@ msgctxt "description"
|
||||||
msgid "Product Type"
|
msgid "Product Type"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeDetails/ProductTypeDetails.json
|
||||||
|
#. [src.productTypes.components.ProductTypeDetails.1007996279]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Product Type Name
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Product Type Name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/intl.json
|
#: build/locale/src/intl.json
|
||||||
#. [src.productTypes] - product types section name
|
#. [src.productTypes] - product types section name
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -3715,6 +3899,14 @@ msgctxt "description"
|
||||||
msgid "Product removed"
|
msgid "Product removed"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/views/ProductTypeUpdate/index.json
|
||||||
|
#. [src.productTypes.views.ProductTypeUpdate.3512959355]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Product type deleted
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Product type deleted"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/categories/components/CategoryProducts/CategoryProducts.json
|
#: build/locale/src/categories/components/CategoryProducts/CategoryProducts.json
|
||||||
#. [src.categories.components.CategoryProducts.2968663655] - section header
|
#. [src.categories.components.CategoryProducts.2968663655] - section header
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4147,6 +4339,14 @@ msgctxt "description"
|
||||||
msgid "Saved changes"
|
msgid "Saved changes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/AssignAttributeDialog/AssignAttributeDialog.json
|
||||||
|
#. [src.productTypes.components.AssignAttributeDialog.902296540]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Search Attributes
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Search Attributes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/orders/components/OrderCustomer/OrderCustomer.json
|
#: build/locale/src/orders/components/OrderCustomer/OrderCustomer.json
|
||||||
#. [src.orders.components.OrderCustomer.2433460203]
|
#. [src.orders.components.OrderCustomer.2433460203]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4179,6 +4379,14 @@ msgctxt "description"
|
||||||
msgid "Search Products..."
|
msgid "Search Products..."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/AssignAttributeDialog/AssignAttributeDialog.json
|
||||||
|
#. [src.productTypes.components.AssignAttributeDialog.524117994]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Search by attribute name
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Search by attribute name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json
|
#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json
|
||||||
#. [src.discounts.components.DiscountCountrySelectDialog.2110418881] - search box placeholder
|
#. [src.discounts.components.DiscountCountrySelectDialog.2110418881] - search box placeholder
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4267,6 +4475,14 @@ msgctxt "order shipping method name"
|
||||||
msgid "Shipping"
|
msgid "Shipping"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeShipping/ProductTypeShipping.json
|
||||||
|
#. [src.productTypes.components.ProductTypeShipping.1325966144] - product type shipping settings, section header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Shipping
|
||||||
|
msgctxt "product type shipping settings, section header"
|
||||||
|
msgid "Shipping"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/orders/components/OrderCustomer/OrderCustomer.json
|
#: build/locale/src/orders/components/OrderCustomer/OrderCustomer.json
|
||||||
#. [src.orders.components.OrderCustomer.2758581442]
|
#. [src.orders.components.OrderCustomer.2758581442]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4339,6 +4555,14 @@ msgctxt "product is not configurable"
|
||||||
msgid "Simple"
|
msgid "Simple"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeList/ProductTypeList.json
|
||||||
|
#. [src.productTypes.components.ProductTypeList.1211157042] - product type
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Simple product
|
||||||
|
msgctxt "product type"
|
||||||
|
msgid "Simple product"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/intl.json
|
#: build/locale/src/intl.json
|
||||||
#. [src.siteSettings] - site settings section name
|
#. [src.siteSettings] - site settings section name
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4359,6 +4583,14 @@ msgctxt "page internal name"
|
||||||
msgid "Slug"
|
msgid "Slug"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.json
|
||||||
|
#. [src.productTypes.components.ProductTypeAttributes.3478065224] - attribute internal name
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Slug
|
||||||
|
msgctxt "attribute internal name"
|
||||||
|
msgid "Slug"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/orders/components/OrderDraftFinalizeDialog/OrderDraftFinalizeDialog.json
|
#: build/locale/src/orders/components/OrderDraftFinalizeDialog/OrderDraftFinalizeDialog.json
|
||||||
#. [src.orders.components.OrderDraftFinalizeDialog.2968256006]
|
#. [src.orders.components.OrderDraftFinalizeDialog.2968256006]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4543,6 +4775,14 @@ msgctxt "description"
|
||||||
msgid "Successfully created new page"
|
msgid "Successfully created new page"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/views/ProductTypeCreate.json
|
||||||
|
#. [src.productTypes.views.3822478981]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Successfully created product type
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Successfully created product type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/views/SaleCreate.json
|
#: build/locale/src/discounts/views/SaleCreate.json
|
||||||
#. [src.discounts.views.3707049729]
|
#. [src.discounts.views.3707049729]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4567,6 +4807,14 @@ msgctxt "description"
|
||||||
msgid "Summary"
|
msgid "Summary"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeList/ProductTypeList.json
|
||||||
|
#. [src.productTypes.components.ProductTypeList.1240292548] - tax rate for a product type
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Tax
|
||||||
|
msgctxt "tax rate for a product type"
|
||||||
|
msgid "Tax"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/intl.json
|
#: build/locale/src/intl.json
|
||||||
#. [src.taxes] - taxes section name
|
#. [src.taxes] - taxes section name
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4579,10 +4827,22 @@ msgstr ""
|
||||||
#. [src.orders.components.OrderPayment.3955023266]
|
#. [src.orders.components.OrderPayment.3955023266]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
#. Taxes
|
#. Taxes
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeTaxes/ProductTypeTaxes.json
|
||||||
|
#. [productTypeTaxesInputLabel]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Taxes
|
||||||
msgctxt "description"
|
msgctxt "description"
|
||||||
msgid "Taxes"
|
msgid "Taxes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeTaxes/ProductTypeTaxes.json
|
||||||
|
#. [productTypeTaxesHeader] - section header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Taxes
|
||||||
|
msgctxt "section header"
|
||||||
|
msgid "Taxes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/orders/components/OrderDraftDetailsSummary/OrderDraftDetailsSummary.json
|
#: build/locale/src/orders/components/OrderDraftDetailsSummary/OrderDraftDetailsSummary.json
|
||||||
#. [src.orders.components.OrderDraftDetailsSummary.3202709354]
|
#. [src.orders.components.OrderDraftDetailsSummary.3202709354]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4663,6 +4923,14 @@ msgctxt "description"
|
||||||
msgid "This product has no variants"
|
msgid "This product has no variants"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.json
|
||||||
|
#. [src.productTypes.components.ProductTypeDetailsPage.1756957616] - switch button
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. This product type has variants
|
||||||
|
msgctxt "switch button"
|
||||||
|
msgid "This product type has variants"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/components/SalePricing/SalePricing.json
|
#: build/locale/src/discounts/components/SalePricing/SalePricing.json
|
||||||
#. [src.discounts.components.SalePricing.2503204759] - time during which sale is active
|
#. [src.discounts.components.SalePricing.2503204759] - time during which sale is active
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4803,6 +5071,22 @@ msgctxt "product type"
|
||||||
msgid "Type"
|
msgid "Type"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeList/ProductTypeList.json
|
||||||
|
#. [src.productTypes.components.ProductTypeList.1952810469] - product type is either simple or configurable
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Type
|
||||||
|
msgctxt "product type is either simple or configurable"
|
||||||
|
msgid "Type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeList/ProductTypeList.json
|
||||||
|
#. [src.productTypes.components.ProductTypeList.2253986440] - product type name
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Type Name
|
||||||
|
msgctxt "product type name"
|
||||||
|
msgid "Type Name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/pages/components/PageSlug/PageSlug.json
|
#: build/locale/src/pages/components/PageSlug/PageSlug.json
|
||||||
#. [src.pages.components.PageSlug.1324178587]
|
#. [src.pages.components.PageSlug.1324178587]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4867,6 +5151,30 @@ msgctxt "unassign product from voucher, button"
|
||||||
msgid "Unassign"
|
msgid "Unassign"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/views/ProductTypeUpdate/index.json
|
||||||
|
#. [src.productTypes.views.ProductTypeUpdate.870815507] - unassign attribute from product type, button
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Unassign
|
||||||
|
msgctxt "unassign attribute from product type, button"
|
||||||
|
msgid "Unassign"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeAttributeUnassignDialog/ProductTypeAttributeUnassignDialog.json
|
||||||
|
#. [src.productTypes.components.ProductTypeAttributeUnassignDialog.404238501] - dialog header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Unassign Attribute From Product Type
|
||||||
|
msgctxt "dialog header"
|
||||||
|
msgid "Unassign Attribute From Product Type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeBulkAttributeUnassignDialog/ProductTypeBulkAttributeUnassignDialog.json
|
||||||
|
#. [src.productTypes.components.ProductTypeBulkAttributeUnassignDialog.766918870] - dialog header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Unassign Attribute from Product Type
|
||||||
|
msgctxt "dialog header"
|
||||||
|
msgid "Unassign Attribute from Product Type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/views/SaleDetails.json
|
#: build/locale/src/discounts/views/SaleDetails.json
|
||||||
#. [src.discounts.views.1827854264] - dialog header
|
#. [src.discounts.views.1827854264] - dialog header
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -5067,6 +5375,14 @@ msgctxt "description"
|
||||||
msgid "Use variants for products that come in a variety of versions for example different sizes or colors"
|
msgid "Use variants for products that come in a variety of versions for example different sizes or colors"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeShipping/ProductTypeShipping.json
|
||||||
|
#. [src.productTypes.components.ProductTypeShipping.2927891783]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Used to calculate rates for shipping for products of this product type, when specific weight is not given
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Used to calculate rates for shipping for products of this product type, when specific weight is not given"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/customers/components/CustomerDetails/CustomerDetails.json
|
#: build/locale/src/customers/components/CustomerDetails/CustomerDetails.json
|
||||||
#. [src.customers.components.CustomerDetails.2968565128] - check to mark this account as active
|
#. [src.customers.components.CustomerDetails.2968565128] - check to mark this account as active
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -5155,6 +5471,14 @@ msgctxt "attribute values"
|
||||||
msgid "Values"
|
msgid "Values"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.json
|
||||||
|
#. [src.productTypes.components.ProductTypeAttributes.888493112] - section header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Variant Attributes
|
||||||
|
msgctxt "section header"
|
||||||
|
msgid "Variant Attributes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/products/views/ProductVariant.json
|
#: build/locale/src/products/views/ProductVariant.json
|
||||||
#. [src.products.views.2279302139]
|
#. [src.products.views.2279302139]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -5279,6 +5603,14 @@ msgctxt "vouchers section name"
|
||||||
msgid "Vouchers"
|
msgid "Vouchers"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/productTypes/components/ProductTypeShipping/ProductTypeShipping.json
|
||||||
|
#. [src.productTypes.components.ProductTypeShipping.746695941]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Weight
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Weight"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/orders/components/OrderPayment/OrderPayment.json
|
#: build/locale/src/orders/components/OrderPayment/OrderPayment.json
|
||||||
#. [orderPaymentVATDoesNotApply] - vat not included in order price
|
#. [orderPaymentVATDoesNotApply] - vat not included in order price
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
|
|
@ -15,6 +15,7 @@ import Typography from "@material-ui/core/Typography";
|
||||||
import makeStyles from "@material-ui/styles/makeStyles";
|
import makeStyles from "@material-ui/styles/makeStyles";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import InfiniteScroll from "react-infinite-scroller";
|
import InfiniteScroll from "react-infinite-scroller";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import Checkbox from "@saleor/components/Checkbox";
|
import Checkbox from "@saleor/components/Checkbox";
|
||||||
import ConfirmButton, {
|
import ConfirmButton, {
|
||||||
|
@ -23,7 +24,7 @@ import ConfirmButton, {
|
||||||
import useModalDialogErrors from "@saleor/hooks/useModalDialogErrors";
|
import useModalDialogErrors from "@saleor/hooks/useModalDialogErrors";
|
||||||
import useModalDialogOpen from "@saleor/hooks/useModalDialogOpen";
|
import useModalDialogOpen from "@saleor/hooks/useModalDialogOpen";
|
||||||
import useSearchQuery from "@saleor/hooks/useSearchQuery";
|
import useSearchQuery from "@saleor/hooks/useSearchQuery";
|
||||||
import i18n from "@saleor/i18n";
|
import { buttonMessages } from "@saleor/intl";
|
||||||
import { maybe, renderCollection } from "@saleor/misc";
|
import { maybe, renderCollection } from "@saleor/misc";
|
||||||
import { FetchMoreProps } from "@saleor/types";
|
import { FetchMoreProps } from "@saleor/types";
|
||||||
import { SearchAttributes_productType_availableAttributes_edges_node } from "../../containers/SearchAttributes/types/SearchAttributes";
|
import { SearchAttributes_productType_availableAttributes_edges_node } from "../../containers/SearchAttributes/types/SearchAttributes";
|
||||||
|
@ -73,6 +74,7 @@ const AssignAttributeDialog: React.FC<AssignAttributeDialogProps> = ({
|
||||||
onSubmit,
|
onSubmit,
|
||||||
onToggle
|
onToggle
|
||||||
}: AssignAttributeDialogProps) => {
|
}: AssignAttributeDialogProps) => {
|
||||||
|
const intl = useIntl();
|
||||||
const classes = useStyles({});
|
const classes = useStyles({});
|
||||||
const [query, onQueryChange, resetQuery] = useSearchQuery(onFetch);
|
const [query, onQueryChange, resetQuery] = useSearchQuery(onFetch);
|
||||||
const errors = useModalDialogErrors(apiErrors, open);
|
const errors = useModalDialogErrors(apiErrors, open);
|
||||||
|
@ -84,17 +86,22 @@ const AssignAttributeDialog: React.FC<AssignAttributeDialogProps> = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog onClose={onClose} open={open} fullWidth maxWidth="sm">
|
<Dialog onClose={onClose} open={open} fullWidth maxWidth="sm">
|
||||||
<DialogTitle>{i18n.t("Assign Attribute")}</DialogTitle>
|
<DialogTitle>
|
||||||
|
<FormattedMessage
|
||||||
|
defaultMessage="Assign Attribute"
|
||||||
|
description="dialog header"
|
||||||
|
/>
|
||||||
|
</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<TextField
|
<TextField
|
||||||
name="query"
|
name="query"
|
||||||
value={query}
|
value={query}
|
||||||
onChange={onQueryChange}
|
onChange={onQueryChange}
|
||||||
label={i18n.t("Search Attributes", {
|
label={intl.formatMessage({
|
||||||
context: "attribute search input label"
|
defaultMessage: "Search Attributes"
|
||||||
})}
|
})}
|
||||||
placeholder={i18n.t("Search by attribute name", {
|
placeholder={intl.formatMessage({
|
||||||
context: "attribute search input placeholder"
|
defaultMessage: "Search by attribute name"
|
||||||
})}
|
})}
|
||||||
fullWidth
|
fullWidth
|
||||||
InputProps={{
|
InputProps={{
|
||||||
|
@ -153,7 +160,7 @@ const AssignAttributeDialog: React.FC<AssignAttributeDialogProps> = ({
|
||||||
!loading && (
|
!loading && (
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell colSpan={2}>
|
<TableCell colSpan={2}>
|
||||||
{i18n.t("No results found")}
|
<FormattedMessage defaultMessage="No results found" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
)
|
)
|
||||||
|
@ -173,7 +180,7 @@ const AssignAttributeDialog: React.FC<AssignAttributeDialogProps> = ({
|
||||||
)}
|
)}
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={onClose}>
|
<Button onClick={onClose}>
|
||||||
{i18n.t("Cancel", { context: "button" })}
|
<FormattedMessage {...buttonMessages.cancel} />
|
||||||
</Button>
|
</Button>
|
||||||
<ConfirmButton
|
<ConfirmButton
|
||||||
transitionState={confirmButtonState}
|
transitionState={confirmButtonState}
|
||||||
|
@ -182,7 +189,10 @@ const AssignAttributeDialog: React.FC<AssignAttributeDialogProps> = ({
|
||||||
type="submit"
|
type="submit"
|
||||||
onClick={onSubmit}
|
onClick={onSubmit}
|
||||||
>
|
>
|
||||||
{i18n.t("Assign attributes", { context: "button" })}
|
<FormattedMessage
|
||||||
|
defaultMessage="Assign attributes"
|
||||||
|
description="button"
|
||||||
|
/>
|
||||||
</ConfirmButton>
|
</ConfirmButton>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
|
@ -5,11 +5,12 @@ import DialogContent from "@material-ui/core/DialogContent";
|
||||||
import DialogTitle from "@material-ui/core/DialogTitle";
|
import DialogTitle from "@material-ui/core/DialogTitle";
|
||||||
import TextField from "@material-ui/core/TextField";
|
import TextField from "@material-ui/core/TextField";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import Form from "@saleor/components/Form";
|
import Form from "@saleor/components/Form";
|
||||||
import { FormSpacer } from "@saleor/components/FormSpacer";
|
import { FormSpacer } from "@saleor/components/FormSpacer";
|
||||||
import ListField from "@saleor/components/ListField";
|
import ListField from "@saleor/components/ListField";
|
||||||
import i18n from "../../../i18n";
|
import { buttonMessages } from "@saleor/intl";
|
||||||
|
|
||||||
export interface FormData {
|
export interface FormData {
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -39,6 +40,8 @@ export interface ProductTypeAttributeEditDialogProps {
|
||||||
const ProductTypeAttributeEditDialog: React.StatelessComponent<
|
const ProductTypeAttributeEditDialog: React.StatelessComponent<
|
||||||
ProductTypeAttributeEditDialogProps
|
ProductTypeAttributeEditDialogProps
|
||||||
> = ({ disabled, errors, name, opened, title, values, onClose, onConfirm }) => {
|
> = ({ disabled, errors, name, opened, title, values, onClose, onConfirm }) => {
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
const initialForm: FormData = {
|
const initialForm: FormData = {
|
||||||
name: name || "",
|
name: name || "",
|
||||||
values: values || []
|
values: values || []
|
||||||
|
@ -54,7 +57,9 @@ const ProductTypeAttributeEditDialog: React.StatelessComponent<
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
error={!!formErrors.name}
|
error={!!formErrors.name}
|
||||||
fullWidth
|
fullWidth
|
||||||
label={i18n.t("Attribute name")}
|
label={intl.formatMessage({
|
||||||
|
defaultMessage: "Attribute name"
|
||||||
|
})}
|
||||||
helperText={formErrors.name}
|
helperText={formErrors.name}
|
||||||
name="name"
|
name="name"
|
||||||
value={data.name}
|
value={data.name}
|
||||||
|
@ -71,7 +76,9 @@ const ProductTypeAttributeEditDialog: React.StatelessComponent<
|
||||||
}
|
}
|
||||||
fullWidth
|
fullWidth
|
||||||
name="values"
|
name="values"
|
||||||
label={i18n.t("Attribute values")}
|
label={intl.formatMessage({
|
||||||
|
defaultMessage: "Attribute values"
|
||||||
|
})}
|
||||||
helperText={
|
helperText={
|
||||||
formErrors.values ||
|
formErrors.values ||
|
||||||
formErrors.addValues ||
|
formErrors.addValues ||
|
||||||
|
@ -83,10 +90,10 @@ const ProductTypeAttributeEditDialog: React.StatelessComponent<
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={onClose}>
|
<Button onClick={onClose}>
|
||||||
{i18n.t("Cancel", { context: "button" })}
|
<FormattedMessage {...buttonMessages.cancel} />
|
||||||
</Button>
|
</Button>
|
||||||
<Button color="primary" variant="contained" type="submit">
|
<Button color="primary" variant="contained" type="submit">
|
||||||
{i18n.t("Save", { context: "button" })}
|
<FormattedMessage {...buttonMessages.confirm} />
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import DialogContentText from "@material-ui/core/DialogContentText";
|
import DialogContentText from "@material-ui/core/DialogContentText";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import ActionDialog from "@saleor/components/ActionDialog";
|
import ActionDialog from "@saleor/components/ActionDialog";
|
||||||
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
|
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
|
||||||
import i18n from "@saleor/i18n";
|
|
||||||
|
|
||||||
export interface ProductTypeAttributeUnassignDialogProps {
|
export interface ProductTypeAttributeUnassignDialogProps {
|
||||||
attributeName: string;
|
attributeName: string;
|
||||||
|
@ -23,27 +23,32 @@ const ProductTypeAttributeUnassignDialog: React.FC<
|
||||||
productTypeName,
|
productTypeName,
|
||||||
onClose,
|
onClose,
|
||||||
onConfirm
|
onConfirm
|
||||||
}) => (
|
}) => {
|
||||||
<ActionDialog
|
const intl = useIntl();
|
||||||
confirmButtonState={confirmButtonState}
|
|
||||||
open={open}
|
return (
|
||||||
onClose={onClose}
|
<ActionDialog
|
||||||
onConfirm={onConfirm}
|
confirmButtonState={confirmButtonState}
|
||||||
title={i18n.t("Unassign attribute from product type")}
|
open={open}
|
||||||
>
|
onClose={onClose}
|
||||||
<DialogContentText
|
onConfirm={onConfirm}
|
||||||
dangerouslySetInnerHTML={{
|
title={intl.formatMessage({
|
||||||
__html: i18n.t(
|
defaultMessage: "Unassign Attribute From Product Type",
|
||||||
"Are you sure you want to unassign <strong>{{ attributeName }}</strong> from <strong>{{ productTypeName }}</strong>?",
|
description: "dialog header"
|
||||||
{
|
})}
|
||||||
attributeName,
|
>
|
||||||
productTypeName
|
<DialogContentText>
|
||||||
}
|
<FormattedMessage
|
||||||
)
|
defaultMessage="Are you sure you want to unassign {attributeName} from {productTypeName}?"
|
||||||
}}
|
values={{
|
||||||
/>
|
attributeName: <strong>{attributeName}</strong>,
|
||||||
</ActionDialog>
|
productTypeName: <strong>{productTypeName}</strong>
|
||||||
);
|
}}
|
||||||
|
/>
|
||||||
|
</DialogContentText>
|
||||||
|
</ActionDialog>
|
||||||
|
);
|
||||||
|
};
|
||||||
ProductTypeAttributeUnassignDialog.displayName =
|
ProductTypeAttributeUnassignDialog.displayName =
|
||||||
"ProductTypeAttributeUnassignDialog";
|
"ProductTypeAttributeUnassignDialog";
|
||||||
export default ProductTypeAttributeUnassignDialog;
|
export default ProductTypeAttributeUnassignDialog;
|
||||||
|
|
|
@ -12,6 +12,7 @@ import TableCell from "@material-ui/core/TableCell";
|
||||||
import TableRow from "@material-ui/core/TableRow";
|
import TableRow from "@material-ui/core/TableRow";
|
||||||
import DeleteIcon from "@material-ui/icons/Delete";
|
import DeleteIcon from "@material-ui/icons/Delete";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import Checkbox from "@saleor/components/Checkbox";
|
import Checkbox from "@saleor/components/Checkbox";
|
||||||
|
@ -21,7 +22,6 @@ import {
|
||||||
SortableTableRow
|
SortableTableRow
|
||||||
} from "@saleor/components/SortableTable";
|
} from "@saleor/components/SortableTable";
|
||||||
import TableHead from "@saleor/components/TableHead";
|
import TableHead from "@saleor/components/TableHead";
|
||||||
import i18n from "@saleor/i18n";
|
|
||||||
import { maybe, renderCollection, stopPropagation } from "@saleor/misc";
|
import { maybe, renderCollection, stopPropagation } from "@saleor/misc";
|
||||||
import { ListActions, ReorderAction } from "@saleor/types";
|
import { ListActions, ReorderAction } from "@saleor/types";
|
||||||
import { AttributeTypeEnum } from "@saleor/types/globalTypes";
|
import { AttributeTypeEnum } from "@saleor/types/globalTypes";
|
||||||
|
@ -81,105 +81,123 @@ const ProductTypeAttributes = withStyles(styles, {
|
||||||
onAttributeClick,
|
onAttributeClick,
|
||||||
onAttributeReorder,
|
onAttributeReorder,
|
||||||
onAttributeUnassign
|
onAttributeUnassign
|
||||||
}: ProductTypeAttributesProps & WithStyles<typeof styles>) => (
|
}: ProductTypeAttributesProps & WithStyles<typeof styles>) => {
|
||||||
<Card>
|
const intl = useIntl();
|
||||||
<CardTitle
|
|
||||||
title={
|
|
||||||
type === AttributeTypeEnum.PRODUCT
|
|
||||||
? i18n.t("Product Attributes")
|
|
||||||
: i18n.t("Variant Attributes")
|
|
||||||
}
|
|
||||||
toolbar={
|
|
||||||
<Button
|
|
||||||
color="primary"
|
|
||||||
variant="text"
|
|
||||||
onClick={() => onAttributeAssign(AttributeTypeEnum[type])}
|
|
||||||
>
|
|
||||||
{i18n.t("Assign attribute", { context: "button" })}
|
|
||||||
</Button>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<Table>
|
|
||||||
<TableHead
|
|
||||||
colSpan={numberOfColumns}
|
|
||||||
disabled={disabled}
|
|
||||||
dragRows
|
|
||||||
selected={selected}
|
|
||||||
items={attributes}
|
|
||||||
toggleAll={toggleAll}
|
|
||||||
toolbar={toolbar}
|
|
||||||
>
|
|
||||||
<TableCell className={classes.colName}>
|
|
||||||
{i18n.t("Attribute name")}
|
|
||||||
</TableCell>
|
|
||||||
<TableCell className={classes.colName}>{i18n.t("Slug")}</TableCell>
|
|
||||||
<TableCell />
|
|
||||||
</TableHead>
|
|
||||||
<SortableTableBody onSortEnd={onAttributeReorder}>
|
|
||||||
{renderCollection(
|
|
||||||
attributes,
|
|
||||||
(attribute, attributeIndex) => {
|
|
||||||
const isSelected = attribute ? isChecked(attribute.id) : false;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SortableTableRow
|
<Card>
|
||||||
selected={isSelected}
|
<CardTitle
|
||||||
className={!!attribute ? classes.link : undefined}
|
title={
|
||||||
hover={!!attribute}
|
type === AttributeTypeEnum.PRODUCT
|
||||||
onClick={
|
? intl.formatMessage({
|
||||||
!!attribute
|
defaultMessage: "Product Attributes",
|
||||||
? () => onAttributeClick(attribute.id)
|
description: "section header"
|
||||||
: undefined
|
})
|
||||||
}
|
: intl.formatMessage({
|
||||||
key={maybe(() => attribute.id)}
|
defaultMessage: "Variant Attributes",
|
||||||
index={attributeIndex || 0}
|
description: "section header"
|
||||||
>
|
})
|
||||||
<TableCell padding="checkbox">
|
}
|
||||||
<Checkbox
|
toolbar={
|
||||||
checked={isSelected}
|
<Button
|
||||||
disabled={disabled}
|
color="primary"
|
||||||
disableClickPropagation
|
variant="text"
|
||||||
onChange={() => toggle(attribute.id)}
|
onClick={() => onAttributeAssign(AttributeTypeEnum[type])}
|
||||||
/>
|
>
|
||||||
</TableCell>
|
<FormattedMessage
|
||||||
<TableCell className={classes.colName}>
|
defaultMessage="Assign attribute"
|
||||||
{maybe(() => attribute.name) ? (
|
description="button"
|
||||||
attribute.name
|
/>
|
||||||
) : (
|
</Button>
|
||||||
<Skeleton />
|
}
|
||||||
)}
|
/>
|
||||||
</TableCell>
|
<Table>
|
||||||
<TableCell className={classes.colSlug}>
|
<TableHead
|
||||||
{maybe(() => attribute.slug) ? (
|
colSpan={numberOfColumns}
|
||||||
attribute.slug
|
disabled={disabled}
|
||||||
) : (
|
dragRows
|
||||||
<Skeleton />
|
selected={selected}
|
||||||
)}
|
items={attributes}
|
||||||
</TableCell>
|
toggleAll={toggleAll}
|
||||||
<TableCell className={classes.iconCell}>
|
toolbar={toolbar}
|
||||||
<IconButton
|
>
|
||||||
onClick={stopPropagation(() =>
|
<TableCell className={classes.colName}>
|
||||||
onAttributeUnassign(attribute.id)
|
<FormattedMessage defaultMessage="Attribute name" />
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className={classes.colName}>
|
||||||
|
<FormattedMessage
|
||||||
|
defaultMessage="Slug"
|
||||||
|
description="attribute internal name"
|
||||||
|
/>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell />
|
||||||
|
</TableHead>
|
||||||
|
<SortableTableBody onSortEnd={onAttributeReorder}>
|
||||||
|
{renderCollection(
|
||||||
|
attributes,
|
||||||
|
(attribute, attributeIndex) => {
|
||||||
|
const isSelected = attribute ? isChecked(attribute.id) : false;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SortableTableRow
|
||||||
|
selected={isSelected}
|
||||||
|
className={!!attribute ? classes.link : undefined}
|
||||||
|
hover={!!attribute}
|
||||||
|
onClick={
|
||||||
|
!!attribute
|
||||||
|
? () => onAttributeClick(attribute.id)
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
|
key={maybe(() => attribute.id)}
|
||||||
|
index={attributeIndex || 0}
|
||||||
|
>
|
||||||
|
<TableCell padding="checkbox">
|
||||||
|
<Checkbox
|
||||||
|
checked={isSelected}
|
||||||
|
disabled={disabled}
|
||||||
|
disableClickPropagation
|
||||||
|
onChange={() => toggle(attribute.id)}
|
||||||
|
/>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className={classes.colName}>
|
||||||
|
{maybe(() => attribute.name) ? (
|
||||||
|
attribute.name
|
||||||
|
) : (
|
||||||
|
<Skeleton />
|
||||||
)}
|
)}
|
||||||
>
|
</TableCell>
|
||||||
<DeleteIcon color="primary" />
|
<TableCell className={classes.colSlug}>
|
||||||
</IconButton>
|
{maybe(() => attribute.slug) ? (
|
||||||
|
attribute.slug
|
||||||
|
) : (
|
||||||
|
<Skeleton />
|
||||||
|
)}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className={classes.iconCell}>
|
||||||
|
<IconButton
|
||||||
|
onClick={stopPropagation(() =>
|
||||||
|
onAttributeUnassign(attribute.id)
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<DeleteIcon color="primary" />
|
||||||
|
</IconButton>
|
||||||
|
</TableCell>
|
||||||
|
</SortableTableRow>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
() => (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={numberOfColumns}>
|
||||||
|
<FormattedMessage defaultMessage="No attributes found" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</SortableTableRow>
|
</TableRow>
|
||||||
);
|
)
|
||||||
},
|
)}
|
||||||
() => (
|
</SortableTableBody>
|
||||||
<TableRow>
|
</Table>
|
||||||
<TableCell colSpan={numberOfColumns}>
|
</Card>
|
||||||
{i18n.t("No attributes found")}
|
);
|
||||||
</TableCell>
|
}
|
||||||
</TableRow>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
</SortableTableBody>
|
|
||||||
</Table>
|
|
||||||
</Card>
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
ProductTypeAttributes.displayName = "ProductTypeAttributes";
|
ProductTypeAttributes.displayName = "ProductTypeAttributes";
|
||||||
export default ProductTypeAttributes;
|
export default ProductTypeAttributes;
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import DialogContentText from "@material-ui/core/DialogContentText";
|
import DialogContentText from "@material-ui/core/DialogContentText";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import ActionDialog from "@saleor/components/ActionDialog";
|
import ActionDialog from "@saleor/components/ActionDialog";
|
||||||
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
|
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
|
||||||
import i18n from "@saleor/i18n";
|
|
||||||
|
|
||||||
export interface ProductTypeBulkAttributeUnassignDialogProps {
|
export interface ProductTypeBulkAttributeUnassignDialogProps {
|
||||||
attributeQuantity: string;
|
attributeQuantity: number;
|
||||||
confirmButtonState: ConfirmButtonTransitionState;
|
confirmButtonState: ConfirmButtonTransitionState;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
productTypeName: string;
|
productTypeName: string;
|
||||||
|
@ -23,27 +23,37 @@ const ProductTypeBulkAttributeUnassignDialog: React.FC<
|
||||||
productTypeName,
|
productTypeName,
|
||||||
onClose,
|
onClose,
|
||||||
onConfirm
|
onConfirm
|
||||||
}) => (
|
}) => {
|
||||||
<ActionDialog
|
const intl = useIntl();
|
||||||
confirmButtonState={confirmButtonState}
|
|
||||||
open={open}
|
return (
|
||||||
onClose={onClose}
|
<ActionDialog
|
||||||
onConfirm={onConfirm}
|
confirmButtonState={confirmButtonState}
|
||||||
title={i18n.t("Unassign attribute from product type")}
|
open={open}
|
||||||
>
|
onClose={onClose}
|
||||||
<DialogContentText
|
onConfirm={onConfirm}
|
||||||
dangerouslySetInnerHTML={{
|
title={intl.formatMessage({
|
||||||
__html: i18n.t(
|
defaultMessage: "Unassign Attribute from Product Type",
|
||||||
"Are you sure you want to unassign <strong>{{ attributeQuantity }}</strong> attributes from <strong>{{ productTypeName }}</strong>?",
|
description: "dialog header"
|
||||||
{
|
})}
|
||||||
attributeQuantity,
|
>
|
||||||
productTypeName
|
<DialogContentText>
|
||||||
}
|
<FormattedMessage
|
||||||
)
|
defaultMessage="Are you sure you want to unassign {counter, plural,
|
||||||
}}
|
one {this attribute}
|
||||||
/>
|
other {{displayQuantity} attributes}
|
||||||
</ActionDialog>
|
} from {productTypeName}?"
|
||||||
);
|
description="unassign multiple attributes from product type"
|
||||||
|
values={{
|
||||||
|
attributeQuantity: <strong>{attributeQuantity}</strong>,
|
||||||
|
counter: attributeQuantity,
|
||||||
|
productTypeName: <strong>{productTypeName}</strong>
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</DialogContentText>
|
||||||
|
</ActionDialog>
|
||||||
|
);
|
||||||
|
};
|
||||||
ProductTypeBulkAttributeUnassignDialog.displayName =
|
ProductTypeBulkAttributeUnassignDialog.displayName =
|
||||||
"ProductTypeBulkAttributeUnassignDialog";
|
"ProductTypeBulkAttributeUnassignDialog";
|
||||||
export default ProductTypeBulkAttributeUnassignDialog;
|
export default ProductTypeBulkAttributeUnassignDialog;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
import AppHeader from "@saleor/components/AppHeader";
|
import AppHeader from "@saleor/components/AppHeader";
|
||||||
import CardSpacer from "@saleor/components/CardSpacer";
|
import CardSpacer from "@saleor/components/CardSpacer";
|
||||||
|
@ -10,7 +11,7 @@ import PageHeader from "@saleor/components/PageHeader";
|
||||||
import SaveButtonBar from "@saleor/components/SaveButtonBar";
|
import SaveButtonBar from "@saleor/components/SaveButtonBar";
|
||||||
import { ChangeEvent, FormChange } from "@saleor/hooks/useForm";
|
import { ChangeEvent, FormChange } from "@saleor/hooks/useForm";
|
||||||
import useStateFromProps from "@saleor/hooks/useStateFromProps";
|
import useStateFromProps from "@saleor/hooks/useStateFromProps";
|
||||||
import i18n from "@saleor/i18n";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { ProductTypeDetails_taxTypes } from "@saleor/productTypes/types/ProductTypeDetails";
|
import { ProductTypeDetails_taxTypes } from "@saleor/productTypes/types/ProductTypeDetails";
|
||||||
import { UserError } from "@saleor/types";
|
import { UserError } from "@saleor/types";
|
||||||
import { WeightUnitsEnum } from "@saleor/types/globalTypes";
|
import { WeightUnitsEnum } from "@saleor/types/globalTypes";
|
||||||
|
@ -67,6 +68,7 @@ const ProductTypeCreatePage: React.StatelessComponent<
|
||||||
onBack,
|
onBack,
|
||||||
onSubmit
|
onSubmit
|
||||||
}: ProductTypeCreatePageProps) => {
|
}: ProductTypeCreatePageProps) => {
|
||||||
|
const intl = useIntl();
|
||||||
const [taxTypeDisplayName, setTaxTypeDisplayName] = useStateFromProps("");
|
const [taxTypeDisplayName, setTaxTypeDisplayName] = useStateFromProps("");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -78,7 +80,9 @@ const ProductTypeCreatePage: React.StatelessComponent<
|
||||||
>
|
>
|
||||||
{({ change, data, errors: formErrors, hasChanged, submit }) => (
|
{({ change, data, errors: formErrors, hasChanged, submit }) => (
|
||||||
<Container>
|
<Container>
|
||||||
<AppHeader onBack={onBack}>{i18n.t("Product Types")}</AppHeader>
|
<AppHeader onBack={onBack}>
|
||||||
|
{intl.formatMessage(sectionNames.productTypes)}
|
||||||
|
</AppHeader>
|
||||||
<PageHeader title={pageTitle} />
|
<PageHeader title={pageTitle} />
|
||||||
<Grid>
|
<Grid>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import DialogContentText from "@material-ui/core/DialogContentText";
|
import DialogContentText from "@material-ui/core/DialogContentText";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import ActionDialog from "@saleor/components/ActionDialog";
|
import ActionDialog from "@saleor/components/ActionDialog";
|
||||||
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
|
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
|
||||||
import i18n from "@saleor/i18n";
|
|
||||||
|
|
||||||
export interface ProductTypeDeleteDialogProps {
|
export interface ProductTypeDeleteDialogProps {
|
||||||
confirmButtonState: ConfirmButtonTransitionState;
|
confirmButtonState: ConfirmButtonTransitionState;
|
||||||
|
@ -19,25 +19,31 @@ const ProductTypeDeleteDialog: React.FC<ProductTypeDeleteDialogProps> = ({
|
||||||
name,
|
name,
|
||||||
onClose,
|
onClose,
|
||||||
onConfirm
|
onConfirm
|
||||||
}) => (
|
}) => {
|
||||||
<ActionDialog
|
const intl = useIntl();
|
||||||
confirmButtonState={confirmButtonState}
|
|
||||||
open={open}
|
return (
|
||||||
onClose={onClose}
|
<ActionDialog
|
||||||
onConfirm={onConfirm}
|
confirmButtonState={confirmButtonState}
|
||||||
title={i18n.t("Remove product type")}
|
open={open}
|
||||||
>
|
onClose={onClose}
|
||||||
<DialogContentText
|
onConfirm={onConfirm}
|
||||||
dangerouslySetInnerHTML={{
|
title={intl.formatMessage({
|
||||||
__html: i18n.t(
|
defaultMessage: "Delete Product Type",
|
||||||
"Are you sure you want to remove <strong>{{ name }}</strong>?",
|
description: "dialog header"
|
||||||
{
|
})}
|
||||||
name
|
>
|
||||||
}
|
<DialogContentText>
|
||||||
)
|
<FormattedMessage
|
||||||
}}
|
defaultMessage="Are you sure you want to delete {name}?"
|
||||||
/>
|
description="delete product type"
|
||||||
</ActionDialog>
|
values={{
|
||||||
);
|
name: <strong>{name}</strong>
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</DialogContentText>
|
||||||
|
</ActionDialog>
|
||||||
|
);
|
||||||
|
};
|
||||||
ProductTypeDeleteDialog.displayName = "ProductTypeDeleteDialog";
|
ProductTypeDeleteDialog.displayName = "ProductTypeDeleteDialog";
|
||||||
export default ProductTypeDeleteDialog;
|
export default ProductTypeDeleteDialog;
|
||||||
|
|
|
@ -3,9 +3,10 @@ import CardContent from "@material-ui/core/CardContent";
|
||||||
import { createStyles, withStyles, WithStyles } from "@material-ui/core/styles";
|
import { createStyles, withStyles, WithStyles } from "@material-ui/core/styles";
|
||||||
import TextField from "@material-ui/core/TextField";
|
import TextField from "@material-ui/core/TextField";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import i18n from "@saleor/i18n";
|
import { commonMessages } from "@saleor/intl";
|
||||||
import { FormErrors } from "@saleor/types";
|
import { FormErrors } from "@saleor/types";
|
||||||
|
|
||||||
const styles = createStyles({
|
const styles = createStyles({
|
||||||
|
@ -24,23 +25,31 @@ interface ProductTypeDetailsProps extends WithStyles<typeof styles> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const ProductTypeDetails = withStyles(styles, { name: "ProductTypeDetails" })(
|
const ProductTypeDetails = withStyles(styles, { name: "ProductTypeDetails" })(
|
||||||
({ classes, data, disabled, errors, onChange }: ProductTypeDetailsProps) => (
|
({ classes, data, disabled, errors, onChange }: ProductTypeDetailsProps) => {
|
||||||
<Card className={classes.root}>
|
const intl = useIntl();
|
||||||
<CardTitle title={i18n.t("Information")} />
|
|
||||||
<CardContent>
|
return (
|
||||||
<TextField
|
<Card className={classes.root}>
|
||||||
disabled={disabled}
|
<CardTitle
|
||||||
error={!!errors.name}
|
title={intl.formatMessage(commonMessages.generalInformations)}
|
||||||
fullWidth
|
|
||||||
helperText={errors.name}
|
|
||||||
label={i18n.t("Product Type Name")}
|
|
||||||
name="name"
|
|
||||||
onChange={onChange}
|
|
||||||
value={data.name}
|
|
||||||
/>
|
/>
|
||||||
</CardContent>
|
<CardContent>
|
||||||
</Card>
|
<TextField
|
||||||
)
|
disabled={disabled}
|
||||||
|
error={!!errors.name}
|
||||||
|
fullWidth
|
||||||
|
helperText={errors.name}
|
||||||
|
label={intl.formatMessage({
|
||||||
|
defaultMessage: "Product Type Name"
|
||||||
|
})}
|
||||||
|
name="name"
|
||||||
|
onChange={onChange}
|
||||||
|
value={data.name}
|
||||||
|
/>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
ProductTypeDetails.displayName = "ProductTypeDetails";
|
ProductTypeDetails.displayName = "ProductTypeDetails";
|
||||||
export default ProductTypeDetails;
|
export default ProductTypeDetails;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
import AppHeader from "@saleor/components/AppHeader";
|
import AppHeader from "@saleor/components/AppHeader";
|
||||||
import CardSpacer from "@saleor/components/CardSpacer";
|
import CardSpacer from "@saleor/components/CardSpacer";
|
||||||
|
@ -11,7 +12,7 @@ import PageHeader from "@saleor/components/PageHeader";
|
||||||
import SaveButtonBar from "@saleor/components/SaveButtonBar";
|
import SaveButtonBar from "@saleor/components/SaveButtonBar";
|
||||||
import { ChangeEvent, FormChange } from "@saleor/hooks/useForm";
|
import { ChangeEvent, FormChange } from "@saleor/hooks/useForm";
|
||||||
import useStateFromProps from "@saleor/hooks/useStateFromProps";
|
import useStateFromProps from "@saleor/hooks/useStateFromProps";
|
||||||
import i18n from "@saleor/i18n";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { maybe } from "@saleor/misc";
|
import { maybe } from "@saleor/misc";
|
||||||
import { ListActions, ReorderEvent, UserError } from "@saleor/types";
|
import { ListActions, ReorderEvent, UserError } from "@saleor/types";
|
||||||
import { AttributeTypeEnum, WeightUnitsEnum } from "@saleor/types/globalTypes";
|
import { AttributeTypeEnum, WeightUnitsEnum } from "@saleor/types/globalTypes";
|
||||||
|
@ -90,6 +91,7 @@ const ProductTypeDetailsPage: React.StatelessComponent<
|
||||||
onDelete,
|
onDelete,
|
||||||
onSubmit
|
onSubmit
|
||||||
}) => {
|
}) => {
|
||||||
|
const intl = useIntl();
|
||||||
const [taxTypeDisplayName, setTaxTypeDisplayName] = useStateFromProps(
|
const [taxTypeDisplayName, setTaxTypeDisplayName] = useStateFromProps(
|
||||||
maybe(() => productType.taxType.description)
|
maybe(() => productType.taxType.description)
|
||||||
);
|
);
|
||||||
|
@ -129,7 +131,9 @@ const ProductTypeDetailsPage: React.StatelessComponent<
|
||||||
>
|
>
|
||||||
{({ change, data, errors: formErrors, hasChanged, submit }) => (
|
{({ change, data, errors: formErrors, hasChanged, submit }) => (
|
||||||
<Container>
|
<Container>
|
||||||
<AppHeader onBack={onBack}>{i18n.t("Product Types")}</AppHeader>
|
<AppHeader onBack={onBack}>
|
||||||
|
{intl.formatMessage(sectionNames.productTypes)}
|
||||||
|
</AppHeader>
|
||||||
<PageHeader title={pageTitle} />
|
<PageHeader title={pageTitle} />
|
||||||
<Grid>
|
<Grid>
|
||||||
<div>
|
<div>
|
||||||
|
@ -171,7 +175,10 @@ const ProductTypeDetailsPage: React.StatelessComponent<
|
||||||
<ControlledCheckbox
|
<ControlledCheckbox
|
||||||
checked={data.hasVariants}
|
checked={data.hasVariants}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
label={i18n.t("This product type has variants")}
|
label={intl.formatMessage({
|
||||||
|
defaultMessage: "This product type has variants",
|
||||||
|
description: "switch button"
|
||||||
|
})}
|
||||||
name="hasVariants"
|
name="hasVariants"
|
||||||
onChange={change}
|
onChange={change}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -12,12 +12,12 @@ import TableFooter from "@material-ui/core/TableFooter";
|
||||||
import TableRow from "@material-ui/core/TableRow";
|
import TableRow from "@material-ui/core/TableRow";
|
||||||
import Typography from "@material-ui/core/Typography";
|
import Typography from "@material-ui/core/Typography";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import Checkbox from "@saleor/components/Checkbox";
|
import Checkbox from "@saleor/components/Checkbox";
|
||||||
import Skeleton from "@saleor/components/Skeleton";
|
import Skeleton from "@saleor/components/Skeleton";
|
||||||
import TableHead from "@saleor/components/TableHead";
|
import TableHead from "@saleor/components/TableHead";
|
||||||
import TablePagination from "@saleor/components/TablePagination";
|
import TablePagination from "@saleor/components/TablePagination";
|
||||||
import i18n from "../../../i18n";
|
|
||||||
import { maybe, renderCollection } from "../../../misc";
|
import { maybe, renderCollection } from "../../../misc";
|
||||||
import { ListActions, ListProps } from "../../../types";
|
import { ListActions, ListProps } from "../../../types";
|
||||||
import { ProductTypeList_productTypes_edges_node } from "../../types/ProductTypeList";
|
import { ProductTypeList_productTypes_edges_node } from "../../types/ProductTypeList";
|
||||||
|
@ -64,115 +64,144 @@ const ProductTypeList = withStyles(styles, { name: "ProductTypeList" })(
|
||||||
toggle,
|
toggle,
|
||||||
toggleAll,
|
toggleAll,
|
||||||
toolbar
|
toolbar
|
||||||
}: ProductTypeListProps) => (
|
}: ProductTypeListProps) => {
|
||||||
<Card>
|
const intl = useIntl();
|
||||||
<Table>
|
|
||||||
<TableHead
|
return (
|
||||||
colSpan={numberOfColumns}
|
<Card>
|
||||||
selected={selected}
|
<Table>
|
||||||
disabled={disabled}
|
<TableHead
|
||||||
items={productTypes}
|
colSpan={numberOfColumns}
|
||||||
toggleAll={toggleAll}
|
selected={selected}
|
||||||
toolbar={toolbar}
|
disabled={disabled}
|
||||||
>
|
items={productTypes}
|
||||||
<TableCell className={classes.colName}>
|
toggleAll={toggleAll}
|
||||||
{i18n.t("Type Name", { context: "table header" })}
|
toolbar={toolbar}
|
||||||
</TableCell>
|
>
|
||||||
<TableCell className={classes.colType}>
|
<TableCell className={classes.colName}>
|
||||||
{i18n.t("Type", { context: "table header" })}
|
<FormattedMessage
|
||||||
</TableCell>
|
defaultMessage="Type Name"
|
||||||
<TableCell className={classes.colTax}>
|
description="product type name"
|
||||||
{i18n.t("Tax", { context: "table header" })}
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableHead>
|
<TableCell className={classes.colType}>
|
||||||
<TableFooter>
|
<FormattedMessage
|
||||||
<TableRow>
|
defaultMessage="Type"
|
||||||
<TablePagination
|
description="product type is either simple or configurable"
|
||||||
colSpan={numberOfColumns}
|
/>
|
||||||
hasNextPage={pageInfo && !disabled ? pageInfo.hasNextPage : false}
|
</TableCell>
|
||||||
onNextPage={onNextPage}
|
<TableCell className={classes.colTax}>
|
||||||
hasPreviousPage={
|
<FormattedMessage
|
||||||
pageInfo && !disabled ? pageInfo.hasPreviousPage : false
|
defaultMessage="Tax"
|
||||||
}
|
description="tax rate for a product type"
|
||||||
onPreviousPage={onPreviousPage}
|
/>
|
||||||
/>
|
</TableCell>
|
||||||
</TableRow>
|
</TableHead>
|
||||||
</TableFooter>
|
<TableFooter>
|
||||||
<TableBody>
|
<TableRow>
|
||||||
{renderCollection(
|
<TablePagination
|
||||||
productTypes,
|
colSpan={numberOfColumns}
|
||||||
productType => {
|
hasNextPage={
|
||||||
const isSelected = productType
|
pageInfo && !disabled ? pageInfo.hasNextPage : false
|
||||||
? isChecked(productType.id)
|
}
|
||||||
: false;
|
onNextPage={onNextPage}
|
||||||
return (
|
hasPreviousPage={
|
||||||
<TableRow
|
pageInfo && !disabled ? pageInfo.hasPreviousPage : false
|
||||||
className={!!productType ? classes.link : undefined}
|
}
|
||||||
hover={!!productType}
|
onPreviousPage={onPreviousPage}
|
||||||
key={productType ? productType.id : "skeleton"}
|
/>
|
||||||
onClick={productType ? onRowClick(productType.id) : undefined}
|
</TableRow>
|
||||||
selected={isSelected}
|
</TableFooter>
|
||||||
>
|
<TableBody>
|
||||||
<TableCell padding="checkbox">
|
{renderCollection(
|
||||||
<Checkbox
|
productTypes,
|
||||||
checked={isSelected}
|
productType => {
|
||||||
disabled={disabled}
|
const isSelected = productType
|
||||||
disableClickPropagation
|
? isChecked(productType.id)
|
||||||
onChange={() => toggle(productType.id)}
|
: false;
|
||||||
/>
|
return (
|
||||||
</TableCell>
|
<TableRow
|
||||||
<TableCell className={classes.colName}>
|
className={!!productType ? classes.link : undefined}
|
||||||
{productType ? (
|
hover={!!productType}
|
||||||
<>
|
key={productType ? productType.id : "skeleton"}
|
||||||
{productType.name}
|
onClick={
|
||||||
<Typography variant="caption">
|
productType ? onRowClick(productType.id) : undefined
|
||||||
{maybe(() => productType.hasVariants)
|
}
|
||||||
? i18n.t("Configurable", {
|
selected={isSelected}
|
||||||
context: "product type"
|
>
|
||||||
})
|
<TableCell padding="checkbox">
|
||||||
: i18n.t("Simple product", {
|
<Checkbox
|
||||||
context: "product type"
|
checked={isSelected}
|
||||||
})}
|
disabled={disabled}
|
||||||
</Typography>
|
disableClickPropagation
|
||||||
</>
|
onChange={() => toggle(productType.id)}
|
||||||
) : (
|
/>
|
||||||
<Skeleton />
|
</TableCell>
|
||||||
)}
|
<TableCell className={classes.colName}>
|
||||||
</TableCell>
|
{productType ? (
|
||||||
<TableCell className={classes.colType}>
|
<>
|
||||||
{maybe(() => productType.isShippingRequired) !==
|
{productType.name}
|
||||||
undefined ? (
|
<Typography variant="caption">
|
||||||
productType.isShippingRequired ? (
|
{maybe(() => productType.hasVariants)
|
||||||
<>{i18n.t("Physical", { context: "product type" })}</>
|
? intl.formatMessage({
|
||||||
|
defaultMessage: "Configurable",
|
||||||
|
description: "product type"
|
||||||
|
})
|
||||||
|
: intl.formatMessage({
|
||||||
|
defaultMessage: "Simple product",
|
||||||
|
description: "product type"
|
||||||
|
})}
|
||||||
|
</Typography>
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>{i18n.t("Digital", { context: "product type" })}</>
|
<Skeleton />
|
||||||
)
|
)}
|
||||||
) : (
|
</TableCell>
|
||||||
<Skeleton />
|
<TableCell className={classes.colType}>
|
||||||
)}
|
{maybe(() => productType.isShippingRequired) !==
|
||||||
</TableCell>
|
undefined ? (
|
||||||
<TableCell className={classes.colTax}>
|
productType.isShippingRequired ? (
|
||||||
{maybe(() => productType.taxType) ? (
|
<>
|
||||||
productType.taxType.description
|
<FormattedMessage
|
||||||
) : (
|
defaultMessage="Physical"
|
||||||
<Skeleton />
|
description="product type"
|
||||||
)}
|
/>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<FormattedMessage
|
||||||
|
defaultMessage="Digital"
|
||||||
|
description="product type"
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<Skeleton />
|
||||||
|
)}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className={classes.colTax}>
|
||||||
|
{maybe(() => productType.taxType) ? (
|
||||||
|
productType.taxType.description
|
||||||
|
) : (
|
||||||
|
<Skeleton />
|
||||||
|
)}
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
() => (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={numberOfColumns}>
|
||||||
|
<FormattedMessage defaultMessage="No product types found" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
)
|
||||||
},
|
)}
|
||||||
() => (
|
</TableBody>
|
||||||
<TableRow>
|
</Table>
|
||||||
<TableCell colSpan={numberOfColumns}>
|
</Card>
|
||||||
{i18n.t("No product types found")}
|
);
|
||||||
</TableCell>
|
}
|
||||||
</TableRow>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
</TableBody>
|
|
||||||
</Table>
|
|
||||||
</Card>
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
ProductTypeList.displayName = "ProductTypeList";
|
ProductTypeList.displayName = "ProductTypeList";
|
||||||
export default ProductTypeList;
|
export default ProductTypeList;
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
import Button from "@material-ui/core/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import AddIcon from "@material-ui/icons/Add";
|
import AddIcon from "@material-ui/icons/Add";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import AppHeader from "@saleor/components/AppHeader";
|
import AppHeader from "@saleor/components/AppHeader";
|
||||||
import Container from "@saleor/components/Container";
|
import Container from "@saleor/components/Container";
|
||||||
import PageHeader from "@saleor/components/PageHeader";
|
import PageHeader from "@saleor/components/PageHeader";
|
||||||
import i18n from "../../../i18n";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { ListActions, PageListProps } from "../../../types";
|
import { ListActions, PageListProps } from "../../../types";
|
||||||
import { ProductTypeList_productTypes_edges_node } from "../../types/ProductTypeList";
|
import { ProductTypeList_productTypes_edges_node } from "../../types/ProductTypeList";
|
||||||
import ProductTypeList from "../ProductTypeList";
|
import ProductTypeList from "../ProductTypeList";
|
||||||
|
@ -17,21 +18,31 @@ interface ProductTypeListPageProps extends PageListProps, ListActions {
|
||||||
|
|
||||||
const ProductTypeListPage: React.StatelessComponent<
|
const ProductTypeListPage: React.StatelessComponent<
|
||||||
ProductTypeListPageProps
|
ProductTypeListPageProps
|
||||||
> = ({ disabled, onAdd, onBack, ...listProps }) => (
|
> = ({ disabled, onAdd, onBack, ...listProps }) => {
|
||||||
<Container>
|
const intl = useIntl();
|
||||||
<AppHeader onBack={onBack}>{i18n.t("Configuration")}</AppHeader>
|
|
||||||
<PageHeader title={i18n.t("Product types")}>
|
return (
|
||||||
<Button
|
<Container>
|
||||||
color="primary"
|
<AppHeader onBack={onBack}>
|
||||||
variant="contained"
|
{intl.formatMessage(sectionNames.configuration)}
|
||||||
disabled={disabled}
|
</AppHeader>
|
||||||
onClick={onAdd}
|
<PageHeader title={intl.formatMessage(sectionNames.productTypes)}>
|
||||||
>
|
<Button
|
||||||
{i18n.t("Add product type")} <AddIcon />
|
color="primary"
|
||||||
</Button>
|
variant="contained"
|
||||||
</PageHeader>
|
disabled={disabled}
|
||||||
<ProductTypeList disabled={disabled} {...listProps} />
|
onClick={onAdd}
|
||||||
</Container>
|
>
|
||||||
);
|
<FormattedMessage
|
||||||
|
defaultMessage="Add product type"
|
||||||
|
description="button"
|
||||||
|
/>{" "}
|
||||||
|
<AddIcon />
|
||||||
|
</Button>
|
||||||
|
</PageHeader>
|
||||||
|
<ProductTypeList disabled={disabled} {...listProps} />
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
};
|
||||||
ProductTypeListPage.displayName = "ProductTypeListPage";
|
ProductTypeListPage.displayName = "ProductTypeListPage";
|
||||||
export default ProductTypeListPage;
|
export default ProductTypeListPage;
|
||||||
|
|
|
@ -2,10 +2,10 @@ import Card from "@material-ui/core/Card";
|
||||||
import CardContent from "@material-ui/core/CardContent";
|
import CardContent from "@material-ui/core/CardContent";
|
||||||
import TextField from "@material-ui/core/TextField";
|
import TextField from "@material-ui/core/TextField";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import { ControlledCheckbox } from "@saleor/components/ControlledCheckbox";
|
import { ControlledCheckbox } from "@saleor/components/ControlledCheckbox";
|
||||||
import i18n from "../../../i18n";
|
|
||||||
import { WeightUnitsEnum } from "../../../types/globalTypes";
|
import { WeightUnitsEnum } from "../../../types/globalTypes";
|
||||||
|
|
||||||
interface ProductTypeShippingProps {
|
interface ProductTypeShippingProps {
|
||||||
|
@ -20,34 +20,49 @@ interface ProductTypeShippingProps {
|
||||||
|
|
||||||
const ProductTypeShipping: React.StatelessComponent<
|
const ProductTypeShipping: React.StatelessComponent<
|
||||||
ProductTypeShippingProps
|
ProductTypeShippingProps
|
||||||
> = ({ data, defaultWeightUnit, disabled, onChange }) => (
|
> = ({ data, defaultWeightUnit, disabled, onChange }) => {
|
||||||
<Card>
|
const intl = useIntl();
|
||||||
<CardTitle title={i18n.t("Shipping")} />
|
|
||||||
<CardContent>
|
return (
|
||||||
<ControlledCheckbox
|
<Card>
|
||||||
checked={data.isShippingRequired}
|
<CardTitle
|
||||||
disabled={disabled}
|
title={intl.formatMessage({
|
||||||
label={i18n.t("Is this product shippable?")}
|
defaultMessage: "Shipping",
|
||||||
name="isShippingRequired"
|
description: "product type shipping settings, section header"
|
||||||
onChange={onChange}
|
})}
|
||||||
/>
|
/>
|
||||||
{data.isShippingRequired && (
|
<CardContent>
|
||||||
<TextField
|
<ControlledCheckbox
|
||||||
|
checked={data.isShippingRequired}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
InputProps={{ endAdornment: defaultWeightUnit }}
|
label={intl.formatMessage({
|
||||||
label={i18n.t("Weight")}
|
defaultMessage: "Is this product shippable?",
|
||||||
name="weight"
|
description: "switch button"
|
||||||
helperText={i18n.t(
|
})}
|
||||||
"Used to calculate rates for shipping for products of this product type, when specific weight is not given"
|
name="isShippingRequired"
|
||||||
)}
|
|
||||||
type="number"
|
|
||||||
value={data.weight}
|
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
/>
|
/>
|
||||||
)}
|
{data.isShippingRequired && (
|
||||||
</CardContent>
|
<TextField
|
||||||
</Card>
|
disabled={disabled}
|
||||||
);
|
InputProps={{ endAdornment: defaultWeightUnit }}
|
||||||
|
label={intl.formatMessage({
|
||||||
|
defaultMessage: "Weight"
|
||||||
|
})}
|
||||||
|
name="weight"
|
||||||
|
helperText={intl.formatMessage({
|
||||||
|
defaultMessage:
|
||||||
|
"Used to calculate rates for shipping for products of this product type, when specific weight is not given"
|
||||||
|
})}
|
||||||
|
type="number"
|
||||||
|
value={data.weight}
|
||||||
|
onChange={onChange}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
ProductTypeShipping.displayName = "ProductTypeShipping";
|
ProductTypeShipping.displayName = "ProductTypeShipping";
|
||||||
export default ProductTypeShipping;
|
export default ProductTypeShipping;
|
||||||
|
|
|
@ -2,11 +2,11 @@ import Card from "@material-ui/core/Card";
|
||||||
import CardContent from "@material-ui/core/CardContent";
|
import CardContent from "@material-ui/core/CardContent";
|
||||||
import { createStyles, withStyles, WithStyles } from "@material-ui/core/styles";
|
import { createStyles, withStyles, WithStyles } from "@material-ui/core/styles";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import SingleAutocompleteSelectField from "@saleor/components/SingleAutocompleteSelectField";
|
import SingleAutocompleteSelectField from "@saleor/components/SingleAutocompleteSelectField";
|
||||||
import { ProductTypeDetails_taxTypes } from "@saleor/productTypes/types/ProductTypeDetails";
|
import { ProductTypeDetails_taxTypes } from "@saleor/productTypes/types/ProductTypeDetails";
|
||||||
import i18n from "../../../i18n";
|
|
||||||
import { maybe } from "../../../misc";
|
import { maybe } from "../../../misc";
|
||||||
import { ProductTypeForm } from "../ProductTypeDetailsPage/ProductTypeDetailsPage";
|
import { ProductTypeForm } from "../ProductTypeDetailsPage/ProductTypeDetailsPage";
|
||||||
|
|
||||||
|
@ -34,29 +34,42 @@ const ProductTypeTaxes = withStyles(styles, { name: "ProductTypeTaxes" })(
|
||||||
taxTypes,
|
taxTypes,
|
||||||
taxTypeDisplayName,
|
taxTypeDisplayName,
|
||||||
onChange
|
onChange
|
||||||
}: ProductTypeTaxesProps) => (
|
}: ProductTypeTaxesProps) => {
|
||||||
<Card className={classes.root}>
|
const intl = useIntl();
|
||||||
<CardTitle title={i18n.t("Taxes")} />
|
|
||||||
<CardContent>
|
return (
|
||||||
<SingleAutocompleteSelectField
|
<Card className={classes.root}>
|
||||||
disabled={disabled}
|
<CardTitle
|
||||||
displayValue={taxTypeDisplayName}
|
title={intl.formatMessage({
|
||||||
label={i18n.t("Taxes")}
|
defaultMessage: "Taxes",
|
||||||
name={"taxType" as keyof ProductTypeForm}
|
description: "section header",
|
||||||
onChange={onChange}
|
id: "productTypeTaxesHeader"
|
||||||
value={data.taxType}
|
})}
|
||||||
choices={maybe(
|
|
||||||
() =>
|
|
||||||
taxTypes.map(c => ({ label: c.description, value: c.taxCode })),
|
|
||||||
[]
|
|
||||||
)}
|
|
||||||
InputProps={{
|
|
||||||
autoComplete: "off"
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</CardContent>
|
<CardContent>
|
||||||
</Card>
|
<SingleAutocompleteSelectField
|
||||||
)
|
disabled={disabled}
|
||||||
|
displayValue={taxTypeDisplayName}
|
||||||
|
label={intl.formatMessage({
|
||||||
|
defaultMessage: "Taxes",
|
||||||
|
id: "productTypeTaxesInputLabel"
|
||||||
|
})}
|
||||||
|
name={"taxType" as keyof ProductTypeForm}
|
||||||
|
onChange={onChange}
|
||||||
|
value={data.taxType}
|
||||||
|
choices={maybe(
|
||||||
|
() =>
|
||||||
|
taxTypes.map(c => ({ label: c.description, value: c.taxCode })),
|
||||||
|
[]
|
||||||
|
)}
|
||||||
|
InputProps={{
|
||||||
|
autoComplete: "off"
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
ProductTypeTaxes.displayName = "ProductTypeTaxes";
|
ProductTypeTaxes.displayName = "ProductTypeTaxes";
|
||||||
export default ProductTypeTaxes;
|
export default ProductTypeTaxes;
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import { parse as parseQs } from "qs";
|
import { parse as parseQs } from "qs";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useIntl } from "react-intl";
|
||||||
import { Route, RouteComponentProps, Switch } from "react-router-dom";
|
import { Route, RouteComponentProps, Switch } from "react-router-dom";
|
||||||
|
|
||||||
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { WindowTitle } from "../components/WindowTitle";
|
import { WindowTitle } from "../components/WindowTitle";
|
||||||
import i18n from "../i18n";
|
|
||||||
import {
|
import {
|
||||||
productTypeAddPath,
|
productTypeAddPath,
|
||||||
productTypeListPath,
|
productTypeListPath,
|
||||||
|
@ -40,17 +41,19 @@ const ProductTypeUpdate: React.StatelessComponent<
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ProductTypeRouter: React.StatelessComponent<
|
export const ProductTypeRouter: React.FC = () => {
|
||||||
RouteComponentProps<any>
|
const intl = useIntl();
|
||||||
> = () => (
|
|
||||||
<>
|
return (
|
||||||
<WindowTitle title={i18n.t("Product types")} />
|
<>
|
||||||
<Switch>
|
<WindowTitle title={intl.formatMessage(sectionNames.productTypes)} />
|
||||||
<Route exact path={productTypeListPath} component={ProductTypeList} />
|
<Switch>
|
||||||
<Route exact path={productTypeAddPath} component={ProductTypeCreate} />
|
<Route exact path={productTypeListPath} component={ProductTypeList} />
|
||||||
<Route path={productTypePath(":id")} component={ProductTypeUpdate} />
|
<Route exact path={productTypeAddPath} component={ProductTypeCreate} />
|
||||||
</Switch>
|
<Route path={productTypePath(":id")} component={ProductTypeUpdate} />
|
||||||
</>
|
</Switch>
|
||||||
);
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
ProductTypeRouter.displayName = "ProductTypeRouter";
|
ProductTypeRouter.displayName = "ProductTypeRouter";
|
||||||
export default ProductTypeRouter;
|
export default ProductTypeRouter;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
import { WindowTitle } from "@saleor/components/WindowTitle";
|
import { WindowTitle } from "@saleor/components/WindowTitle";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import i18n from "../../i18n";
|
|
||||||
import { getMutationState, maybe } from "../../misc";
|
import { getMutationState, maybe } from "../../misc";
|
||||||
import ProductTypeCreatePage, {
|
import ProductTypeCreatePage, {
|
||||||
ProductTypeForm
|
ProductTypeForm
|
||||||
|
@ -16,11 +16,14 @@ import { productTypeListUrl, productTypeUrl } from "../urls";
|
||||||
export const ProductTypeCreate: React.StatelessComponent = () => {
|
export const ProductTypeCreate: React.StatelessComponent = () => {
|
||||||
const navigate = useNavigator();
|
const navigate = useNavigator();
|
||||||
const notify = useNotifier();
|
const notify = useNotifier();
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
const handleCreateSuccess = (updateData: ProductTypeCreateMutation) => {
|
const handleCreateSuccess = (updateData: ProductTypeCreateMutation) => {
|
||||||
if (updateData.productTypeCreate.errors.length === 0) {
|
if (updateData.productTypeCreate.errors.length === 0) {
|
||||||
notify({
|
notify({
|
||||||
text: i18n.t("Successfully created product type")
|
text: intl.formatMessage({
|
||||||
|
defaultMessage: "Successfully created product type"
|
||||||
|
})
|
||||||
});
|
});
|
||||||
navigate(productTypeUrl(updateData.productTypeCreate.productType.id));
|
navigate(productTypeUrl(updateData.productTypeCreate.productType.id));
|
||||||
}
|
}
|
||||||
|
@ -48,7 +51,13 @@ export const ProductTypeCreate: React.StatelessComponent = () => {
|
||||||
<TypedProductTypeCreateDataQuery displayLoader>
|
<TypedProductTypeCreateDataQuery displayLoader>
|
||||||
{({ data, loading }) => (
|
{({ data, loading }) => (
|
||||||
<>
|
<>
|
||||||
<WindowTitle title={i18n.t("Create product type")} />
|
<WindowTitle
|
||||||
|
title={intl.formatMessage({
|
||||||
|
defaultMessage: "Create Product Type",
|
||||||
|
description: "window title",
|
||||||
|
id: "productTypeCreateHeader"
|
||||||
|
})}
|
||||||
|
/>
|
||||||
<ProductTypeCreatePage
|
<ProductTypeCreatePage
|
||||||
defaultWeightUnit={maybe(() => data.shop.defaultWeightUnit)}
|
defaultWeightUnit={maybe(() => data.shop.defaultWeightUnit)}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
|
@ -57,8 +66,10 @@ export const ProductTypeCreate: React.StatelessComponent = () => {
|
||||||
? createProductTypeData.productTypeCreate.errors
|
? createProductTypeData.productTypeCreate.errors
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
pageTitle={i18n.t("Create Product Type", {
|
pageTitle={intl.formatMessage({
|
||||||
context: "page title"
|
defaultMessage: "Create Product Type",
|
||||||
|
description: "header",
|
||||||
|
id: "productTypeCreatePageHeader"
|
||||||
})}
|
})}
|
||||||
saveButtonBarState={formTransitionState}
|
saveButtonBarState={formTransitionState}
|
||||||
taxTypes={maybe(() => data.taxTypes, [])}
|
taxTypes={maybe(() => data.taxTypes, [])}
|
||||||
|
|
|
@ -2,6 +2,7 @@ import DialogContentText from "@material-ui/core/DialogContentText";
|
||||||
import IconButton from "@material-ui/core/IconButton";
|
import IconButton from "@material-ui/core/IconButton";
|
||||||
import DeleteIcon from "@material-ui/icons/Delete";
|
import DeleteIcon from "@material-ui/icons/Delete";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import ActionDialog from "@saleor/components/ActionDialog";
|
import ActionDialog from "@saleor/components/ActionDialog";
|
||||||
import useBulkActions from "@saleor/hooks/useBulkActions";
|
import useBulkActions from "@saleor/hooks/useBulkActions";
|
||||||
|
@ -10,9 +11,9 @@ 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 { configurationMenuUrl } from "../../configuration";
|
import { configurationMenuUrl } from "../../configuration";
|
||||||
import i18n from "../../i18n";
|
|
||||||
import { getMutationState, maybe } from "../../misc";
|
import { getMutationState, maybe } from "../../misc";
|
||||||
import ProductTypeListPage from "../components/ProductTypeListPage";
|
import ProductTypeListPage from "../components/ProductTypeListPage";
|
||||||
import { TypedProductTypeBulkDeleteMutation } from "../mutations";
|
import { TypedProductTypeBulkDeleteMutation } from "../mutations";
|
||||||
|
@ -38,6 +39,7 @@ export const ProductTypeList: React.StatelessComponent<
|
||||||
const { isSelected, listElements, reset, toggle, toggleAll } = useBulkActions(
|
const { isSelected, listElements, reset, toggle, toggleAll } = useBulkActions(
|
||||||
params.ids
|
params.ids
|
||||||
);
|
);
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
const closeModal = () => navigate(productTypeListUrl(), true);
|
const closeModal = () => navigate(productTypeListUrl(), true);
|
||||||
|
|
||||||
|
@ -54,7 +56,7 @@ export const ProductTypeList: React.StatelessComponent<
|
||||||
const handleProductTypeBulkDelete = (data: ProductTypeBulkDelete) => {
|
const handleProductTypeBulkDelete = (data: ProductTypeBulkDelete) => {
|
||||||
if (data.productTypeBulkDelete.errors.length === 0) {
|
if (data.productTypeBulkDelete.errors.length === 0) {
|
||||||
notify({
|
notify({
|
||||||
text: i18n.t("Removed product types")
|
text: intl.formatMessage(commonMessages.savedChanges)
|
||||||
});
|
});
|
||||||
reset();
|
reset();
|
||||||
refetch();
|
refetch();
|
||||||
|
@ -126,22 +128,27 @@ export const ProductTypeList: React.StatelessComponent<
|
||||||
onClose={closeModal}
|
onClose={closeModal}
|
||||||
onConfirm={onProductTypeBulkDelete}
|
onConfirm={onProductTypeBulkDelete}
|
||||||
open={params.action === "remove"}
|
open={params.action === "remove"}
|
||||||
title={i18n.t("Remove Product Types")}
|
title={intl.formatMessage({
|
||||||
|
defaultMessage: "Delete Product Types",
|
||||||
|
description: "dialog header"
|
||||||
|
})}
|
||||||
variant="delete"
|
variant="delete"
|
||||||
>
|
>
|
||||||
<DialogContentText
|
<DialogContentText>
|
||||||
dangerouslySetInnerHTML={{
|
<FormattedMessage
|
||||||
__html: i18n.t(
|
defaultMessage="Are you sure you want to delete {counter, plural,
|
||||||
"Are you sure you want to remove <strong>{{ number }}</strong> product types?",
|
one {this product type}
|
||||||
{
|
other {{displayQuantity} product types}
|
||||||
number: maybe(
|
}?"
|
||||||
() => params.ids.length.toString(),
|
description="dialog content"
|
||||||
"..."
|
values={{
|
||||||
)
|
counter: maybe(() => params.ids.length),
|
||||||
}
|
displayQuantity: (
|
||||||
)
|
<strong>{maybe(() => params.ids.length)}</strong>
|
||||||
}}
|
)
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
</DialogContentText>
|
||||||
</ActionDialog>
|
</ActionDialog>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
import Button from "@material-ui/core/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import { attributeUrl } from "@saleor/attributes/urls";
|
import { attributeUrl } from "@saleor/attributes/urls";
|
||||||
import { WindowTitle } from "@saleor/components/WindowTitle";
|
import { WindowTitle } from "@saleor/components/WindowTitle";
|
||||||
import useBulkActions from "@saleor/hooks/useBulkActions";
|
import useBulkActions from "@saleor/hooks/useBulkActions";
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import i18n from "@saleor/i18n";
|
import { commonMessages } from "@saleor/intl";
|
||||||
import { getMutationState, maybe } from "@saleor/misc";
|
import { getMutationState, maybe } from "@saleor/misc";
|
||||||
import AssignAttributeDialog from "@saleor/productTypes/components/AssignAttributeDialog";
|
import AssignAttributeDialog from "@saleor/productTypes/components/AssignAttributeDialog";
|
||||||
import { ReorderEvent } from "@saleor/types";
|
import { ReorderEvent } from "@saleor/types";
|
||||||
|
@ -44,6 +45,7 @@ export const ProductTypeUpdate: React.FC<ProductTypeUpdateProps> = ({
|
||||||
const notify = useNotifier();
|
const notify = useNotifier();
|
||||||
const productAttributeListActions = useBulkActions();
|
const productAttributeListActions = useBulkActions();
|
||||||
const variantAttributeListActions = useBulkActions();
|
const variantAttributeListActions = useBulkActions();
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ProductTypeUpdateErrors>
|
<ProductTypeUpdateErrors>
|
||||||
|
@ -59,9 +61,7 @@ export const ProductTypeUpdate: React.FC<ProductTypeUpdateProps> = ({
|
||||||
const handleAttributeAssignSuccess = (data: AssignAttribute) => {
|
const handleAttributeAssignSuccess = (data: AssignAttribute) => {
|
||||||
if (data.attributeAssign.errors.length === 0) {
|
if (data.attributeAssign.errors.length === 0) {
|
||||||
notify({
|
notify({
|
||||||
text: i18n.t("Attributes assigned", {
|
text: intl.formatMessage(commonMessages.savedChanges)
|
||||||
context: "notification"
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
closeModal();
|
closeModal();
|
||||||
} else if (
|
} else if (
|
||||||
|
@ -76,9 +76,7 @@ export const ProductTypeUpdate: React.FC<ProductTypeUpdateProps> = ({
|
||||||
) => {
|
) => {
|
||||||
if (data.attributeUnassign.errors.length === 0) {
|
if (data.attributeUnassign.errors.length === 0) {
|
||||||
notify({
|
notify({
|
||||||
text: i18n.t("Attribute unassigned", {
|
text: intl.formatMessage(commonMessages.savedChanges)
|
||||||
context: "notification"
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
closeModal();
|
closeModal();
|
||||||
productAttributeListActions.reset();
|
productAttributeListActions.reset();
|
||||||
|
@ -90,8 +88,8 @@ export const ProductTypeUpdate: React.FC<ProductTypeUpdateProps> = ({
|
||||||
) => {
|
) => {
|
||||||
if (deleteData.productTypeDelete.errors.length === 0) {
|
if (deleteData.productTypeDelete.errors.length === 0) {
|
||||||
notify({
|
notify({
|
||||||
text: i18n.t("Product type deleted", {
|
text: intl.formatMessage({
|
||||||
context: "notification"
|
defaultMessage: "Product type deleted"
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
navigate(productTypeListUrl(), true);
|
navigate(productTypeListUrl(), true);
|
||||||
|
@ -105,9 +103,7 @@ export const ProductTypeUpdate: React.FC<ProductTypeUpdateProps> = ({
|
||||||
updateData.productTypeUpdate.errors.length === 0
|
updateData.productTypeUpdate.errors.length === 0
|
||||||
) {
|
) {
|
||||||
notify({
|
notify({
|
||||||
text: i18n.t("Product type updated", {
|
text: intl.formatMessage(commonMessages.savedChanges)
|
||||||
context: "notification"
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
} else if (
|
} else if (
|
||||||
updateData.productTypeUpdate.errors !== null &&
|
updateData.productTypeUpdate.errors !== null &&
|
||||||
|
@ -290,9 +286,10 @@ export const ProductTypeUpdate: React.FC<ProductTypeUpdateProps> = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{i18n.t("Unassign", {
|
<FormattedMessage
|
||||||
context: "unassign attribute from product type"
|
defaultMessage="Unassign"
|
||||||
})}
|
description="unassign attribute from product type, button"
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
@ -315,9 +312,10 @@ export const ProductTypeUpdate: React.FC<ProductTypeUpdateProps> = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{i18n.t("Unassign", {
|
<FormattedMessage
|
||||||
context: "unassign attribute from product type"
|
defaultMessage="Unassign"
|
||||||
})}
|
description="unassign attribute from product type, button"
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
@ -433,10 +431,7 @@ export const ProductTypeUpdate: React.FC<ProductTypeUpdateProps> = ({
|
||||||
onConfirm={handleProductTypeDelete}
|
onConfirm={handleProductTypeDelete}
|
||||||
/>
|
/>
|
||||||
<ProductTypeBulkAttributeUnassignDialog
|
<ProductTypeBulkAttributeUnassignDialog
|
||||||
attributeQuantity={maybe(
|
attributeQuantity={maybe(() => params.ids.length)}
|
||||||
() => params.ids.length.toString(),
|
|
||||||
"..."
|
|
||||||
)}
|
|
||||||
confirmButtonState={unassignTransactionState}
|
confirmButtonState={unassignTransactionState}
|
||||||
onClose={closeModal}
|
onClose={closeModal}
|
||||||
onConfirm={handleBulkAttributeUnassign}
|
onConfirm={handleBulkAttributeUnassign}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import ProductTypeBulkAttributeUnassignDialog, {
|
||||||
import Decorator from "../../Decorator";
|
import Decorator from "../../Decorator";
|
||||||
|
|
||||||
const props: ProductTypeBulkAttributeUnassignDialogProps = {
|
const props: ProductTypeBulkAttributeUnassignDialogProps = {
|
||||||
attributeQuantity: "4",
|
attributeQuantity: 4,
|
||||||
confirmButtonState: "default",
|
confirmButtonState: "default",
|
||||||
onClose: () => undefined,
|
onClose: () => undefined,
|
||||||
onConfirm: () => undefined,
|
onConfirm: () => undefined,
|
||||||
|
|
Loading…
Reference in a new issue