Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to define a "noResultsMessage" on the PostTermList component #202

Merged
merged 7 commits into from
Mar 22, 2023

Conversation

fabiankaegy
Copy link
Member

Description of the Change

Currently the PostTermList just renders completely empty if no terms are assigned to the post. This leads to a bad experience for the user because they are not able to user the inline control to select new terms. In order to fix this I've added a noResultsMessage prop to the component which has a default value.

I've also changed it so that the component only renders the no results message if the block this component is being used within also is currently selected.

Changelog Entry

Added - Ability to define noResultsMessage on PostTermList component

Credits

Props @fabiankaegy

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@fabiankaegy fabiankaegy added the [Type] Enhancement New feature or request label Feb 23, 2023
@fabiankaegy fabiankaegy self-assigned this Feb 23, 2023
@github-actions
Copy link

github-actions bot commented Feb 23, 2023

Size Change: +408 B (+1%)

Total Size: 51.8 kB

Filename Size Change
dist/index.js 51.8 kB +408 B (+1%)

compressed-size-action

@fabiankaegy fabiankaegy requested a review from ncoetzer February 23, 2023 07:57
@fabiankaegy
Copy link
Member Author

@Antonio-Laguna I would love to also hear your thoughts on how this API could be made more "composable".

I had initially tried to use some kind of slot fill system with an actual <PostTermList.NoResults> component that you could use but found it to be overkill for this example.

But very curious whether you have any other ideas / think this is good as is :)

@fabiankaegy fabiankaegy force-pushed the fix/post-term-list-new-terms branch from 3c203a4 to dc033ec Compare March 3, 2023 15:42
@fabiankaegy fabiankaegy merged commit dd5d637 into develop Mar 22, 2023
@fabiankaegy fabiankaegy deleted the fix/post-term-list-new-terms branch March 22, 2023 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant