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 Add fixtures for arbitrary data gridfield behat tests #159

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Nov 21, 2023

Adds:

  • A new subclass of ArrayData which has all the methods needed to be dumped straight into a gridfield with an unmodified GridFieldConfig_RecordEditor config
  • A new admin section (based on but not subclassing ModelAdmin) with two tabs:
    1. A tab with ArrayData, using a modified gridfield config that sets all the necessary information to display, filter, sort etc the data
    2. A tab with the new ArbitraryDataModel class
  • An extension on DatabaseAdmin and TestSessionEnvironment for setting up a table and default records for the new ArbitraryDataModel class - since it's not a DataObject subclass that doesn't happen automatically.

Issue

Copy link
Contributor

@maxime-rainville maxime-rainville left a comment

Choose a reason for hiding this comment

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

LGTM

use SilverStripe\ORM\Search\BasicSearchContext;
use SilverStripe\View\ArrayData;

class ArbitraryDataAdmin extends LeftAndMain
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worthwhile exploring if we want to provide something like this in core or in an optional module.

@maxime-rainville maxime-rainville merged commit 5f70444 into silverstripe:1 Dec 19, 2023
@maxime-rainville maxime-rainville deleted the pulls/1/arbitrarydata-gridfield branch December 19, 2023 07:18
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