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

feat: add support for repeatable link values #358

Closed
wants to merge 3 commits into from

Conversation

levimykel
Copy link
Contributor

@levimykel levimykel commented Oct 29, 2024

Resolves: Repeatable links project

Description
The second of 3 PRs to support an array of links as well as single links. It would allow devs to not manually wrap their link in a Group. It would also allow editors to have a better experience with a dedicated UI for multiple links.

This PR handles the link value changes. Links can now be an array of links or a single link (as they've always been in the past). This is set via the repeat property in the link model (see PR 1)

Here's what to expect from the output of API v2:

// repeat: false
{
  "example_link": {
    "link_type": "Web",
    "url": "https://prismicio.io",
    "text": "Visit Prismic!",
    "variant": "primary"
  }
}

// repeat: true
{
  "example_links": [
    {
      "link_type": "Web",
        "url": "https://prismicio.io",
        "text": "Visit Prismic!",
        "variant": "primary"
    },
    {
      "link_type": "Web",
        "url": "https://prismicio.io/docs",
        "text": "View the Prismic docs",
        "variant": "secondary"
    }
  ]
}

Other PRs

Note

Until PR 3 is merged into this PR, the tests will fail.

Checklist

  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

@dani-mp dani-mp closed this Nov 27, 2024
@dani-mp dani-mp deleted the lg/repeatable-links-value branch November 27, 2024 14:53
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