open-nomad/ui/app/templates/components/global-header.hbs
Buck Doyle 2d344179d3
Migrate preview deployments from Netlify to Vercel (#9471)
This adds:

* a script for building and deploying the Ember UI and Storybook to
  Vercel
* configuration for that deployment
* a header link to the UI to link to Storybook when built with
  STORYBOOK_LINK=true

It also removes a file used to configure Netlify redirects.

The Netlify setup had two “sites”: nomad-storybook and nomad-ui. I
attempted to replicate that here but ran into some platform limitations
with Vercel: two “projects” cannot share the same root directory without
also sharing the same vercel.json that lets us specify configuration
such as the rewrite needed to handle deep linking into the Ember UI. I
tried having Storybook use /ui/storybook as the root directory (and
adding a symbolically-linked package.json to bypass Vercel’s refusal
to build without it) but that produced broken Storybook deployments.

This instead combines the two projects into one
(nomad-storybook-and-ui), defaults to forwarding / to /ui/, and
adds the header link to the UI to navigate to Storybook.

Rather than have a complex build script in the Vercel configuration UI,
this delegates to a script in the repository.
2020-12-07 08:33:49 -06:00

31 lines
1,000 B
Handlebars

<nav class="navbar is-primary" title="navigation">
<div class="navbar-brand">
<span data-test-header-gutter-toggle class="gutter-toggle" aria-label="menu" onclick={{action this.onHamburgerClick}}>
<HamburgerMenu />
</span>
<LinkTo @route="jobs" class="navbar-item is-logo" aria-label="Home">
<NomadLogo />
</LinkTo>
</div>
{{#unless (media "isMobile")}}
<GlobalSearch::Control />
{{/unless}}
<div class="navbar-end">
{{#if this.config.APP.showStorybookLink}}
<a href="/storybook/" class="navbar-item">Storybook</a>
{{/if}}
<a href="https://nomadproject.io/docs" class="navbar-item">Documentation</a>
<LinkTo @route="settings.tokens" class="navbar-item">ACL Tokens</LinkTo>
</div>
</nav>
<div class="navbar is-secondary">
<div class="navbar-item is-gutter">
<RegionSwitcher @decoration="is-outlined" />
</div>
<nav class="breadcrumb is-large" title="breadcrumb navigation">
<ul>
{{yield}}
</ul>
</nav>
</div>