diff --git a/ui/desktop/app/router.js b/ui/desktop/app/router.js index bcf4938e5..afd04e391 100644 --- a/ui/desktop/app/router.js +++ b/ui/desktop/app/router.js @@ -13,7 +13,9 @@ Router.map(function () { this.route('method', { path: ':auth_method_id' }); }); this.route('projects', function () { - this.route('targets', function () {}); + this.route('targets', function () { + this.route('target', { path: ':target_id' }, function() {}); + }); this.route('sessions', function() {}); }); }); diff --git a/ui/desktop/app/routes/scopes/scope/projects/targets/target.js b/ui/desktop/app/routes/scopes/scope/projects/targets/target.js new file mode 100644 index 000000000..5031c8a4a --- /dev/null +++ b/ui/desktop/app/routes/scopes/scope/projects/targets/target.js @@ -0,0 +1,35 @@ +import Route from '@ember/routing/route'; + +export default class ScopesScopeProjectsTargetsTargetRoute extends Route { + // =methods + + /** + * Load a target. + * @param {object} params + * @param {string} params.target_id + * @return {TargetModel} + */ + async model({ target_id }) { + return this.store.findRecord('target', target_id, { reload: true }); + } + + /** + * Renders the target-specific templates for header and navigation + * page sections. + * @override + */ + renderTemplate() { + super.renderTemplate(...arguments); + + this.render('scopes/scope/projects/targets/target/-header', { + into: 'scopes/scope/projects/targets/target', + outlet: 'header', + }); + + this.render('scopes/scope/projects/targets/target/-navigation', { + into: 'scopes/scope/projects/targets/target', + outlet: 'navigation', + }); + + } +} diff --git a/ui/desktop/app/routes/scopes/scope/projects/targets/target/index.js b/ui/desktop/app/routes/scopes/scope/projects/targets/target/index.js new file mode 100644 index 000000000..2199146f8 --- /dev/null +++ b/ui/desktop/app/routes/scopes/scope/projects/targets/target/index.js @@ -0,0 +1,4 @@ +import Route from '@ember/routing/route'; + +export default class ScopesScopeProjectsTargetsTargetIndexRoute extends Route { +} diff --git a/ui/desktop/app/templates/scopes/scope/projects/targets/index.hbs b/ui/desktop/app/templates/scopes/scope/projects/targets/index.hbs index 8c3c463e5..bee6e9d46 100644 --- a/ui/desktop/app/templates/scopes/scope/projects/targets/index.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects/targets/index.hbs @@ -21,7 +21,12 @@ {{#each @model as |model|}}
{{model.target.description}}
{{model.description}}
\ No newline at end of file diff --git a/ui/desktop/app/templates/scopes/scope/projects/targets/target/-navigation.hbs b/ui/desktop/app/templates/scopes/scope/projects/targets/target/-navigation.hbs new file mode 100644 index 000000000..b27314ac2 --- /dev/null +++ b/ui/desktop/app/templates/scopes/scope/projects/targets/target/-navigation.hbs @@ -0,0 +1,5 @@ +