Files
threshold-ui/ui/core/mirage/scenarios/default.js
T

34 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-05-19 18:10:39 -04:00
export default function(server) {
// Scope resources
2020-06-04 16:53:37 -04:00
// creates a global scope
const globalScope = server.create('scope', {
id: 'global',
type: 'global',
name: 'Global'
});
const orgScope = server.createList('scope', 3, {
type: 'org',
scope: { id: globalScope.id, type: globalScope.type }
}, 'withChildren')[0];
2020-06-18 15:51:40 -04:00
// Auth
2020-10-26 11:17:03 -04:00
server.createList('auth-method', 1, { scope: globalScope }, 'withAccountsAndUsers');
2020-09-30 10:45:39 -04:00
server.createList('auth-method', 3, { scope: orgScope }, 'withAccountsAndUsers');
2020-05-19 18:10:39 -04:00
2020-09-01 12:03:36 -04:00
// Groups and Users
2020-10-26 11:17:03 -04:00
server.createList('group', 1, { scope: globalScope }, 'withMembers');
2020-09-09 16:24:48 -04:00
server.createList('group', 5, { scope: orgScope }, 'withMembers');
2020-08-12 13:41:23 -04:00
// Role
2020-10-26 11:17:03 -04:00
server.createList('role', 1, { scope: globalScope }, 'withPrincipals');
2020-09-10 11:03:44 -04:00
server.createList('role', 5, { scope: orgScope }, 'withPrincipals');
2020-06-22 21:39:38 -04:00
// Other resources
2020-09-04 08:41:28 -04:00
server.schema.scopes.where({type: 'project'}).models.forEach(scope => {
server.createList('host-catalog', 2, { scope }, 'withChildren');
2020-08-25 15:45:51 -04:00
server.createList('target', 2, { scope }, 'withRandomHostSets');
2020-09-18 12:54:31 -04:00
server.createList('session', 4, { scope }, 'withAssociations');
2020-07-28 11:06:06 -04:00
});
2020-05-19 18:10:39 -04:00
}