Skip to content

Commit

Permalink
Merge branch 'vagrant-get-started' of ssh://github.com/hashicorp/dev-…
Browse files Browse the repository at this point in the history
…portal into vagrant-get-started
  • Loading branch information
im2nguyen committed Jan 28, 2025
2 parents 1685a4f + 38b3fa6 commit e060616
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 10 deletions.
15 changes: 9 additions & 6 deletions build-libs/__tests__/get-latest-content-sha-for-product.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ import { PRODUCT_REDIRECT_ENTRIES } from '@build-libs/redirects'

describe('getLatestContentShaForProduct', () => {
PRODUCT_REDIRECT_ENTRIES.forEach(({ repo, path }) => {
it(`fetches the latest SHA for the "${repo}" repo`, async () => {
const latestSha = await getLatestContentShaForProduct(repo)
expect(typeof latestSha).toBe('string')
})

if (['hcp-docs', 'sentinel', 'ptfe-releases'].includes(repo)) {
if (repo === 'hvd-docs') {
console.log(`Skipping test for repo "${repo}"`)
} else {
it(`fetches the latest SHA for the "${repo}" repo`, async () => {
const latestSha = await getLatestContentShaForProduct(repo)
expect(typeof latestSha).toBe('string')
})
}
if (['hcp-docs', 'sentinel', 'ptfe-releases', 'hvd-docs'].includes(repo)) {
console.log(`Skipping test for private repo "${repo}"`)
} else {
it(`fetches the latest SHA for the "${repo}" repo, then validates the SHA by fetching redirects`, async () => {
Expand Down
8 changes: 7 additions & 1 deletion build-libs/redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ async function getRedirectsFromContentRepo(repoName, redirectsPath, config) {
let redirectsFileString
if (isDeveloperBuild) {
// For `hashicorp/dev-portal` builds, load redirects remotely
const latestContentSha = await getLatestContentShaForProduct(repoName)
// hvd-docs is not hosted on the content API, so we need to use main as the latest sha
const latestContentSha =
repoName === 'hvd-docs'
? 'main'
: await getLatestContentShaForProduct(repoName)
redirectsFileString = await fetchGithubFile({
owner: 'hashicorp',
repo: repoName,
Expand Down Expand Up @@ -126,6 +130,7 @@ const PRODUCT_REDIRECT_ENTRIES = [
{ repo: 'hcp-docs', path: '/redirects.js' },
{ repo: 'ptfe-releases', path: 'website/redirects.js' },
{ repo: 'sentinel', path: 'website/redirects.js' },
{ repo: 'hvd-docs', path: '/redirects.js' },
]

async function buildProductRedirects() {
Expand Down Expand Up @@ -299,6 +304,7 @@ function filterInvalidRedirects(redirects, repoSlug) {
'ptfe-releases': 'terraform/enterprise',
'cloud.hashicorp.com': 'hcp',
'hcp-docs': 'hcp',
'hvd-docs': 'validated-designs',
}
const productSlug = productSlugsByRepo[repoSlug] ?? repoSlug

Expand Down
1 change: 1 addition & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import Card from 'components/card'
import CardWithLink from 'views/product-downloads-view/components/card-with-link'
import MobileDownloadStandaloneLink from 'components/mobile-download-standalone-link'
import Heading from 'components/heading'
import InlineAlert from 'components/inline-alert'
import InlineLink from 'components/inline-link'
import { IconInfo16 } from '@hashicorp/flight-icons/svg-react/info-16'
import { IconDownload16 } from '@hashicorp/flight-icons/svg-react/download-16'
// Types
import { InstallProps, ReleaseBuild } from './types'
Expand All @@ -26,6 +29,7 @@ function InstallCallout({
customInstallProps,
headingData,
cardClassName,
children,
}: {
customInstallProps: InstallProps
/** We link to this heading from the side nav, so we've lifted up its data */
Expand All @@ -34,6 +38,7 @@ function InstallCallout({
text: string
}
cardClassName?: string
children?: React.ReactNode
}) {
const { latestVersion, builds } = customInstallProps
return (
Expand Down Expand Up @@ -71,6 +76,7 @@ function InstallCallout({
/>
))}
</div>
{children}
</Card>
)
}
Expand Down
10 changes: 10 additions & 0 deletions src/views/product-downloads-view/boundary/download.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@
.lastCard {
margin-top: 32px;
}

.alert {
margin-top: 24px;
}

.cardIcon {
margin-top: 3px;
max-height: 16px;
max-width: 16px;
}
23 changes: 22 additions & 1 deletion src/views/product-downloads-view/boundary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import ProductDownloadsView from 'views/product-downloads-view'
// Components
import { InstallCallout } from './components'
import InlineAlert from 'components/inline-alert'
import InlineLink from 'components/inline-link'
import { IconInfo16 } from '@hashicorp/flight-icons/svg-react/info-16'
// Types
import { InstallProps } from './components/install-callout/types'
import { ProductDownloadsViewProps } from 'views/product-downloads-view/types'
Expand Down Expand Up @@ -60,7 +63,25 @@ function BoundaryDownloadsView({
<InstallCallout
headingData={SHARED_HEADINGS.desktopClient}
customInstallProps={desktopClientProps}
/>
>
<InlineAlert
className={s.alert}
color="neutral"
title="Note"
description={
<>
You can find previous versions of the Desktop Client on the{' '}
<InlineLink
href="https://releases.hashicorp.com/boundary-desktop"
textSize={200}
>
Desktop Client releases page.
</InlineLink>
</>
}
icon={<IconInfo16 className={s.cardIcon} />}
/>
</InstallCallout>
<InstallCallout
cardClassName={s.lastCard}
headingData={SHARED_HEADINGS.installer}
Expand Down
9 changes: 7 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
"@components/*": ["components/*"]
},
"types": ["vitest/globals", "@testing-library/jest-dom"],
"strictNullChecks": false
"strictNullChecks": false,
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules", "scripts/migrate-io/templates"]
}

0 comments on commit e060616

Please sign in to comment.