diff --git a/assets/images/azure/azure-resources-search.png b/assets/images/azure/azure-resources-search.png new file mode 100644 index 0000000000..093792539a Binary files /dev/null and b/assets/images/azure/azure-resources-search.png differ diff --git a/assets/images/azure/azure-storage-containers.png b/assets/images/azure/azure-storage-containers.png new file mode 100644 index 0000000000..96059de04b Binary files /dev/null and b/assets/images/azure/azure-storage-containers.png differ diff --git a/assets/images/azure/azure-storage-permissions.png b/assets/images/azure/azure-storage-permissions.png new file mode 100644 index 0000000000..040479bdaa Binary files /dev/null and b/assets/images/azure/azure-storage-permissions.png differ diff --git a/assets/images/azure/azure-storage-shared-access-tokens.png b/assets/images/azure/azure-storage-shared-access-tokens.png new file mode 100644 index 0000000000..89a7a206de Binary files /dev/null and b/assets/images/azure/azure-storage-shared-access-tokens.png differ diff --git a/assets/images/help/enterprises/audit-stream-add-azureblob.png b/assets/images/help/enterprises/audit-stream-add-azureblob.png new file mode 100644 index 0000000000..21f4bf0cdf Binary files /dev/null and b/assets/images/help/enterprises/audit-stream-add-azureblob.png differ diff --git a/assets/images/help/enterprises/audit-stream-choice-azure.png b/assets/images/help/enterprises/audit-stream-choice-azure.png index 1f632f1db2..206d236942 100644 Binary files a/assets/images/help/enterprises/audit-stream-choice-azure.png and b/assets/images/help/enterprises/audit-stream-choice-azure.png differ diff --git a/assets/images/help/enterprises/audit-stream-choice-azureblob.png b/assets/images/help/enterprises/audit-stream-choice-azureblob.png new file mode 100644 index 0000000000..d7d08c51d4 Binary files /dev/null and b/assets/images/help/enterprises/audit-stream-choice-azureblob.png differ diff --git a/assets/images/help/enterprises/audit-stream-choice-google-cloud-storage.png b/assets/images/help/enterprises/audit-stream-choice-google-cloud-storage.png index 5fab644d54..036ebc0383 100644 Binary files a/assets/images/help/enterprises/audit-stream-choice-google-cloud-storage.png and b/assets/images/help/enterprises/audit-stream-choice-google-cloud-storage.png differ diff --git a/assets/images/help/enterprises/audit-stream-choice-s3.png b/assets/images/help/enterprises/audit-stream-choice-s3.png index a77a643924..0b0d6e3107 100644 Binary files a/assets/images/help/enterprises/audit-stream-choice-s3.png and b/assets/images/help/enterprises/audit-stream-choice-s3.png differ diff --git a/assets/images/help/enterprises/audit-stream-choice-splunk.png b/assets/images/help/enterprises/audit-stream-choice-splunk.png index 60fdab62a2..69708a399b 100644 Binary files a/assets/images/help/enterprises/audit-stream-choice-splunk.png and b/assets/images/help/enterprises/audit-stream-choice-splunk.png differ diff --git a/assets/images/help/pull_requests/commit-squashing-diagram.png b/assets/images/help/pull_requests/commit-squashing-diagram.png index 702896664e..e197d830b1 100644 Binary files a/assets/images/help/pull_requests/commit-squashing-diagram.png and b/assets/images/help/pull_requests/commit-squashing-diagram.png differ diff --git a/assets/images/help/pull_requests/standard-merge-commit-diagram.png b/assets/images/help/pull_requests/standard-merge-commit-diagram.png index 8b7c985169..72360c1b7a 100644 Binary files a/assets/images/help/pull_requests/standard-merge-commit-diagram.png and b/assets/images/help/pull_requests/standard-merge-commit-diagram.png differ diff --git a/components/Search.tsx b/components/Search.tsx index 3f6d0adc70..662ff49e76 100644 --- a/components/Search.tsx +++ b/components/Search.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef, ReactNode, RefObject } from 'react' import { useRouter } from 'next/router' import useSWR from 'swr' import cx from 'classnames' -import { ActionList, DropdownMenu, Label, Overlay } from '@primer/components' +import { ActionList, DropdownMenu, Flash, Label, Overlay } from '@primer/components' import { ItemInput } from '@primer/components/lib/ActionList/List' import { useTranslation } from 'components/hooks/useTranslation' @@ -176,20 +176,28 @@ export function Search({ 'pt-9 color-bg-default color-shadow-medium position-absolute top-0 right-0', styles.resultsContainer, isHeaderSearch && styles.resultsContainerHeader, - query ? 'd-block' : 'd-none', - query && styles.resultsContainerOpen + query || searchError ? 'd-block' : 'd-none', + (query || searchError) && styles.resultsContainerOpen )} > - + {searchError ? ( + + ) : ( + + )} {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
(value: T, delay?: number): [T, (value: T) => void] { return [debouncedValue, setDebouncedValue] } +function ShowSearchError({ + error, + isHeaderSearch, + isMobileSearch, +}: { + error: Error + isHeaderSearch: boolean + isMobileSearch: boolean +}) { + const { t } = useTranslation('search') + return ( + +

{t('search_error')}

+ {process.env.NODE_ENV === 'development' && ( +

+ + {error.toString()} + +

+ )} +
+ ) +} + function ShowSearchResults({ anchorRef, isHeaderSearch, diff --git a/components/landing/CodeExamples.tsx b/components/landing/CodeExamples.tsx index 8f77b4c672..58a49ef571 100644 --- a/components/landing/CodeExamples.tsx +++ b/components/landing/CodeExamples.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react' +import { useEffect, useState } from 'react' import { ArrowRightIcon, SearchIcon } from '@primer/octicons-react' import { Text } from '@primer/components' @@ -13,11 +13,11 @@ export const CodeExamples = () => { const { t } = useTranslation('product_landing') const [numVisible, setNumVisible] = useState(PAGE_SIZE) const [search, setSearch] = useState('') + const [typed, setTyped] = useState('') - const onSearchChange: React.ChangeEventHandler = (e) => { - setSearch(e.target.value) + useEffect(() => { setNumVisible(PAGE_SIZE) // reset the visible count (only matters after searching) - } + }, [search]) const isSearching = !!search let searchResults: typeof productCodeExamples = [] @@ -31,7 +31,13 @@ export const CodeExamples = () => { return (
-
+
{ + event.preventDefault() + setSearch(typed.trim()) + }} + > { type="search" autoComplete="off" aria-label={t('search_code_examples')} - onChange={onSearchChange} + onChange={(event) => setTyped(event.target.value)} + value={typed} /> -
+ + -
+ {isSearching && ( +
+

+ {t('search_results_for')}: {search} +

+

+ {t('matches_displayed')}: {searchResults.length} +

+
+ )} +
    {(isSearching ? searchResults : productCodeExamples.slice(0, numVisible)).map((example) => { return (
  • @@ -61,7 +81,7 @@ export const CodeExamples = () => {
  • ) })} -
+ {numVisible < productCodeExamples.length && !isSearching && (