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

NEW Extend new AbstractGridFieldComponent class #458

Merged
merged 1 commit into from
Mar 3, 2022

Conversation

GuySartorelli
Copy link
Collaborator

@GuySartorelli GuySartorelli commented Feb 12, 2022

This makes the GridFieldExportAction and GridFieldWorkflowRestrictedEditButton components Injectable, and allows any future enhancements in the new abstract class to automatically apply without requiring additional changes in this module.

The class is introduced in silverstripe/framework 4.11.0 (see silverstripe/silverstripe-framework#10204) so the dependency constraint needs to be updated.

Also use dependency injection instead of the new keyword when instantiating GridFields, their components, and configs.

@GuySartorelli
Copy link
Collaborator Author

Note that tests will error until a 4.11 branch or tag is available in silverstripe/silverstripe-framework

@GuySartorelli GuySartorelli force-pushed the enh/gridfieldcomponents-di branch from f9b55bc to 11888f5 Compare February 12, 2022 07:17
@emteknetnz
Copy link
Collaborator

Could you please run git commit --amend --no-edit && git push -f to trigger a new build, this PR to travis-shared should ensure it now works with the ^4.11 framework requirement

@GuySartorelli GuySartorelli force-pushed the enh/gridfieldcomponents-di branch from 11888f5 to 98a8cd8 Compare March 3, 2022 04:50
@GuySartorelli
Copy link
Collaborator Author

@emteknetnz Done!

This makes the `GridFieldExportAction` and `GridFieldWorkflowRestrictedEditButton` component `Injectable`, and allows any future enhancements in the new abstract class to automatically apply without requiring additional changes in this module.

The class is introduced in silverstripe/framework 4.11.0 so the dependency constraint needs to be updated.

Also use dependency injection instead of the `new` keyword when instantiating GridFields, their components, and configs.
@GuySartorelli GuySartorelli force-pushed the enh/gridfieldcomponents-di branch from 98a8cd8 to 6f22076 Compare March 3, 2022 05:34
@GuySartorelli
Copy link
Collaborator Author

Fixed phpcs linting issue.

@emteknetnz emteknetnz merged commit 0349b40 into symbiote:5 Mar 3, 2022
@GuySartorelli GuySartorelli deleted the enh/gridfieldcomponents-di branch March 3, 2022 21:46
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