From 57ac747762f001cd38dbe3d73eff6d8dfb191441 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Mon, 2 Nov 2020 16:55:03 -0500 Subject: [PATCH] chore: add grant_scope_id to model and mocks --- addons/api/addon/generated/models/role.js | 5 +++++ ui/core/mirage/factories/role.js | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/addons/api/addon/generated/models/role.js b/addons/api/addon/generated/models/role.js index 5d8f2bddc..3632696a4 100644 --- a/addons/api/addon/generated/models/role.js +++ b/addons/api/addon/generated/models/role.js @@ -17,6 +17,11 @@ export default class GeneratedRoleModel extends BaseModel { }) description; + @attr('string', { + description: 'The scope to which this role applies. Defaults to the role\'s scope.', + }) + grant_scope_id; + @attr('date', { description: 'The time this resource was created\nOutput only.', readOnly: true, diff --git a/ui/core/mirage/factories/role.js b/ui/core/mirage/factories/role.js index 87eb39092..aa4356af7 100644 --- a/ui/core/mirage/factories/role.js +++ b/ui/core/mirage/factories/role.js @@ -19,6 +19,14 @@ export default factory.extend({ const groups = server.createList('group', 2, { scope }); role.update({ users, groups }); } - }) + }), + + /** + * Set the grant scope ID to match the scope ID. + */ + afterCreate(role) { + const { scope: { id } } = role; + role.update({ grant_scope_id: id }); + } });