fix(portal): recognize legacy lineup report links as resource buttons

This commit is contained in:
AIAMarketing committed 2026-10-30 15:40:57 -07:00
1 parent 95c5f229f5
commit 16a72caa00
1 file changed
+7 -2
+7 -2
View File
@@ -1,8 +1,13 @@
/** Translate a narrow presentation vocabulary; never copy arbitrary classes/styles. */ /** Translate a narrow presentation vocabulary; never copy arbitrary classes/styles. */
export function portalLinkPresentation(classes: string[], background: string, protocol: string): string | undefined { export function portalLinkPresentation(classes: string[], background: string, protocol: string, label = ''): string | undefined {
if (protocol === 'mailto:' || protocol === 'tel:') return 'portal-contact-link'; if (protocol === 'mailto:' || protocol === 'tel:') return 'portal-contact-link';
// The legacy portal's operational lineup-report anchors are styled by HubSpot
// rules that do not survive the sanitized render. Recognize their visible
// label, not arbitrary source classes, CSS, destinations or executable markup.
const lineupReport = /\b(?:daily|monthly)\s+lineup\s+report\b/i.test(label.replace(/\s+/g, ' ').trim());
if (classes.some((name) => ['hs-button', 'content-button', 'portal-resource-button'].includes(name)) || if (classes.some((name) => ['hs-button', 'content-button', 'portal-resource-button'].includes(name)) ||
['rgb(255, 189, 89)', 'rgb(255, 145, 77)', '#ffbd59', '#ff914d'].includes(background.toLowerCase())) { ['rgb(255, 189, 89)', 'rgb(255, 145, 77)', '#ffbd59', '#ff914d'].includes(background.toLowerCase()) ||
lineupReport) {
return 'portal-resource-button'; return 'portal-resource-button';
} }
return undefined; return undefined;