Icu 13880 create manage scopes route and view with keyword values (#2342)

* feat: 🎸 manage scopes route and page

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13880

* Update addons/core/translations/resources/en-us.yaml

Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>

* Update ui/admin/app/abilities/role.js

Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>

* Update ui/admin/app/components/form/role/manage-scopes/index.hbs

Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
---------

Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
This commit is contained in:
Lisbet AlvarezandZhihe Li authored and Lisbet Alvarez committed 2024-07-15 17:23:00 -07:00
1 parent 85bce84356
commit 89e072401c
18 files changed
+536 -16

No files matched your search

@@ -23,6 +23,7 @@ export default class GeneratedRoleModel extends BaseModel {
description;
@attr('array', {
emptyArrayIfMissing: true,
description:
"The scopes to which this role applies. Defaults to the role's scope.",
})
@@ -97,6 +97,8 @@ module('Unit | Serializer | role', function (hooks) {
id: '1',
name: 'Role 1',
grant_strings: ['*', '*'],
grant_scope_ids: ['*', '*'],
principals: ['*'],
};
const normalized = serializer.normalizeSingleResponse(
store,
@@ -112,14 +114,15 @@ module('Unit | Serializer | role', function (hooks) {
authorized_actions: [],
name: 'Role 1',
grant_strings: ['*', '*'],
principals: [],
grant_scope_ids: ['*', '*'],
principals: ['*'],
},
relationships: {},
},
});
});
test('it normalizes missing principals to empty array', function (assert) {
test('it normalizes missing arrays to empty array', function (assert) {
const store = this.owner.lookup('service:store');
const serializer = store.serializerFor('role');
const role = store.createRecord('role').constructor;
@@ -140,6 +143,7 @@ module('Unit | Serializer | role', function (hooks) {
scope: { id: 'o_123', scope_id: 'o_123' },
principals: [],
grant_strings: [],
grant_scope_ids: [],
},
relationships: {},
},