Merge branch 'main' into repo-sync
This commit is contained in:
@@ -8,6 +8,7 @@ import { SupportSection } from 'components/page-footer/SupportSection'
|
||||
import { DeprecationBanner } from 'components/page-header/DeprecationBanner'
|
||||
import { useMainContext } from 'components/context/MainContext'
|
||||
import { useTranslation } from 'components/hooks/useTranslation'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
type Props = { children?: React.ReactNode }
|
||||
export const DefaultLayout = (props: Props) => {
|
||||
@@ -15,7 +16,6 @@ export const DefaultLayout = (props: Props) => {
|
||||
page,
|
||||
error,
|
||||
isHomepageVersion,
|
||||
currentLanguage,
|
||||
currentPathWithoutLanguage,
|
||||
currentVersion,
|
||||
currentProduct,
|
||||
@@ -24,6 +24,7 @@ export const DefaultLayout = (props: Props) => {
|
||||
status,
|
||||
} = useMainContext()
|
||||
const { t } = useTranslation(['errors', 'scroll_button'])
|
||||
const router = useRouter()
|
||||
return (
|
||||
<div className="d-lg-flex">
|
||||
<Head>
|
||||
@@ -52,7 +53,7 @@ export const DefaultLayout = (props: Props) => {
|
||||
{page.topics.length > 0 && <meta name="keywords" content={page.topics.join(',')} />}
|
||||
|
||||
{/* For analytics events */}
|
||||
{currentLanguage && <meta name="path-language" content={currentLanguage} />}
|
||||
{router.locale && <meta name="path-language" content={router.locale} />}
|
||||
{currentVersion && <meta name="path-version" content={currentVersion} />}
|
||||
{currentProduct && <meta name="path-product" content={currentProduct.id} />}
|
||||
{relativePath && (
|
||||
|
||||
@@ -77,7 +77,6 @@ export type MainContextT = {
|
||||
relativePath?: string
|
||||
enterpriseServerReleases: EnterpriseServerReleases
|
||||
currentPathWithoutLanguage: string
|
||||
currentLanguage: string
|
||||
userLanguage: string
|
||||
allVersions: Record<string, VersionItem>
|
||||
currentVersion?: string
|
||||
@@ -162,7 +161,6 @@ export const getMainContext = (req: any, res: any): MainContextT => {
|
||||
'supported',
|
||||
]),
|
||||
enterpriseServerVersions: req.context.enterpriseServerVersions,
|
||||
currentLanguage: req.context.currentLanguage,
|
||||
userLanguage: req.context.userLanguage || '',
|
||||
allVersions: req.context.allVersions,
|
||||
currentVersion: req.context.currentVersion,
|
||||
|
||||
@@ -21,14 +21,8 @@ type Notif = {
|
||||
export const HeaderNotifications = () => {
|
||||
const router = useRouter()
|
||||
const { currentVersion } = useVersion()
|
||||
const {
|
||||
relativePath,
|
||||
allVersions,
|
||||
data,
|
||||
currentLanguage,
|
||||
userLanguage,
|
||||
currentPathWithoutLanguage,
|
||||
} = useMainContext()
|
||||
const { relativePath, allVersions, data, userLanguage, currentPathWithoutLanguage } =
|
||||
useMainContext()
|
||||
const { languages } = useLanguages()
|
||||
const { t } = useTranslation('header')
|
||||
|
||||
@@ -39,12 +33,12 @@ export const HeaderNotifications = () => {
|
||||
type: NotificationType.TRANSLATION,
|
||||
content: data.reusables.policies.translation,
|
||||
})
|
||||
} else if (languages[currentLanguage].wip !== true) {
|
||||
} else if (router.locale && languages[router.locale].wip !== true) {
|
||||
translationNotices.push({
|
||||
type: NotificationType.TRANSLATION,
|
||||
content: t('notices.localization_complete'),
|
||||
})
|
||||
} else if (languages[currentLanguage].wip) {
|
||||
} else if (router.locale && languages[router.locale].wip) {
|
||||
translationNotices.push({
|
||||
type: NotificationType.TRANSLATION,
|
||||
content: t('notices.localization_in_progress'),
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
} from '@primer/octicons-react'
|
||||
import { useMainContext } from 'components/context/MainContext'
|
||||
import dayjs from 'dayjs'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
import { Link } from 'components/Link'
|
||||
import { MarkdownContent } from 'components/ui/MarkdownContent'
|
||||
@@ -18,7 +19,8 @@ type Props = {
|
||||
context: GHESReleaseNotesContextT
|
||||
}
|
||||
export function GHESReleaseNotes({ context }: Props) {
|
||||
const { currentLanguage, currentProduct } = useMainContext()
|
||||
const router = useRouter()
|
||||
const { currentProduct } = useMainContext()
|
||||
const [focusedPatch, setFocusedPatch] = useState('')
|
||||
const {
|
||||
prevRelease,
|
||||
@@ -37,7 +39,7 @@ export function GHESReleaseNotes({ context }: Props) {
|
||||
{prevRelease ? (
|
||||
<Link
|
||||
className="btn btn-outline"
|
||||
href={`/${currentLanguage}/${currentVersion.plan}@${prevRelease}/${currentProduct?.id}/release-notes`}
|
||||
href={`/${router.locale}/${currentVersion.plan}@${prevRelease}/${currentProduct?.id}/release-notes`}
|
||||
>
|
||||
<ChevronLeftIcon /> {prevRelease}
|
||||
</Link>
|
||||
@@ -52,7 +54,7 @@ export function GHESReleaseNotes({ context }: Props) {
|
||||
{nextRelease ? (
|
||||
<Link
|
||||
className="btn btn-outline"
|
||||
href={`/${currentLanguage}/${currentVersion.plan}@${nextRelease}/${currentProduct?.id}/release-notes`}
|
||||
href={`/${router.locale}/${currentVersion.plan}@${nextRelease}/${currentProduct?.id}/release-notes`}
|
||||
>
|
||||
{nextRelease} <ChevronRightIcon />
|
||||
</Link>
|
||||
@@ -87,7 +89,7 @@ export function GHESReleaseNotes({ context }: Props) {
|
||||
<MarkdownContent data-search="article-content">
|
||||
<ul className="list-style-none pl-0 text-bold">
|
||||
{releases.map((release) => {
|
||||
const releaseLink = `/${currentLanguage}/${currentVersion.plan}@${release.version}/${currentProduct?.id}/release-notes`
|
||||
const releaseLink = `/${router.locale}/${currentVersion.plan}@${release.version}/${currentProduct?.id}/release-notes`
|
||||
|
||||
if (!release.patches || release.patches.length === 0) {
|
||||
return (
|
||||
|
||||
@@ -109,6 +109,17 @@ You can filter the alerts shown in the {% data variables.product.prodname_code_s
|
||||
|
||||
The benefit of using keyword filters is that only values with results are shown in the drop-down lists. This makes it easy to avoid setting filters that find no results.
|
||||
|
||||
### Restricting results to application code only
|
||||
|
||||
You can use the "Only alerts in application code" filter or `autofilter:true` keyword and value to restrict results to alerts in application code. Application code excludes the following.
|
||||
|
||||
- Code generated by the build process
|
||||
- Test code
|
||||
- Library or third-party code
|
||||
- Documentation
|
||||
|
||||
{% data variables.product.prodname_code_scanning_capc %} categorizes files by file path. At this time, you cannot manually categorize source files.
|
||||
|
||||
{% ifversion fpt or ghes > 3.1 %}
|
||||
## Searching {% data variables.product.prodname_code_scanning %} alerts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user