From 51b4cb965e6ed4f62956892e1477d44fc0edb3ef Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Thu, 24 Oct 2024 09:27:32 +0100 Subject: [PATCH] Create Copilot group on Home page without affecting GHES users: #2 (#52832) Co-authored-by: Rachael Sewell --- content/index.md | 22 +++++++++++++------ .../components/ProductSelectionCard.tsx | 5 +++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/content/index.md b/content/index.md index ab878f7e4ef1..855610b01ec8 100644 --- a/content/index.md +++ b/content/index.md @@ -100,7 +100,14 @@ childGroups: - repositories - pull-requests - discussions + - name: GitHub Copilot + octicon: CopilotIcon + children: - copilot + - copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot + - copilot/using-github-copilot/prompt-engineering-for-github-copilot + - copilot/using-github-copilot/asking-github-copilot-questions-in-githubcom + - copilot/using-github-copilot/example-use-cases/refactoring-code-with-github-copilot - name: CI/CD and DevOps octicon: GearIcon children: @@ -128,6 +135,13 @@ childGroups: - issues - issues/planning-and-tracking-with-projects - search-github + - name: Enterprise and Teams + octicon: OrganizationIcon + children: + - organizations + - code-security/securing-your-organization + - admin + - gh-wa - name: Developers octicon: CodeSquareIcon children: @@ -135,14 +149,8 @@ childGroups: - rest - graphql - webhooks + - copilot/building-copilot-extensions - github-models - - name: Enterprise and Teams - octicon: OrganizationIcon - children: - - organizations - - code-security/securing-your-organization - - admin - - gh-wa - name: Community octicon: GlobeIcon children: diff --git a/src/landings/components/ProductSelectionCard.tsx b/src/landings/components/ProductSelectionCard.tsx index 6ba80ceff7cd..d60e55ae37b7 100644 --- a/src/landings/components/ProductSelectionCard.tsx +++ b/src/landings/components/ProductSelectionCard.tsx @@ -10,6 +10,11 @@ type ProductSelectionCardProps = { } export const ProductSelectionCard = ({ group }: ProductSelectionCardProps) => { + // Don't display the group if it has no children due to versioning + if (!group.children || group.children.length === 0) { + return null + } + const groupIcon = { height: '22px', }