From 0f5a452142eccdc6fc8dc871c6b669573e4ab9dd Mon Sep 17 00:00:00 2001 From: Eduardo Roth Date: Tue, 19 Dec 2023 17:29:20 -0600 Subject: [PATCH] fix(): missing challengeNumber properties --- docs/src/components/ChallengeFooter.astro | 8 ++++---- docs/src/components/Content.astro | 8 ++++---- docs/src/components/PageTitle.astro | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/src/components/ChallengeFooter.astro b/docs/src/components/ChallengeFooter.astro index f11b636..3292bba 100644 --- a/docs/src/components/ChallengeFooter.astro +++ b/docs/src/components/ChallengeFooter.astro @@ -3,11 +3,11 @@ import VideoButton from './VideoButton.astro' import ClipboardCopy from './ClipboardCopy.astro' -const {author, challengeNumber, title, blogLink, videoLink, command} = Astro.props.entry.data; +const {author, challenge, title, blogLink, videoLink, command} = Astro.props.entry.data; -const authorLink = `https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A${challengeNumber}+label%3A"answer+author"`; +const authorLink = `https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A${challenge?.number}+label%3A"answer+author"`; const authorDescription = `${title} solution author`; -const communityLink = `https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A${challengeNumber}+label%3Aanswer`; +const communityLink = `https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A${challenge?.number}+label%3Aanswer`; const communityDescription = `${title} community solutions`; const npxCommand = `npx nx serve ${command}`; --- @@ -22,7 +22,7 @@ const npxCommand = `npx nx serve ${command}`; } +

Your PR title must start with Answer:{challenge?.number}.

} +{ challenge?.number && author && } -{challengeNumber && } +{challenge?.number && } { renderCommentSection && } @@ -26,4 +26,4 @@ const renderCommentSection = !Astro.props.entry.data.noCommentSection; font-size: var(--sl-text-xs); color: var(--sl-color-gray-3); } - \ No newline at end of file + diff --git a/docs/src/components/PageTitle.astro b/docs/src/components/PageTitle.astro index 3b6cb5f..6f416af 100644 --- a/docs/src/components/PageTitle.astro +++ b/docs/src/components/PageTitle.astro @@ -2,13 +2,13 @@ import type { Props } from '@astrojs/starlight/props'; import Default from '@astrojs/starlight/components/PageTitle.astro'; -const {label: challengeLabel, number: challengeNumber} = Astro.props.entry.data.challenge ?? {}; +const challenge = Astro.props.entry.data.challenge; ---
- {challengeNumber &&
{challengeLabel} #{challengeNumber}
} + {challenge?.number &&
{challenge.label} #{challenge.number}
}