Allow selection of unpublished documents in link picker and align display of URLs#19296
Merged
leekelleher merged 3 commits intorelease/16.0from May 12, 2025
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enables the selection of unpublished documents in the link picker by switching the validation from the URL property to the name property, and it ensures that the actual URL is displayed rather than the localLink syntax. Key changes include updating the validator in firstUpdated, adding helper methods to retrieve the actual URL for both documents and media, and revising the error message for consistency.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/multi-url-picker/link-picker-modal/link-picker-modal.element.ts | Updates URL validation and display logic by introducing async URL population and helper methods for fetching document and media URLs. |
| src/Umbraco.Web.UI.Client/src/assets/lang/en.ts | Revises the error message to align with the new validation and selection logic. |
as the nested `url` may also be `null` or `undefined`.
leekelleher
approved these changes
May 12, 2025
Member
leekelleher
left a comment
There was a problem hiding this comment.
Tested out, works as described. 👍
AndyButland
commented
May 12, 2025
...o.Web.UI.Client/src/packages/multi-url-picker/link-picker-modal/link-picker-modal.element.ts
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
Resolves: #19294
Description
The linked issue notes that that the validation we have in place currently prevents selection of an unpublished document in the link picker, and that we supported that in 13.
This PR allows that now, but moving the validation to look at the
namefor the selected URL, which we will always have, rather than the URL. It also fixes an error that occurred when we didn't get a URL back from the request to retrieve it for the document.I also noticed that when selecting a document or media URL, we see it's actual URL displayed in the picker. But on the opening of the picker for a pre-selected link, we see the
localLinksyntax. So I've also aligned this by requesting the actual URL for display when the picker is loaded.Testing