Files
threshold-ui/addons/api/mirage/factories/managed-group.js
T

27 lines
574 B
JavaScript
Raw Normal View History

2021-11-04 16:26:09 -07:00
import factory from '../generated/factories/managed-group';
2021-11-10 09:07:17 -08:00
import { random } from 'faker';
2021-10-29 13:23:41 -07:00
import permissions from '../helpers/permissions';
2021-11-10 16:12:42 -05:00
const types = ['oidc'];
2021-10-29 13:23:41 -07:00
export default factory.extend({
id: (i) => `managed-groups-id-${i}`,
2021-11-10 16:12:42 -05:00
type: (i) => types[i % types.length],
2021-10-29 13:23:41 -07:00
authorized_actions: () =>
2021-11-04 16:26:09 -07:00
permissions.authorizedActionsFor('managed-group') || [
2021-10-29 13:23:41 -07:00
'no-op',
'read',
'update',
'delete',
],
2021-11-10 09:07:17 -08:00
attributes() {
switch (this.type) {
case 'oidc':
return {
2021-11-10 16:12:42 -05:00
filter: random.words(),
2021-11-10 09:07:17 -08:00
};
}
},
2021-10-29 13:23:41 -07:00
});