From e8709fa3fa7c06d2c66375596676d55a9f6f7c5d Mon Sep 17 00:00:00 2001 From: Meis Date: Fri, 18 Oct 2024 11:11:08 -0600 Subject: [PATCH] feat: [InstitutionHeading] Support rendering as a link (isProfileLink) to the institution profile --- src/pages/Filing/FilingApp/FileSubmission.tsx | 2 ++ .../Filing/FilingApp/FilingErrors/index.tsx | 2 ++ src/pages/Filing/FilingApp/FilingSubmit.tsx | 2 ++ .../Filing/FilingApp/FilingWarnings/index.tsx | 2 ++ .../Filing/FilingApp/InstitutionHeading.tsx | 28 +++++++++++++------ src/pages/PointOfContact/index.tsx | 2 ++ 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/pages/Filing/FilingApp/FileSubmission.tsx b/src/pages/Filing/FilingApp/FileSubmission.tsx index dddd6ea54..c5063edaa 100644 --- a/src/pages/Filing/FilingApp/FileSubmission.tsx +++ b/src/pages/Filing/FilingApp/FileSubmission.tsx @@ -279,6 +279,8 @@ export function FileSubmission(): JSX.Element { diff --git a/src/pages/Filing/FilingApp/FilingErrors/index.tsx b/src/pages/Filing/FilingApp/FilingErrors/index.tsx index 0e0f39349..6f2fc9a20 100644 --- a/src/pages/Filing/FilingApp/FilingErrors/index.tsx +++ b/src/pages/Filing/FilingApp/FilingErrors/index.tsx @@ -157,6 +157,8 @@ function FilingErrors(): JSX.Element { diff --git a/src/pages/Filing/FilingApp/FilingSubmit.tsx b/src/pages/Filing/FilingApp/FilingSubmit.tsx index a77ab0d63..98662afe9 100644 --- a/src/pages/Filing/FilingApp/FilingSubmit.tsx +++ b/src/pages/Filing/FilingApp/FilingSubmit.tsx @@ -116,6 +116,8 @@ export function FilingSubmit(): JSX.Element { diff --git a/src/pages/Filing/FilingApp/FilingWarnings/index.tsx b/src/pages/Filing/FilingApp/FilingWarnings/index.tsx index c454378ea..ab5a0ab9c 100644 --- a/src/pages/Filing/FilingApp/FilingWarnings/index.tsx +++ b/src/pages/Filing/FilingApp/FilingWarnings/index.tsx @@ -139,6 +139,8 @@ function FilingWarnings(): JSX.Element { diff --git a/src/pages/Filing/FilingApp/InstitutionHeading.tsx b/src/pages/Filing/FilingApp/InstitutionHeading.tsx index 6c6de0b22..c5b9fa80e 100644 --- a/src/pages/Filing/FilingApp/InstitutionHeading.tsx +++ b/src/pages/Filing/FilingApp/InstitutionHeading.tsx @@ -1,3 +1,4 @@ +import { Link } from 'components/Link'; import { Heading } from 'design-system-react'; import type { HeadingType } from 'design-system-react/dist/components/Headings/Heading'; import type { InstitutionDataType } from './InstitutionCard.types'; @@ -8,18 +9,27 @@ function InstitutionHeading({ lei, filingPeriod, headingType = '5', + isProfileLink = false, +}: InstitutionDataType & { // eslint-disable-next-line react/require-default-props -}: InstitutionDataType & { headingType?: HeadingType }): JSX.Element { - const content: (number | string)[] = []; + headingType?: HeadingType; + // eslint-disable-next-line react/require-default-props + isProfileLink?: boolean; +}): JSX.Element { // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - for (const item of [name || lei, filingPeriod]) { - if (item) { - content.push(item); - } - } - const contentUsed = content + const content = [name || lei, filingPeriod] .filter(Boolean) .join(`${'\u00A0\u00A0'}|${'\u00A0\u00A0'}`); - return {contentUsed}; + + if (isProfileLink && lei) + return ( + + + {content} + + + ); + + return {content}; } export default InstitutionHeading; diff --git a/src/pages/PointOfContact/index.tsx b/src/pages/PointOfContact/index.tsx index dc51a995a..67e378517 100644 --- a/src/pages/PointOfContact/index.tsx +++ b/src/pages/PointOfContact/index.tsx @@ -209,6 +209,8 @@ function PointOfContact(): JSX.Element {