Skip to content

Commit

Permalink
Merge pull request github#35562 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot authored Dec 5, 2024
2 parents 1f977df + 888f31e commit 451fe95
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 72 deletions.
10 changes: 2 additions & 8 deletions content/copilot/example-prompts-for-github-copilot-chat/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
title: Example prompts for GitHub Copilot Chat
title: Copilot Chat Cookbook
shortTitle: Example prompts
intro: 'Find examples of prompts to use with {% data variables.product.prodname_copilot_chat %}.'
allowTitleToDifferFromFilename: true
versions:
feature: copilot
topics:
Expand All @@ -14,11 +15,4 @@ children:
- /documenting-code
- /testing-code
- /security-analysis
spotlight:
- article: /testing-code/generate-unit-tests
image: /assets/images/copilot-landing/generating_unit_tests.png
- article: /refactoring-code/improving-code-readability-and-maintainability
image: /assets/images/copilot-landing/improving_code_readability.png
- article: /debugging-errors/debugging-invalid-json
image: /assets/images/copilot-landing/debugging_invalid_json.png
---
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ redirect_from:
> {% data reusables.copilot.signup-procedure-enterprise-msft-ea %}
1. Ensure you are signed in as an enterprise admin on {% data variables.product.github %}.
1. Navigate to the [{% data variables.product.prodname_copilot %} sign up page](https://github.com/github-copilot/purchase).
1. Ensure you are signed in to the right enterprise account. If you are not, click **{% octicon "arrow-switch" aria-hidden="true" %} Switch** and select the enterprise for which you want to purchase {% data variables.product.prodname_copilot %}. You can also append `?enterprise=YOUR-ENTERPRISE` to the URL to pre-select the enterprise.
1. Navigate to the {% data variables.product.prodname_copilot_short %} signup page:
* For **{% data variables.product.prodname_copilot_business_short %}**, go to the [signup page for {% data variables.product.prodname_copilot_business_short %}](https://github.com/github-copilot/business_signup/choose_business_type).
* For **{% data variables.product.prodname_copilot_enterprise_short %}**, go to the [signup page for {% data variables.product.prodname_copilot_enterprise_short %}](https://github.com/github-copilot/enterprise_signup/choose_enterprise).
1. Follow the steps to sign up and enable {% data variables.product.prodname_copilot_short %} for organizations in your enterprise. If you purchased {% data variables.product.prodname_copilot_enterprise_short %}, you will be able to assign either {% data variables.product.prodname_copilot_enterprise_short %} or {% data variables.product.prodname_copilot_business_short %} to each individual organization in the enterprise.

## Next steps
Expand Down
17 changes: 13 additions & 4 deletions data/reusables/copilot/signup-procedure-org.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
1. Navigate to the [{% data variables.product.prodname_copilot %} sign up page](https://github.com/github-copilot/purchase).
1. Ensure you are signed in to the right organization account. If you are not, click **{% octicon "arrow-switch" aria-hidden="true" %} Switch** and select the organization for which you want to purchase {% data variables.product.prodname_copilot %}.
1. Click **Enable {% data variables.product.prodname_copilot %}**.
1. Enable {% data variables.product.prodname_copilot_short %} for some or all members of your organization. For more information about assigning seats, see "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization)."
1. Go to the [{% data variables.product.prodname_copilot_for_business %} sign up page](https://github.com/github-copilot/business_signup/choose_business_type).
1. Select an organization for which you want to purchase {% data variables.product.prodname_copilot %} and click **Continue**.
1. Follow the steps to confirm your payment details, then click **Save**.

If you don't have a payment method on file, you'll be prompted to add one.

1. In the "Public code suggestions" dropdown, select **Allow** or **Block** to allow or block suggestions that match public code, and click **Save and continue**. You can change these preferences later by returning to your {% data variables.product.prodname_copilot %} settings.
1. Either grant access to {% data variables.product.prodname_copilot %} for all current and future users in your organization, or for specific users in your organization.
* If you selected **Allow for all members**, click **Confirm** in the "Confirm seat assignment" dialog to confirm that you want to enable {% data variables.product.prodname_copilot %} for all current and future users in your organization.
* If you selected **Selected teams/users**, you can choose **Add people** or **Add team**.
* If you selected **Add people**, in the "Enable GitHub Copilot access for selected members of ORGANIZATION" dialog, you can either search for individual members, or you can add members in bulk by uploading a CSV file.
* If you selected **Add team**, in the "Enable GitHub Copilot access for selected teams of ORGANIZATION" dialog, start typing the team name in the search bar, select the team you want to add and click **Add team(s) to access list**.
1. To finish setting up your {% data variables.product.prodname_copilot_for_business %} subscription, click **Save and finish**. Organization members will receive an email with instructions on how to start using {% data variables.product.prodname_copilot %}.
4 changes: 1 addition & 3 deletions src/frame/components/context/CategoryLandingContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
FeaturedLink,
getFeaturedLinksFromReq,
} from 'src/landings/components/ProductLandingContext'
import { TocItem, Spotlight } from '#src/landings/types.ts'
import { TocItem } from '#src/landings/types.ts'

export type CategoryLandingContextT = {
title: string
Expand All @@ -18,7 +18,6 @@ export type CategoryLandingContextT = {
renderedPage: string
currentLearningTrack?: LearningTrack
currentLayout: string
currentSpotlight: Array<Spotlight>
}

export const CategoryLandingContext = createContext<CategoryLandingContextT | null>(null)
Expand Down Expand Up @@ -49,6 +48,5 @@ export const getCategoryLandingContextFromRequest = (req: any): CategoryLandingC
renderedPage: req.context.renderedPage,
currentLearningTrack: req.context.currentLearningTrack,
currentLayout: req.context.currentLayoutName,
currentSpotlight: req.context.page.spotlight,
}
}
16 changes: 0 additions & 16 deletions src/frame/lib/frontmatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,6 @@ export const schema = {
octicon: {
type: 'string',
},
spotlight: {
type: 'array',
minItems: 3,
maxItems: 3,
items: {
type: 'object',
properties: {
article: {
type: 'string',
},
image: {
type: 'string',
},
},
},
},
// END category landing tags
},
}
Expand Down
72 changes: 38 additions & 34 deletions src/landings/components/CategoryLanding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import { DefaultLayout } from 'src/frame/components/DefaultLayout'
import { ArticleTitle } from 'src/frame/components/article/ArticleTitle'
import { Lead } from 'src/frame/components/ui/Lead'
import { useCategoryLandingContext } from 'src/frame/components/context/CategoryLandingContext'
import { ClientSideRedirects } from 'src/rest/components/ClientSideRedirects'
import { RestRedirect } from 'src/rest/components/RestRedirect'
import { Breadcrumbs } from 'src/frame/components/page-header/Breadcrumbs'
import { ArticleCardItems } from 'src/landings/types'

export const CategoryLanding = () => {
const router = useRouter()
const { title, intro, tocItems, currentSpotlight } = useCategoryLandingContext()
const { title, intro, tocItems } = useCategoryLandingContext()

// tocItems contains directories and its children, we only want the child articles
const onlyFlatItems: ArticleCardItems = tocItems.flatMap((item) => item.childTocItems || [])
Expand Down Expand Up @@ -70,6 +72,11 @@ export const CategoryLanding = () => {
}
return (
<DefaultLayout>
{router.route === '/[versionId]/rest/[category]' && <RestRedirect />}
{/* Doesn't matter *where* this is included because it will
never render anything. It always just return null. */}
<ClientSideRedirects />

<div className="container-xl px-3 px-md-6 my-4">
<div className={cx('d-none d-xl-block mt-3 mr-auto width-full')}>
<Breadcrumbs />
Expand All @@ -79,39 +86,36 @@ export const CategoryLanding = () => {

<h2 className="py-5">Spotlight</h2>
<div className="d-md-flex d-sm-block col-md-12">
{
// The articles in the spotlight should be contained within the page's children. If not, we throw.
currentSpotlight.map((spotlightItem, index) => {
const matchedItem = onlyFlatItems.find((item) =>
item.fullPath.endsWith(spotlightItem.article),
)
if (
!matchedItem ||
!matchedItem.title ||
!matchedItem.intro ||
!matchedItem.fullPath
) {
throw new Error(
`Couldn't find the articles defined in the spotlight region defined for ${router.asPath}. Check that page's spotlight frontmater property.`,
)
}

// A missing image is possible, in that case the CookBookArticleCard component can handle a placeholder at a future iteration.
return (
<div className="col-md-4">
<CookBookArticleCard
key={index}
image={spotlightItem.image}
title={matchedItem.title}
description={matchedItem.intro}
spotlight={true}
url={matchedItem.fullPath}
tags={[]}
/>
</div>
)
})
}
<div className="col-md-4">
<CookBookArticleCard
image={'/assets/images/copilot-landing/generating_unit_tests.png'}
title="Generate unit tests"
description="Copilot Chat can help with generating unit tests for a function."
spotlight={true}
url="/en/copilot/example-prompts-for-github-copilot-chat/testing-code/generate-unit-tests"
tags={[]}
/>
</div>
<div className="col-md-4">
<CookBookArticleCard
image={'/assets/images/copilot-landing/improving_code_readability.png'}
title="Improving code readability and maintainability"
description="Learn how to improve your code readability and maintainability."
spotlight={true}
url="/en/copilot/example-prompts-for-github-copilot-chat/refactoring-code/improving-code-readability-and-maintainability"
tags={[]}
/>
</div>
<div className="col-md-4">
<CookBookArticleCard
image={'/assets/images/copilot-landing/debugging_invalid_json.png'}
title="Debugging invalid JSON"
description="Copilot can identify and resolve syntax errors or structural issues in JSON data."
spotlight={true}
tags={[]}
url="/en/copilot/example-prompts-for-github-copilot-chat/debugging-errors/debugging-invalid-json"
/>
</div>
</div>

<div className="pt-8">
Expand Down
5 changes: 0 additions & 5 deletions src/landings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,3 @@ export type TocItem = BaseTocItem & {
}

export type ArticleCardItems = ChildTocItem[]

export type Spotlight = {
article: string
image: string
}

0 comments on commit 451fe95

Please sign in to comment.