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

LinkField support for has_many #44

Closed
1 task
mfendeksilverstripe opened this issue May 13, 2022 · 1 comment
Closed
1 task

LinkField support for has_many #44

mfendeksilverstripe opened this issue May 13, 2022 · 1 comment

Comments

@mfendeksilverstripe
Copy link
Collaborator

mfendeksilverstripe commented May 13, 2022

LinkField support for has_many

Current React UI only supports has_one relationship for Link via the LinkField. We need to enhance this field to handle has_many relationship as well to enhance the CMS user experience.

Setup

Added a simple has_many relationship.

CtaBlock.php:

private static array $has_many = [
    'Links' => Link::class,
];

LinkRelationExtension.php:

private static array $has_one = [
    'CtaBlock' => CtaBlock::class,
];

Current state

We have to rely on GridField to manage these links as LinkField doesn't support this relationship setup. This functionally works but is far from ideal.

Desired state

The goal is the use LinkField with the Links relation in a similar way we can use UploadField to handle a has_many relation. We expect a React UI to be available to allow content author to manage multiple links via this field.

Impacted versions

This feature can be implemented only in GraphQL 4 compatible version as this is an enhancements. Back-porting this to the GraphQL 3 compatible is a nice to have but not manadatory.

Pull request

@maxime-rainville
Copy link

Duplicate of #107

@maxime-rainville maxime-rainville marked this as a duplicate of #107 Nov 23, 2023
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

2 participants