-
Notifications
You must be signed in to change notification settings - Fork 824
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
ENH Make all GridField components injectable (using abstract class) #10204
ENH Make all GridField components injectable (using abstract class) #10204
Conversation
Some components were already injectable, but all GridField components shipped in silverstripe should be injectable. This makes it a LOT easier to make global project-specific changes to a given component. The new AbstractGridFieldComponent also makes it easy to make similar wide-spread changes in the future.
d82d9d8
to
3edc3e0
Compare
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.
Looks good to me, I think I prefer the abstract class approach. It would allow us to easily add any other traits in the future if we wanted e.g. Extensible, Configurable
If other are happy with this I'm happy to merge. I'll run this through wider silverstripe/installer CI to see if it catches anything
https://github.com/emteknetnz/silverstripe-installer/actions/runs/1721684404
Cross repo run above using this PR at a patch file was green, happy with this |
I figured I'd write this while these changes are fairly fresh in my mind, and save someone else the trouble. Obviously if there's some procedure ormpolicy for writing release notes that I'm not following here feel please let me know and feel free to close this PR. Refer to silverstripe/silverstripe-admin#1251 for preview PRs, silverstripe#10204 for the `GridFieldComponent` stuff, and silverstripe/silverstripe-elemental#913 for changes to elemental search indexing. There are some extra new lines in here that I can't remove from the GitHub editor - but I expect there will be other requested changes so I'll clean that up at the same time.
…ilverstripe#10204) * ENH Make all GridField components injectable. Some components were already injectable, but all GridField components shipped in silverstripe should be injectable. This makes it a LOT easier to make global project-specific changes to a given component. The new AbstractGridFieldComponent also makes it easy to make similar wide-spread changes in the future. * DOCS Encourage injection for GridField and GridFieldComponents.
Alternative to #10154.
Some components were already injectable, but all GridField components shipped in silverstripe should be injectable.
This makes it a LOT easier to make global project-specific changes to a given component.
The new
AbstractGridFieldComponent
class also makes it easier to make similar wide-spread changes to the components in the future.Separate pull requests will need to be made to other silverstripe core modules to replace use of the
new
keyword to take advantage of this - I'll work on that as time permits if this PR gets approved.