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

Nested gridfield #383

Closed
maxime-rainville opened this issue Apr 4, 2024 · 3 comments
Closed

Nested gridfield #383

maxime-rainville opened this issue Apr 4, 2024 · 3 comments

Comments

@maxime-rainville
Copy link
Collaborator

maxime-rainville commented Apr 4, 2024

Description

Our friends at Creamarketing have developed a cool Nested GridField extension that allows users to manage a sub relation directly within a parent gridfield.

This is a pretty cool feature. Creamarketing has offered to contribute it back to this module.

image

User story

As a content author, I want a way to access nested relations in a GrdiField without having to drill down to individual records.

Acceptance criteria

  • Nested relations can be displayed in a secondary GridField within a primary GridField.
  • Nested GridField can work with Has_many and many_many relations.
  • The solution can work in both ModelAdmin and GridFields in the edit form of a record.
  • Developers have an API for exposing specific relations in a nested Gridfield.
  • All GridField components in framework and this module can work with Nested GridField.
    • The Orderable gridfiled component works within a single nested gridfield.
  • All permission checks on DataObjects are retained inside nested GridFields.
  • Code base is targeted to the namespace of the symbiote/silverstripe-gridfieldextensions module.
  • Solution is functional with the Silverstripe CMS native GridField state management solution.
  • Solution includes comprehensive PHPUnit tests.
  • All user facing string are localised and provide a default English translation.
  • The nested gridfield state when navigating between pages is retained.
  • Nested Gridfield can be nested inside other nested GridFields to at least 10 levels.
  • A maximum nested Gridfield recursion limit can be configured and has a sensible default value.
  • DataObject with relations to themselves (e.g.Hierarchy) can be rendered recursively in a nested GridField (this could be used to display a tree in nested GridField)
  • The configuration for the nested GridField can be customised by a developer if needed.
  • When a record doesn't have any nested relations, nested gridfield can be configured not to show.
    • (Default behaviour to run past the UX team)
  • Nested GridField considers use case where a GridField is used to managed constructs that are not DataList/DataObjects. (Throwing meaningful exception is a valid solution for this AC)
  • The GridField extensions developer docs are updated to explain how to use nested GridField.
  • Developers have to op-in to using the feature.

Excludes

Silverstripe will handle:

  • Behat test.
  • Risk analysis.
  • Adding a nested GridField to frameworktest
  • Design review (Maybe not ... need to clear this point with design team)

Other:

  • Creamarketing has an enhanced state management solution that works with the nested Gridfield module. This is a seperate concern that may be follow up on in a separate card.
  • Creamarketing has a extension that allows rows to be dragged between nested gridfield. This may be look in a follow up card.
  • Loading indicator.

PRs

@forsdahl
Copy link

Added an initial PR for the nested gridfield implementation #384

@GuySartorelli
Copy link
Collaborator

PR merged. This will be included in the October minor release.
I've opened #389 to add behat test coverage.

@michalkleiner
Copy link
Collaborator

Awesome work @forsdahl!

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

4 participants