Skip to content

Commit 26fa8a4

Browse files
committed
fix(boards): hide build command when no upstream board config exists
1 parent 2d3846b commit 26fa8a4

4 files changed

Lines changed: 41 additions & 38 deletions

File tree

apps/api/src/services/normalizer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,10 @@ export class Normalizer {
301301
!enrichment.boardConfigSlugs?.size || enrichment.boardConfigSlugs.has(slug)
302302
? boardGithubUrl(slug, supportTier)
303303
: null,
304-
build_command: buildCommand(slug),
304+
build_command:
305+
!enrichment.boardConfigSlugs?.size || enrichment.boardConfigSlugs.has(slug)
306+
? buildCommand(slug)
307+
: null,
305308
legacy_paths: this.getLegacyPaths(slug, enrichment.redirects),
306309
maintainers: boardMaintainers,
307310
kernel_branches: kernelBranches,

apps/www/src/app/(frontend)/[locale]/boards/[slug]/page.tsx

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -400,53 +400,54 @@ export default async function BoardPage({ params }: Props) {
400400
formattedGroups={formattedGroups}
401401
formattedRollingGroups={formattedRollingGroups}
402402
locale={locale}
403-
boardBuildCommand={board.build_command}
404403
boardGithubUrl={board.github_url ?? undefined}
405404
/>
406405

407-
<ScrollReveal>
408-
<section className="mb-20">
409-
<div className="rounded-2xl border border-[rgb(var(--border)/0.5)] overflow-hidden bg-[rgb(var(--bg-el)/0.3)]">
410-
<div className="flex items-center gap-3 px-6 py-5 border-b border-[rgb(var(--border)/0.3)]">
411-
<div className="w-10 h-10 rounded-xl bg-[rgb(var(--brand)/0.1)] flex items-center justify-center">
412-
<Code size={18} strokeWidth={2} stroke="rgb(var(--brand))" />
406+
{board.build_command && (
407+
<ScrollReveal>
408+
<section className="mb-20">
409+
<div className="rounded-2xl border border-[rgb(var(--border)/0.5)] overflow-hidden bg-[rgb(var(--bg-el)/0.3)]">
410+
<div className="flex items-center gap-3 px-6 py-5 border-b border-[rgb(var(--border)/0.3)]">
411+
<div className="w-10 h-10 rounded-xl bg-[rgb(var(--brand)/0.1)] flex items-center justify-center">
412+
<Code size={18} strokeWidth={2} stroke="rgb(var(--brand))" />
413+
</div>
414+
<div>
415+
<h2 className="text-lg font-bold">{t('build_from_source')}</h2>
416+
<p className="text-xs text-[rgb(var(--fg-3))]">{t('build_description')}</p>
417+
</div>
413418
</div>
414-
<div>
415-
<h2 className="text-lg font-bold">{t('build_from_source')}</h2>
416-
<p className="text-xs text-[rgb(var(--fg-3))]">{t('build_description')}</p>
419+
<div className="bg-[rgb(10_10_12)] p-5">
420+
<pre className="text-sm font-mono text-gray-300 overflow-x-auto whitespace-pre-wrap break-all">
421+
<span className="text-green-400 select-none">$ </span>
422+
{board.build_command}
423+
</pre>
417424
</div>
418-
</div>
419-
<div className="bg-[rgb(10_10_12)] p-5">
420-
<pre className="text-sm font-mono text-gray-300 overflow-x-auto whitespace-pre-wrap break-all">
421-
<span className="text-green-400 select-none">$ </span>
422-
{board.build_command}
423-
</pre>
424-
</div>
425-
<div className="px-6 py-4 flex gap-4 border-t border-[rgb(var(--border)/0.2)]">
426-
<a
427-
href={ARMBIAN_URLS.BUILD_DOCS}
428-
target="_blank"
429-
rel="noopener noreferrer"
430-
className="text-sm font-medium text-[rgb(var(--brand))] hover:underline inline-flex items-center gap-1.5"
431-
>
432-
<BookOpen size={14} strokeWidth={2} />
433-
{t('build_docs')}
434-
</a>
435-
{board.github_url && (
425+
<div className="px-6 py-4 flex gap-4 border-t border-[rgb(var(--border)/0.2)]">
436426
<a
437-
href={board.github_url}
427+
href={ARMBIAN_URLS.BUILD_DOCS}
438428
target="_blank"
439429
rel="noopener noreferrer"
440430
className="text-sm font-medium text-[rgb(var(--brand))] hover:underline inline-flex items-center gap-1.5"
441431
>
442-
<SiGithub size={14} />
443-
{t('board_config')}
432+
<BookOpen size={14} strokeWidth={2} />
433+
{t('build_docs')}
444434
</a>
445-
)}
435+
{board.github_url && (
436+
<a
437+
href={board.github_url}
438+
target="_blank"
439+
rel="noopener noreferrer"
440+
className="text-sm font-medium text-[rgb(var(--brand))] hover:underline inline-flex items-center gap-1.5"
441+
>
442+
<SiGithub size={14} />
443+
{t('board_config')}
444+
</a>
445+
)}
446+
</div>
446447
</div>
447-
</div>
448-
</section>
449-
</ScrollReveal>
448+
</section>
449+
</ScrollReveal>
450+
)}
450451

451452
{siblingBoards.length > 0 && (
452453
<ScrollReveal>

apps/www/src/components/board/board-page-downloads.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ interface BoardPageDownloadsProps {
109109
formattedRollingGroups?: FormattedGroup[];
110110
locale: string;
111111
tBoard?: unknown;
112-
boardBuildCommand?: string;
113112
boardGithubUrl?: string;
114113
}
115114

packages/schemas/src/board.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const BoardDetailSchema = BoardSummarySchema.extend({
4343
docs_url: z.string().url(),
4444
forum_url: z.string().url(),
4545
github_url: z.string().url().nullable(),
46-
build_command: z.string(),
46+
build_command: z.string().nullable(),
4747
legacy_paths: z.array(z.string()).default([]),
4848
maintainers: z.array(BoardMaintainerSchema).default([]),
4949
kernel_branches: z.array(KernelBranchInfoSchema).default([]),

0 commit comments

Comments
 (0)