Merge branch 'main' into test-acceptance-credential-stores

This commit is contained in:
Carlos Alcaide Corvo authored and GitHub committed 2021-07-21 07:59:52 -07:00
commit 2000c10006
9 files changed
+114 -1

No files matched your search

@@ -271,3 +271,11 @@ credential-store:
title: Credential Store
title_plural: Credential Stores
description: A credential stores is a collection of credentials and credential libraries.
credential-library:
title: Credential Library
title_plural: Credential Libraries
description: A credential library is a resource that provides credentials.
messages:
none:
title: No Credential Libraries Available
description: No Credential Libraries available in this credential store.
+3 -1
View File
@@ -90,7 +90,9 @@ Router.map(function () {
this.route(
'credential-store',
{ path: ':credential_store_id' },
function () {}
function () {
this.route('credential-libraries', function () {});
}
);
this.route('new');
});
@@ -0,0 +1,16 @@
import Route from '@ember/routing/route';
export default class ScopesScopeCredentialStoresCredentialStoreCredentialLibrariesRoute extends Route {
// =methods
/**
* Loads all credential libraries under the current credential store.
* @return {Promise{[CredentialLibraryModel]}}
*/
model() {
const { id: credential_store_id } = this.modelFor(
'scopes.scope.credential-stores.credential-store'
);
return this.store.query('credential-library', { credential_store_id });
}
}
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';
export default class ScopesScopeCredentialStoresCredentialStoreCredentialLibrariesIndexRoute extends Route {}
@@ -2,4 +2,9 @@
<nav.link @route='scopes.scope.credential-stores.credential-store.index'>
{{t 'titles.details'}}
</nav.link>
<nav.link
@route='scopes.scope.credential-stores.credential-store.credential-libraries'
>
{{t 'resources.credential-library.title_plural'}}
</nav.link>
</Rose::Nav::Tabs>
@@ -0,0 +1,3 @@
{{page-title (t 'resources.credential-library.title_plural')}}
{{outlet}}
@@ -0,0 +1,44 @@
{{#if @model}}
<Rose::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
</header.row>
</table.header>
<table.body as |body|>
{{#each @model as |credentialLibrary|}}
<body.row as |row|>
<row.headerCell>
{{credentialLibrary.displayName}}
<p>{{credentialLibrary.description}}</p>
</row.headerCell>
<row.cell>
<Copyable
@text={{credentialLibrary.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{credentialLibrary.id}}</code>
</Copyable>
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{else}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.credential-library.messages.none.title'}}
as |message|
>
<message.description>
{{t 'resources.credential-library.messages.none.description'}}
</message.description>
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}
@@ -0,0 +1,16 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module(
'Unit | Route | scopes/scope/credential-stores/credential-store/credential-libraries',
function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let route = this.owner.lookup(
'route:scopes/scope/credential-stores/credential-store/credential-libraries'
);
assert.ok(route);
});
}
);
@@ -0,0 +1,16 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module(
'Unit | Route | scopes/scope/credential-stores/credential-store/credential-libraries/index',
function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let route = this.owner.lookup(
'route:scopes/scope/credential-stores/credential-store/credential-libraries/index'
);
assert.ok(route);
});
}
);