Skip to content

Commit

Permalink
feat: remove boundary installer for versions less than 0.18.0 (#2678)
Browse files Browse the repository at this point in the history
* hide boundary installer component for verions less than 0.18.0

* remove boundary installer from sidebar for versions less than 0.18.0

* add comments and check if product is boundary
  • Loading branch information
LeahMarieBush authored Jan 29, 2025
1 parent c844cef commit 548cb72
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* SPDX-License-Identifier: MPL-2.0
*/

import { gt } from 'semver'
// Components
import Card from 'components/card'
import CardWithLink from 'views/product-downloads-view/components/card-with-link'
Expand All @@ -21,6 +22,7 @@ import { getFileExtension, humanArch } from '../helpers'
import s from './install-callout.module.css'
import { ContentWithPermalink } from 'views/open-api-docs-view/components/content-with-permalink'
import viewStyles from 'views/product-downloads-view/product-downloads-view.module.css'
import { useCurrentVersion } from 'views/product-downloads-view/contexts'

/**
* Render a callout to download the Boundary Desktop Client.
Expand All @@ -41,7 +43,11 @@ function InstallCallout({
children?: React.ReactNode
}) {
const { latestVersion, builds } = customInstallProps
return (
const { currentVersion } = useCurrentVersion()
// If the boundary version is less than 0.18.0, we don't want to show the installer since
// previous versions of boundary do not work with the installer
return headingData.id === 'installer' &&
gt('0.18.0', currentVersion) ? null : (
<Card elevation="base" className={cardClassName}>
<ContentWithPermalink
className={s.headingContainer}
Expand Down
9 changes: 8 additions & 1 deletion src/views/product-downloads-view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { ReactElement, useMemo } from 'react'
import { useRouter } from 'next/router'
import Head from 'next/head'
import { gt } from 'semver'

// Global imports
import { useCurrentProduct } from 'contexts'
Expand Down Expand Up @@ -129,6 +130,12 @@ const ProductDownloadsViewContent = ({
},
]
: []
// If the product is boundary and the version is less than 0.18.0, we don't want
// to show the installer since previous boundary versions don't work with the installer
const filteredAdditionalDownloadItems =
currentProduct.slug === 'boundary' && gt('0.18.0', currentVersion)
? additionalDownloadItems.filter((item) => item.fullPath !== '#installer')
: additionalDownloadItems

const sidebarNavDataLevels = [
generateTopLevelSidebarNavData(currentProduct.name),
Expand All @@ -139,7 +146,7 @@ const ProductDownloadsViewContent = ({
{ divider: true },
{ heading: 'Operating Systems' },
...downloadMenuItems,
...additionalDownloadItems,
...filteredAdditionalDownloadItems,
{ divider: true },
{
title: SHARED_HEADINGS.releaseInfo.text,
Expand Down

0 comments on commit 548cb72

Please sign in to comment.