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

ENH Make all GridField components injectable (using abstract class) #10204

Merged

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Jan 16, 2022

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.

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.
@GuySartorelli GuySartorelli force-pushed the enh/abstract-gridfield-component branch from d82d9d8 to 3edc3e0 Compare January 16, 2022 22:58
Copy link
Member

@emteknetnz emteknetnz left a 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

@emteknetnz
Copy link
Member

Cross repo run above using this PR at a patch file was green, happy with this

@emteknetnz emteknetnz merged commit 5c54276 into silverstripe:4 Feb 1, 2022
@GuySartorelli GuySartorelli deleted the enh/abstract-gridfield-component branch February 1, 2022 22:34
GuySartorelli added a commit to GuySartorelli/silverstripe-framework that referenced this pull request Feb 6, 2022
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.
GuySartorelli added a commit to GuySartorelli/silverstripe-framework that referenced this pull request Jul 6, 2022
…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.
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.

2 participants