Skip to content

Commit

Permalink
UI/Custom empty state messages for transit and transform (hashicorp#1…
Browse files Browse the repository at this point in the history
…3090)

* customizes empty state messages for transit and transform

* adds changelog

* clarifies key name
  • Loading branch information
hellobontempo authored and Artem Alexandrov committed Feb 4, 2022
1 parent 59db856 commit 4aae3f4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
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 transit and transform
```
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',
firstStep: 'create 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',
firstStep: 'create an encryption key',
},
};

Expand Down
4 changes: 2 additions & 2 deletions ui/app/models/secret-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { fragment } from 'ember-data-model-fragments/attributes';
import fieldToAttrs, { expandAttributeMeta } from 'vault/utils/field-to-attrs';
import { validator, buildValidations } from 'ember-cp-validations';

//identity will be managed separately and the inclusion
//of the system backend is an implementation detail
// identity will be managed separately and the inclusion
// of the system backend is an implementation detail
const LIST_EXCLUDED_BACKENDS = ['system', 'identity'];

const Validations = buildValidations({
Expand Down
2 changes: 1 addition & 1 deletion ui/app/routes/vault/cluster/secrets/backend/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default Route.extend({
if (noConnectionCapabilities) {
return 'You cannot yet generate credentials. Ask your administrator if you think you should have access.';
} else {
return 'You can connect and external database to Vault. We recommend that you create a user for Vault rather than using the database root user.';
return 'You can connect an external database to Vault. We recommend that you create a user for Vault rather than using the database root user.';
}
};
controller.set('showEmptyState', showEmptyState);
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 (and options.firstStep (not tab))}}
<EmptyState
@title="Get started with {{capitalize backendType}}"
@message="To use {{backendType}}, you'll need to {{options.firstStep}}."
>
<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

0 comments on commit 4aae3f4

Please sign in to comment.