Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI/Custom empty state messages for transit and transform #13090

Merged
merged 6 commits into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/13090.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: customizes empty state messages for secret backends
```
2 changes: 2 additions & 0 deletions ui/app/helpers/options-for-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const SECRET_BACKENDS = {
displayName: 'Transformation',
navigateTree: false,
listItemPartial: 'secret-list/transform-list-item',
message: 'a transformation and a role',
tabs: [
{
name: 'transformations',
Expand Down Expand Up @@ -136,6 +137,7 @@ const SECRET_BACKENDS = {
navigateTree: false,
editComponent: 'transit-edit',
listItemPartial: 'secret-list/item',
message: 'an encryption key',
},
};

Expand Down
27 changes: 19 additions & 8 deletions ui/app/templates/vault/cluster/secrets/backend/list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,25 @@
{{/if}}
{{else}}
{{#if (eq baseKey.id '')}}
<EmptyState
@title="No {{pluralize options.item}} in this backend"
@message="Secrets in this backend will be listed here. Add a secret to get started."
>
<SecretLink @mode="create" @secret="" @queryParams={{query-params initialKey=(or filter baseKey.id) itemType=tab}} @class="link">
{{options.create}}
</SecretLink>
</EmptyState>
{{#if options.message}}
<EmptyState
@title="Get started with {{capitalize backendType}}"
@message="To use {{backendType}}, you'll need to create {{options.message}}."
>
<SecretLink @mode="create" @secret="" @queryParams={{query-params initialKey=(or filter baseKey.id) itemType=tab}} @class="link">
{{options.create}}
</SecretLink>
</EmptyState>
{{else}}
<EmptyState
@title="No {{pluralize options.item}} in this backend"
@message="Secrets in this backend will be listed here. Add a secret to get started."
>
<SecretLink @mode="create" @secret="" @queryParams={{query-params initialKey=(or filter baseKey.id) itemType=tab}} @class="link">
{{options.create}}
</SecretLink>
</EmptyState>
{{/if}}
{{else}}
{{#if filterIsFolder}}
<EmptyState
Expand Down