From c8597486aa2d2bc4e8fda5e1a359fbd9702b3f04 Mon Sep 17 00:00:00 2001 From: hashishaw Date: Tue, 25 May 2021 16:13:19 -0500 Subject: [PATCH 1/6] Styling for empty-state and splash-page --- ui/app/styles/components/empty-state.scss | 10 ++++++++++ ui/app/styles/components/splash-page.scss | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ui/app/styles/components/empty-state.scss b/ui/app/styles/components/empty-state.scss index 9f685794bdad..7a90a73ea205 100644 --- a/ui/app/styles/components/empty-state.scss +++ b/ui/app/styles/components/empty-state.scss @@ -8,6 +8,16 @@ box-shadow: 0 -2px 0 -1px $ui-gray-300; } +.empty-state-transparent { + align-items: center; + color: $grey; + background: transparent; + display: flex; + justify-content: center; + padding: $spacing-xxl 0; + box-shadow: none; +} + .empty-state-content { max-width: 320px; } diff --git a/ui/app/styles/components/splash-page.scss b/ui/app/styles/components/splash-page.scss index 2b6c887bade5..637bfd5fa4bb 100644 --- a/ui/app/styles/components/splash-page.scss +++ b/ui/app/styles/components/splash-page.scss @@ -21,5 +21,5 @@ } .splash-page-header { - padding: $size-6 $size-5; + padding: $size-6 0; } From b27a9fe11fe70320d28221ecf080643c1dba347c Mon Sep 17 00:00:00 2001 From: hashishaw Date: Wed, 26 May 2021 11:36:02 -0500 Subject: [PATCH 2/6] Update shamir-flow language and trigger onError on non-400 error --- ui/lib/core/addon/components/shamir-flow.js | 6 ++++++ ui/lib/core/addon/templates/components/shamir-flow.hbs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/lib/core/addon/components/shamir-flow.js b/ui/lib/core/addon/components/shamir-flow.js index 7f109f06ede5..24d6f89dc222 100644 --- a/ui/lib/core/addon/components/shamir-flow.js +++ b/ui/lib/core/addon/components/shamir-flow.js @@ -42,6 +42,7 @@ export default Component.extend(DEFAULTS, { }, onUpdate() {}, + onError() {}, onShamirSuccess() {}, // can be overridden w/an attr isComplete(data) { @@ -88,6 +89,10 @@ export default Component.extend(DEFAULTS, { if (e.httpStatus === 400) { this.set('errors', e.errors); } else { + // if licensing error, trigger parent method to handle + if (e.httpStatus === 500 && e.errors?.join(' ').includes('licensing is in an invalid state')) { + this.onError(); + } throw e; } }, @@ -152,6 +157,7 @@ export default Component.extend(DEFAULTS, { }, onSubmit(data) { + console.log('on submit', data); if (!data.key) { return; } diff --git a/ui/lib/core/addon/templates/components/shamir-flow.hbs b/ui/lib/core/addon/templates/components/shamir-flow.hbs index ace02e1d89a0..6b5bfa6b1dcc 100644 --- a/ui/lib/core/addon/templates/components/shamir-flow.hbs +++ b/ui/lib/core/addon/templates/components/shamir-flow.hbs @@ -148,7 +148,7 @@
{{input class="input"type="password" name="key" value=key data-test-shamir-input=true}} From 0b3b4b0a28e6b8c1377c540f3d2e99a164145238 Mon Sep 17 00:00:00 2001 From: hashishaw Date: Wed, 26 May 2021 11:37:30 -0500 Subject: [PATCH 3/6] Add license terminated screen to unseal --- ui/app/controllers/vault/cluster/unseal.js | 5 ++ ui/app/templates/vault/cluster/unseal.hbs | 86 +++++++++++++++------- 2 files changed, 65 insertions(+), 26 deletions(-) diff --git a/ui/app/controllers/vault/cluster/unseal.js b/ui/app/controllers/vault/cluster/unseal.js index 7f975cd9011b..3965f9bd9e1c 100644 --- a/ui/app/controllers/vault/cluster/unseal.js +++ b/ui/app/controllers/vault/cluster/unseal.js @@ -3,6 +3,7 @@ import Controller from '@ember/controller'; export default Controller.extend({ wizard: service(), + showLicenseError: false, actions: { transitionToCluster(resp) { @@ -19,5 +20,9 @@ export default Controller.extend({ isUnsealed(data) { return data.sealed === false; }, + + handleUnsealError() { + this.set('showLicenseError', true); + }, }, }); diff --git a/ui/app/templates/vault/cluster/unseal.hbs b/ui/app/templates/vault/cluster/unseal.hbs index 86be949bf65b..1cce33aa36af 100644 --- a/ui/app/templates/vault/cluster/unseal.hbs +++ b/ui/app/templates/vault/cluster/unseal.hbs @@ -1,26 +1,60 @@ - - -

- Unseal Vault -

-
- - - - -
+{{#if showLicenseError}} + + + + + + + + + + +
+ +
+{{else}} + + +

+ Unseal Vault +

+
+ +
+

{{capitalize model.name}} is {{if model.unsealed 'unsealed' 'sealed'}}

+

+ Unseal Vault by entering portions of the unseal key. This can be done via multiple mechanisms on multiple computers. Once all portions are entered, the root key will be decrypted and Vault will unseal. +

+
+ +
+ + + +
+{{/if}} From c7516c3fdba3594dd539ab264c7aaf77aee30652 Mon Sep 17 00:00:00 2001 From: hashishaw Date: Wed, 26 May 2021 11:39:14 -0500 Subject: [PATCH 4/6] Clean up language --- ui/app/controllers/vault/cluster/unseal.js | 2 +- ui/app/templates/vault/cluster/unseal.hbs | 2 +- ui/lib/core/addon/components/empty-state.js | 2 +- ui/lib/core/addon/components/shamir-flow.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/app/controllers/vault/cluster/unseal.js b/ui/app/controllers/vault/cluster/unseal.js index 3965f9bd9e1c..8d1e76adbdc0 100644 --- a/ui/app/controllers/vault/cluster/unseal.js +++ b/ui/app/controllers/vault/cluster/unseal.js @@ -21,7 +21,7 @@ export default Controller.extend({ return data.sealed === false; }, - handleUnsealError() { + handleLicenseError() { this.set('showLicenseError', true); }, }, diff --git a/ui/app/templates/vault/cluster/unseal.hbs b/ui/app/templates/vault/cluster/unseal.hbs index 1cce33aa36af..d135f55443b1 100644 --- a/ui/app/templates/vault/cluster/unseal.hbs +++ b/ui/app/templates/vault/cluster/unseal.hbs @@ -42,7 +42,7 @@ Date: Wed, 26 May 2021 13:04:28 -0500 Subject: [PATCH 5/6] Remove log --- ui/lib/core/addon/components/shamir-flow.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/lib/core/addon/components/shamir-flow.js b/ui/lib/core/addon/components/shamir-flow.js index be1f0f67db9e..b0426feb843c 100644 --- a/ui/lib/core/addon/components/shamir-flow.js +++ b/ui/lib/core/addon/components/shamir-flow.js @@ -157,7 +157,6 @@ export default Component.extend(DEFAULTS, { }, onSubmit(data) { - console.log('on submit', data); if (!data.key) { return; } From 45e73d9bff8885ccc83bd748f17d4414e64eaa1a Mon Sep 17 00:00:00 2001 From: hashishaw Date: Wed, 26 May 2021 13:41:37 -0500 Subject: [PATCH 6/6] Add changelog --- changelog/11705.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/11705.txt diff --git a/changelog/11705.txt b/changelog/11705.txt new file mode 100644 index 000000000000..42d683d81f57 --- /dev/null +++ b/changelog/11705.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: Add specific error message if unseal fails due to license +```