Skip to content

Template resolution and link handling - #12824

Merged
tdipisa merged 5 commits into
geosolutions-it:masterfrom
offtherailz:template-and-link-handling
Aug 24, 2026
Merged

tdipisa merged 5 commits into
geosolutions-it:masterfrom
offtherailz:template-and-link-handling

Conversation

@offtherailz

@offtherailz offtherailz commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Description

Refactor of how templates and link targets are handled, plus test coverage.

  • Template placeholders are resolved without compiling them: only property references (${properties.NAME}) are substituted, expressions are not; 0 and false are preserved instead of being replaced. Interpolated values are HTML-escaped.
  • Link target checks are centralized in URLUtils (getSafeHref, hardened isValidURL); ALink, DetailsInfo, FilterItems, geostory and catalog links route through it, so references without a protocol stay in-app and absolute URLs are limited to the allowed protocols.
  • Permalink loading resolves pathTemplate to an application path and reports an invalid target instead of navigating to it.
  • Added coverage for the HTML rendering components.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?

#12823

What is the new behavior?

Closes #12823

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

Templates are resolved with generateTemplateString, that now keeps 0 and false
instead of replacing every falsy value. Only property references are supported,
expressions are not.
getSafeHref keeps the references without protocol and drops the others,
isValidURL rejects non strings and paths resolved on another host.
@offtherailz offtherailz added this to the 2026.03.00 milestone Aug 20, 2026
@cla-bot cla-bot Bot added the CLA Ready label Aug 20, 2026
@tdipisa
tdipisa requested a review from MV88 August 21, 2026 08:11

@MV88 MV88 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@tdipisa
tdipisa merged commit 89bfae8 into geosolutions-it:master Aug 24, 2026
16 checks passed
@offtherailz

Copy link
Copy Markdown
Member Author

Successfully created backport PR for 2026.02.xx:

offtherailz added a commit that referenced this pull request Aug 24, 2026
* refactor: resolve template placeholders without compiling them

Templates are resolved with generateTemplateString, that now keeps 0 and false
instead of replacing every falsy value. Only property references are supported,
expressions are not.

* refactor: move link target checks to URLUtils

getSafeHref keeps the references without protocol and drops the others,
isValidURL rejects non strings and paths resolved on another host.

* fix: report permalink targets that are not application paths

* chore: use getSafeHref for geostory and catalog links

* test: coverage for the html rendering components

(cherry picked from commit 89bfae8)
tdipisa added a commit that referenced this pull request Aug 25, 2026
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.

Refactor template resolution and centralize link target handling

3 participants