Skip to content

Commit b7f48ea

Browse files
sarahspeterbemattpollard
authored
Support GHAE internal-only semantic versioning (github#29178)
Co-authored-by: Peter Bengtsson <[email protected]> Co-authored-by: Matt Pollard <[email protected]>
1 parent eeda4f2 commit b7f48ea

File tree

298 files changed

+890
-863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+890
-863
lines changed

components/context/ProductLandingContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export type ProductLandingContextT = {
5454
whatsNewChangelog?: Array<{ href: string; title: string; date: string }>
5555
tocItems: Array<TocItem>
5656
hasGuidesPage: boolean
57-
releases: Array<{
57+
ghesReleases: Array<{
5858
version: string
5959
firstPreviousRelease: string
6060
secondPreviousRelease: string
@@ -115,7 +115,7 @@ export const getProductLandingContextFromRequest = (req: any): ProductLandingCon
115115
changelogUrl: req.context.changelogUrl || [],
116116
productCodeExamples: req.context.productCodeExamples || [],
117117
productCommunityExamples: req.context.productCommunityExamples || [],
118-
releases: req.context.releases || [],
118+
ghesReleases: req.context.ghesReleases || [],
119119

120120
productUserExamples: (req.context.productUserExamples || []).map(
121121
({ user, description }: any) => ({

components/landing/ProductReleases.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ export function ProductReleases() {
99
const { t } = useTranslation('product_landing')
1010
const router = useRouter()
1111
const { enterpriseServerReleases, allVersions } = useMainContext()
12-
const { releases, shortTitle } = useProductLandingContext()
12+
const { ghesReleases, shortTitle } = useProductLandingContext()
1313
const currentPath = router.asPath.split('?')[0]
1414
return (
1515
<div>
1616
<div className="d-lg-flex gutter-lg flex-items-stretch">
17-
{releases.map((release) => {
17+
{ghesReleases.map((release) => {
1818
const releaseNumber = release.version
1919
if (!enterpriseServerReleases.supported.includes(releaseNumber)) {
2020
return null

components/release-notes/GHAEReleaseNotePatch.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import { useRef, useEffect } from 'react'
2+
import dayjs from 'dayjs'
23
import cx from 'classnames'
34

45
import { useTranslation } from 'components/hooks/useTranslation'
56
import { useOnScreen } from 'components/hooks/useOnScreen'
67
import { PatchNotes } from './PatchNotes'
7-
import { ReleaseNotePatch } from './types'
8+
import { CurrentVersion, ReleaseNotePatch } from './types'
89

910
import styles from './PatchNotes.module.scss'
1011

11-
type Props = { patch: ReleaseNotePatch; didEnterView: () => void }
12-
export function GHAEReleaseNotePatch({ patch, didEnterView }: Props) {
12+
type Props = { patch: ReleaseNotePatch; currentVersion: CurrentVersion; didEnterView: () => void }
13+
export function GHAEReleaseNotePatch({ patch, currentVersion, didEnterView }: Props) {
1314
const { t } = useTranslation('release_notes')
1415
const containerRef = useRef<HTMLDivElement>(null)
1516
const onScreen = useOnScreen(containerRef, { rootMargin: '-40% 0px -50%' })
@@ -25,11 +26,13 @@ export function GHAEReleaseNotePatch({ patch, didEnterView }: Props) {
2526
<div
2627
ref={containerRef}
2728
className={cx(styles.sectionHeading, 'mb-10 pb-6 border-bottom border-top')}
28-
id={patch.date}
29+
id={patch.release}
2930
>
3031
<header style={{ zIndex: 1 }} className="container-xl border-bottom px-3 pt-4 pb-2">
3132
<div className="d-flex flex-items-center">
32-
<h2 className="border-bottom-0 m-0 p-0">{patch.title}</h2>
33+
<h2 className="border-bottom-0 m-0 p-0">
34+
{currentVersion.versionTitle} {patch.release}
35+
</h2>
3336

3437
{patch.release_candidate && (
3538
<span
@@ -41,7 +44,7 @@ export function GHAEReleaseNotePatch({ patch, didEnterView }: Props) {
4144
)}
4245
</div>
4346
<p className="color-fg-muted mt-1">
44-
{bannerText} {patch.friendlyDate}.
47+
{bannerText} {dayjs(patch.date).format('MMMM DD, YYYY')}.
4548
</p>
4649
</header>
4750

components/release-notes/GHAEReleaseNotes.tsx

Lines changed: 20 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { SyntheticEvent, useState } from 'react'
1+
import { useState } from 'react'
22
import cx from 'classnames'
3-
import { ChevronDownIcon } from '@primer/octicons-react'
3+
import dayjs from 'dayjs'
44
import { GHAEReleaseNotePatch } from './GHAEReleaseNotePatch'
55
import { GHAEReleaseNotesContextT } from './types'
66
import { MarkdownContent } from 'components/ui/MarkdownContent'
@@ -29,6 +29,7 @@ export function GHAEReleaseNotes({ context }: GitHubAEProps) {
2929
<GHAEReleaseNotePatch
3030
key={patch.version}
3131
patch={patch}
32+
currentVersion={currentVersion}
3233
didEnterView={() => setFocusedPatch(patch.version)}
3334
/>
3435
)
@@ -69,50 +70,26 @@ const CollapsibleReleaseSection = ({
6970
release: GHAEReleaseNotesContextT['releases'][0]
7071
focusedPatch: string
7172
}) => {
72-
const defaultIsOpen = true
73-
const [isOpen, setIsOpen] = useState(defaultIsOpen)
74-
75-
const onToggle = (e: SyntheticEvent) => {
76-
const newIsOpen = (e.target as HTMLDetailsElement).open
77-
setIsOpen(newIsOpen)
78-
}
79-
8073
return (
8174
<li key={release.version} className="border-bottom">
82-
<details
83-
className="my-0 details-reset release-notes-version-picker"
84-
aria-current="page"
85-
open={defaultIsOpen}
86-
onToggle={onToggle}
87-
>
88-
<summary className="px-3 py-4 my-0 d-flex flex-items-center flex-justify-between outline-none">
89-
{release.version}
90-
<div className="d-flex">
91-
<span className="color-fg-muted text-small text-normal mr-1">
92-
{release.patches.length} {release.patches.length === 1 ? 'release' : 'releases'}
93-
</span>
94-
<ChevronDownIcon className={isOpen ? 'rotate-180' : ''} />
95-
</div>
96-
</summary>
97-
<ul className="color-bg-subtle border-top list-style-none py-4 px-0 my-0">
98-
{release.patches.map((patch) => {
99-
const isActive = patch.version === focusedPatch
100-
return (
101-
<li
102-
key={patch.version}
103-
className={cx('px-3 my-0 py-1', isActive && 'color-bg-accent')}
75+
<ul className="list-style-none py-4 px-0 my-0">
76+
{release.patches.map((patch) => {
77+
const isActive = patch.release === focusedPatch
78+
return (
79+
<li key={patch.release} className={cx('px-3 my-0', isActive && 'color-bg-accent')}>
80+
<a
81+
href={`#${patch.release}`}
82+
className="d-flex flex-items-center flex-justify-between"
10483
>
105-
<a
106-
href={`#${patch.date}`}
107-
className="d-flex flex-items-center flex-justify-between"
108-
>
109-
{patch.friendlyDate}
110-
</a>
111-
</li>
112-
)
113-
})}
114-
</ul>
115-
</details>
84+
{patch.release}
85+
<span className="color-fg-muted text-mono text-small text-normal">
86+
{dayjs(patch.date).format('MMMM DD, YYYY')}
87+
</span>
88+
</a>
89+
</li>
90+
)
91+
})}
92+
</ul>
11693
</li>
11794
)
11895
}

components/release-notes/GHESReleaseNotes.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ export function GHESReleaseNotes({ context }: Props) {
9292
>
9393
{release.version}
9494
<span className="color-fg-muted text-small text-normal mr-1">
95-
{release.patches.length} releases
95+
{release.patches.length}{' '}
96+
{release.patches.length === 1 ? 'release' : 'releases'}
9697
</span>
9798
</Link>
9899
</li>

components/release-notes/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export type ReleaseNotePatch = {
2222
patchVersion: string
2323
version: string
2424
downloadVersion: string
25+
release: string
2526
intro: string
2627
date: string
2728
friendlyDate: string
@@ -39,8 +40,6 @@ export type GHAEReleaseNotesContextT = {
3940

4041
export type GHESReleaseNotesContextT = {
4142
latestPatch: string
42-
prevRelease?: string
43-
nextRelease?: string
4443
latestRelease: string
4544
currentVersion: CurrentVersion
4645
releaseNotes: Array<ReleaseNotePatch>

content/account-and-profile/managing-subscriptions-and-notifications-on-github/managing-subscriptions-for-activity-on-github/managing-your-subscriptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ When you unwatch a repository, you unsubscribe from future updates from that rep
7272
- Ignore all notifications for a repository
7373
- If enabled, customize the types of event you receive notifications for ({% data reusables.notifications-v2.custom-notification-types %})
7474

75-
{%- ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5819 %}
75+
{%- ifversion fpt or ghec or ghes > 3.3 or ghae > 3.3 %}
7676
1. Optionally, to unsubscribe from all repositories owned by a given user or organization, select the **Unwatch all** dropdown and click the organization whose repositories you'd like to unsubscribe from. The button to unwatch all repositories is only available if you are watching all activity or custom notifications on over 10 repositories.
7777

7878
![Screenshot of the Unwatch All button.](/assets/images/help/notifications-v2/unsubscribe-from-all-repos.png)

content/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Email notifications from {% data variables.product.product_location %} contain t
141141
- There are updates in repositories or team discussions you're watching or in a conversation you're participating in. For more information, see "[About participating and watching notifications](#about-participating-and-watching-notifications)."
142142
- You gain access to a new repository or you've joined a new team. For more information, see "[Automatic watching](#automatic-watching)."
143143
- There are new {% data variables.product.prodname_dependabot_alerts %} in your repository. For more information, see "[{% data variables.product.prodname_dependabot_alerts %} notification options](#dependabot-alerts-notification-options)." {% ifversion fpt or ghec %}
144-
- There are workflow runs updates on repositories set up with {% data variables.product.prodname_actions %}. For more information, see "[{% data variables.product.prodname_actions %} notification options](#github-actions-notification-options)."{% endif %}{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5668 %}
144+
- There are workflow runs updates on repositories set up with {% data variables.product.prodname_actions %}. For more information, see "[{% data variables.product.prodname_actions %} notification options](#github-actions-notification-options)."{% endif %}{% ifversion fpt or ghec or ghes > 3.3 or ghae > 3.3 %}
145145
- There are new deploy keys added to repositories that belong to organizations that you're an owner of. For more information, see "[Organization alerts notification options](#organization-alerts-notification-options)."{% endif %}
146146

147147
## Automatic watching
@@ -206,7 +206,7 @@ Choose how you want to receive workflow run updates for repositories that you ar
206206

207207
{% endif %}
208208

209-
{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5668 %}
209+
{% ifversion fpt or ghec or ghes > 3.3 or ghae > 3.3 %}
210210
## Organization alerts notification options
211211

212212
If you're an organization owner, you'll receive email notifications by default when organization members add new deploy keys to repositories within the organization. You can unsubscribe from these notifications. On the notification settings page, under "Organization alerts", unselect **Email**.

content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-access-to-your-personal-repositories/inviting-collaborators-to-a-personal-repository.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ If you're a member of an {% data variables.product.prodname_emu_enterprise %}, y
3838
1. Ask for the username of the person you're inviting as a collaborator.{% ifversion fpt or ghec %} If they don't have a username yet, they can sign up for {% data variables.product.prodname_dotcom %} For more information, see "[Signing up for a new {% data variables.product.prodname_dotcom %} account](/articles/signing-up-for-a-new-github-account)".{% endif %}
3939
{% data reusables.repositories.navigate-to-repo %}
4040
{% data reusables.repositories.sidebar-settings %}
41-
{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-5658%}
41+
{% ifversion fpt or ghec or ghes > 3.4 or ghae > 3.4%}
4242
{% data reusables.repositories.click-collaborators-teams %}
4343
1. Click **Invite a collaborator**.
4444
!["Invite a collaborator" button](/assets/images/help/repository/invite-a-collaborator-button.png)

content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-access-to-your-personal-repositories/removing-a-collaborator-from-a-personal-repository.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ While forks of private repositories are deleted when a collaborator is removed,
3030

3131
{% data reusables.repositories.navigate-to-repo %}
3232
{% data reusables.repositories.sidebar-settings %}
33-
{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-5658 %}
33+
{% ifversion fpt or ghec or ghes > 3.4 or ghae > 3.4 %}
3434
{% data reusables.repositories.click-collaborators-teams %}
3535
4. To the right of the collaborator you want to remove, click {% octicon "trash" aria-label="The trash icon" %}.
3636
![Button to remove collaborator](/assets/images/help/repository/collaborator-remove.png)

0 commit comments

Comments
 (0)