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 all 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 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