From 35af59730548eec1ca8c385230d05d6c9c0dd0b4 Mon Sep 17 00:00:00 2001 From: Angel Garbarino Date: Sun, 12 Nov 2023 10:38:08 -0700 Subject: [PATCH 1/7] make splash page view only block content --- ui/app/components/splash-page.hbs | 23 +++++++++++++ ui/app/components/splash-page.js | 34 ------------------- .../components/splash-page/splash-content.js | 10 ------ .../components/splash-page/splash-footer.js | 10 ------ .../components/splash-page/splash-header.js | 10 ------ ui/app/templates/components/splash-page.hbs | 26 -------------- 6 files changed, 23 insertions(+), 90 deletions(-) create mode 100644 ui/app/components/splash-page.hbs delete mode 100644 ui/app/components/splash-page.js delete mode 100644 ui/app/components/splash-page/splash-content.js delete mode 100644 ui/app/components/splash-page/splash-footer.js delete mode 100644 ui/app/components/splash-page/splash-header.js delete mode 100644 ui/app/templates/components/splash-page.hbs diff --git a/ui/app/components/splash-page.hbs b/ui/app/components/splash-page.hbs new file mode 100644 index 000000000000..8a080c0b369c --- /dev/null +++ b/ui/app/components/splash-page.hbs @@ -0,0 +1,23 @@ +{{! + Copyright (c) HashiCorp, Inc. + SPDX-License-Identifier: BUSL-1.1 +~}} + +{{yield to="altContent"}} + +
+
+
+
+ {{yield to="pageHeader"}} +
+
+ {{yield to="pageSubHeader"}} +
+ + {{yield to="pageFooter"}} +
+
+
\ 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 ec1634e6d521..000000000000 --- 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 From 21f3c5a2bf51447afca1b866625152c359c4aede Mon Sep 17 00:00:00 2001 From: Angel Garbarino Date: Sun, 12 Nov 2023 10:38:42 -0700 Subject: [PATCH 2/7] change invocation of component --- ui/app/templates/vault/cluster/auth.hbs | 60 +++++++++++--------- ui/app/templates/vault/cluster/init.hbs | 38 ++++++------- ui/app/templates/vault/cluster/mfa-setup.hbs | 10 ++-- ui/app/templates/vault/cluster/unseal.hbs | 16 +++--- 4 files changed, 64 insertions(+), 60 deletions(-) diff --git a/ui/app/templates/vault/cluster/auth.hbs b/ui/app/templates/vault/cluster/auth.hbs index 4d75b44acc01..278cfb57fc24 100644 --- a/ui/app/templates/vault/cluster/auth.hbs +++ b/ui/app/templates/vault/cluster/auth.hbs @@ -3,22 +3,25 @@ SPDX-License-Identifier: BUSL-1.1 ~}} - - -
- - - -
-
- + + <:altContent> + {{#if this.mfaErrors}} +
+ + + +
+ {{/if}} + + + <:pageHeader> {{#if this.oidcProvider}}
@@ -52,10 +55,11 @@
{{/if}} -
- {{#unless this.mfaAuthData}} + + + <:pageSubHeader> {{#if (has-feature "Namespaces")}} - + {{#unless this.mfaAuthData}}
@@ -73,7 +77,7 @@ data-test-auth-form-ns-input value={{this.namespaceInput}} placeholder={{if this.managedNamespaceRoot "/ (Default)" "/ (Root)"}} - oninput={{perform this.updateNamespace value="target.value"}} + {{on "input" (perform this.updateNamespace value="target.value")}} autocomplete="off" spellcheck="false" name="namespace" @@ -87,10 +91,11 @@
-
+ {{/unless}} {{/if}} - {{/unless}} - + + + <:pageContent> {{#if this.mfaAuthData}} {{/if}} - - + + + <:pageFooter>

{{#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 + Contact your administrator for login credentials. {{/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 70d44deb8e90..3c6818a00719 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))}} - + + <:pageHeader> + {{#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}} + + <:pageContent> + {{#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 b4d3419f356f..7a8d0fab3f13 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 ~}} - - + + <:pageHeader>

MFA setup

-
- + + <:pageContent>
{{#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 ed9a02983d4b..e95f3969727b 100644 --- a/ui/app/templates/vault/cluster/unseal.hbs +++ b/ui/app/templates/vault/cluster/unseal.hbs @@ -23,13 +23,14 @@ {{else}} - - + + <:pageHeader>

Unseal Vault

-
- + + + <:pageContent>

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

-
- + + + <:pageFooter>

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

-
+
{{/if}} \ No newline at end of file From c82f04a3ffdfe5c9f06ed258814fbbc1cc59267d Mon Sep 17 00:00:00 2001 From: Angel Garbarino Date: Sat, 18 Nov 2023 08:47:05 -0700 Subject: [PATCH 3/7] address some of the pr comments --- ui/app/components/splash-page.hbs | 33 ++++++++++---------- ui/app/templates/vault/cluster/auth.hbs | 4 +-- ui/app/templates/vault/cluster/init.hbs | 8 ++--- ui/app/templates/vault/cluster/mfa-setup.hbs | 8 ++--- ui/app/templates/vault/cluster/unseal.hbs | 12 +++---- 5 files changed, 33 insertions(+), 32 deletions(-) diff --git a/ui/app/components/splash-page.hbs b/ui/app/components/splash-page.hbs index 8a080c0b369c..4b225c3bb658 100644 --- a/ui/app/components/splash-page.hbs +++ b/ui/app/components/splash-page.hbs @@ -2,22 +2,23 @@ Copyright (c) HashiCorp, Inc. SPDX-License-Identifier: BUSL-1.1 ~}} - -{{yield to="altContent"}} - -
-
-
-
- {{yield to="pageHeader"}} +{{#if (has-block "altContent")}} + {{yield to="altContent"}} +{{else}} +
+
+
+
+ {{yield to="header"}} +
+
+ {{yield to="subHeader"}} +
+ + {{yield to="footer"}}
-
- {{yield to="pageSubHeader"}} -
- - {{yield to="pageFooter"}}
-
\ No newline at end of file +{{/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 278cfb57fc24..9bcbfee657bf 100644 --- a/ui/app/templates/vault/cluster/auth.hbs +++ b/ui/app/templates/vault/cluster/auth.hbs @@ -21,7 +21,7 @@ {{/if}} - <:pageHeader> + <:header> {{#if this.oidcProvider}}
@@ -55,7 +55,7 @@
{{/if}} - + <:pageSubHeader> {{#if (has-feature "Namespaces")}} diff --git a/ui/app/templates/vault/cluster/init.hbs b/ui/app/templates/vault/cluster/init.hbs index 3c6818a00719..172f8c0668de 100644 --- a/ui/app/templates/vault/cluster/init.hbs +++ b/ui/app/templates/vault/cluster/init.hbs @@ -4,7 +4,7 @@ ~}} - <:pageHeader> + <:header> {{#if (and this.model.usingRaft (not this.prefersInit))}}

Raft Storage @@ -26,8 +26,8 @@ Let's set up the initial set of root keys that you will need in case of an emergency.

{{/if}} - - <:pageContent> + + <:content> {{#if (and this.model.usingRaft (not this.prefersInit))}} {{else if this.keyData}} @@ -214,5 +214,5 @@
{{/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 7a8d0fab3f13..3c203179fe37 100644 --- a/ui/app/templates/vault/cluster/mfa-setup.hbs +++ b/ui/app/templates/vault/cluster/mfa-setup.hbs @@ -4,10 +4,10 @@ ~}} - <:pageHeader> + <:header>

MFA setup

- - <:pageContent> + + <: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 e95f3969727b..ebaca1beae08 100644 --- a/ui/app/templates/vault/cluster/unseal.hbs +++ b/ui/app/templates/vault/cluster/unseal.hbs @@ -24,13 +24,13 @@
{{else}} - <:pageHeader> + <:header>

Unseal Vault

- + - <:pageContent> + <:content>

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

- + - <:pageFooter> + <:footer>

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

- +
{{/if}} \ No newline at end of file From 7889bd980d4acc4054475f7833e69127e8cd7380 Mon Sep 17 00:00:00 2001 From: Angel Garbarino Date: Sat, 18 Nov 2023 09:36:16 -0700 Subject: [PATCH 4/7] add test coverage --- ui/app/components/splash-page.hbs | 6 +- .../components/splash-page-test.js | 57 +++++++++++++++++++ 2 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 ui/tests/integration/components/splash-page-test.js diff --git a/ui/app/components/splash-page.hbs b/ui/app/components/splash-page.hbs index 4b225c3bb658..72aa78ceea1d 100644 --- a/ui/app/components/splash-page.hbs +++ b/ui/app/components/splash-page.hbs @@ -8,13 +8,13 @@
-
+
{{yield to="header"}}
-
+
{{yield to="subHeader"}}
-