diff --git a/addons/api/mirage/scenarios/default.js b/addons/api/mirage/scenarios/default.js
index f03170eb4..368d1299e 100644
--- a/addons/api/mirage/scenarios/default.js
+++ b/addons/api/mirage/scenarios/default.js
@@ -17,7 +17,7 @@ export default function (server) {
'withChildren'
)[0];
- server.create('user', { id: 'authenticateduser' });
+ server.create('user', { id: 'authenticateduser', scope: globalScope });
// Auth
const globalAuthMethods = server.createList(
diff --git a/ui/admin/app/components/form/role/add-principals/index.hbs b/ui/admin/app/components/form/role/add-principals/index.hbs
index 9fa698c63..546ff86d8 100644
--- a/ui/admin/app/components/form/role/add-principals/index.hbs
+++ b/ui/admin/app/components/form/role/add-principals/index.hbs
@@ -62,9 +62,6 @@
-
-
-
{{principal.description}}
{{/each}}
diff --git a/ui/admin/app/routes/scopes.js b/ui/admin/app/routes/scopes.js
index 4f53d4955..d9ac05ba9 100644
--- a/ui/admin/app/routes/scopes.js
+++ b/ui/admin/app/routes/scopes.js
@@ -13,7 +13,12 @@ export default class ScopesRoute extends Route {
* @param {string} params.scope_id
* @return {Promise{[ScopeModel]}}
*/
- model() {
+ async model() {
+ // Always preload the global scope, if possible, since the query below
+ // only fetches org scopes.
+ await this.store.findRecord('scope', 'global').catch(() => {
+ /* no op */
+ });
// NOTE: In the absence of a `scope_id` query parameter, this endpoint is
// expected to default to the global scope, thus returning org scopes.
return this.store.findAll('scope').catch(() => A([]));
diff --git a/ui/admin/app/routes/scopes/scope/groups/group/add-members.js b/ui/admin/app/routes/scopes/scope/groups/group/add-members.js
index 7629c17d9..4906130cd 100644
--- a/ui/admin/app/routes/scopes/scope/groups/group/add-members.js
+++ b/ui/admin/app/routes/scopes/scope/groups/group/add-members.js
@@ -26,11 +26,10 @@ export default class ScopesScopeGroupsGroupAddMembersRoute extends Route {
* @return {Promise{GroupModel, [UserModel]}}
*/
model() {
- const group = this.modelFor('scopes.scope.groups.group');
- const { scopeID: scope_id } = group;
return hash({
group: this.modelFor('scopes.scope.groups.group'),
- users: this.store.query('user', { scope_id }),
+ // load all users from all scopes
+ users: this.store.query('user', { scope_id: 'global', recursive: true }),
});
}
diff --git a/ui/admin/tests/acceptance/authentication-test.js b/ui/admin/tests/acceptance/authentication-test.js
index df8b7ad9b..130a40d84 100644
--- a/ui/admin/tests/acceptance/authentication-test.js
+++ b/ui/admin/tests/acceptance/authentication-test.js
@@ -7,7 +7,7 @@ import {
find,
findAll,
getRootElement,
- //setupOnerror,
+ setupOnerror,
} from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
@@ -115,6 +115,9 @@ module('Acceptance | authentication', function (hooks) {
test('visiting auth method when the scope cannot be loaded is still allowed', async function (assert) {
assert.expect(1);
+ setupOnerror(() => {
+ // do nothing, otherwise an uncaught adapter error will fail the test
+ });
this.server.get('/scopes', () => {
return new Response(404);
});