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 invite to create the first record when the list is empty #4113

Merged
merged 10 commits into from
Jan 3, 2020

Conversation

m4theushw
Copy link
Contributor

@m4theushw m4theushw commented Dec 5, 2019

localhost_8080_ (9)

Closes #2639

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.

Nice! This needs rebase though.

docs/List.md Outdated Show resolved Hide resolved
packages/ra-ui-materialui/src/list/Empty.js Outdated Show resolved Hide resolved
packages/ra-ui-materialui/src/list/Empty.js Outdated Show resolved Hide resolved
@m4theushw
Copy link
Contributor Author

PR rebased

@fzaninotto
Copy link
Member

sorry, a recent PR merge modified the List doc and requires a new rebase for this PR

@m4theushw
Copy link
Contributor Author

Ready!

docs/List.md Outdated Show resolved Hide resolved
@@ -40,6 +40,8 @@ module.exports = {
loading: 'Chargement',
not_found: 'Page manquante',
show: '%{name} #%{id}',
empty: 'Pas encore de %{name}.',
invite: 'Voulez-vous en créer un ?',
Copy link
Member

Choose a reason for hiding this comment

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

This will cause bad wording when the resource name is feminine (ex: promotion). But I don't see an easy way to fix that, so we'll go with that translation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could leave to user to override the empty text, by looking for a resources.foobar.empty key. If there's no such key we use the default one ra.page.empty.

The invite key could also be customizable, like resources.foobar.invite.

Copy link
Member

Choose a reason for hiding this comment

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

Great idea. Would you mind adding that feature to your PR?

Copy link
Contributor Author

@m4theushw m4theushw Dec 12, 2019

Choose a reason for hiding this comment

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

I'll work on it

@m4theushw m4theushw force-pushed the empty-page branch 2 times, most recently from aeb26d7 to aab6cb8 Compare December 11, 2019 15:39
@m4theushw m4theushw requested a review from fzaninotto December 12, 2019 17:27
@ThieryMichel ThieryMichel merged commit 7128f47 into marmelab:next Jan 3, 2020
@fzaninotto fzaninotto changed the title [RFR] Invite to create the first record Add invite to create the first record when the list is empty Jan 3, 2020
@fzaninotto fzaninotto added this to the 3.2.0 milestone Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants