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

API Replace FormActions with anchors to enable panel-based loading in GridField navigation buttons #8953

Merged

Conversation

robbieaverill
Copy link
Contributor

@robbieaverill robbieaverill commented May 1, 2019

This replaces the Prev, Next, and New buttons in GridField "better buttons" from FormActions to simple anchors. Doing this means that (a) they don't have their own loading indicators, and (b) the CMS panel automatically obtains a loading indicator while processing.

None of these actions are POST actions, so don't need to be FormActions (technically speaking).

This also adds tooltips and ARIA labels for accessibility to these buttons, and changed the new class names for circular buttons to be more BEM compliant.

Issue: silverstripe/silverstripe-admin#815

Note: this is removing public API, but those were added in #8569 and haven't been tagged in a stable release yet. They aren't needed for anchor based buttons, so I've deleted them.

$previousAndNextGroup->addExtraClass('circular-group mr-2');
$previousAndNextGroup->setFieldHolderTemplate(get_class($previousAndNextGroup) . '_holder_buttongroup');
$previousAndNextGroup->addExtraClass('btn-group--circular mr-2');
$previousAndNextGroup->setFieldHolderTemplate(CompositeField::class . '_holder_buttongroup');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would've resulted in a fatal error (template not found) if CompositeField was rerouted with Injector to MyCompositeField

@unclecheese unclecheese force-pushed the pulls/4.4/better-button-fixes branch from d138d9f to a71d363 Compare May 3, 2019 03:02
@unclecheese unclecheese merged commit 5337e6d into silverstripe:4.4 May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants