Part of #749. resolveContentLink derives the label from the wrong node when the link is a mixin.
Its precedence is jcr:title on the content node, then j:linkTitle, then the target's displayable name. That is right when the link is the content (jnt:nodeLink). It is wrong when the link is a mixin on something else: Jahia/jahia.com's jahiacommix:cta sits on a card, a panel or a hero that already has a jcr:title — the heading, not the link label. So the API returns the heading.
This cost the largest single win available on that site: the CTA mixin is 23 call sites, and all of them had to keep getLinkProps plus the discriminator ternary.
Part of #749.
resolveContentLinkderives the label from the wrong node when the link is a mixin.Its precedence is
jcr:titleon the content node, thenj:linkTitle, then the target's displayable name. That is right when the link is the content (jnt:nodeLink). It is wrong when the link is a mixin on something else: Jahia/jahia.com'sjahiacommix:ctasits on a card, a panel or a hero that already has ajcr:title— the heading, not the link label. So the API returns the heading.This cost the largest single win available on that site: the CTA mixin is 23 call sites, and all of them had to keep
getLinkPropsplus the discriminator ternary.labelProperties?: readonly string[]to state where the label lives.labelFrom: "content" | "target".