diff --git a/ui/app/components/doc-link.js b/ui/app/components/doc-link.js index 2bc9bb163379..35a9ac0b1a1c 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/block-empty.js b/ui/app/components/empty-action-namespaces.js similarity index 100% rename from ui/app/components/block-empty.js rename to ui/app/components/empty-action-namespaces.js diff --git a/ui/app/components/empty-state.js b/ui/app/components/empty-state.js new file mode 100644 index 000000000000..04e6c3d213c7 --- /dev/null +++ b/ui/app/components/empty-state.js @@ -0,0 +1,6 @@ +import OuterHTML from './outer-html'; + +export default OuterHTML.extend({ + title: null, + message: null, +}); diff --git a/ui/app/components/learn-link.js b/ui/app/components/learn-link.js new file mode 100644 index 000000000000..1071690186cd --- /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', +}); diff --git a/ui/app/components/list-view.js b/ui/app/components/list-view.js index 47b6c92ea9e3..6c21340897e1 100644 --- a/ui/app/components/list-view.js +++ b/ui/app/components/list-view.js @@ -6,9 +6,17 @@ export default Component.extend({ tagName: '', items: null, itemNoun: 'item', + // the dasherized name of a component to render + // in the EmptyState component if there are no items in items.length + emptyActions: '', + + 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/controllers/vault/cluster/access/leases/list.js b/ui/app/controllers/vault/cluster/access/leases/list.js index 36b6828901f6..a80e513836c4 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/styles/components/empty-state.scss b/ui/app/styles/components/empty-state.scss new file mode 100644 index 000000000000..2cb489aae09f --- /dev/null +++ b/ui/app/styles/components/empty-state.scss @@ -0,0 +1,38 @@ +.empty-state { + align-items: center; + color: $grey; + display: flex; + background: $ui-gray-050; + justify-content: center; + padding: $spacing-xxl $spacing-s; + box-shadow: 0 -2px 0 -1px $ui-gray-300; +} + +.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 3c395c50dc77..846710bcddb3 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 fb70aca502d5..a3abb00b2cd3 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/block-empty.hbs b/ui/app/templates/components/block-empty.hbs deleted file mode 100644 index d0f7e402f744..000000000000 --- 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/components/empty-action-namespaces.hbs b/ui/app/templates/components/empty-action-namespaces.hbs new file mode 100644 index 000000000000..ddb51d93bcd7 --- /dev/null +++ b/ui/app/templates/components/empty-action-namespaces.hbs @@ -0,0 +1,7 @@ +{{#link-to "vault.cluster.access.namespaces.create"}} + Create namespace +{{/link-to}} + + + Learn More + diff --git a/ui/app/templates/components/empty-state.hbs b/ui/app/templates/components/empty-state.hbs new file mode 100644 index 000000000000..ebe81417b425 --- /dev/null +++ b/ui/app/templates/components/empty-state.hbs @@ -0,0 +1,21 @@ +
+
+

+ {{title}} +

+ {{#if message}} +

+ {{message}} +

+ {{/if}} + {{#if hasBlock}} +
+ {{yield}} +
+ {{else if emptyActions}} +
+ {{component emptyActions}} +
+ {{/if}} +
+
diff --git a/ui/app/templates/components/identity/entity-nav.hbs b/ui/app/templates/components/identity/entity-nav.hbs index adf0ab5a14a0..17d31f71826a 100644 --- a/ui/app/templates/components/identity/entity-nav.hbs +++ b/ui/app/templates/components/identity/entity-nav.hbs @@ -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 b1c9ca9a5d9d..0e47789dc08c 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,15 @@
{{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/components/identity/item-aliases.hbs b/ui/app/templates/components/identity/item-aliases.hbs index 8b3995930978..405b5b6dfd19 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 1366797fec92..eb44ed08c05a 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 4f20517fee85..4b5485a72720 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 caabe9614d8c..758a5c360744 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 868dd3298e6a..a7ceeaf0ab78 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 e3eaf9a2ebf8..0896f0e86835 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 54815bcdcd4f..da3bf430b226 100644 --- a/ui/app/templates/components/list-view.hbs +++ b/ui/app/templates/components/list-view.hbs @@ -5,15 +5,9 @@ {{/each}} {{else}} -
-
-
-
-

- {{emptyMessage}} -

-
-
-
-
+ {{/if}} diff --git a/ui/app/templates/partials/secret-form-show.hbs b/ui/app/templates/partials/secret-form-show.hbs index 1be2406e564f..7cd5acbbcbbc 100644 --- a/ui/app/templates/partials/secret-form-show.hbs +++ b/ui/app/templates/partials/secret-form-show.hbs @@ -1,11 +1,22 @@ {{#if (and isV2 modelForData.destroyed)}} - - Version {{modelForData.version}} of this secret has been permanently destroyed. - + + + Learn More + + {{else if (and isV2 modelForData.deleted)}} - - Version {{modelForData.version}} of this secret has been deleted. - + + + Learn More + + {{else}} {{#if showAdvancedMode}} {{json-editor 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 f80b5276c980..a12974e74b0b 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,23 @@ {{/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"}} + Create {{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 2e85b5f19b11..58a685713047 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 @@ -57,7 +57,7 @@ - {{else}} + {{else if (eq identityType 'entity')}} {{#confirm-action confirmButtonClasses="button is-primary" confirmButtonText="Disable" @@ -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}} @@ -106,23 +106,23 @@ {{/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"}} + Create {{identityType}} + {{/link-to}} + + Learn More + + {{/if}} diff --git a/ui/app/templates/vault/cluster/access/identity/show.hbs b/ui/app/templates/vault/cluster/access/identity/show.hbs index 3536e7d35775..b4156fafe6f9 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 @@