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

feature: External Link (in Action Block) #234

Merged
merged 3 commits into from
Jan 6, 2025
Merged

Conversation

jbmoelker
Copy link
Member

Changes

  • Adds ExternalLink item to ActionBlock with required title and url field (with validation).
  • Matches the openInNewTab property also available in the built-in links in StructuredText fields.
  • Reuses the same style field configuration used for the InternalLink block.

Associated issue

N/A

How to test

  1. Open preview link
  2. Navigate to the Action Block demo and scroll down to the "Action block with External Links" section.
  3. Verify the External Links render as primary and secondary
  4. Verify the first action opens the external link in the same tab, and the second action opens a new tab
  5. Go the the external-links environment and play around with the new External Link option in Action Blocks
  6. Verify changes made are reflected in the web page (note: run locally as changes are not updated on deploy preview)

Checklist

  • I have performed a self-review of my own code
  • I have made sure that my PR is easy to review (not too big, includes comments)
  • I have made updated relevant documentation files (in project README, docs/, etc)
  • I have added a decision log entry if the change affects the architecture or changes a significant technology
  • I have notified a reviewer

@jbmoelker jbmoelker changed the title feature: ExternalLink (in ActionBlock) feature: External Link (in Action Block) Dec 28, 2024
@jbmoelker jbmoelker mentioned this pull request Dec 28, 2024
Copy link
Contributor

@jurgenbelien jurgenbelien left a comment

Choose a reason for hiding this comment

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

Looks good! Just pondering the reusable field schema file location..

config/datocms/migrations/1734363388_actionBlock.ts Outdated Show resolved Hide resolved
rather than in lib/ to make it clear they should no longer be mutated
Copy link

cloudflare-workers-and-pages bot commented Jan 6, 2025

Deploying head-start with  Cloudflare Pages  Cloudflare Pages

Latest commit: e10a9c7
Status: ✅  Deploy successful!
Preview URL: https://74ab6b60.head-start.pages.dev
Branch Preview URL: https://feat-external-link.head-start.pages.dev

View logs

@jbmoelker jbmoelker merged commit 8cdbee0 into main Jan 6, 2025
5 checks passed
@jbmoelker jbmoelker deleted the feat/external-link branch January 6, 2025 18:49
jurgenbelien added a commit that referenced this pull request Feb 4, 2025
> [!IMPORTANT] 
> Depends on #234, which should be merged first.

# Changes

- Adds Email Link to easily send an email (with optional subject and
body text).
- Adds Phone Link to easily start phone call, send sms (with optional
text) or contact via WhatsApp (with optional message).

# Associated issue

N/A

# How to test

1. Open preview link
2. Navigate to Action Block demo > "Action block with Email Links"
section
3. Verify all variations (mailto only, with subject, with subject +
body) work
4. Navigate to Action Block demo > "Action block with Phone Links"
section
5. Verify all variations (call, sms, whatsapp) work (best to check on
both Android and iOS)
6. Go the the `email-and-phone-links` environment and play around with
the new Email Link and Phone Link option in Action Blocks
7. Verify changes made are reflected in the web page (note: run locally
as changes are not updated on deploy preview)

# Checklist

- [x] I have performed a self-review of my own code
- [x] I have made sure that my PR is easy to review (not too big,
includes comments)
- ~I have made updated relevant documentation files (in project README,
docs/, etc)~
- ~I have added a decision log entry if the change affects the
architecture or changes a significant technology~
- [x] I have notified a reviewer

<!-- Please strike through and check off all items that do not apply
(rather than removing them) -->

---------

Co-authored-by: Jurgen Beliën <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants