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: repeatable links code snippets #1477

Merged
merged 3 commits into from
Nov 13, 2024
Merged

feat: repeatable links code snippets #1477

merged 3 commits into from
Nov 13, 2024

Conversation

dani-mp
Copy link
Contributor

@dani-mp dani-mp commented Nov 5, 2024

Resolves:
https://linear.app/prismic/issue/DT-2425/aauser-when-i-create-a-link-field-and-allow-repeatable-option-i-can

Description

  • Update link code snippets showcasing all 4 variations for the combinations of allowText and repeat configs.
  • Ensure link code snippets are updated when their repeat config changes.

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 requested a review from a team as a code owner November 5, 2024 12:30
Copy link

vercel bot commented Nov 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
slice-machine ✅ Ready (Inspect) Visit Preview Nov 11, 2024 2:55pm

@dani-mp dani-mp changed the title Repeatable links code snippets feat: repeatable links code snippets Nov 11, 2024
Copy link
Contributor

@jomifepe jomifepe left a comment

Choose a reason for hiding this comment

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

Tested and looks good 🚀

Comment on lines +73 to +84
} else if (repeat && !allowText) {
codeText = stripIndent`
<template v-for="(link, index) in ${dotPath(fieldPath)}" :key="index">
<PrismicLink :field="link">Link</PrismicLink>
</template>
`;
} else if (repeat && allowText) {
codeText = stripIndent`
<template v-for="(link, index) in ${dotPath(fieldPath)}" :key="index">
<PrismicLink :field="link" />
</template>
`;
Copy link
Contributor

@jomifepe jomifepe Nov 12, 2024

Choose a reason for hiding this comment

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

Not sure why, but I wasn't able to see the correct snippet with repeat, does it work correctly for you?

Kapture.2024-11-12.at.10.22.41.mp4

I can see it for Next and Sveltekit.

Screenshot 2024-11-12 at 10 13 14

Screenshot 2024-11-12 at 10 19 17

@dani-mp dani-mp merged commit 69439db into repeatable-link Nov 13, 2024
33 checks passed
@dani-mp dani-mp deleted the dani/snippets branch November 13, 2024 12:12
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