Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #114 +/- ##
============================================
+ Coverage 86.48% 86.65% +0.17%
Complexity 148 148
============================================
Files 18 18
Lines 969 982 +13
Branches 86 92 +6
============================================
+ Hits 838 851 +13
Misses 131 131
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
951d33c to
80100bf
Compare
gziolo
left a comment
There was a problem hiding this comment.
@emdashcodes, everything looks great from my perspective. This bring the client and server implementation closer to each other after the mandatory category got introduced. As noted in the feedback, @galatanovidiu is working in #115 on adding filtering capabilities on the server, so I added a commit to account on the same shape on the client. This way we should have the interfaces open for further extension with not risk of backward incompatibilities.
I'm approving this PR, but since I added new commits that change some code paths substantially, I would appreciate some sanity check.
This PR adds some basic category registration and filtering functionality to the
@wordpress/abilitiesclient package, allowing developers to filter abilities by category through the JavaScript API. This addresses some of the feedback highlighted in #102 (review).What's Changed
category: stringfield to theAbilityinterface and storegetAbilities()API function to accept an optionalcategoryparameter throughargsobjectTests
Documentation updates
registerAbilitydocumentationNot Addressed in this PR
Testing Instructions
npm run test:clientmeta.show_in_resttotrueFor example, I have some server and client abilities, and I can filter by navigation: