diff --git a/ui/app/components/splash-page.hbs b/ui/app/components/splash-page.hbs new file mode 100644 index 0000000000..187687ac40 --- /dev/null +++ b/ui/app/components/splash-page.hbs @@ -0,0 +1,21 @@ +{{! + Copyright (c) HashiCorp, Inc. + SPDX-License-Identifier: BUSL-1.1 +~}} + +
+
+
+
+ {{yield to="header"}} +
+
+ {{yield to="subHeader"}} +
+ + {{yield to="footer"}} +
+
+
\ No newline at end of file diff --git a/ui/app/components/splash-page.js b/ui/app/components/splash-page.js deleted file mode 100644 index ec1634e6d5..0000000000 --- a/ui/app/components/splash-page.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -/** - * @module SplashPage - * SplashPage component is used as a landing page with a box horizontally and center aligned on the page. It's used as the login landing page. - * - * - * @example - * ```js - * - * content here - * -
-
-
- {{yield (hash header=(component "splash-page/splash-header"))}} -
-
- {{yield (hash sub-header=(component "splash-page/splash-header"))}} -
- - {{yield (hash footer=(component "splash-page/splash-content"))}} -
-
- -{{/if}} \ No newline at end of file diff --git a/ui/app/templates/vault/cluster/auth.hbs b/ui/app/templates/vault/cluster/auth.hbs index 4d75b44acc..13d291f2a2 100644 --- a/ui/app/templates/vault/cluster/auth.hbs +++ b/ui/app/templates/vault/cluster/auth.hbs @@ -3,126 +3,130 @@ SPDX-License-Identifier: BUSL-1.1 ~}} - - -
- - - -
-
- - {{#if this.oidcProvider}} -
- -
- {{else}} -
-
- +{{#if this.mfaErrors}} +
+ + + +
+{{else}} + + <:header> + {{#if this.oidcProvider}} +
+
-
-
- {{#if this.mfaAuthData}} - - {{else if this.waitingForOktaNumberChallenge}} - - {{/if}} -

- {{if (or this.mfaAuthData this.waitingForOktaNumberChallenge) "Authenticate" "Sign in to Vault"}} -

-
- {{/if}} - - {{#unless this.mfaAuthData}} - {{#if (has-feature "Namespaces")}} - - -
-
- -
- {{#if this.managedNamespaceRoot}} -
- /{{this.managedNamespaceRoot}} + {{else}} +
+
+ +
+
+
+ {{#if this.mfaAuthData}} + + {{else if this.waitingForOktaNumberChallenge}} + + {{/if}} +

+ {{if (or this.mfaAuthData this.waitingForOktaNumberChallenge) "Authenticate" "Sign in to Vault"}} +

+
+ {{/if}} + + + <:subHeader> + {{#if (has-feature "Namespaces")}} + {{#unless this.mfaAuthData}} + +
+
+
- {{/if}} -
-
-
- + {{#if this.managedNamespaceRoot}} +
+ /{{this.managedNamespaceRoot}} +
+ {{/if}} +
+
+
+ +
-
- - - {{/if}} - {{/unless}} - - {{#if this.mfaAuthData}} - - {{else}} - - {{/if}} - - -
-

- {{#if this.oidcProvider}} - Once you log in, you will be redirected back to your application. If you require login credentials, contact your - administrator. - {{else}} - Contact your administrator for login credentials - {{/if}} -

-
-
- \ No newline at end of file + + {{/unless}} + {{/if}} + + + <:content> + {{#if this.mfaAuthData}} + + {{else}} + + {{/if}} + + + <:footer> +
+

+ {{#if this.oidcProvider}} + Once you log in, you will be redirected back to your application. If you require login credentials, contact your + administrator. + {{else}} + Contact your administrator for login credentials. + {{/if}} +

+
+ + +{{/if}} \ No newline at end of file diff --git a/ui/app/templates/vault/cluster/init.hbs b/ui/app/templates/vault/cluster/init.hbs index 70d44deb8e..172f8c0668 100644 --- a/ui/app/templates/vault/cluster/init.hbs +++ b/ui/app/templates/vault/cluster/init.hbs @@ -3,18 +3,13 @@ SPDX-License-Identifier: BUSL-1.1 ~}} - - {{#if (and this.model.usingRaft (not this.prefersInit))}} - + + <:header> + {{#if (and this.model.usingRaft (not this.prefersInit))}}

Raft Storage

-
- - - - {{else if this.keyData}} - + {{else if this.keyData}} {{#let (or this.keyData.recovery_keys this.keyData.keys) as |keyArray|}}

Vault has been initialized! @@ -26,8 +21,16 @@ {{/if}}

{{/let}} -
- + {{else}} +

+ Let's set up the initial set of root keys that you will need in case of an emergency. +

+ {{/if}} + + <:content> + {{#if (and this.model.usingRaft (not this.prefersInit))}} + + {{else if this.keyData}}

@@ -104,14 +107,7 @@ />

-
- {{else}} - -

- Let's set up the initial set of root keys that you’ll need in case of an emergency -

-
- + {{else}}
- - {{/if}} + {{/if}} + \ No newline at end of file diff --git a/ui/app/templates/vault/cluster/mfa-setup.hbs b/ui/app/templates/vault/cluster/mfa-setup.hbs index b4d3419f35..3c203179fe 100644 --- a/ui/app/templates/vault/cluster/mfa-setup.hbs +++ b/ui/app/templates/vault/cluster/mfa-setup.hbs @@ -3,11 +3,11 @@ SPDX-License-Identifier: BUSL-1.1 ~}} - - + + <:header>

MFA setup

-
- + + <:content>
{{#if (eq this.onStep 1)}} @@ -31,5 +31,5 @@ {{/if}}
-
+
\ No newline at end of file diff --git a/ui/app/templates/vault/cluster/unseal.hbs b/ui/app/templates/vault/cluster/unseal.hbs index ed9a02983d..ebaca1beae 100644 --- a/ui/app/templates/vault/cluster/unseal.hbs +++ b/ui/app/templates/vault/cluster/unseal.hbs @@ -23,13 +23,14 @@
{{else}} - - + + <:header>

Unseal Vault

-
- + + + <:content>

{{capitalize this.model.name}} @@ -57,8 +58,9 @@ /> {{/if}}

-
- + + + <:footer>

@@ -66,6 +68,6 @@

-
+
{{/if}} \ No newline at end of file diff --git a/ui/tests/integration/components/splash-page-test.js b/ui/tests/integration/components/splash-page-test.js new file mode 100644 index 0000000000..82ddef0c9e --- /dev/null +++ b/ui/tests/integration/components/splash-page-test.js @@ -0,0 +1,37 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'ember-qunit'; +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Component | splash-page', function (hooks) { + setupRenderingTest(hooks); + + test('it should render', async function (assert) { + assert.expect(4); + await render(hbs` + <:header> + Header here + + <:subHeader> + sub header + + <:content> + content + + <:footer> +
footer
+ + +
+ `); + assert.dom('[data-test-splash-page-header]').includesText('Header here', 'Header renders'); + assert.dom('[data-test-splash-page-sub-header]').includesText('sub header', 'SubHeader renders'); + assert.dom('[data-test-splash-page-content]').includesText('content', 'Content renders'); + assert.dom('[data-test-footer]').includesText('footer', 'Footer renders'); + }); +});