diff --git a/.netlify/ui-redirects b/.netlify/ui-redirects deleted file mode 100644 index ea709efd3..000000000 --- a/.netlify/ui-redirects +++ /dev/null @@ -1,2 +0,0 @@ -/ /ui -/ui/* /ui/index.html 200 \ No newline at end of file diff --git a/ui/.vercel/build.sh b/ui/.vercel/build.sh new file mode 100755 index 000000000..82f9b3c13 --- /dev/null +++ b/ui/.vercel/build.sh @@ -0,0 +1,6 @@ +STORYBOOK_LINK=true ember build +mkdir -p ui-dist/ui +mv dist/* ui-dist/ui/ + +yarn build-storybook +mv storybook-static ui-dist/storybook/ diff --git a/ui/README.md b/ui/README.md index 8960b099e..04b861294 100644 --- a/ui/README.md +++ b/ui/README.md @@ -83,7 +83,7 @@ Nomad UI releases are in lockstep with Nomad releases and are integrated into th ### Storybook UI Library -The Storybook project provides a browser to see what components and patterns are present in the application and how to use them. You can run it locally with `yarn storybook` after you have `ember serve` running. The latest version from the `master` branch is at [`nomad-storybook.netlify.com`](https://nomad-storybook.netlify.com/). +The Storybook project provides a browser to see what components and patterns are present in the application and how to use them. You can run it locally with `yarn storybook` after you have `ember serve` running. The latest version from the `master` branch is at [`nomad-storybook-and-ui.vercel.app/storybook/`](https://nomad-storybook-and-ui.vercel.app/storybook/). To generate a new story for a component, run `ember generate story component-name`. You can use the existing stories as a guide. diff --git a/ui/app/components/global-header.js b/ui/app/components/global-header.js index a7fbc9d88..a1b13deb1 100644 --- a/ui/app/components/global-header.js +++ b/ui/app/components/global-header.js @@ -1,8 +1,11 @@ import Component from '@ember/component'; import classic from 'ember-classic-decorator'; +import { inject as service } from '@ember/service'; @classic export default class GlobalHeader extends Component { + @service config; + 'data-test-global-header' = true; onHamburgerClick() {} } diff --git a/ui/app/templates/components/global-header.hbs b/ui/app/templates/components/global-header.hbs index 5a6b50e4f..4beb56b39 100644 --- a/ui/app/templates/components/global-header.hbs +++ b/ui/app/templates/components/global-header.hbs @@ -11,6 +11,9 @@ {{/unless}} diff --git a/ui/config/environment.js b/ui/config/environment.js index e459f2624..35f112b9b 100644 --- a/ui/config/environment.js +++ b/ui/config/environment.js @@ -29,6 +29,7 @@ module.exports = function(environment) { mirageWithNamespaces: false, mirageWithTokens: true, mirageWithRegions: true, + showStorybookLink: process.env.STORYBOOK_LINK === 'true', }, }; diff --git a/ui/vercel.json b/ui/vercel.json new file mode 100644 index 000000000..12421f686 --- /dev/null +++ b/ui/vercel.json @@ -0,0 +1,12 @@ +{ + "github": { + "silent": true + }, + "redirects": [ + { "source": "/", "destination": "/ui/" } + ], + "rewrites": [ + { "source": "/ui/(.*)", "destination": "/ui/index.html" } + ], + "trailingSlash": true +}