Remove configurable label (#3646)

* Remove default export

* Rename misleading labels

* Remove default export

* Remove redundant message

* Extract messages

---------

Co-authored-by: andrzejewsky <vox3r69@gmail.com>
This commit is contained in:
Timur Carpeev 2023-06-06 14:27:56 +02:00 committed by GitHub
parent f5f216eca3
commit f2f11a6450
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 69 deletions

View file

@ -1502,6 +1502,10 @@
"9OtpHt": { "9OtpHt": {
"string": "Order line deleted" "string": "Order line deleted"
}, },
"9QtKvB": {
"context": "Product type is shippable",
"string": "Shippable"
},
"9RCuN3": { "9RCuN3": {
"string": "Payment successfully captured" "string": "Payment successfully captured"
}, },
@ -1618,10 +1622,6 @@
"context": "channels availability text", "context": "channels availability text",
"string": "In {selectedChannelsCount} out of {allChannelsCount, plural, one {# channel} other {# channels}}" "string": "In {selectedChannelsCount} out of {allChannelsCount, plural, one {# channel} other {# channels}}"
}, },
"ADTNND": {
"context": "product type",
"string": "Physical"
},
"AHK0K9": { "AHK0K9": {
"context": "dialog content", "context": "dialog content",
"string": "{counter,plural,one{Are you sure you want to unassign this product?} other{Are you sure you want to unassign {displayQuantity} products?}}" "string": "{counter,plural,one{Are you sure you want to unassign this product?} other{Are you sure you want to unassign {displayQuantity} products?}}"
@ -1828,9 +1828,6 @@
"context": "variant availability in channel", "context": "variant availability in channel",
"string": "Available" "string": "Available"
}, },
"Be+J13": {
"string": "Configurable"
},
"BfJGij": { "BfJGij": {
"context": "header", "context": "header",
"string": "Address Information" "string": "Address Information"
@ -2789,6 +2786,10 @@
"context": "switch button", "context": "switch button",
"string": "Is this product shippable?" "string": "Is this product shippable?"
}, },
"ICeshC": {
"context": "product type",
"string": "Shippable"
},
"IEpmGQ": { "IEpmGQ": {
"context": "description", "context": "description",
"string": "Use Saleor Cloud to access Saleor Apps" "string": "Use Saleor Cloud to access Saleor Apps"
@ -5410,10 +5411,6 @@
"context": "order history message", "context": "order history message",
"string": "Fulfillment confirmation was sent to customer" "string": "Fulfillment confirmation was sent to customer"
}, },
"asdvmK": {
"context": "product type",
"string": "Digital"
},
"auxEP1": { "auxEP1": {
"context": "input placeholder", "context": "input placeholder",
"string": "Search by attribute name" "string": "Search by attribute name"
@ -6514,10 +6511,6 @@
"context": "product field", "context": "product field",
"string": "Collections" "string": "Collections"
}, },
"jyTwDR": {
"context": "product type is either simple or configurable",
"string": "Type"
},
"jyaAlB": { "jyaAlB": {
"context": "button", "context": "button",
"string": "Create collection" "string": "Create collection"
@ -8119,6 +8112,10 @@
"vcwrgW": { "vcwrgW": {
"string": "No translatable entities found" "string": "No translatable entities found"
}, },
"vdk01u": {
"context": "product type",
"string": "Not shippable"
},
"ve/Sph": { "ve/Sph": {
"context": "there are more elements of list that are hidden", "context": "there are more elements of list that are hidden",
"string": "and {number} more" "string": "and {number} more"
@ -8456,10 +8453,6 @@
"context": "dialog header", "context": "dialog header",
"string": "Dectivate App" "string": "Dectivate App"
}, },
"yNb+dT": {
"context": "product type",
"string": "Simple product"
},
"yOaNWB": { "yOaNWB": {
"context": "delete shipping method", "context": "delete shipping method",
"string": "Are you sure you want to delete {name}?" "string": "Are you sure you want to delete {name}?"

View file

@ -11,15 +11,10 @@ import {
productTypeUrl, productTypeUrl,
} from "@dashboard/productTypes/urls"; } from "@dashboard/productTypes/urls";
import { getArrowDirection } from "@dashboard/utils/sort"; import { getArrowDirection } from "@dashboard/utils/sort";
import { import { TableBody, TableCell, TableFooter } from "@material-ui/core";
TableBody,
TableCell,
TableFooter,
Typography,
} from "@material-ui/core";
import { makeStyles } from "@saleor/macaw-ui"; import { makeStyles } from "@saleor/macaw-ui";
import React from "react"; import React from "react";
import { FormattedMessage, useIntl } from "react-intl"; import { FormattedMessage } from "react-intl";
import { maybe, renderCollection } from "../../../misc"; import { maybe, renderCollection } from "../../../misc";
import { ListActions, ListProps, SortPage } from "../../../types"; import { ListActions, ListProps, SortPage } from "../../../types";
@ -70,8 +65,6 @@ const ProductTypeList: React.FC<ProductTypeListProps> = props => {
} = props; } = props;
const classes = useStyles(props); const classes = useStyles(props);
const intl = useIntl();
return ( return (
<ResponsiveTable> <ResponsiveTable>
<TableHead <TableHead
@ -108,9 +101,9 @@ const ProductTypeList: React.FC<ProductTypeListProps> = props => {
className={classes.colType} className={classes.colType}
> >
<FormattedMessage <FormattedMessage
id="jyTwDR" id="9QtKvB"
defaultMessage="Type" defaultMessage="Shippable"
description="product type is either simple or configurable" description="Product type is shippable"
/> />
</TableCellHeader> </TableCellHeader>
<TableCell className={classes.colTax}> <TableCell className={classes.colTax}>
@ -150,22 +143,7 @@ const ProductTypeList: React.FC<ProductTypeListProps> = props => {
</TableCell> </TableCell>
<TableCell className={classes.colName}> <TableCell className={classes.colName}>
{productType ? ( {productType ? (
<> <span data-test-id="name">{productType.name}</span>
<span data-test-id="name">{productType.name}</span>
<Typography variant="caption">
{maybe(() => productType.hasVariants)
? intl.formatMessage({
id: "X90t9n",
defaultMessage: "Configurable",
description: "product type",
})
: intl.formatMessage({
id: "yNb+dT",
defaultMessage: "Simple product",
description: "product type",
})}
</Typography>
</>
) : ( ) : (
<Skeleton /> <Skeleton />
)} )}
@ -175,16 +153,16 @@ const ProductTypeList: React.FC<ProductTypeListProps> = props => {
productType.isShippingRequired ? ( productType.isShippingRequired ? (
<> <>
<FormattedMessage <FormattedMessage
id="ADTNND" id="ICeshC"
defaultMessage="Physical" defaultMessage="Shippable"
description="product type" description="product type"
/> />
</> </>
) : ( ) : (
<> <>
<FormattedMessage <FormattedMessage
id="asdvmK" id="vdk01u"
defaultMessage="Digital" defaultMessage="Not shippable"
description="product type" description="product type"
/> />
</> </>

View file

@ -1,2 +0,0 @@
export { default } from "./ProductTypeList";
export * from "./ProductTypeList";

View file

@ -4,6 +4,7 @@ import FilterBar from "@dashboard/components/FilterBar";
import { configurationMenuUrl } from "@dashboard/configuration"; import { configurationMenuUrl } from "@dashboard/configuration";
import { ProductTypeFragment } from "@dashboard/graphql"; import { ProductTypeFragment } from "@dashboard/graphql";
import { sectionNames } from "@dashboard/intl"; import { sectionNames } from "@dashboard/intl";
import ProductTypeList from "@dashboard/productTypes/components/ProductTypeList/ProductTypeList";
import { import {
productTypeAddUrl, productTypeAddUrl,
ProductTypeListUrlSortField, ProductTypeListUrlSortField,
@ -19,7 +20,6 @@ import {
SortPage, SortPage,
TabPageProps, TabPageProps,
} from "../../../types"; } from "../../../types";
import ProductTypeList from "../ProductTypeList";
import { import {
createFilterStructure, createFilterStructure,
ProductTypeFilterKeys, ProductTypeFilterKeys,

View file

@ -31,6 +31,7 @@ import {
} from "@dashboard/graphql"; } from "@dashboard/graphql";
import useNavigator from "@dashboard/hooks/useNavigator"; import useNavigator from "@dashboard/hooks/useNavigator";
import useStateFromProps from "@dashboard/hooks/useStateFromProps"; import useStateFromProps from "@dashboard/hooks/useStateFromProps";
import { ProductOrganization } from "@dashboard/products/components/ProductOrganization/ProductOrganization";
import { ProductVariantPrice } from "@dashboard/products/components/ProductVariantPrice"; import { ProductVariantPrice } from "@dashboard/products/components/ProductVariantPrice";
import { import {
ProductCreateUrlQueryParams, ProductCreateUrlQueryParams,
@ -42,7 +43,6 @@ import { useIntl } from "react-intl";
import { FetchMoreProps, RelayToFlat } from "../../../types"; import { FetchMoreProps, RelayToFlat } from "../../../types";
import { ProductDetailsForm } from "../ProductDetailsForm"; import { ProductDetailsForm } from "../ProductDetailsForm";
import { ProductOrganization } from "../ProductOrganization";
import { ProductShipping } from "../ProductShipping"; import { ProductShipping } from "../ProductShipping";
import { ProductStocks } from "../ProductStocks"; import { ProductStocks } from "../ProductStocks";
import ProductTaxes from "../ProductTaxes"; import ProductTaxes from "../ProductTaxes";

View file

@ -12,7 +12,6 @@ import {
ProductErrorFragment, ProductErrorFragment,
} from "@dashboard/graphql"; } from "@dashboard/graphql";
import { ChangeEvent } from "@dashboard/hooks/useForm"; import { ChangeEvent } from "@dashboard/hooks/useForm";
import { commonMessages } from "@dashboard/intl";
import { productTypeUrl } from "@dashboard/productTypes/urls"; import { productTypeUrl } from "@dashboard/productTypes/urls";
import { FetchMoreProps } from "@dashboard/types"; import { FetchMoreProps } from "@dashboard/types";
import { getFormErrors, getProductErrorMessage } from "@dashboard/utils/errors"; import { getFormErrors, getProductErrorMessage } from "@dashboard/utils/errors";
@ -133,17 +132,6 @@ export const ProductOrganization: React.FC<
</Link> </Link>
</Text> </Text>
</Box> </Box>
<Box display="flex" flexDirection="column">
<Text variant="bodyEmp">
<FormattedMessage id="Be+J13" defaultMessage="Configurable" />
</Text>
<Text variant="caption">
{productType?.hasVariants
? intl.formatMessage(commonMessages.yes)
: intl.formatMessage(commonMessages.no)}
</Text>
</Box>
</Box> </Box>
)} )}
<SingleAutocompleteSelectField <SingleAutocompleteSelectField

View file

@ -1 +0,0 @@
export * from "./ProductOrganization";

View file

@ -42,6 +42,7 @@ import useNavigator from "@dashboard/hooks/useNavigator";
import useStateFromProps from "@dashboard/hooks/useStateFromProps"; import useStateFromProps from "@dashboard/hooks/useStateFromProps";
import { maybe } from "@dashboard/misc"; import { maybe } from "@dashboard/misc";
import ProductExternalMediaDialog from "@dashboard/products/components/ProductExternalMediaDialog"; import ProductExternalMediaDialog from "@dashboard/products/components/ProductExternalMediaDialog";
import { ProductOrganization } from "@dashboard/products/components/ProductOrganization/ProductOrganization";
import { defaultGraphiQLQuery } from "@dashboard/products/queries"; import { defaultGraphiQLQuery } from "@dashboard/products/queries";
import { productImageUrl, productListUrl } from "@dashboard/products/urls"; import { productImageUrl, productListUrl } from "@dashboard/products/urls";
import { ProductVariantListError } from "@dashboard/products/views/ProductUpdate/handlers/errors"; import { ProductVariantListError } from "@dashboard/products/views/ProductUpdate/handlers/errors";
@ -53,7 +54,6 @@ import { useIntl } from "react-intl";
import { getChoices } from "../../utils/data"; import { getChoices } from "../../utils/data";
import { ProductDetailsForm } from "../ProductDetailsForm"; import { ProductDetailsForm } from "../ProductDetailsForm";
import ProductMedia from "../ProductMedia"; import ProductMedia from "../ProductMedia";
import { ProductOrganization } from "../ProductOrganization";
import ProductTaxes from "../ProductTaxes"; import ProductTaxes from "../ProductTaxes";
import ProductVariants from "../ProductVariants"; import ProductVariants from "../ProductVariants";
import ProductUpdateForm from "./form"; import ProductUpdateForm from "./form";