-
Notifications
You must be signed in to change notification settings - Fork 14
fix: use users-permissions as non-plugin collections #104
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
Conversation
a213789 to
4c0613b
Compare
Convly
left a comment
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.
Could you also update https://github.com/strapi/client/blob/main/CONTRIBUTING.md#-testing-the-changes ?
🤦 I meant this review to be for #105 but you've already modified the file over there, feel free to ignore this one |
innerdvations
left a comment
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.
Very nice, lgtm! Tested and works for me.
I don't see any issues aside from the question about single types, which I think can be resolved later, unless you want to address it here.
Convly
left a comment
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.
LGTM with the upcoming PR for single types.
As a quick note, I'm a bit concerned about the addition of all those edge cases (first for prefixes, then hard-coded stuff for plugins & U&P, and now WELL_KNOWN_STRAPI_RESOURCES). But hopefully this is the last hard coded edge case we'll have to deal with thanks to the upcoming generated API which should eliminate the need for these 🙏
The thing is, these are kind of like edge cases in Strapi CMS and are the exact sort of thing the client should work around, to make it transparent to the user and easier to work with. But yes, almost every workaround we build into strapi/client is something that in Strapi v6 we should probably make a breaking change to align with the standard way of doing things. |
What does it do?
Solution Implemented
Added auto-detection for well-known Strapi resources like
users:Key Changes:
src/client.ts
WELL_KNOWN_STRAPI_RESOURCESmapping that identifies special content-typescollection()method to auto-apply plugin configuration for 'users'tests/unit/client.test.ts
tests/unit/content-types/collection/collection-manager.test.ts
README.md
Usage
Before (required manual configuration):
After (works automatically):
How to test it?
Related issue(s)/PR(s)
Fixes #90