From e3e929613f5fc085d73875c7b39b08ae28dddde6 Mon Sep 17 00:00:00 2001 From: Matthew Irish Date: Wed, 14 Nov 2018 17:12:42 -0600 Subject: [PATCH] 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 36b682890..a80e51383 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 7424ce337..1a2111e1c 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 513c61227..17d31f718 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 78e0a455a..a12974e74 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 d222227a5..069af2aab 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 501fcba37..ae2789d39 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 c2ee1e033..179539ae9 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 82974320a..da7b5bc80 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