Feature cross scope group members (#1196)

* chore: 🤖 add scope column to role principals and group members

* chore: 🤖 add recursion and filtering to user and group mocks

* feat: 🎸 expose groups and roles on projects

* feat: 🎸 enable cross-scope assignment of group members
This commit is contained in:
Randall Morey authored and GitHub committed 2022-07-18 16:36:43 -07:00
1 parent 31cf696902
commit 94530cec9c
5 files changed
+13 -9

No files matched your search

@@ -62,9 +62,6 @@
<row.cell>
<ScopeBadge @scope={{principal.scopeModel}} />
</row.cell>
<row.cell>
<ScopeBadge @scope={{principal.scopeModel}} />
</row.cell>
<row.cell>{{principal.description}}</row.cell>
</body.row>
{{/each}}
+6 -1
View File
@@ -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([]));
@@ -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 }),
});
}
@@ -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);
});