chore: 🤖 Add role CRUD forms to admin ui

This commit is contained in:
Susmitha Girumala committed 2020-06-22 21:39:38 -04:00
1 parent c563996a0c
commit 2b59aeee4b
32 files changed
+732

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import ApplicationAdapter from './application';
import ScopeAdapterMixin from '../mixins/scope-adapter';
export default class RoleAdapter extends ApplicationAdapter.extend(
ScopeAdapterMixin
) {
// =attributes
/**
* Role is scoped to org only, for now.
* @type {boolean}
*/
includeProject = false;
}
+1
View File
@@ -0,0 +1 @@
export { default } from 'api/adapters/role';
@@ -0,0 +1,16 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import config from 'ember-get-config';
module('Unit | Adapter | role', function(hooks) {
setupTest(hooks);
test('it generates URL prefixes without project scope', function (assert) {
assert.expect(1);
const service = this.owner.lookup('service:scope');
service.org = { id: 1 };
service.project = { id: 2 };
const adapter = this.owner.lookup('adapter:role');
assert.equal(adapter.urlPrefix(), `${config.api.namespace}/orgs/1`);
});
});