move Add -> Create, add emptyTitle for leases list

This commit is contained in:
Matthew Irish 2018-11-14 17:12:42 -06:00
parent 9dfcaacda4
commit e3e929613f
8 changed files with 38 additions and 39 deletions

View File

@ -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);

View File

@ -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',

View File

@ -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}}
</p.levelRight>

View File

@ -45,10 +45,10 @@
{{else}}
<EmptyState
@title="No {{identityType}} aliases yet"
@message="A list of {{identityType}} aliases in this namespace will be listed here. Choose one of the {{pluralize identityType}} and click &quot;Add Alias&quot; to get started."
@message="A list of {{identityType}} aliases in this namespace will be listed here. Choose one of the {{pluralize identityType}} and click &quot;Create Alias&quot; to get started."
>
{{#link-to "vault.cluster.access.identity.create" (pluralize identityType) tagName="button" class="link"}}
Add {{identityType}}
Create {{identityType}}
{{/link-to}}
<LearnLink @path="/vault/identity-access-management/iam-identity">
Learn More

View File

@ -77,7 +77,7 @@
{{#if item.canAddAlias}}
<li class="action">
{{#link-to "vault.cluster.access.identity.aliases.add" (pluralize identityType) item.id}}
Add alias
Create alias
{{/link-to}}
</li>
{{/if}}
@ -116,10 +116,10 @@
{{else}}
<EmptyState
@title="No {{pluralize identityType}} yet"
@message="A list of {{pluralize identityType}} in this namespace will be listed here. Add your first {{identityType}} to get started."
@message="A list of {{pluralize identityType}} in this namespace will be listed here. Create your first {{identityType}} to get started."
>
{{#link-to "vault.cluster.access.identity.create" (pluralize identityType) tagName="button" class="link"}}
Add {{identityType}}
Create {{identityType}}
{{/link-to}}
<LearnLink @path="/vault/identity-access-management/iam-identity">
Learn More

View File

@ -104,32 +104,16 @@
glyph=(if item.isFolder 'folder' 'document')
size=14
class="has-text-grey-light"
}}
<span class="has-text-weight-semibold">
{{or item.keyWithoutParent item.id}}
</span>
{{/link-to}}
}}<span class="has-text-weight-semibold">{{or item.keyWithoutParent item.id}}</span>{{/link-to}}
{{else}}
<div class="box is-sideless">
There are no leases matching <code>{{filter}}</code>
</div>
<EmptyState
@title="There are no leases matching &quot;{{this.filter}}&quot;"
/>
{{/each}}
{{else}}
<div class="empty-state">
<div class="empty-state-title">
{{#if (eq baseKey.id '')}}
There are currently no leases.
{{else}}
{{#if filterIsFolder}}
{{#if (eq filter baseKey.id)}}
There are no leases under <code>{{filter}}</code>.
{{else}}
We couldn't find a prefix matching <code>{{filter}}</code>.
{{/if}}
{{/if}}
{{/if}}
</div>
</div>
<EmptyState
@title={{this.emptyTitle}}
/>
{{/if}}
{{#if (gt model.meta.lastPage 1) }}
{{list-pagination

View File

@ -7,7 +7,7 @@
</p.levelLeft>
<p.levelRight>
{{#link-to 'vault.cluster.access.namespaces.create' class="button has-icon-right is-ghost is-compact"}}
Add namespace
Create namespace
<ICon @glyph="chevron-right" @size=11 />
{{/link-to}}
</p.levelRight>

View File

@ -12,7 +12,7 @@
</p.levelLeft>
<p.levelRight>
{{#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}}
</p.levelRight>
@ -154,10 +154,10 @@
{{else}}
<EmptyState
@title="No {{uppercase policyType}} policies yet"
@message="A list of policies will be listed here. Add your first {{uppercase policyType}} policy to get started."
@message="A list of policies will be listed here. Create your first {{uppercase policyType}} policy to get started."
>
{{#link-to "vault.cluster.policies.create" class="link"}}
Add {{uppercase policyType}} policy
Create {{uppercase policyType}} policy
{{/link-to}}
<LearnLink @path="/vault/getting-started/policies">
Learn More