diff --git a/src/containers/EditListingForm/EditListingForm.js b/src/containers/EditListingForm/EditListingForm.js index 5a296556..99963422 100644 --- a/src/containers/EditListingForm/EditListingForm.js +++ b/src/containers/EditListingForm/EditListingForm.js @@ -137,21 +137,24 @@ class EditListingForm extends Component { saveActionMsg = 'Save listing', submitting, } = this.props; - const requiredStr = intl.formatMessage({ id: 'EditListingForm.required' }); - const maxLengthStr = intl.formatMessage( + const titleRequiredMessage = intl.formatMessage({ id: 'EditListingForm.titleRequired' }); + const maxLengthMessage = intl.formatMessage( { id: 'EditListingForm.maxLength' }, { maxLength: TITLE_MAX_LENGTH, } ); - const maxLength60 = maxLength(maxLengthStr, TITLE_MAX_LENGTH); - const imageRequiredStr = intl.formatMessage({ id: 'EditListingForm.imageRequired' }); + const maxLength60Message = maxLength(maxLengthMessage, TITLE_MAX_LENGTH); + const imageRequiredMessage = intl.formatMessage({ id: 'EditListingForm.imageRequired' }); const locationRequiredMessage = intl.formatMessage({ id: 'EditListingForm.locationRequired', }); const locationNotRecognizedMessage = intl.formatMessage({ id: 'EditListingForm.locationNotRecognized', }); + const descriptionRequiredMessage = intl.formatMessage({ + id: 'EditListingForm.descriptionRequired', + }); return (
@@ -160,7 +163,7 @@ class EditListingForm extends Component { label="Title" component={enhancedField('input')} type="text" - validate={[required(requiredStr), maxLength60]} + validate={[required(titleRequiredMessage), maxLength60Message]} />

Images

@@ -188,7 +191,7 @@ class EditListingForm extends Component { }} name="images" type="hidden" - validate={[noEmptyArray(imageRequiredStr)]} + validate={[noEmptyArray(imageRequiredMessage)]} /> @@ -207,7 +210,7 @@ class EditListingForm extends Component { name="description" label="Description" component={enhancedField('textarea')} - validate={[required(requiredStr)]} + validate={[required(descriptionRequiredMessage)]} />
diff --git a/src/translations/en.json b/src/translations/en.json index 6e2d7f37..dcf41201 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -5,11 +5,12 @@ "HeroSearchForm.search": "Search", "HeroSection.subTitle": "The largest online community to rent music studios", "HeroSection.title": "Book Studiotime anywhere", - "EditListingForm.required": "Required", + "EditListingForm.titleRequired": "You need to add a title.", "EditListingForm.imageRequired": "You need to add at least one image.", "EditListingForm.maxLength": "Must be {maxLength} characters or less", "EditListingForm.locationRequired": "You need to provide a location", "EditListingForm.locationNotRecognized": "We didn't recognize this location. Please try another location.", + "EditListingForm.descriptionRequired": "You need to add a description.", "ListingPage.loadingListingData": "Loading listing data", "ListingPage.noListingData": "Could not find listing data", "PageLayout.authInfoFailed": "Could not get authentication information.",