Merge pull request #643 from hashicorp/feature-credential-store-crud-new
Feature credential store crud new
This commit is contained in:
6 files changed
+50
-2
No files matched your search
@@ -465,6 +465,7 @@ export default function () {
|
||||
);
|
||||
|
||||
this.get('/credential-stores/:id');
|
||||
this.post('/credential-stores');
|
||||
this.patch('/credential-stores/:id');
|
||||
|
||||
// credential-libraries
|
||||
|
||||
@@ -92,6 +92,7 @@ Router.map(function () {
|
||||
{ path: ':credential_store_id' },
|
||||
function () {}
|
||||
);
|
||||
this.route('new');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeCredentialStoresNewRoute extends Route {
|
||||
// =methods
|
||||
/**
|
||||
* Creates a new unsaved credential-store
|
||||
*/
|
||||
model() {
|
||||
const scopeModel = this.modelFor('scopes.scope');
|
||||
return this.store.createRecord('credential-store', {
|
||||
type: 'vault',
|
||||
scopeModel,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
<p>{{t 'resources.credential-store.description'}}</p>
|
||||
</page.header>
|
||||
|
||||
{{!-- <page.actions>
|
||||
<page.actions>
|
||||
{{#if @model}}
|
||||
<Rose::LinkButton
|
||||
@route='scopes.scope.credential-stores.new'
|
||||
@@ -20,7 +20,7 @@
|
||||
{{t 'titles.new'}}
|
||||
</Rose::LinkButton>
|
||||
{{/if}}
|
||||
</page.actions> --}}
|
||||
</page.actions>
|
||||
|
||||
<page.body>
|
||||
{{#if @model}}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{{page-title (t 'titles.new')}}
|
||||
|
||||
<Rose::Layout::Page as |page|>
|
||||
<page.breadcrumbs>
|
||||
<BreadCrumbs />
|
||||
</page.breadcrumbs>
|
||||
|
||||
<page.header>
|
||||
<h2>{{t 'titles.new'}}</h2>
|
||||
</page.header>
|
||||
|
||||
<page.body>
|
||||
<Form::CredentialStore
|
||||
@model={{@model}}
|
||||
@submit={{route-action 'save' @model}}
|
||||
@cancel={{route-action 'cancel' @model}}
|
||||
/>
|
||||
</page.body>
|
||||
|
||||
</Rose::Layout::Page>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Route | scopes/scope/credential-stores/new', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let route = this.owner.lookup('route:scopes/scope/credential-stores/new');
|
||||
assert.ok(route);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user