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

Standardise how actions are pulled through to admin sections #1841

Open
10 tasks
GuySartorelli opened this issue Oct 24, 2024 · 0 comments
Open
10 tasks

Standardise how actions are pulled through to admin sections #1841

GuySartorelli opened this issue Oct 24, 2024 · 0 comments

Comments

@GuySartorelli
Copy link
Member

GuySartorelli commented Oct 24, 2024

Right now:

  1. LeftAndMain gets actions from $record->getCMSActions() and only adds 'save' and 'delete' if there are no actions in the result.
  2. CMSMain gets actions from $record->getCMSActions() and uses it outright, after some normalisation of empty action menus
  3. GridFieldDetailForm_ItemRequest which powers ModelAdmin completely ignores $record->getCMSActions(), building its own list from scratch

These should be normalised, so developers can rely on a consistent behaviour for how form actions are produced.

Acceptance Criteria

  • All admin sections include actions returned from the getCMSActions() method of the record
  • All admin sections include a "create" action if the user has create permissions and this is a new record
  • All admin sections include a "save" action if the user has edit permissions and this is a pre-existing record
  • All admin sections include a "delete" action if the user has delete permissions and this is a pre-existing record
  • silverstripe/versioned-admin replaces the "delete" action with a "archive" action for versioned records
  • silverstripe/versioned-admin adds a "publish" action for versioned records if the user has publish permissions and the record has not been published
  • silverstripe/versioned-admin adds a "unpublish" action for versioned records if the user has unpublish permissions and the record has been published
  • The actions added by the admin sections will be displayed before actions returned from the record
  • The actions won't be added if they're already in the list returned from the record
  • The actions should appear essentially the same as they currently do in the /admin/pages section
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

1 participant