Remove misleading helperText on SEO form (#3677)
This commit is contained in:
parent
b396c8e9a5
commit
78077f8220
2 changed files with 1 additions and 18 deletions
|
@ -7589,9 +7589,6 @@
|
||||||
"context": "set expiry date selected label",
|
"context": "set expiry date selected label",
|
||||||
"string": "Set gift card expiry date"
|
"string": "Set gift card expiry date"
|
||||||
},
|
},
|
||||||
"s/sTT6": {
|
|
||||||
"string": "If empty, the preview shows what will be autogenerated."
|
|
||||||
},
|
|
||||||
"s17U7u": {
|
"s17U7u": {
|
||||||
"context": "discount type",
|
"context": "discount type",
|
||||||
"string": "Percentage"
|
"string": "Percentage"
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { TextField } from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { Box, Button, Input, Text } from "@saleor/macaw-ui/next";
|
import { Box, Button, Input, Text } from "@saleor/macaw-ui/next";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { defineMessages, FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import { DashboardCard } from "../Card";
|
import { DashboardCard } from "../Card";
|
||||||
|
|
||||||
|
@ -64,7 +64,6 @@ export const SeoForm: React.FC<SeoFormProps> = props => {
|
||||||
disabled,
|
disabled,
|
||||||
errors = [],
|
errors = [],
|
||||||
helperText,
|
helperText,
|
||||||
allowEmptySlug = false,
|
|
||||||
loading,
|
loading,
|
||||||
title,
|
title,
|
||||||
slug,
|
slug,
|
||||||
|
@ -82,20 +81,9 @@ export const SeoForm: React.FC<SeoFormProps> = props => {
|
||||||
|
|
||||||
const shouldDisplayHelperText = helperText && !expanded;
|
const shouldDisplayHelperText = helperText && !expanded;
|
||||||
|
|
||||||
const { seoFieldMessage } = defineMessages({
|
|
||||||
seoFieldMessage: {
|
|
||||||
id: "s/sTT6",
|
|
||||||
defaultMessage: "If empty, the preview shows what will be autogenerated.",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const getSlugHelperMessage = () => {
|
const getSlugHelperMessage = () => {
|
||||||
const error = !!getError(SeoField.slug);
|
const error = !!getError(SeoField.slug);
|
||||||
|
|
||||||
if (allowEmptySlug && !error) {
|
|
||||||
return intl.formatMessage(seoFieldMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
return error ? getSlugErrorMessage() : "";
|
return error ? getSlugErrorMessage() : "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -185,7 +173,6 @@ export const SeoForm: React.FC<SeoFormProps> = props => {
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
maxLength={maxTitleLength}
|
maxLength={maxTitleLength}
|
||||||
placeholder={titlePlaceholder}
|
placeholder={titlePlaceholder}
|
||||||
helperText={intl.formatMessage(seoFieldMessage)}
|
|
||||||
label={
|
label={
|
||||||
<Box display="flex" gap={3}>
|
<Box display="flex" gap={3}>
|
||||||
<Box as="span">
|
<Box as="span">
|
||||||
|
@ -235,7 +222,6 @@ export const SeoForm: React.FC<SeoFormProps> = props => {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
helperText={intl.formatMessage(seoFieldMessage)}
|
|
||||||
InputProps={{
|
InputProps={{
|
||||||
inputProps: {
|
inputProps: {
|
||||||
maxLength: maxDescriptionLength,
|
maxLength: maxDescriptionLength,
|
||||||
|
|
Loading…
Reference in a new issue