From 3b4bb24eb7d13efb811829ceb7daa957518a0eed Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Thu, 15 Jul 2021 09:36:32 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Add=20credential=20store?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add screen to create new credential store --- ui/admin/app/router.js | 1 + .../scopes/scope/credential-stores/new.js | 14 +++++++++++++ .../scopes/scope/credential-stores/index.hbs | 4 ++-- .../scopes/scope/credential-stores/new.hbs | 20 +++++++++++++++++++ .../scope/credential-stores/new-test.js | 11 ++++++++++ 5 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 ui/admin/app/routes/scopes/scope/credential-stores/new.js create mode 100644 ui/admin/app/templates/scopes/scope/credential-stores/new.hbs create mode 100644 ui/admin/tests/unit/routes/scopes/scope/credential-stores/new-test.js diff --git a/ui/admin/app/router.js b/ui/admin/app/router.js index 21a7859c7..665582957 100644 --- a/ui/admin/app/router.js +++ b/ui/admin/app/router.js @@ -92,6 +92,7 @@ Router.map(function () { { path: ':credential_store_id' }, function () {} ); + this.route('new'); }); }); }); diff --git a/ui/admin/app/routes/scopes/scope/credential-stores/new.js b/ui/admin/app/routes/scopes/scope/credential-stores/new.js new file mode 100644 index 000000000..fecb9bb9b --- /dev/null +++ b/ui/admin/app/routes/scopes/scope/credential-stores/new.js @@ -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, + }); + } +} diff --git a/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs b/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs index 0e2177ff1..c8ff3b098 100644 --- a/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs +++ b/ui/admin/app/templates/scopes/scope/credential-stores/index.hbs @@ -11,7 +11,7 @@

{{t 'resources.credential-store.description'}}

- {{!-- + {{#if @model}} {{/if}} - --}} + {{#if @model}} diff --git a/ui/admin/app/templates/scopes/scope/credential-stores/new.hbs b/ui/admin/app/templates/scopes/scope/credential-stores/new.hbs new file mode 100644 index 000000000..cb38701d9 --- /dev/null +++ b/ui/admin/app/templates/scopes/scope/credential-stores/new.hbs @@ -0,0 +1,20 @@ +{{page-title (t 'titles.new')}} + + + + + + + +

{{t 'titles.new'}}

+
+ + + + + +
\ No newline at end of file diff --git a/ui/admin/tests/unit/routes/scopes/scope/credential-stores/new-test.js b/ui/admin/tests/unit/routes/scopes/scope/credential-stores/new-test.js new file mode 100644 index 000000000..ea136c333 --- /dev/null +++ b/ui/admin/tests/unit/routes/scopes/scope/credential-stores/new-test.js @@ -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); + }); +});