From 865d10e3d36303cf1aab9c701ca1d7b383e55e9b Mon Sep 17 00:00:00 2001 From: Joshua Ogle Date: Fri, 2 Nov 2018 14:17:02 -0600 Subject: [PATCH 01/15] Add Empty State component --- ui/app/components/empty-state.js | 5 + ui/app/styles/components/empty-state.scss | 37 +++++++ ui/app/styles/core.scss | 1 + ui/app/styles/utils/_colors.scss | 2 +- ui/app/templates/components/empty-state.hbs | 15 +++ .../components/identity/entity-nav.hbs | 14 +-- .../identity/item-alias/alias-metadata.hbs | 21 ++-- .../cluster/access/identity/aliases/index.hbs | 37 ++++--- .../vault/cluster/access/identity/index.hbs | 35 ++++--- .../vault/cluster/access/leases/list.hbs | 32 +++--- .../vault/cluster/policies/index.hbs | 95 +++++++++--------- .../vault/cluster/replication/index.hbs | 8 +- .../replication/mode/secondaries/index.hbs | 23 ++--- .../vault/cluster/secrets/backend/list.hbs | 98 ++++++++++--------- .../templates/vault/cluster/settings/seal.hbs | 12 +-- .../components/empty-state-test.js | 26 +++++ 16 files changed, 266 insertions(+), 195 deletions(-) create mode 100644 ui/app/components/empty-state.js create mode 100644 ui/app/styles/components/empty-state.scss create mode 100644 ui/app/templates/components/empty-state.hbs create mode 100644 ui/tests/integration/components/empty-state-test.js diff --git a/ui/app/components/empty-state.js b/ui/app/components/empty-state.js new file mode 100644 index 0000000000..6009f58771 --- /dev/null +++ b/ui/app/components/empty-state.js @@ -0,0 +1,5 @@ +import Component from '@ember/component'; + +export default Component.extend({ + classNames: ['empty-state box is-sideless is-marginless is-fullwidth is-bottomless'] +}); diff --git a/ui/app/styles/components/empty-state.scss b/ui/app/styles/components/empty-state.scss new file mode 100644 index 0000000000..403a7af19f --- /dev/null +++ b/ui/app/styles/components/empty-state.scss @@ -0,0 +1,37 @@ +.empty-state { + align-items: center; + color: $grey; + display: flex; + background: $ui-gray-050; + justify-content: center; + padding: $spacing-xxl $spacing-s; +} + +.empty-state-content { + max-width: 320px; +} + +.empty-state-title { + color: $grey; + font-size: $size-4; + font-weight: $font-weight-semibold; + line-height: 1.2; + margin-bottom: $spacing-xs; +} + +.empty-state-actions { + margin-top: $spacing-xs; + + a, + .link, + a:not(.button):not(.file-delete-button):not(.tag) { + color: $blue; + font-size: $size-8; + font-weight: $font-weight-semibold; + text-decoration: none; + } + + > * + * { + margin-left: $spacing-s; + } +} diff --git a/ui/app/styles/core.scss b/ui/app/styles/core.scss index 3c395c50dc..846710bcdd 100644 --- a/ui/app/styles/core.scss +++ b/ui/app/styles/core.scss @@ -49,6 +49,7 @@ @import "./components/console-ui-panel"; @import "./components/control-group"; @import "./components/doc-link"; +@import "./components/empty-state"; @import "./components/env-banner"; @import "./components/features-selection"; @import "./components/form-section"; diff --git a/ui/app/styles/utils/_colors.scss b/ui/app/styles/utils/_colors.scss index fb70aca502..a3abb00b2c 100644 --- a/ui/app/styles/utils/_colors.scss +++ b/ui/app/styles/utils/_colors.scss @@ -21,7 +21,7 @@ $ui-gray-050: #F7F8FA; $ui-gray-100: #EBEEF2; $ui-gray-200: #DCE0E6; $ui-gray-300: #BAC1CC; -$ui-gray-500: #6a7786; +$ui-gray-500: #6F7682; $ui-gray-700: #525761; $ui-gray-800: #373A42; $ui-gray-900: #1F2124; diff --git a/ui/app/templates/components/empty-state.hbs b/ui/app/templates/components/empty-state.hbs new file mode 100644 index 0000000000..9bb7a672c3 --- /dev/null +++ b/ui/app/templates/components/empty-state.hbs @@ -0,0 +1,15 @@ +
+

+ {{{title}}} +

+ {{#if message}} +

+ {{{message}}} +

+ {{/if}} + {{#if hasBlock}} +
+ {{yield}} +
+ {{/if}} +
diff --git a/ui/app/templates/components/identity/entity-nav.hbs b/ui/app/templates/components/identity/entity-nav.hbs index adf0ab5a14..513c61227a 100644 --- a/ui/app/templates/components/identity/entity-nav.hbs +++ b/ui/app/templates/components/identity/entity-nav.hbs @@ -12,7 +12,7 @@ {{/link-to}} {{/if}} {{#link-to "vault.cluster.access.identity.create" (pluralize identityType) class="button has-icon-right is-ghost is-compact" data-test-entity-create-link=true}} - Create {{identityType}} + Add {{identityType}} {{i-con glyph="chevron-right" size=11}} {{/link-to}} @@ -33,10 +33,12 @@ -
-
-
- {{identity/lookup-input type=identityType}} +{{#if model.meta.total}} +
+
+
+ {{identity/lookup-input type=identityType}} +
-
+{{/if}} diff --git a/ui/app/templates/components/identity/item-alias/alias-metadata.hbs b/ui/app/templates/components/identity/item-alias/alias-metadata.hbs index b1c9ca9a5d..bd5034a40c 100644 --- a/ui/app/templates/components/identity/item-alias/alias-metadata.hbs +++ b/ui/app/templates/components/identity/item-alias/alias-metadata.hbs @@ -17,15 +17,14 @@
{{else}} -
-
-
-
-

- There is no metadata associated with {{model.name}}. -

-
-
-
-
+ + {{#link-to "vault.cluster.access.identity.aliases.edit" model.id tagName="button" class="link"}} + Edit {{lowercase (humanize model.identityType)}} + {{/link-to}} + + Learn More + + {{/each-in}} diff --git a/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs b/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs index f80b5276c9..5409f42dfe 100644 --- a/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs @@ -1,4 +1,4 @@ -{{identity/entity-nav identityType=identityType}} +{{identity/entity-nav identityType=identityType model=model}} {{#if model.meta.total}} {{#each model as |item|}} {{#linked-block @@ -35,23 +35,22 @@ {{/linked-block}} {{/each}} + {{#if (gt model.meta.lastPage 1) }} + {{list-pagination + page=model.meta.currentPage + lastPage=model.meta.lastPage + link="vault.cluster.access.identity.aliases.index" + }} + {{/if}} {{else}} -
-
-
-
-

- There are currently no {{identityType}} aliases. -

-
-
-
-
-{{/if}} -{{#if (gt model.meta.lastPage 1) }} - {{list-pagination - page=model.meta.currentPage - lastPage=model.meta.lastPage - link="vault.cluster.access.identity.aliases.index" - }} + + {{#link-to "vault.cluster.access.identity.create" (pluralize identityType) tagName="button" class="link"}} + Add {{identityType}} + {{/link-to}} + + Learn More + + {{/if}} diff --git a/ui/app/templates/vault/cluster/access/identity/index.hbs b/ui/app/templates/vault/cluster/access/identity/index.hbs index 2e85b5f19b..c9c0739b0b 100644 --- a/ui/app/templates/vault/cluster/access/identity/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/index.hbs @@ -106,23 +106,22 @@ {{/linked-block}} {{/each}} + {{#if (gt model.meta.lastPage 1) }} + {{list-pagination + page=model.meta.currentPage + lastPage=model.meta.lastPage + link="vault.cluster.access.identity.index" + }} + {{/if}} {{else}} -
-
-
-
-

- There are currently no {{pluralize identityType}}. -

-
-
-
-
-{{/if}} -{{#if (gt model.meta.lastPage 1) }} - {{list-pagination - page=model.meta.currentPage - lastPage=model.meta.lastPage - link="vault.cluster.access.identity.index" - }} + + {{#link-to "vault.cluster.access.identity.create" (pluralize identityType) tagName="button" class="link"}} + Add {{identityType}} + {{/link-to}} + + Learn More + + {{/if}} diff --git a/ui/app/templates/vault/cluster/access/leases/list.hbs b/ui/app/templates/vault/cluster/access/leases/list.hbs index c8db1805b5..501fcba378 100644 --- a/ui/app/templates/vault/cluster/access/leases/list.hbs +++ b/ui/app/templates/vault/cluster/access/leases/list.hbs @@ -115,25 +115,19 @@ {{/each}} {{else}} -
-
-
-
-

- {{#if (eq baseKey.id '')}} - There are currently no leases. - {{else}} - {{#if filterIsFolder}} - {{#if (eq filter baseKey.id)}} - There are no leases under {{filter}}. - {{else}} - We couldn't find a prefix matching {{filter}}. - {{/if}} - {{/if}} - {{/if}} -

-
-
+
+
+ {{#if (eq baseKey.id '')}} + There are currently no leases. + {{else}} + {{#if filterIsFolder}} + {{#if (eq filter baseKey.id)}} + There are no leases under {{filter}}. + {{else}} + We couldn't find a prefix matching {{filter}}. + {{/if}} + {{/if}} + {{/if}}
{{/if}} diff --git a/ui/app/templates/vault/cluster/policies/index.hbs b/ui/app/templates/vault/cluster/policies/index.hbs index 76293ed28b..eb4322a5b6 100644 --- a/ui/app/templates/vault/cluster/policies/index.hbs +++ b/ui/app/templates/vault/cluster/policies/index.hbs @@ -12,40 +12,40 @@ {{#link-to "vault.cluster.policies.create" class="button has-icon-right is-ghost is-compact" data-test-policy-create-link=true}} - Create {{uppercase policyType}} policy + Add {{uppercase policyType}} policy {{i-con glyph="chevron-right" size=11}} {{/link-to}} -
-
-
- {{navigate-input - filterFocusDidChange=(action "setFilterFocus") - filterDidChange=(action "setFilter") - filter=filter - filterMatchesKey=filterMatchesKey - firstPartialMatch=firstPartialMatch - extraNavParams=policyType - placeholder="Filter policies" - mode="policy" - }} - {{#if filterFocused}} - {{#if filterMatchesKey}} -

- ENTER to go to {{or pageFilter filter}} -

+ {{#if model.meta.total}} +
+
+
+ {{navigate-input + filterFocusDidChange=(action "setFilterFocus") + filterDidChange=(action "setFilter") + filter=filter + filterMatchesKey=filterMatchesKey + firstPartialMatch=firstPartialMatch + extraNavParams=policyType + placeholder="Filter policies" + mode="policy" + }} + {{#if filterFocused}} + {{#if filterMatchesKey}} +

+ ENTER to go to {{or pageFilter filter}} +

+ {{/if}} + {{#if firstPartialMatch}} +

+ TAB to complete {{firstPartialMatch.id}} +

+ {{/if}} {{/if}} - {{#if firstPartialMatch}} -

- TAB to complete {{firstPartialMatch.id}} -

- {{/if}} - {{/if}} +
-
- {{#if model.meta.total}} {{#each model as |item|}} {{#if (eq item.id "root")}}
@@ -139,30 +139,29 @@
{{/linked-block}} {{/if}} + {{#if (gt model.meta.lastPage 1) }} + {{list-pagination + page=model.meta.currentPage + lastPage=model.meta.lastPage + link="vault.cluster.policies.index" + }} + {{/if}} {{else}} -
-

There are no policies matching {{pageFilter}}.

-
+ {{/each}} {{else}} -
-
-
-
-

- There are currently no {{uppercase policyType}} policies. -

-
-
-
-
- {{/if}} - {{#if (gt model.meta.lastPage 1) }} - {{list-pagination - page=model.meta.currentPage - lastPage=model.meta.lastPage - link="vault.cluster.policies.index" - }} + + {{#link-to "vault.cluster.policies.create" tagName="button" class="link"}} + Add {{uppercase policyType}} policy + {{/link-to}} + + Learn More + + {{/if}} {{else}} {{upgrade-page title="Sentinel" minimumEdition="Vault Enterprise Premium"}} diff --git a/ui/app/templates/vault/cluster/replication/index.hbs b/ui/app/templates/vault/cluster/replication/index.hbs index ab10db1e9a..d6ca74b7af 100644 --- a/ui/app/templates/vault/cluster/replication/index.hbs +++ b/ui/app/templates/vault/cluster/replication/index.hbs @@ -6,11 +6,9 @@ -
-

- The current cluster configuration does not support replication. -

-
+ {{else}} {{replication-summary cluster=model diff --git a/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs b/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs index b0563ad7fe..561b5fab0d 100644 --- a/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs +++ b/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs @@ -46,17 +46,18 @@
{{/each}} {{else}} -
-
-
-
-

- There are currently no known {{performanceMode}} secondary clusters associated with this cluster. -

-
-
-
-
+ + {{#if model.canAddSecondary}} + {{#link-to 'vault.cluster.replication.mode.secondaries.add' model.name replicationMode tagName="button" class="link" }} + Add secondary + {{/link-to}} + {{/if}} + + Learn More + + {{/if}}
{{#if model.canAddSecondary}} diff --git a/ui/app/templates/vault/cluster/secrets/backend/list.hbs b/ui/app/templates/vault/cluster/secrets/backend/list.hbs index c6a132620a..35b6c3bb23 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/list.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/list.hbs @@ -1,39 +1,39 @@ {{secret-list-header isCertTab=(eq tab "certs") model=backendModel baseKey=baseKey backendCrumb=backendCrumb filter=filter}} {{#with (options-for-backend backendType tab) as |options|}} -
-
-
- {{navigate-input - enterpriseProduct="vault" - filterFocusDidChange=(action "setFilterFocus") - filterDidChange=(action "setFilter") - filter=filter - filterMatchesKey=filterMatchesKey - firstPartialMatch=firstPartialMatch - baseKey=(get baseKey "id") - shouldNavigateTree=options.navigateTree - placeholder=options.searchPlaceholder - mode=(if (eq tab 'certs') 'secrets-cert' 'secrets') - }} - {{#if filterFocused}} - {{#if filterMatchesKey}} - {{#unless filterIsFolder}} + {{#if model.meta.total}} +
+
+
+ {{navigate-input + enterpriseProduct="vault" + filterFocusDidChange=(action "setFilterFocus") + filterDidChange=(action "setFilter") + filter=filter + filterMatchesKey=filterMatchesKey + firstPartialMatch=firstPartialMatch + baseKey=(get baseKey "id") + shouldNavigateTree=options.navigateTree + placeholder=options.searchPlaceholder + mode=(if (eq tab 'certs') 'secrets-cert' 'secrets') + }} + {{#if filterFocused}} + {{#if filterMatchesKey}} + {{#unless filterIsFolder}} +

+ Enter to view {{filter}} +

+ {{/unless}} + {{/if}} + {{#if firstPartialMatch}}

- Enter to view {{filter}} + Tab to autocomplete

- {{/unless}} + {{/if}} {{/if}} - {{#if firstPartialMatch}} -

- Tab to autocomplete -

- {{/if}} - {{/if}} +
-
- {{#if model.meta.total}} {{#each model as |item|}} {{partial options.listItemPartial}} {{else}} @@ -45,27 +45,29 @@ {{/if}}
{{/each}} + {{#if (gt model.meta.lastPage 1) }} + {{list-pagination + page=model.meta.currentPage + lastPage=model.meta.lastPage + link=(concat "vault.cluster.secrets.backend.list" (if (not baseKey.id) "-root")) + model=(compact (array backend (if baseKey.id baseKey.id))) + }} + {{/if}} {{else}} - - {{#if (eq baseKey.id '')}} - There are currently no {{pluralize options.item}} in this backend. - {{else}} - {{#if filterIsFolder}} - {{#if (eq filter baseKey.id)}} - There are no {{pluralize options.item}} under {{or filter}}. - {{else}} - We couldn't find a folder matching {{filter}}. - {{/if}} +
+
+ {{#if (eq baseKey.id '')}} + There are currently no {{pluralize options.item}} in this backend. + {{else}} + {{#if filterIsFolder}} + {{#if (eq filter baseKey.id)}} + There are no {{pluralize options.item}} under {{or filter}}. + {{else}} + We couldn't find a folder matching {{filter}}. + {{/if}} + {{/if}} {{/if}} - {{/if}} - +
+
{{/if}} {{/with}} -{{#if (gt model.meta.lastPage 1) }} - {{list-pagination - page=model.meta.currentPage - lastPage=model.meta.lastPage - link=(concat "vault.cluster.secrets.backend.list" (if (not baseKey.id) "-root")) - model=(compact (array backend (if baseKey.id baseKey.id))) - }} -{{/if}} diff --git a/ui/app/templates/vault/cluster/settings/seal.hbs b/ui/app/templates/vault/cluster/settings/seal.hbs index 6a3ab0b316..e78a0385fd 100644 --- a/ui/app/templates/vault/cluster/settings/seal.hbs +++ b/ui/app/templates/vault/cluster/settings/seal.hbs @@ -29,13 +29,7 @@ {{/confirm-action}}
{{else}} -
-
-
-
-

The token you are currently authenticated with does not have sufficient capabilities to seal this vault.

-
-
-
-
+ {{/if}} diff --git a/ui/tests/integration/components/empty-state-test.js b/ui/tests/integration/components/empty-state-test.js new file mode 100644 index 0000000000..41036f1f11 --- /dev/null +++ b/ui/tests/integration/components/empty-state-test.js @@ -0,0 +1,26 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'ember-qunit'; +import { render } from '@ember/test-helpers'; +import hbs from 'htmlbars-inline-precompile'; + +module('Integration | Component | empty-state', function(hooks) { + setupRenderingTest(hooks); + + test('it renders', async function(assert) { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.set('myAction', function(val) { ... }); + + await render(hbs`{{empty-state}}`); + + assert.equal(this.element.textContent.trim(), ''); + + // Template block usage: + await render(hbs` + {{#empty-state}} + template block text + {{/empty-state}} + `); + + assert.equal(this.element.textContent.trim(), 'template block text'); + }); +}); From f6924209c35743de3a21c42561e78e7375dcbfa2 Mon Sep 17 00:00:00 2001 From: Joshua Ogle Date: Sat, 3 Nov 2018 10:26:48 -0600 Subject: [PATCH 02/15] Remove old BlockEmpty component --- ui/app/components/block-empty.js | 2 -- ui/app/templates/components/block-empty.hbs | 11 ----------- ui/app/templates/partials/secret-form-show.hbs | 12 ++++++------ 3 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 ui/app/components/block-empty.js delete mode 100644 ui/app/templates/components/block-empty.hbs diff --git a/ui/app/components/block-empty.js b/ui/app/components/block-empty.js deleted file mode 100644 index 96167992d7..0000000000 --- a/ui/app/components/block-empty.js +++ /dev/null @@ -1,2 +0,0 @@ -import OuterHTML from './outer-html'; -export default OuterHTML.extend(); diff --git a/ui/app/templates/components/block-empty.hbs b/ui/app/templates/components/block-empty.hbs deleted file mode 100644 index d0f7e402f7..0000000000 --- a/ui/app/templates/components/block-empty.hbs +++ /dev/null @@ -1,11 +0,0 @@ -
-
-
-
-

- {{yield}} -

-
-
-
-
\ No newline at end of file diff --git a/ui/app/templates/partials/secret-form-show.hbs b/ui/app/templates/partials/secret-form-show.hbs index 1be2406e56..ddab011136 100644 --- a/ui/app/templates/partials/secret-form-show.hbs +++ b/ui/app/templates/partials/secret-form-show.hbs @@ -1,11 +1,11 @@ {{#if (and isV2 modelForData.destroyed)}} - - Version {{modelForData.version}} of this secret has been permanently destroyed. - + {{else if (and isV2 modelForData.deleted)}} - - Version {{modelForData.version}} of this secret has been deleted. - + {{else}} {{#if showAdvancedMode}} {{json-editor From ab00bc8d96bb6ea4829817e699af5c69173a3d4e Mon Sep 17 00:00:00 2001 From: Joshua Ogle Date: Sat, 3 Nov 2018 10:33:32 -0600 Subject: [PATCH 03/15] Replaced more old empty states --- .../templates/components/identity/item-aliases.hbs | 14 +++----------- .../templates/components/identity/item-groups.hbs | 14 +++----------- .../templates/components/identity/item-members.hbs | 14 +++----------- .../components/identity/item-metadata.hbs | 14 +++----------- .../components/identity/item-parent-groups.hbs | 14 +++----------- .../components/identity/item-policies.hbs | 14 +++----------- ui/app/templates/components/list-view.hbs | 14 +++----------- .../replication/mode/secondaries/config-show.hbs | 14 +++----------- 8 files changed, 24 insertions(+), 88 deletions(-) diff --git a/ui/app/templates/components/identity/item-aliases.hbs b/ui/app/templates/components/identity/item-aliases.hbs index 8b39959309..133025be5c 100644 --- a/ui/app/templates/components/identity/item-aliases.hbs +++ b/ui/app/templates/components/identity/item-aliases.hbs @@ -28,15 +28,7 @@
{{/linked-block}} {{else}} -
-
-
-
-

- There are no {{model.identityType}} aliases for {{model.name}}. -

-
-
-
-
+ {{/each}} diff --git a/ui/app/templates/components/identity/item-groups.hbs b/ui/app/templates/components/identity/item-groups.hbs index 1366797fec..eb44ed08c0 100644 --- a/ui/app/templates/components/identity/item-groups.hbs +++ b/ui/app/templates/components/identity/item-groups.hbs @@ -25,15 +25,7 @@ {{/linked-block}} {{/each}} {{else}} -
-
-
-
-

- {{model.name}} is not a member of any groups. -

-
-
-
-
+ {{/if}} diff --git a/ui/app/templates/components/identity/item-members.hbs b/ui/app/templates/components/identity/item-members.hbs index 4f20517fee..4b5485a727 100644 --- a/ui/app/templates/components/identity/item-members.hbs +++ b/ui/app/templates/components/identity/item-members.hbs @@ -52,15 +52,7 @@ {{/linked-block}} {{/each}} {{else}} -
-
-
-
-

- There are no members in this group. -

-
-
-
-
+ {{/if}} diff --git a/ui/app/templates/components/identity/item-metadata.hbs b/ui/app/templates/components/identity/item-metadata.hbs index caabe9614d..758a5c3607 100644 --- a/ui/app/templates/components/identity/item-metadata.hbs +++ b/ui/app/templates/components/identity/item-metadata.hbs @@ -14,15 +14,7 @@
{{else}} -
-
-
-
-

- There is no metadata associated with {{model.name}}. -

-
-
-
-
+ {{/each-in}} diff --git a/ui/app/templates/components/identity/item-parent-groups.hbs b/ui/app/templates/components/identity/item-parent-groups.hbs index 868dd3298e..a7ceeaf0ab 100644 --- a/ui/app/templates/components/identity/item-parent-groups.hbs +++ b/ui/app/templates/components/identity/item-parent-groups.hbs @@ -23,15 +23,7 @@ {{/linked-block}} {{/each}} {{else}} -
-
-
-
-

- This group has no parent groups. -

-
-
-
-
+ {{/if}} diff --git a/ui/app/templates/components/identity/item-policies.hbs b/ui/app/templates/components/identity/item-policies.hbs index e3eaf9a2eb..0896f0e868 100644 --- a/ui/app/templates/components/identity/item-policies.hbs +++ b/ui/app/templates/components/identity/item-policies.hbs @@ -20,15 +20,7 @@
{{/linked-block}} {{else}} -
-
-
-
-

- There are no policies associated with {{model.name}}. -

-
-
-
-
+ {{/each}} diff --git a/ui/app/templates/components/list-view.hbs b/ui/app/templates/components/list-view.hbs index 54815bcdcd..4d35a8a805 100644 --- a/ui/app/templates/components/list-view.hbs +++ b/ui/app/templates/components/list-view.hbs @@ -5,15 +5,7 @@ {{/each}}
{{else}} -
-
-
-
-

- {{emptyMessage}} -

-
-
-
-
+ {{/if}} diff --git a/ui/app/templates/vault/cluster/replication/mode/secondaries/config-show.hbs b/ui/app/templates/vault/cluster/replication/mode/secondaries/config-show.hbs index 565e5573cb..2697424fe0 100644 --- a/ui/app/templates/vault/cluster/replication/mode/secondaries/config-show.hbs +++ b/ui/app/templates/vault/cluster/replication/mode/secondaries/config-show.hbs @@ -17,17 +17,9 @@ {{/info-table-row}} {{else}} -
-
-
-
-

- The secondary {{model.config.id}} does not currently have performance mount filtering configured. -

-
-
-
-
+ {{/if}}
{{#if model.config.mode}} From 4767923a8f19ff9e263416d33a23419d2910869f Mon Sep 17 00:00:00 2001 From: Joshua Ogle Date: Sat, 3 Nov 2018 11:21:49 -0600 Subject: [PATCH 04/15] Better empty state copy --- ui/app/components/empty-state.js | 3 +- ui/app/components/list-view.js | 8 ++- ui/app/helpers/options-for-backend.js | 12 ++--- ui/app/templates/components/empty-state.hbs | 4 +- .../identity/item-alias/alias-metadata.hbs | 2 +- .../components/identity/item-aliases.hbs | 2 +- ui/app/templates/components/list-view.hbs | 3 +- .../templates/partials/secret-form-show.hbs | 17 +++++-- .../vault/cluster/access/identity/index.hbs | 2 +- .../vault/cluster/access/leases/error.hbs | 50 +++++++++---------- .../vault/cluster/access/namespaces/index.hbs | 2 +- .../mode/secondaries/config-show.hbs | 2 +- .../replication/mode/secondaries/index.hbs | 2 +- .../vault/cluster/secrets/backend/list.hbs | 26 ++++++++-- .../templates/vault/cluster/settings/seal.hbs | 2 +- .../components/empty-state-test.js | 25 ++++++++-- 16 files changed, 105 insertions(+), 57 deletions(-) diff --git a/ui/app/components/empty-state.js b/ui/app/components/empty-state.js index 6009f58771..d05a94b9ed 100644 --- a/ui/app/components/empty-state.js +++ b/ui/app/components/empty-state.js @@ -1,5 +1,6 @@ import Component from '@ember/component'; export default Component.extend({ - classNames: ['empty-state box is-sideless is-marginless is-fullwidth is-bottomless'] + title: null, + classNames: ['empty-state box is-sideless is-marginless is-fullwidth is-bottomless'], }); diff --git a/ui/app/components/list-view.js b/ui/app/components/list-view.js index 47b6c92ea9..3c7a097f44 100644 --- a/ui/app/components/list-view.js +++ b/ui/app/components/list-view.js @@ -7,8 +7,12 @@ export default Component.extend({ items: null, itemNoun: 'item', + emptyTitle: computed('itemNoun', function() { + let items = pluralize(this.get('itemNoun')); + return `No ${items} yet`; + }), emptyMessage: computed('itemNoun', function() { let items = pluralize(this.get('itemNoun')); - return `There are currently no ${items}`; - }), + return `Your ${items} will be listed here. Add your first ${this.get('itemNoun')} to get started.`; + }) }); diff --git a/ui/app/helpers/options-for-backend.js b/ui/app/helpers/options-for-backend.js index 1a2111e1c5..7424ce337b 100644 --- a/ui/app/helpers/options-for-backend.js +++ b/ui/app/helpers/options-for-backend.js @@ -5,7 +5,7 @@ import { assign } from '@ember/polyfills'; const DEFAULT_DISPLAY = { searchPlaceholder: 'Filter secrets', item: 'secret', - create: 'Create secret', + create: 'Add secret', navigateTree: true, editComponent: 'secret-edit', listItemPartial: 'partials/secret-list/item', @@ -15,7 +15,7 @@ const SECRET_BACKENDS = { displayName: 'AWS', searchPlaceholder: 'Filter roles', item: 'role', - create: 'Create role', + create: 'Add role', navigateTree: false, editComponent: 'role-aws-edit', listItemPartial: 'partials/secret-list/aws-role-item', @@ -30,7 +30,7 @@ const SECRET_BACKENDS = { label: 'Roles', searchPlaceholder: 'Filter roles', item: 'role', - create: 'Create role', + create: 'Add role', editComponent: 'role-pki-edit', }, { @@ -39,7 +39,7 @@ const SECRET_BACKENDS = { label: 'Certificates', searchPlaceholder: 'Filter certificates', item: 'certificates', - create: 'Create role', + create: 'Add role', tab: 'certs', listItemPartial: 'partials/secret-list/pki-cert-item', editComponent: 'pki-cert-show', @@ -50,7 +50,7 @@ const SECRET_BACKENDS = { displayName: 'SSH', searchPlaceholder: 'Filter roles', item: 'role', - create: 'Create role', + create: 'Add role', navigateTree: false, editComponent: 'role-ssh-edit', listItemPartial: 'partials/secret-list/ssh-role-item', @@ -58,7 +58,7 @@ const SECRET_BACKENDS = { transit: { searchPlaceholder: 'Filter keys', item: 'key', - create: 'Create encryption key', + create: 'Add encryption key', navigateTree: false, editComponent: 'transit-edit', listItemPartial: 'partials/secret-list/item', diff --git a/ui/app/templates/components/empty-state.hbs b/ui/app/templates/components/empty-state.hbs index 9bb7a672c3..6b20e06851 100644 --- a/ui/app/templates/components/empty-state.hbs +++ b/ui/app/templates/components/empty-state.hbs @@ -1,10 +1,10 @@

- {{{title}}} + {{title}}

{{#if message}}

- {{{message}}} + {{message}}

{{/if}} {{#if hasBlock}} diff --git a/ui/app/templates/components/identity/item-alias/alias-metadata.hbs b/ui/app/templates/components/identity/item-alias/alias-metadata.hbs index bd5034a40c..f56c547a83 100644 --- a/ui/app/templates/components/identity/item-alias/alias-metadata.hbs +++ b/ui/app/templates/components/identity/item-alias/alias-metadata.hbs @@ -20,7 +20,7 @@ - {{#link-to "vault.cluster.access.identity.aliases.edit" model.id tagName="button" class="link"}} + {{#link-to "vault.cluster.access.identity.aliases.edit" model.id tagName="button" class="link"}} Edit {{lowercase (humanize model.identityType)}} {{/link-to}} diff --git a/ui/app/templates/components/identity/item-aliases.hbs b/ui/app/templates/components/identity/item-aliases.hbs index 133025be5c..405b5b6dfd 100644 --- a/ui/app/templates/components/identity/item-aliases.hbs +++ b/ui/app/templates/components/identity/item-aliases.hbs @@ -29,6 +29,6 @@ {{/linked-block}} {{else}} {{/each}} diff --git a/ui/app/templates/components/list-view.hbs b/ui/app/templates/components/list-view.hbs index 4d35a8a805..115226bb86 100644 --- a/ui/app/templates/components/list-view.hbs +++ b/ui/app/templates/components/list-view.hbs @@ -6,6 +6,7 @@
{{else}} {{/if}} diff --git a/ui/app/templates/partials/secret-form-show.hbs b/ui/app/templates/partials/secret-form-show.hbs index ddab011136..e9b29862d7 100644 --- a/ui/app/templates/partials/secret-form-show.hbs +++ b/ui/app/templates/partials/secret-form-show.hbs @@ -1,11 +1,20 @@ {{#if (and isV2 modelForData.destroyed)}} + @title="Version {{modelForData.version}} of this secret has been permanently destroyed" + @message="A version that has been permanently deleted cannot be restored. You can see other versions of this secret in the History menu."> + + Learn More + + {{else if (and isV2 modelForData.deleted)}} + @title="Version {{modelForData.version}} of this secret has been deleted" + @message="A version that has been deleted but can be undeleted using the Version {{modelForData.version}} menu above. + You can also see other versions of this secret in the History menu."> + + Learn More + + {{else}} {{#if showAdvancedMode}} {{json-editor diff --git a/ui/app/templates/vault/cluster/access/identity/index.hbs b/ui/app/templates/vault/cluster/access/identity/index.hbs index c9c0739b0b..c98a010b66 100644 --- a/ui/app/templates/vault/cluster/access/identity/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/index.hbs @@ -1,4 +1,4 @@ -{{identity/entity-nav identityType=identityType}} +{{identity/entity-nav identityType=identityType model=model}} {{#if model.meta.total}} {{#each model as |item|}} {{#linked-block diff --git a/ui/app/templates/vault/cluster/access/leases/error.hbs b/ui/app/templates/vault/cluster/access/leases/error.hbs index 05c759f900..39ec436113 100644 --- a/ui/app/templates/vault/cluster/access/leases/error.hbs +++ b/ui/app/templates/vault/cluster/access/leases/error.hbs @@ -10,32 +10,30 @@ {{model.message}} {{/unless}} -
- {{#if (eq model.httpStatus 400)}} +{{#if (eq model.httpStatus 400)}} + +{{else if (eq model.httpStatus 404)}} + + {{#link-to "vault.cluster.access.leases" tagName="button" class="link"}}Back to lookup{{/link-to}} + +{{else if (eq model.httpStatus 403)}} + + {{#link-to "vault.cluster.access.leases" tagName="button" class="link"}}Back to lookup{{/link-to}} + +{{else}} + {{#each model.errors as |error|}} - {{else if (eq model.httpStatus 404)}} -

- Unable to find lease for the id: {{model.keyId}}. Try going back to the - {{#link-to "vault.cluster.access.leases"}}lookup{{/link-to}} - and re-entering the id. -

- {{else if (eq model.httpStatus 403)}} -

- You don't have access to {{model.keyId}}. If you think you've reached this page in error, please contact your administrator. -

- {{else}} - {{#each model.errors as |error|}} -

- {{error}} -

- {{/each}} - {{/if}} -
-
- {{#link-to "vault.cluster.access.leases" class="button"}} - Back - {{/link-to}} -
+ {{/each}} +{{/if}} diff --git a/ui/app/templates/vault/cluster/access/namespaces/index.hbs b/ui/app/templates/vault/cluster/access/namespaces/index.hbs index 0a29642a91..c2ee1e0335 100644 --- a/ui/app/templates/vault/cluster/access/namespaces/index.hbs +++ b/ui/app/templates/vault/cluster/access/namespaces/index.hbs @@ -7,7 +7,7 @@ {{#link-to 'vault.cluster.access.namespaces.create' class="button has-icon-right is-ghost is-compact"}} - Create a namespace + Add namespace {{/link-to}} diff --git a/ui/app/templates/vault/cluster/replication/mode/secondaries/config-show.hbs b/ui/app/templates/vault/cluster/replication/mode/secondaries/config-show.hbs index 2697424fe0..9e65248518 100644 --- a/ui/app/templates/vault/cluster/replication/mode/secondaries/config-show.hbs +++ b/ui/app/templates/vault/cluster/replication/mode/secondaries/config-show.hbs @@ -18,7 +18,7 @@
{{else}} {{/if}}
diff --git a/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs b/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs index 561b5fab0d..fc6d133fed 100644 --- a/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs +++ b/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs @@ -48,7 +48,7 @@ {{else}} + @message="Associated secondary clusters will be listed here. Add your first secondary cluster to get started."> {{#if model.canAddSecondary}} {{#link-to 'vault.cluster.replication.mode.secondaries.add' model.name replicationMode tagName="button" class="link" }} Add secondary diff --git a/ui/app/templates/vault/cluster/secrets/backend/list.hbs b/ui/app/templates/vault/cluster/secrets/backend/list.hbs index 35b6c3bb23..39f121d389 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/list.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/list.hbs @@ -55,16 +55,34 @@ {{/if}} {{else}}
-
+
{{#if (eq baseKey.id '')}} - There are currently no {{pluralize options.item}} in this backend. +
+ No {{pluralize options.item}} in this backend yet +
+
+ Secrets in this backend will be listed here. Add a secret to get started. +
+
+ {{#secret-link + mode="create" + secret='' + queryParams=(query-params initialKey=(or filter baseKey.id)) + class="link" + data-test-secret-create=true + }} + {{options.create}} + {{/secret-link}} +
{{else}} {{#if filterIsFolder}} +
{{#if (eq filter baseKey.id)}} - There are no {{pluralize options.item}} under {{or filter}}. + No {{pluralize options.item}} under {{or filter}} {{else}} - We couldn't find a folder matching {{filter}}. + No folders matching {{filter}} {{/if}} +
{{/if}} {{/if}}
diff --git a/ui/app/templates/vault/cluster/settings/seal.hbs b/ui/app/templates/vault/cluster/settings/seal.hbs index e78a0385fd..3dd27f46ea 100644 --- a/ui/app/templates/vault/cluster/settings/seal.hbs +++ b/ui/app/templates/vault/cluster/settings/seal.hbs @@ -30,6 +30,6 @@
{{else}} {{/if}} diff --git a/ui/tests/integration/components/empty-state-test.js b/ui/tests/integration/components/empty-state-test.js index 41036f1f11..e63b6afd00 100644 --- a/ui/tests/integration/components/empty-state-test.js +++ b/ui/tests/integration/components/empty-state-test.js @@ -1,6 +1,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; -import { render } from '@ember/test-helpers'; +import { render, find } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; module('Integration | Component | empty-state', function(hooks) { @@ -16,11 +16,28 @@ module('Integration | Component | empty-state', function(hooks) { // Template block usage: await render(hbs` - {{#empty-state}} - template block text + {{#empty-state + title="Empty State Title" + message="This is the empty state message" + }} + Actions Link {{/empty-state}} `); - assert.equal(this.element.textContent.trim(), 'template block text'); + assert.equal( + find('.empty-state-title').textContent.trim(), + 'Empty State Title', + 'renders empty state title' + ); + assert.equal( + find('.empty-state-message').textContent.trim(), + 'This is the empty state message', + 'renders empty state message' + ); + assert.equal( + find('.empty-state-actions').textContent.trim(), + 'Actions Link', + 'renders empty state actions' + ); }); }); From 1bf4886cb4cb988ddd5035f494bc31a0902d3478 Mon Sep 17 00:00:00 2001 From: Joshua Ogle Date: Sat, 10 Nov 2018 12:53:26 -0700 Subject: [PATCH 05/15] Fix prettier style on List View test --- ui/app/components/list-view.js | 3 ++- ui/app/templates/vault/cluster/secrets/backend/list.hbs | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/components/list-view.js b/ui/app/components/list-view.js index 3c7a097f44..72f7b8ace2 100644 --- a/ui/app/components/list-view.js +++ b/ui/app/components/list-view.js @@ -11,8 +11,9 @@ export default Component.extend({ let items = pluralize(this.get('itemNoun')); return `No ${items} yet`; }), + emptyMessage: computed('itemNoun', function() { let items = pluralize(this.get('itemNoun')); return `Your ${items} will be listed here. Add your first ${this.get('itemNoun')} to get started.`; - }) + }), }); diff --git a/ui/app/templates/vault/cluster/secrets/backend/list.hbs b/ui/app/templates/vault/cluster/secrets/backend/list.hbs index 39f121d389..2d74c26f17 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/list.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/list.hbs @@ -69,7 +69,6 @@ secret='' queryParams=(query-params initialKey=(or filter baseKey.id)) class="link" - data-test-secret-create=true }} {{options.create}} {{/secret-link}} From c4c987ee19aad2f5b66f15db63b7de7890bfde67 Mon Sep 17 00:00:00 2001 From: Matthew Irish Date: Wed, 14 Nov 2018 14:56:03 -0600 Subject: [PATCH 06/15] add learn link component --- ui/app/components/doc-link.js | 5 +++-- ui/app/components/learn-link.js | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 ui/app/components/learn-link.js diff --git a/ui/app/components/doc-link.js b/ui/app/components/doc-link.js index 2bc9bb1633..35a9ac0b1a 100644 --- a/ui/app/components/doc-link.js +++ b/ui/app/components/doc-link.js @@ -11,9 +11,10 @@ export default Component.extend({ target: '_blank', rel: 'noreferrer noopener', + host: 'https://www.vaultproject.io', path: '/', - href: computed('path', function() { - return `https://www.vaultproject.io${this.get('path')}`; + href: computed('host', 'path', function() { + return `${this.host}${this.path}`; }), }); diff --git a/ui/app/components/learn-link.js b/ui/app/components/learn-link.js new file mode 100644 index 0000000000..1071690186 --- /dev/null +++ b/ui/app/components/learn-link.js @@ -0,0 +1,5 @@ +import DocLink from './doc-link'; + +export default DocLink.extend({ + host: 'https://learn.hashicorp.com', +}); From 5f71ee99402b4c92f767391a60180741f862bd86 Mon Sep 17 00:00:00 2001 From: Matthew Irish Date: Wed, 14 Nov 2018 14:57:12 -0600 Subject: [PATCH 07/15] use outer-html component as a base for empty state --- ui/app/components/empty-state.js | 5 +++-- ui/app/templates/components/empty-state.hbs | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ui/app/components/empty-state.js b/ui/app/components/empty-state.js index d05a94b9ed..f83fc964c0 100644 --- a/ui/app/components/empty-state.js +++ b/ui/app/components/empty-state.js @@ -1,6 +1,7 @@ +import OuterHTML from './outer-html'; import Component from '@ember/component'; -export default Component.extend({ +export default OuterHTML.extend({ title: null, - classNames: ['empty-state box is-sideless is-marginless is-fullwidth is-bottomless'], + message: null, }); diff --git a/ui/app/templates/components/empty-state.hbs b/ui/app/templates/components/empty-state.hbs index 6b20e06851..2de1778cf0 100644 --- a/ui/app/templates/components/empty-state.hbs +++ b/ui/app/templates/components/empty-state.hbs @@ -1,15 +1,17 @@ -
-

- {{title}} -

- {{#if message}} +
+
+

+ {{title}} +

+ {{#if message}}

{{message}}

- {{/if}} - {{#if hasBlock}} + {{/if}} + {{#if hasBlock}}
{{yield}}
- {{/if}} + {{/if}} +
From 4d8e6fa1cc6375a617a72c59b12276e699f37938 Mon Sep 17 00:00:00 2001 From: Matthew Irish Date: Wed, 14 Nov 2018 14:58:33 -0600 Subject: [PATCH 08/15] use anchors and LearnLink component --- .../components/identity/item-alias/alias-metadata.hbs | 7 ++++--- ui/app/templates/partials/secret-form-show.hbs | 10 ++++++---- .../vault/cluster/access/identity/aliases/index.hbs | 7 ++++--- .../templates/vault/cluster/access/identity/index.hbs | 7 ++++--- .../templates/vault/cluster/access/leases/error.hbs | 8 ++++++-- ui/app/templates/vault/cluster/policies/index.hbs | 11 ++++++----- .../cluster/replication/mode/secondaries/index.hbs | 7 ++++--- 7 files changed, 34 insertions(+), 23 deletions(-) diff --git a/ui/app/templates/components/identity/item-alias/alias-metadata.hbs b/ui/app/templates/components/identity/item-alias/alias-metadata.hbs index f56c547a83..0e47789dc0 100644 --- a/ui/app/templates/components/identity/item-alias/alias-metadata.hbs +++ b/ui/app/templates/components/identity/item-alias/alias-metadata.hbs @@ -19,12 +19,13 @@ {{else}} + @message="You can store custom data that you want to associate with a {{lowercase (humanize model.identityType)}}. Edit this {{lowercase (humanize model.identityType)}} to get started." + > {{#link-to "vault.cluster.access.identity.aliases.edit" model.id tagName="button" class="link"}} Edit {{lowercase (humanize model.identityType)}} {{/link-to}} - + Learn More - + {{/each-in}} diff --git a/ui/app/templates/partials/secret-form-show.hbs b/ui/app/templates/partials/secret-form-show.hbs index e9b29862d7..7cd5acbbcb 100644 --- a/ui/app/templates/partials/secret-form-show.hbs +++ b/ui/app/templates/partials/secret-form-show.hbs @@ -1,8 +1,9 @@ {{#if (and isV2 modelForData.destroyed)}} - + @message="A version that has been permanently deleted cannot be restored. You can see other versions of this secret in the History menu." + > + Learn More @@ -10,8 +11,9 @@ - + You can also see other versions of this secret in the History menu." + > + Learn More diff --git a/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs b/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs index 5409f42dfe..78e0a455a7 100644 --- a/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs @@ -45,12 +45,13 @@ {{else}} + @message="A list of {{identityType}} aliases in this namespace will be listed here. Choose one of the {{pluralize identityType}} and click "Add Alias" to get started." + > {{#link-to "vault.cluster.access.identity.create" (pluralize identityType) tagName="button" class="link"}} Add {{identityType}} {{/link-to}} - + Learn More - + {{/if}} diff --git a/ui/app/templates/vault/cluster/access/identity/index.hbs b/ui/app/templates/vault/cluster/access/identity/index.hbs index c98a010b66..d222227a5c 100644 --- a/ui/app/templates/vault/cluster/access/identity/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/index.hbs @@ -116,12 +116,13 @@ {{else}} + @message="A list of {{pluralize identityType}} in this namespace will be listed here. Add your first {{identityType}} to get started." + > {{#link-to "vault.cluster.access.identity.create" (pluralize identityType) tagName="button" class="link"}} Add {{identityType}} {{/link-to}} - + Learn More - + {{/if}} diff --git a/ui/app/templates/vault/cluster/access/leases/error.hbs b/ui/app/templates/vault/cluster/access/leases/error.hbs index 39ec436113..39f1a94d46 100644 --- a/ui/app/templates/vault/cluster/access/leases/error.hbs +++ b/ui/app/templates/vault/cluster/access/leases/error.hbs @@ -20,14 +20,18 @@ @title="No leases with that ID" @message="Unable to find lease for the ID "{{model.keyId}}". Try going back to the lookup and re-entering the ID." > - {{#link-to "vault.cluster.access.leases" tagName="button" class="link"}}Back to lookup{{/link-to}} + {{#link-to "vault.cluster.access.leases" class="link"}} + Back to lookup + {{/link-to}} {{else if (eq model.httpStatus 403)}} - {{#link-to "vault.cluster.access.leases" tagName="button" class="link"}}Back to lookup{{/link-to}} + {{#link-to "vault.cluster.access.leases" class="link"}} + Back to lookup + {{/link-to}} {{else}} {{#each model.errors as |error|}} diff --git a/ui/app/templates/vault/cluster/policies/index.hbs b/ui/app/templates/vault/cluster/policies/index.hbs index eb4322a5b6..82974320a7 100644 --- a/ui/app/templates/vault/cluster/policies/index.hbs +++ b/ui/app/templates/vault/cluster/policies/index.hbs @@ -148,19 +148,20 @@ {{/if}} {{else}} {{/each}} {{else}} - {{#link-to "vault.cluster.policies.create" tagName="button" class="link"}} + @message="A list of policies will be listed here. Add your first {{uppercase policyType}} policy to get started." + > + {{#link-to "vault.cluster.policies.create" class="link"}} Add {{uppercase policyType}} policy {{/link-to}} - + Learn More - + {{/if}} {{else}} diff --git a/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs b/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs index fc6d133fed..61f87ddd80 100644 --- a/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs +++ b/ui/app/templates/vault/cluster/replication/mode/secondaries/index.hbs @@ -48,13 +48,14 @@ {{else}} + @message="Associated secondary clusters will be listed here. Add your first secondary cluster to get started." + > {{#if model.canAddSecondary}} - {{#link-to 'vault.cluster.replication.mode.secondaries.add' model.name replicationMode tagName="button" class="link" }} + {{#link-to 'vault.cluster.replication.mode.secondaries.add' model.name replicationMode class="link" }} Add secondary {{/link-to}} {{/if}} - + Learn More From a80b649dbe223f548779610f19f245eae6add102 Mon Sep 17 00:00:00 2001 From: Matthew Irish Date: Wed, 14 Nov 2018 17:12:42 -0600 Subject: [PATCH 09/15] move Add -> Create, add emptyTitle for leases list --- .../vault/cluster/access/leases/list.js | 15 ++++++++++ ui/app/helpers/options-for-backend.js | 12 ++++---- .../components/identity/entity-nav.hbs | 2 +- .../cluster/access/identity/aliases/index.hbs | 4 +-- .../vault/cluster/access/identity/index.hbs | 6 ++-- .../vault/cluster/access/leases/list.hbs | 30 +++++-------------- .../vault/cluster/access/namespaces/index.hbs | 2 +- .../vault/cluster/policies/index.hbs | 6 ++-- 8 files changed, 38 insertions(+), 39 deletions(-) diff --git a/ui/app/controllers/vault/cluster/access/leases/list.js b/ui/app/controllers/vault/cluster/access/leases/list.js index 36b6828901..a80e513836 100644 --- a/ui/app/controllers/vault/cluster/access/leases/list.js +++ b/ui/app/controllers/vault/cluster/access/leases/list.js @@ -49,6 +49,21 @@ export default Controller.extend({ return !!utils.keyIsFolder(this.get('filter')); }), + emptyTitle: computed('baseKey.id', 'filter', 'filterIsFolder', function() { + let id = this.get('baseKey.id'); + let filter = this.filter; + if (id === '') { + return 'There are currently no leases.'; + } + if (this.filterIsFolder) { + if (filter === id) { + return `There are no leases under "${filter}".`; + } else { + return `We couldn't find a prefix matching "${filter}".`; + } + } + }), + actions: { setFilter(val) { this.set('filter', val); diff --git a/ui/app/helpers/options-for-backend.js b/ui/app/helpers/options-for-backend.js index 7424ce337b..1a2111e1c5 100644 --- a/ui/app/helpers/options-for-backend.js +++ b/ui/app/helpers/options-for-backend.js @@ -5,7 +5,7 @@ import { assign } from '@ember/polyfills'; const DEFAULT_DISPLAY = { searchPlaceholder: 'Filter secrets', item: 'secret', - create: 'Add secret', + create: 'Create secret', navigateTree: true, editComponent: 'secret-edit', listItemPartial: 'partials/secret-list/item', @@ -15,7 +15,7 @@ const SECRET_BACKENDS = { displayName: 'AWS', searchPlaceholder: 'Filter roles', item: 'role', - create: 'Add role', + create: 'Create role', navigateTree: false, editComponent: 'role-aws-edit', listItemPartial: 'partials/secret-list/aws-role-item', @@ -30,7 +30,7 @@ const SECRET_BACKENDS = { label: 'Roles', searchPlaceholder: 'Filter roles', item: 'role', - create: 'Add role', + create: 'Create role', editComponent: 'role-pki-edit', }, { @@ -39,7 +39,7 @@ const SECRET_BACKENDS = { label: 'Certificates', searchPlaceholder: 'Filter certificates', item: 'certificates', - create: 'Add role', + create: 'Create role', tab: 'certs', listItemPartial: 'partials/secret-list/pki-cert-item', editComponent: 'pki-cert-show', @@ -50,7 +50,7 @@ const SECRET_BACKENDS = { displayName: 'SSH', searchPlaceholder: 'Filter roles', item: 'role', - create: 'Add role', + create: 'Create role', navigateTree: false, editComponent: 'role-ssh-edit', listItemPartial: 'partials/secret-list/ssh-role-item', @@ -58,7 +58,7 @@ const SECRET_BACKENDS = { transit: { searchPlaceholder: 'Filter keys', item: 'key', - create: 'Add encryption key', + create: 'Create encryption key', navigateTree: false, editComponent: 'transit-edit', listItemPartial: 'partials/secret-list/item', diff --git a/ui/app/templates/components/identity/entity-nav.hbs b/ui/app/templates/components/identity/entity-nav.hbs index 513c61227a..17d31f7182 100644 --- a/ui/app/templates/components/identity/entity-nav.hbs +++ b/ui/app/templates/components/identity/entity-nav.hbs @@ -12,7 +12,7 @@ {{/link-to}} {{/if}} {{#link-to "vault.cluster.access.identity.create" (pluralize identityType) class="button has-icon-right is-ghost is-compact" data-test-entity-create-link=true}} - Add {{identityType}} + Create {{identityType}} {{i-con glyph="chevron-right" size=11}} {{/link-to}} diff --git a/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs b/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs index 78e0a455a7..a12974e74b 100644 --- a/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs @@ -45,10 +45,10 @@ {{else}} {{#link-to "vault.cluster.access.identity.create" (pluralize identityType) tagName="button" class="link"}} - Add {{identityType}} + Create {{identityType}} {{/link-to}} Learn More diff --git a/ui/app/templates/vault/cluster/access/identity/index.hbs b/ui/app/templates/vault/cluster/access/identity/index.hbs index d222227a5c..069af2aab5 100644 --- a/ui/app/templates/vault/cluster/access/identity/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/index.hbs @@ -77,7 +77,7 @@ {{#if item.canAddAlias}}
  • {{#link-to "vault.cluster.access.identity.aliases.add" (pluralize identityType) item.id}} - Add alias + Create alias {{/link-to}}
  • {{/if}} @@ -116,10 +116,10 @@ {{else}} {{#link-to "vault.cluster.access.identity.create" (pluralize identityType) tagName="button" class="link"}} - Add {{identityType}} + Create {{identityType}} {{/link-to}} Learn More diff --git a/ui/app/templates/vault/cluster/access/leases/list.hbs b/ui/app/templates/vault/cluster/access/leases/list.hbs index 501fcba378..ae2789d396 100644 --- a/ui/app/templates/vault/cluster/access/leases/list.hbs +++ b/ui/app/templates/vault/cluster/access/leases/list.hbs @@ -104,32 +104,16 @@ glyph=(if item.isFolder 'folder' 'document') size=14 class="has-text-grey-light" - }} - - {{or item.keyWithoutParent item.id}} - - {{/link-to}} + }}{{or item.keyWithoutParent item.id}}{{/link-to}} {{else}} -
    - There are no leases matching {{filter}} -
    + {{/each}} {{else}} -
    -
    - {{#if (eq baseKey.id '')}} - There are currently no leases. - {{else}} - {{#if filterIsFolder}} - {{#if (eq filter baseKey.id)}} - There are no leases under {{filter}}. - {{else}} - We couldn't find a prefix matching {{filter}}. - {{/if}} - {{/if}} - {{/if}} -
    -
    + {{/if}} {{#if (gt model.meta.lastPage 1) }} {{list-pagination diff --git a/ui/app/templates/vault/cluster/access/namespaces/index.hbs b/ui/app/templates/vault/cluster/access/namespaces/index.hbs index c2ee1e0335..179539ae94 100644 --- a/ui/app/templates/vault/cluster/access/namespaces/index.hbs +++ b/ui/app/templates/vault/cluster/access/namespaces/index.hbs @@ -7,7 +7,7 @@ {{#link-to 'vault.cluster.access.namespaces.create' class="button has-icon-right is-ghost is-compact"}} - Add namespace + Create namespace {{/link-to}} diff --git a/ui/app/templates/vault/cluster/policies/index.hbs b/ui/app/templates/vault/cluster/policies/index.hbs index 82974320a7..da7b5bc80b 100644 --- a/ui/app/templates/vault/cluster/policies/index.hbs +++ b/ui/app/templates/vault/cluster/policies/index.hbs @@ -12,7 +12,7 @@ {{#link-to "vault.cluster.policies.create" class="button has-icon-right is-ghost is-compact" data-test-policy-create-link=true}} - Add {{uppercase policyType}} policy + Create {{uppercase policyType}} policy {{i-con glyph="chevron-right" size=11}} {{/link-to}} @@ -154,10 +154,10 @@ {{else}} {{#link-to "vault.cluster.policies.create" class="link"}} - Add {{uppercase policyType}} policy + Create {{uppercase policyType}} policy {{/link-to}} Learn More From 98ccba4acf3ffa6620c19366f8a7e597fded5327 Mon Sep 17 00:00:00 2001 From: Matthew Irish Date: Wed, 14 Nov 2018 17:14:22 -0600 Subject: [PATCH 10/15] lint --- ui/app/components/empty-state.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/app/components/empty-state.js b/ui/app/components/empty-state.js index f83fc964c0..04e6c3d213 100644 --- a/ui/app/components/empty-state.js +++ b/ui/app/components/empty-state.js @@ -1,5 +1,4 @@ import OuterHTML from './outer-html'; -import Component from '@ember/component'; export default OuterHTML.extend({ title: null, From 2d864cb141394a3f1cd83944a9fb6e866891555c Mon Sep 17 00:00:00 2001 From: Matthew Irish Date: Thu, 15 Nov 2018 11:19:52 -0600 Subject: [PATCH 11/15] don't use bulma classes for empty-state --- ui/app/styles/components/empty-state.scss | 1 + ui/app/templates/components/empty-state.hbs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/app/styles/components/empty-state.scss b/ui/app/styles/components/empty-state.scss index 403a7af19f..2cb489aae0 100644 --- a/ui/app/styles/components/empty-state.scss +++ b/ui/app/styles/components/empty-state.scss @@ -5,6 +5,7 @@ background: $ui-gray-050; justify-content: center; padding: $spacing-xxl $spacing-s; + box-shadow: 0 -2px 0 -1px $ui-gray-300; } .empty-state-content { diff --git a/ui/app/templates/components/empty-state.hbs b/ui/app/templates/components/empty-state.hbs index 2de1778cf0..18509137cf 100644 --- a/ui/app/templates/components/empty-state.hbs +++ b/ui/app/templates/components/empty-state.hbs @@ -1,4 +1,4 @@ -
    +

    {{title}} From 5197a531f0cf9788c1e2c0219ed7d3492bc9021f Mon Sep 17 00:00:00 2001 From: Matthew Irish Date: Thu, 15 Nov 2018 11:51:09 -0600 Subject: [PATCH 12/15] don't show disable button for groups --- ui/app/templates/vault/cluster/access/identity/index.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/templates/vault/cluster/access/identity/index.hbs b/ui/app/templates/vault/cluster/access/identity/index.hbs index 069af2aab5..58a6857130 100644 --- a/ui/app/templates/vault/cluster/access/identity/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/index.hbs @@ -57,7 +57,7 @@ - {{else}} + {{else if (eq identityType 'entity')}} {{#confirm-action confirmButtonClasses="button is-primary" confirmButtonText="Disable" From 08bbfd66867343f746401374397245d675dcec4d Mon Sep 17 00:00:00 2001 From: Matthew Irish Date: Thu, 15 Nov 2018 11:58:55 -0600 Subject: [PATCH 13/15] make sure tabs show up on identity show pages --- ui/app/templates/vault/cluster/access/identity/show.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/templates/vault/cluster/access/identity/show.hbs b/ui/app/templates/vault/cluster/access/identity/show.hbs index 3536e7d357..b4156fafe6 100644 --- a/ui/app/templates/vault/cluster/access/identity/show.hbs +++ b/ui/app/templates/vault/cluster/access/identity/show.hbs @@ -32,7 +32,7 @@

    diff --git a/ui/app/templates/components/list-view.hbs b/ui/app/templates/components/list-view.hbs index 115226bb86..da3bf430b2 100644 --- a/ui/app/templates/components/list-view.hbs +++ b/ui/app/templates/components/list-view.hbs @@ -6,7 +6,8 @@
    {{else}} {{/if}} diff --git a/ui/app/templates/vault/cluster/access/namespaces/index.hbs b/ui/app/templates/vault/cluster/access/namespaces/index.hbs index 179539ae94..85b830d87b 100644 --- a/ui/app/templates/vault/cluster/access/namespaces/index.hbs +++ b/ui/app/templates/vault/cluster/access/namespaces/index.hbs @@ -12,7 +12,7 @@ {{/link-to}} - + {{list.item.id}}