diff --git a/libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.html b/libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.html index e3e3972ab5..cfaa71f751 100644 --- a/libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.html +++ b/libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.html @@ -1,10 +1,11 @@

Overview

-

{{ use_default(challenge.description) }}

+

{{ useNaIfFalsey(challenge.description) }}

Continue reading + >Continue reading
@@ -13,11 +14,15 @@

Challenge Details

Start Date - {{ challenge.startDate }} + + {{ useNaIfFalsey(challenge.startDate) }} + End Date - {{ challenge.endDate }} + + {{ useNaIfFalsey(challenge.endDate) }} + Status @@ -26,7 +31,7 @@

Challenge Details

Platform - {{ use_default(challenge.platform.name) }} + {{ useNaIfFalsey(challenge.platform.name) }} diff --git a/libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.ts b/libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.ts index 3d5d3fb96b..c0089433f8 100644 --- a/libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.ts +++ b/libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.ts @@ -19,8 +19,8 @@ export class ChallengeOverviewComponent { organizationCards: OrganizationCard[] = MOCK_ORGANIZATION_CARDS; // mockTopics = ['breast', 'cancer']; - use_default(str: string) { - return str === '' ? 'Not available' : str; + useNaIfFalsey(str: string | null | undefined) { + return str || 'Not available'; } prettify(camel: string | undefined) { diff --git a/libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.html b/libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.html index 07e977829a..b849e59811 100644 --- a/libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.html +++ b/libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.html @@ -2,7 +2,7 @@

Overview

-

{{ use_default(org.description) }}

+

{{ useNaIfFalsey(org.description) }}

Continue reading @@ -15,11 +15,11 @@

Organization Details

Acronym - {{ use_default(org.acronym) }} + {{ useNaIfFalsey(org.acronym) }} Contact Email - {{ use_default(org.email) }} + {{ useNaIfFalsey(org.email) }} diff --git a/libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.ts b/libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.ts index 37663e43f3..aad5edc31f 100644 --- a/libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.ts +++ b/libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.ts @@ -18,7 +18,7 @@ export class OrgProfileOverviewComponent { @Input({ required: true }) organization!: Organization; organizationCards: OrganizationCard[] = MOCK_ORGANIZATION_CARDS; - use_default(str: string | undefined) { - return str === '' ? 'Not available' : str; + useNaIfFalsey(str: string | undefined) { + return str || 'Not available'; } }