diff --git a/ui/admin/app/routes/scopes/scope/roles/role/index.js b/ui/admin/app/routes/scopes/scope/roles/role/index.js index 8b39b2808..4d64d1d8b 100644 --- a/ui/admin/app/routes/scopes/scope/roles/role/index.js +++ b/ui/admin/app/routes/scopes/scope/roles/role/index.js @@ -17,14 +17,20 @@ export default class ScopesScopeRolesRoleIndexRoute extends Route { */ async afterModel() { const currentScope = this.modelFor('scopes.scope'); - const subScopes = currentScope.isProject - ? [] - : (await this.store.query('scope', { scope_id: currentScope.id })).map( - (scope) => ({ - model: scope, - subScopes: this.store.query('scope', { scope_id: scope.id }), - }) - ); + const scopes = await this.store.query('scope', { + scope_id: currentScope.id, + }); + let subScopes = []; + //await the store query to fix ember's proxy promise deprecation warning + if (!currentScope.isProject) { + subScopes = await Promise.all( + scopes.map(async (scope) => ({ + model: scope, + subScopes: await this.store.query('scope', { scope_id: scope.id }), + })) + ); + } + const grantScopes = [ { model: currentScope, diff --git a/yarn.lock b/yarn.lock index 4a0f0a253..03e4e4272 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18913,7 +18913,7 @@ react-dom@^16: prop-types "^15.6.2" scheduler "^0.19.1" -react-is@^16.13.1: +react-is@^16.13.1, react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==