-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Enable list header actions hook #3048
Enable list header actions hook #3048
Conversation
🦋 Changeset is good to goLatest commit: 1332df1 We got this. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
list: { access }, | ||
openCreateItemModal, | ||
} = useList(); | ||
if (!access.create) return null; |
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.
We re taking care of access control here instead of List->index
@@ -70,7 +68,7 @@ export function ListLayout(props) { | |||
<HeaderInset> | |||
<FlexGroup align="center" justify="space-between"> | |||
<PageTitle>{list.plural}</PageTitle> | |||
{list.access.create ? listHeaderActions ? listHeaderActions() : <CreateItem /> : null} | |||
{listHeaderActions ? listHeaderActions() : <CreateItem />} |
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.
Do not want to remove all the header items which dev may have created, list create access check is moved to <CreateItem/>
which will not render itself if there is no access for create.
we can leave this to hook author to decide whether they need action for create access or not.
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.
Good call to move it to create item.
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.
Merge it :)
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.
👍
@gautamsi I had a little git slip and I had to revert and re-open this one. We're still looking at moving forward with it. Forgive me for the confusion.