Merge pull request #661 from hashicorp/credential-library-read

Credential Library - Read
This commit is contained in:
Susmitha Girumala authored and GitHub committed 2021-07-23 15:50:17 -04:00
commit 2726538c41
12 files changed
+123 -2

No files matched your search

@@ -12,6 +12,7 @@
@label={{t 'form.name.label'}}
@error={{@model.errors.name}}
@helperText={{t 'form.name.help'}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
@@ -31,7 +32,7 @@
@label={{t 'form.description.label'}}
@error={{@model.errors.description}}
@helperText={{t 'form.description.help'}}
@disabled={{@model.isSaving}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
@@ -51,6 +52,7 @@
@label={{t 'resources.credential-library.form.vault_path.label'}}
@error={{@model.errors.attributes_path}}
@helperText={{t 'resources.credential-library.form.vault_path.help'}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
@@ -74,6 +76,7 @@
@selectedValue={{@model.attributes.http_method}}
@changed={{fn (mut @model.attributes.http_method)}}
@inline={{true}}
disabled={{@model.isSaving}}
as |radioGroup|
>
{{#each this.httpMethodOptions as |httpMethod|}}
+5
View File
@@ -93,6 +93,11 @@ Router.map(function () {
function () {
this.route('credential-libraries', function () {
this.route('new');
this.route(
'credential-library',
{ path: ':credential_library_id' },
function () {}
);
});
}
);
@@ -0,0 +1,49 @@
import Route from '@ember/routing/route';
export default class ScopesScopeCredentialStoresCredentialStoreCredentialLibrariesCredentialLibraryRoute extends Route {
// =methods
/**
* Load a credential-library using current credential store and its parent scope.
* @param {object} params
* @param {string} params.credential_library_id
* @return {CredentialLibraryModel}
*/
async model({ credential_library_id }) {
return this.store.findRecord('credential-library', credential_library_id, {
reload: true,
});
}
/**
* Renders the credential library specific templates for header, navigation, and action page sections.
* @override
*/
renderTemplate() {
super.renderTemplate(...arguments);
this.render(
'scopes/scope/credential-stores/credential-store/credential-libraries/credential-library/-header',
{
into: 'scopes/scope/credential-stores/credential-store',
outlet: 'header',
}
);
this.render(
'scopes/scope/credential-stores/credential-store/credential-libraries/credential-library/-navigation',
{
into: 'scopes/scope/credential-stores/credential-store',
outlet: 'navigation',
}
);
this.render(
'scopes/scope/credential-stores/credential-store/credential-libraries/credential-library/-actions',
{
into: 'scopes/scope/credential-stores/credential-store',
outlet: 'actions',
}
);
}
}
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';
export default class ScopesScopeCredentialStoresCredentialStoreCredentialLibrariesCredentialLibraryIndexRoute extends Route {}
@@ -0,0 +1,3 @@
{{page-title @model.displayName}}
{{outlet}}
@@ -0,0 +1,9 @@
<h2>{{t 'resources.credential-library.title'}}</h2>
<p>{{t 'resources.credential-library.description'}}</p>
<Copyable
@text={{@model.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{@model.id}}</code>
</Copyable>
@@ -0,0 +1,7 @@
<Rose::Nav::Tabs as |nav|>
<nav.link
@route='scopes.scope.credential-stores.credential-store.credential-libraries.credential-library.index'
>
{{t 'titles.details'}}
</nav.link>
</Rose::Nav::Tabs>
@@ -0,0 +1,5 @@
<Form::CredentialLibrary
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
/>
@@ -11,7 +11,12 @@
{{#each @model as |credentialLibrary|}}
<body.row as |row|>
<row.headerCell>
{{credentialLibrary.displayName}}
<LinkTo
@route='scopes.scope.credential-stores.credential-store.credential-libraries.credential-library'
@model={{credentialLibrary.id}}
>
{{credentialLibrary.displayName}}
</LinkTo>
<p>{{credentialLibrary.description}}</p>
</row.headerCell>
<row.cell>
@@ -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/credential-library',
function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let route = this.owner.lookup(
'route:scopes/scope/credential-stores/credential-store/credential-libraries/credential-library'
);
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/credential-library/index',
function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let route = this.owner.lookup(
'route:scopes/scope/credential-stores/credential-store/credential-libraries/credential-library/index'
);
assert.ok(route);
});
}
);