{patch.title}
+ + {patch.release_candidate && ( + + Release Candidate + + )} + + ++ {patch.friendlyDate} - {bannerText} +
++ {currentVersion.versionTitle}.{patch.patchVersion} +
+ + {patch.release_candidate && ( + + Release Candidate + + )} + + {currentVersion.plan == 'enterprise-server' && ( + + Download + + )} + + +{dayjs(patch.date).format('MMMM, DD, YYYY')}
+ + {patch.version !== latestPatch && currentVersion.currentRelease === latestRelease && ( ++ {' '} + {t('notices.release_notes_use_latest')} +
+ )} + + {patch.version === latestPatch && currentVersion.currentRelease !== latestRelease && ( ++ {' '} + {t('notices.release_notes_use_latest')} +
+ )} + + {patch.version !== latestPatch && currentVersion.currentRelease !== latestRelease && ( ++ {' '} + {t('notices.release_notes_use_latest')} +
+ )} ++ {currentVersion.planTitle} {currentVersion.currentRelease} release notes +
+ + {nextRelease ? ( + + {nextRelease}-
+ {sectionItems.map((item) => {
+ if (typeof item === 'string') {
+ return (
+
- + + + ) + } + + const slug = item.heading ? slugger.slug(item.heading) : '' + return ( +
-
+
+ + {item.heading} + +
+ +-
+ {item.notes.map((note) => {
+ return (
+
+ )
+ })}
+
+ )
+ })}
+
{{ patch.date | date: "%B %d, %Y" }}
{% if patch.version != latestPatch and currentVersionObject.currentRelease == latestRelease %} -{% data ui.header.notices.ghes_release_notes_upgrade_patch_only %}
+{% data ui.header.notices.ghes_release_notes_upgrade_patch_only %} {% data ui.header.notices.release_notes_use_latest %}
{% endif %} {% if patch.version == latestPatch and currentVersionObject.currentRelease != latestRelease %} -{% data ui.header.notices.ghes_release_notes_upgrade_release_only %}
+{% data ui.header.notices.ghes_release_notes_upgrade_release_only %} {% data ui.header.notices.release_notes_use_latest %}
{% endif %} {% if patch.version != latestPatch and currentVersionObject.currentRelease != latestRelease %} -{% data ui.header.notices.ghes_release_notes_upgrade_patch_and_release %}
+{% data ui.header.notices.ghes_release_notes_upgrade_patch_and_release %} {% data ui.header.notices.release_notes_use_latest %}
{% endif %} diff --git a/javascripts/release-notes.js b/javascripts/release-notes.js index 2ad3e49401..176b0321d1 100644 --- a/javascripts/release-notes.js +++ b/javascripts/release-notes.js @@ -1,4 +1,5 @@ export default function releaseNotes () { + if (window.next) return const patches = Array.from(document.querySelectorAll('.js-release-notes-patch')) if (patches.length === 0) return diff --git a/package-lock.json b/package-lock.json index 3eb369e1c1..817269afa0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -93,6 +93,7 @@ "@graphql-inspector/core": "^2.5.0", "@graphql-tools/load": "^6.2.8", "@octokit/rest": "^18.5.3", + "@types/github-slugger": "^1.3.0", "@types/lodash": "^4.14.169", "@types/react": "^17.0.6", "@types/react-dom": "^17.0.5", @@ -4040,6 +4041,12 @@ "integrity": "sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg==", "devOptional": true }, + "node_modules/@types/github-slugger": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@types/github-slugger/-/github-slugger-1.3.0.tgz", + "integrity": "sha512-J/rMZa7RqiH/rT29TEVZO4nBoDP9XJOjnbbIofg7GQKs4JIduEO3WLpte+6WeUz/TcrXKlY+bM7FYrp8yFB+3g==", + "dev": true + }, "node_modules/@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", @@ -27663,6 +27670,12 @@ "integrity": "sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg==", "devOptional": true }, + "@types/github-slugger": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@types/github-slugger/-/github-slugger-1.3.0.tgz", + "integrity": "sha512-J/rMZa7RqiH/rT29TEVZO4nBoDP9XJOjnbbIofg7GQKs4JIduEO3WLpte+6WeUz/TcrXKlY+bM7FYrp8yFB+3g==", + "dev": true + }, "@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", diff --git a/package.json b/package.json index 443b40676c..d75336d655 100644 --- a/package.json +++ b/package.json @@ -99,6 +99,7 @@ "@graphql-inspector/core": "^2.5.0", "@graphql-tools/load": "^6.2.8", "@octokit/rest": "^18.5.3", + "@types/github-slugger": "^1.3.0", "@types/lodash": "^4.14.169", "@types/react": "^17.0.6", "@types/react-dom": "^17.0.5", diff --git a/pages/[versionId]/admin/release-notes.tsx b/pages/[versionId]/admin/release-notes.tsx new file mode 100644 index 0000000000..5de948f8d0 --- /dev/null +++ b/pages/[versionId]/admin/release-notes.tsx @@ -0,0 +1,81 @@ +import { GetServerSideProps } from 'next' +import { Liquid } from 'liquidjs' + +const liquid = new Liquid() + +import { + MainContextT, + MainContext, + getMainContextFromRequest, +} from 'components/context/MainContext' +import { DefaultLayout } from 'components/DefaultLayout' +import { GHAEReleaseNotes } from 'components/release-notes/GHAEReleaseNotes' +import { GHESReleaseNotes } from 'components/release-notes/GHESReleaseNotes' +import { + CurrentVersion, + GHAEReleaseNotesContextT, + GHESReleaseNotesContextT, +} from 'components/release-notes/types' + +type Props = { + mainContext: MainContextT + ghaeContext: GHAEReleaseNotesContextT + ghesContext: GHESReleaseNotesContextT + currentVersion: CurrentVersion +} +export default function ReleaseNotes({ + mainContext, + ghesContext, + ghaeContext, + currentVersion, +}: Props) { + return ( +