diff --git a/ui/core/app/router.js b/ui/core/app/router.js index 34435c631..a047d9042 100644 --- a/ui/core/app/router.js +++ b/ui/core/app/router.js @@ -31,6 +31,7 @@ Router.map(function () { }); this.route('targets', function() { this.route('target', { path: ':target_id' }, function() {}); + this.route('new'); }); }); this.route('new'); diff --git a/ui/core/app/routes/scopes/scope/projects/project/targets/new.js b/ui/core/app/routes/scopes/scope/projects/project/targets/new.js new file mode 100644 index 000000000..000752c13 --- /dev/null +++ b/ui/core/app/routes/scopes/scope/projects/project/targets/new.js @@ -0,0 +1,16 @@ +import Route from '@ember/routing/route'; + +export default class ScopesScopeProjectsProjectTargetsNewRoute extends Route { + + // =methods + + /** + * Creates a new unsaved target in current project scope. + * @return {TargetModel} + */ + model() { + const scopeModel = this.modelFor('scopes.scope.projects.project'); + return this.store.createRecord('target', { scopeModel }); + } + +} diff --git a/ui/core/app/templates/scopes/scope/projects/project/targets/index.hbs b/ui/core/app/templates/scopes/scope/projects/project/targets/index.hbs index 8d330854c..20b6f19ee 100644 --- a/ui/core/app/templates/scopes/scope/projects/project/targets/index.hbs +++ b/ui/core/app/templates/scopes/scope/projects/project/targets/index.hbs @@ -4,6 +4,14 @@
{{target.description}}
{{target.id}}
@@ -48,6 +58,10 @@