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

Refactor logic for sections that deal with only a single record out of LeftAndMain into its own class #1764

Open
GuySartorelli opened this issue May 30, 2024 · 0 comments

Comments

@GuySartorelli
Copy link
Member

GuySartorelli commented May 30, 2024

Most subclasses of LeftAndMain deal with more than one record at a time - be it ModelAdmin which handles multiple records in a GridField, or CMSMain which deals with multiple records in a hierarchical structure.

The logic in LeftAndMain which is intended for sections that only edit a single record should be abstracted out into its own abstract class.

Related

Notes

Acceptance criteria

  • A new abstract SingleRecordAdmin class is created, which is a subclass of LeftAndMain
  • AdminRootController checks for (non-abstract) subclasses of the new class instead of subclasses of LeftAndMain to set up routing rules
  • Methods, properties, and configuration used only for editing single records are moved from LeftAndMain to the new class
  • CMSProfileController, SiteConfigLeftAndMain, and any other controllers in supported modules which only edit a single record are made subclasses of this new class
  • Functionality that's reimplemented in CMSProfileController, SiteConfigLeftAndMain, etc are made generic and are implemented in the new class directly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants