add user group mocks
This commit is contained in:
@@ -11,6 +11,7 @@ import { handlers as userHandlers } from './domains/user.handlers';
|
||||
import { handlers as telemetryHandlers } from './domains/telemetry.handlers';
|
||||
import { handlers as propertyEditorHandlers } from './domains/property-editor.handlers';
|
||||
import { handlers as usersHandlers } from './domains/users.handlers';
|
||||
import { handlers as userGroupsHandlers } from './domains/user-groups.handlers';
|
||||
|
||||
const handlers = [
|
||||
serverHandlers.serverVersionHandler,
|
||||
@@ -26,6 +27,7 @@ const handlers = [
|
||||
...telemetryHandlers,
|
||||
...publishedStatusHandlers,
|
||||
...usersHandlers,
|
||||
...userGroupsHandlers,
|
||||
];
|
||||
|
||||
switch (import.meta.env.VITE_UMBRACO_INSTALL_STATUS) {
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import { rest } from 'msw';
|
||||
import type { UserGroupDetails } from '../../core/models';
|
||||
|
||||
export const handlers = [
|
||||
rest.get('/umbraco/backoffice/user-groups/list/items', (req, res, ctx) => {
|
||||
const items = fakeData;
|
||||
|
||||
const response = {
|
||||
total: items.length,
|
||||
items,
|
||||
};
|
||||
|
||||
return res(ctx.status(200), ctx.json(response));
|
||||
}),
|
||||
];
|
||||
|
||||
const fakeData: Array<UserGroupDetails> = [
|
||||
{
|
||||
key: '10000000-0000-0000-0000-000000000000',
|
||||
name: 'Administrators',
|
||||
icon: 'umb:medal',
|
||||
parentKey: '',
|
||||
type: 'userGroup',
|
||||
hasChildren: false,
|
||||
isTrashed: false,
|
||||
},
|
||||
{
|
||||
key: '20000000-0000-0000-0000-000000000000',
|
||||
name: 'Editors',
|
||||
icon: 'umb:tools',
|
||||
parentKey: '',
|
||||
type: 'userGroup',
|
||||
hasChildren: false,
|
||||
isTrashed: false,
|
||||
},
|
||||
{
|
||||
key: '20000000-0000-0000-0000-000000000000',
|
||||
name: 'Sensitive Data',
|
||||
icon: 'umb:lock',
|
||||
parentKey: '',
|
||||
type: 'userGroup',
|
||||
hasChildren: false,
|
||||
isTrashed: false,
|
||||
},
|
||||
{
|
||||
key: '20000000-0000-0000-0000-000000000000',
|
||||
name: 'Translators',
|
||||
icon: 'umb:globe',
|
||||
parentKey: '',
|
||||
type: 'userGroup',
|
||||
hasChildren: false,
|
||||
isTrashed: false,
|
||||
},
|
||||
{
|
||||
key: '20000000-0000-0000-0000-000000000000',
|
||||
name: 'Writers',
|
||||
icon: 'umb:edit',
|
||||
parentKey: '',
|
||||
type: 'userGroup',
|
||||
hasChildren: false,
|
||||
isTrashed: false,
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user