Support internal links in the Url widget

Created on 10 August 2023, over 1 year ago
Updated 31 August 2023, over 1 year ago

Problem/Motivation

The Url widget is limited to external links only. This is very limiting as a UX consideration for the Url widget being part of for instance a CTA component. It would be nice to incorporate some of the same functionality as the link module in Core in our module.

Steps to reproduce

Add a data type of 'uri' to a custom field. Experience the limited external url input only in the Url widget.

Proposed resolution

  • Copy the core functionality needed from the core files: LinkItem, LinkItemInterface, LinkWidget to Url widget
  • - DONE
  • (if necessary) - Update validation constraints
  • (if necessary) - Update masssageFormValues()

Remaining tasks

Patch & testing.

User interface changes

API changes

  • - DONE
  • - DONE

Data model changes

  • - DONE (computed property extended to uri value with '__url'. Note the double underscore to denote its computed.
  • New properties need to set cache tags to support changes from linked node updates. - Havn't been able to get this implemented and have concerns about performance if it did. Tested the jsonapi url link enhancer that comes with jsonapi_extras module and path changes don't get reflected using that enhancer either so maybe this is just a non-issue and we leave as is.
Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States apmsooner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024