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 ability to disable the Empty Page in List #5165

Merged
merged 3 commits into from
Aug 19, 2020

Conversation

jdemangeon
Copy link
Contributor

@jdemangeon jdemangeon commented Aug 18, 2020

Fixes #5158

It's sometimes useful to be able to display an empty list instead of displaying a special "empty page" when there's no data to display.

So, here is a small change that allows to display an empty page when the list is empty.

@jdemangeon jdemangeon added the RFR Ready For Review label Aug 18, 2020
@@ -100,7 +100,7 @@ export const ListView: FC<ListViewProps> = props => {
{...sanitizeRestProps(rest)}
>
<Title title={title} defaultTitle={defaultTitle} />
{shouldRenderEmptyPage
{shouldRenderEmptyPage && empty !== false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not update the shouldRenderEmptyPage method to use the empty prop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of Typescript ;)

docs/List.md Outdated Show resolved Hide resolved
Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
Copy link
Member

@fzaninotto fzaninotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are integration tests (List.spec.js) about the Empty feature, can you add one about the false value?

@jdemangeon
Copy link
Contributor Author

Review applied

@fzaninotto fzaninotto merged commit 3eb2e3d into master Aug 19, 2020
@fzaninotto fzaninotto deleted the allows-list-empty-page-disabling branch August 19, 2020 09:38
@fzaninotto fzaninotto changed the title Allows List Empty Page Disabling Add ability to disable the Empty Page in List Aug 19, 2020
@Luwangel Luwangel added this to the 3.8.2 milestone Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable empty state on List
4 participants