Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Check if generate(title,image,description) are functions.#36

Merged
jacobsfletch merged 4 commits intopayloadcms:mainfrom
dragos199993:hide-autogenerate-labels
Feb 27, 2023
Merged

Check if generate(title,image,description) are functions.#36
jacobsfletch merged 4 commits intopayloadcms:mainfrom
dragos199993:hide-autogenerate-labels

Conversation

@dragos199993
Copy link
Contributor

hey! @jacobsfletch this is related to the issue #34

Added the condition as you said directly in JSX without the state.

@jacobsfletch
Copy link
Member

@dragos199993 Thanks! I think we'll need to do the same for the image and description fields.

@dragos199993 dragos199993 changed the title Check if generateTitle is function. Check if generate(title,image,description) are functions. Feb 16, 2023
@dragos199993
Copy link
Contributor Author

Added on image and description as well.
Also tested a bit and seems to be working correctly.

With generateTitle + generateDescription
image

Without generateTitle + generateDescription
image

@jacobsfletch
Copy link
Member

jacobsfletch commented Feb 27, 2023

@dragos199993 one last item before I merge this one, we need to remove all instances of Auto-generation will format a description/title/image using the page content because this is no longer relevant. To make things simple, let's just omit those lines completely.

Here's an example

@dragos199993
Copy link
Contributor Author

Ahh, missed those 👍, on image I removed it completely, but on title and description added a ternary inside so the rest of the sentence remains.
image

@jacobsfletch
Copy link
Member

Ahh, missed those 👍, on image I removed it completely, but on title and description added a ternary inside so the rest of the sentence remains.

I don't this info provides enough value to merit the complexity so let's omit that content entirely. We can solely rely on the "auto generate" button label to communicate the functionality. So for example here would be simply:

{`This should be between ${minLength} and ${maxLength} characters. For help in writing quality meta descriptions, see `}

@dragos199993
Copy link
Contributor Author

makes sense - done

@jacobsfletch
Copy link
Member

@dragos199993 🔥 thank you!

@jacobsfletch jacobsfletch merged commit 6bd04df into payloadcms:main Feb 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants