chore: 🤖 setup initial add-principals route

This commit is contained in:
Randall Morey committed 2020-08-31 15:10:10 -04:00
1 parent 444a621bcf
commit 67de48a137
9 files changed
+81

No files matched your search

@@ -0,0 +1,20 @@
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
export default class ScopesScopeRolesRoleAddPrincipalsController extends Controller {
// =services
@service intl;
// =attributes
/**
* Translated roles breadcrumb
* @type {string}
*/
get breadCrumb() {
return this.intl.t('actions.add-principals');
}
}
+1
View File
@@ -62,6 +62,7 @@ Router.map(function () {
this.route('role', { path: ':role_id' }, function () {
this.route('grants');
this.route('principals');
this.route('add-principals');
});
this.route('new');
});
@@ -0,0 +1,29 @@
import Route from '@ember/routing/route';
export default class ScopesScopeRolesRoleAddPrincipalsRoute extends Route {
// =methods
/**
* Empties the actions and navigation outlets and renders a custom header.
* @override
*/
renderTemplate() {
super.renderTemplate(...arguments);
this.render('scopes/scope/roles/role/add-principals/-header', {
into: 'scopes/scope/roles/role',
outlet: 'header'
});
this.render('-empty', {
into: 'scopes/scope/roles/role',
outlet: 'actions'
});
this.render('-empty', {
into: 'scopes/scope/roles/role',
outlet: 'navigation'
});
}
}
@@ -1,4 +1,7 @@
<Rose::Dropdown @text="{{t 'actions.manage'}}" @dropdownRight={{true}} as |dropdown|>
<dropdown.link @route="scopes.scope.roles.role.add-principals">
{{t 'actions.add-principals'}}
</dropdown.link>
<dropdown.button
@style="danger"
@disabled={{@model.canSave}}
@@ -0,0 +1,3 @@
{{title (t "actions.add-principals")}}
{{outlet}}
@@ -0,0 +1 @@
<h2>{{t "actions.add-principals"}}</h2>
@@ -0,0 +1,12 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Controller | scopes/scope/roles/role/add-principals', function(hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.owner.lookup('controller:scopes/scope/roles/role/add-principals');
assert.ok(controller);
});
});
@@ -0,0 +1,11 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Route | scopes/scope/roles/role/add-principals', function(hooks) {
setupTest(hooks);
test('it exists', function(assert) {
let route = this.owner.lookup('route:scopes/scope/roles/role/add-principals');
assert.ok(route);
});
});
+1
View File
@@ -23,6 +23,7 @@ actions:
add-host-set: Create Host Set
add-host: Create Host
add-host-sets: Add Host Sets
add-principals: Add Principals
auth:
titles:
no-scopes: No Scopes Available