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
4 tasks done
GuySartorelli opened this issue May 30, 2024 · 1 comment

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 - already handled by Refactor admin/* routing logic from LeftAndMain into its own abstract class #1761
  • 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

PRs

CMS 5 PRs

CMS 6 PRs

kitchen sink ci

@GuySartorelli GuySartorelli added this to the Silverstripe CMS 6 milestone May 30, 2024
@GuySartorelli GuySartorelli removed their assignment Oct 30, 2024
@emteknetnz
Copy link
Member

emteknetnz commented Oct 30, 2024

@GuySartorelli even though it's draft, I've started by reviewing the CMS 6 framework PR first as that could change the CMS 5 PRs

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

3 participants