Skip to content

Commit

Permalink
add enterprise downloads page
Browse files Browse the repository at this point in the history
  • Loading branch information
jescalan committed Dec 24, 2021
1 parent 3688d63 commit fdae99d
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 78 deletions.
File renamed without changes
76 changes: 76 additions & 0 deletions website/components/downloads-props/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import Link from 'next/link'
import Button from '@hashicorp/react-button'
import { VERSION, CHANGELOG_URL } from 'data/version'
import s from '../../pages/downloads/style.module.css'

const changelogUrl = CHANGELOG_URL.length
? CHANGELOG_URL
: `https://github.com/hashicorp/vault/blob/v${VERSION}/CHANGELOG.md`

export default function DownloadsProps(preMerchandisingSlot) {
return {
changelog: changelogUrl,
getStartedDescription:
'Follow step-by-step tutorials on the essentials of Vault.',
getStartedLinks: [
{
label: 'Getting Started with the CLI',
href: 'http://learn.hashicorp.com/collections/vault/getting-started',
},
{
label: 'Getting Started with Vault UI',
href: 'http://learn.hashicorp.com/collections/vault/getting-started-ui',
},
{
label: 'Vault on HCP',
href: 'http://learn.hashicorp.com/collections/vault/getting-started-ui',
},
{
label: 'View all Vault tutorials',
href: 'https://learn.hashicorp.com/vault',
},
],
logo: (
<img
className={s.logo}
alt="Vault"
src={require('./img/vault-logo.svg')}
/>
),
tutorialLink: {
href: 'https://learn.hashicorp.com/vault',
label: 'View Tutorials at HashiCorp Learn',
},
merchandisingSlot: (
<>
{preMerchandisingSlot && preMerchandisingSlot}

<div className={s.merchandisingSlot}>
<div className={s.centerWrapper}>
<p>
Want all of the power and security of Vault, without the
complexity and overhead of managing it yourself?
</p>
<Button
title="Sign up for HCP Vault"
linkType="inbound"
url="https://portal.cloud.hashicorp.com/sign-up?utm_source=vault_io&utm_content=download_cta"
theme={{
variant: 'tertiary',
brand: 'vault',
}}
/>
</div>
</div>

<p className={s.releaseNote}>
Release notes are available in our{' '}
<Link href={`/docs/release-notes`}>
<a>documentation</a>
</Link>
.
</p>
</>
),
}
}
38 changes: 38 additions & 0 deletions website/pages/downloads/enterprise.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { VERSION } from 'data/version'
import { productSlug } from 'data/metadata'
import ProductDownloadsPage from '@hashicorp/react-product-downloads-page'
import { generateStaticProps } from '@hashicorp/react-product-downloads-page/server'
import baseProps from 'components/downloads-props'
import s from './style.module.css'

export default function DownloadsPage(staticProps) {
return (
<>
<ProductDownloadsPage
enterpriseMode={true}
{...baseProps(
<p className={s.legalNotice}>
<em>
The following shall apply unless your organization has a
separately signed Enterprise License Agreement or Evaluation
Agreement governing your use of the package: Enterprise packages
in this repository are subject to the license terms located in the
package. Please read the license terms prior to using the package.
Your installation and use of the package constitutes your
acceptance of these terms. If you do not accept the terms, do not
use the package.
</em>
</p>
)}
{...staticProps}
/>
</>
)
}

export async function getStaticProps() {
return generateStaticProps({
product: productSlug,
latestVersion: VERSION,
})
}
81 changes: 3 additions & 78 deletions website/pages/downloads/index.jsx
Original file line number Diff line number Diff line change
@@ -1,64 +1,11 @@
import Link from 'next/link'
import Button from '@hashicorp/react-button'
import ProductDownloadsPage from '@hashicorp/react-product-downloads-page'
import { generateStaticProps } from '@hashicorp/react-product-downloads-page/server'
import { VERSION, CHANGELOG_URL } from 'data/version'
import { VERSION } from 'data/version'
import { productSlug } from 'data/metadata'
import s from './style.module.css'
import baseProps from 'components/downloads-props'

export default function DownloadsPage(staticProps) {
const changelogUrl = CHANGELOG_URL.length
? CHANGELOG_URL
: `https://github.com/hashicorp/vault/blob/v${VERSION}/CHANGELOG.md`

return (
<ProductDownloadsPage
{...staticProps}
changelog={changelogUrl}
getStartedDescription="Follow step-by-step tutorials on the essentials of Vault."
getStartedLinks={[
{
label: 'Getting Started with the CLI',
href: 'http://learn.hashicorp.com/collections/vault/getting-started',
},
{
label: 'Getting Started with Vault UI',
href: 'http://learn.hashicorp.com/collections/vault/getting-started-ui',
},
{
label: 'Vault on HCP',
href: 'http://learn.hashicorp.com/collections/vault/getting-started-ui',
},
{
label: 'View all Vault tutorials',
href: 'https://learn.hashicorp.com/vault',
},
]}
logo={
<img
className={s.logo}
alt="Vault"
src={require('./img/vault-logo.svg')}
/>
}
tutorialLink={{
href: 'https://learn.hashicorp.com/vault',
label: 'View Tutorials at HashiCorp Learn',
}}
merchandisingSlot={
<>
<MerchandisingSlot />
<p className={s.releaseNote}>
Release notes are available in our{' '}
<Link href={`/docs/release-notes`}>
<a>documentation</a>
</Link>
.
</p>
</>
}
/>
)
return <ProductDownloadsPage {...baseProps()} {...staticProps} />
}

export function getStaticProps() {
Expand All @@ -67,25 +14,3 @@ export function getStaticProps() {
latestVersion: VERSION,
})
}

function MerchandisingSlot() {
return (
<div className={s.merchandisingSlot}>
<div className={s.centerWrapper}>
<p>
Want all of the power and security of Vault, without the complexity
and overhead of managing it yourself?
</p>
<Button
title="Sign up for HCP Vault"
linkType="inbound"
url="https://portal.cloud.hashicorp.com/sign-up?utm_source=vault_io&utm_content=download_cta"
theme={{
variant: 'tertiary',
brand: 'vault',
}}
/>
</div>
</div>
)
}
4 changes: 4 additions & 0 deletions website/pages/downloads/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@
}
}
}

.legalNotice {
margin-bottom: 50px;
}

0 comments on commit fdae99d

Please sign in to comment.