feat: 🎸 Add credential store

Add screen to create new credential store
This commit is contained in:
Carlos Alcaide committed 2021-07-16 09:24:22 -07:00
1 parent 2217482329
commit 3b4bb24eb7
5 files changed
+48 -2

No files matched your search

+1
View File
@@ -92,6 +92,7 @@ Router.map(function () {
{ path: ':credential_store_id' },
function () {}
);
this.route('new');
});
});
});
@@ -0,0 +1,14 @@
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', {
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);
});
});