From ee6c6626c990bbb235aa493dc79b3ff7350306f4 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 28 Jul 2020 12:21:45 -0400 Subject: [PATCH] chore: add new host catalog logic --- .../projects/project/host-catalogs/new.js | 12 ++++++++++ .../projects/project/host-catalogs/new.hbs | 22 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/new.js b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/new.js index 9e076cd1d..923eb7ac3 100644 --- a/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/new.js +++ b/ui/core/app/routes/scopes/scope/projects/project/host-catalogs/new.js @@ -1,4 +1,16 @@ import Route from '@ember/routing/route'; export default class ScopesScopeProjectsProjectHostCatalogsNewRoute extends Route { + + // =methods + + /** + * Creates a new unsaved host catalog belonging to the current project scope. + * @return {HostCatalogModel} + */ + model() { + const scopeID = this.modelFor('scopes.scope.projects.project').id; + return this.store.createRecord('host-catalog', { scopeID }); + } + } diff --git a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/new.hbs b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/new.hbs index e2147cab0..0d969f874 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/new.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/host-catalogs/new.hbs @@ -1 +1,21 @@ -{{outlet}} \ No newline at end of file +{{title (t 'titles.new')}} + + + + + + + + +

{{t "titles.new"}}

+
+ + + + + +