-
Notifications
You must be signed in to change notification settings - Fork 578
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
feat: add "on this page" to empty table message when you're past page 1 #4886
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works perfectly! I love how clear the ChooseOne makes things.
} | ||
> = ({ isLoading, workspaceRefs, filter, isNonInitialPage }) => { | ||
const { t } = useTranslation("workspacesPage") | ||
console.log(isNonInitialPage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(isNonInitialPage) |
|
||
export const Empty = Template.bind({}) | ||
Empty.args = { ...Admin.args, users: [] } | ||
Empty.args = { users: [] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think not having isNonInitialPage
here is causing Cond
to error with A non-final Cond in a ChooseOne does not have a condition prop.
.
If a saved url takes a user to a page beyond the number of records they have, they see an empty table. The message in the empty table should point out that they might not have no records at all; they just don't have any on this page. So I added an empty-page treatment to the currently paginated pages: workspaces, users, and audit log. I ended up going with this solution over a redirect because I don't think a redirect is always the best behavior, and it was hard to single out just the on-mount cases (since I don't know we have no results until after the fetch).
I added stories for each as well, and in order to do that I needed to prop-drill because the query-params storybook add-on doesn't work for some reason.
While I was in there I switched to
ChooseOne
, making it a little clearer that each page has a 3-way choice, and switched fromLanguage
to i18n.