debian-mirror-gitlab/spec/frontend/members/mock_data.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

129 lines
3.3 KiB
JavaScript
Raw Normal View History

2021-11-18 22:05:49 +05:30
import { MEMBER_TYPES, MEMBER_STATE_CREATED } from '~/members/constants';
2021-09-04 01:27:46 +05:30
2021-01-03 14:25:43 +05:30
export const member = {
requestedAt: null,
canUpdate: false,
canRemove: false,
canOverride: false,
2021-01-29 00:20:46 +05:30
isOverridden: false,
2021-03-11 19:13:27 +05:30
isDirectMember: false,
2021-01-03 14:25:43 +05:30
accessLevel: { integerValue: 50, stringValue: 'Owner' },
source: {
id: 178,
2021-03-08 18:12:59 +05:30
fullName: 'Foo Bar',
2021-01-03 14:25:43 +05:30
webUrl: 'https://gitlab.com/groups/foo-bar',
},
2021-04-29 21:17:54 +05:30
type: 'GroupMember',
2021-11-18 22:05:49 +05:30
state: MEMBER_STATE_CREATED,
2021-01-03 14:25:43 +05:30
user: {
id: 123,
2022-06-21 17:19:12 +05:30
createdAt: '2022-03-10T18:03:04.812Z',
2021-01-03 14:25:43 +05:30
name: 'Administrator',
username: 'root',
webUrl: 'https://gitlab.com/root',
avatarUrl: 'https://www.gravatar.com/avatar/4816142ef496f956a277bedf1a40607b?s=80&d=identicon',
blocked: false,
twoFactorEnabled: false,
2021-04-29 21:17:54 +05:30
oncallSchedules: [{ name: 'schedule 1' }],
2021-11-18 22:05:49 +05:30
escalationPolicies: [{ name: 'policy 1' }],
2022-04-04 11:22:00 +05:30
availability: null,
2022-06-21 17:19:12 +05:30
lastActivityOn: '2022-03-15',
2022-04-04 11:22:00 +05:30
showStatus: true,
2021-01-03 14:25:43 +05:30
},
id: 238,
createdAt: '2020-07-17T16:22:46.923Z',
expiresAt: null,
usingLicense: false,
groupSso: false,
groupManagedAccount: false,
2021-09-04 01:27:46 +05:30
provisionedByThisGroup: false,
2021-01-03 14:25:43 +05:30
validRoles: {
Guest: 10,
Reporter: 20,
Developer: 30,
Maintainer: 40,
Owner: 50,
2021-12-11 22:18:48 +05:30
'Minimal access': 5,
2021-01-03 14:25:43 +05:30
},
};
export const group = {
accessLevel: { integerValue: 10, stringValue: 'Guest' },
sharedWithGroup: {
id: 24,
name: 'Commit451',
avatarUrl: '/uploads/-/system/user/avatar/1/avatar.png?width=40',
fullPath: 'parent-group/commit451',
fullName: 'Parent group / Commit451',
webUrl: 'https://gitlab.com/groups/parent-group/commit451',
},
id: 3,
2022-06-21 17:19:12 +05:30
isDirectMember: true,
2021-01-03 14:25:43 +05:30
createdAt: '2020-08-06T15:31:07.662Z',
expiresAt: null,
validRoles: { Guest: 10, Reporter: 20, Developer: 30, Maintainer: 40, Owner: 50 },
};
2021-10-27 15:23:28 +05:30
export const modalData = {
isAccessRequest: true,
isInvite: true,
memberPath: '/groups/foo-bar/-/group_members/1',
memberType: 'GroupMember',
message: 'Are you sure you want to remove John Smith?',
2021-11-18 22:05:49 +05:30
userDeletionObstacles: { name: 'user', obstacles: [] },
2021-10-27 15:23:28 +05:30
};
2021-01-03 14:25:43 +05:30
const { user, ...memberNoUser } = member;
export const invite = {
...memberNoUser,
2021-11-18 22:05:49 +05:30
state: MEMBER_STATE_CREATED,
2021-01-03 14:25:43 +05:30
invite: {
email: 'jewel@hudsonwalter.biz',
avatarUrl: 'https://www.gravatar.com/avatar/cbab7510da7eec2f60f638261b05436d?s=80&d=identicon',
canResend: true,
},
};
export const orphanedMember = memberNoUser;
export const accessRequest = {
...member,
requestedAt: '2020-07-17T16:22:46.923Z',
};
export const members = [member];
2021-03-11 19:13:27 +05:30
export const membersJsonString = JSON.stringify(members);
export const directMember = { ...member, isDirectMember: true };
export const inheritedMember = { ...member, isDirectMember: false };
2021-04-17 20:07:23 +05:30
export const member2faEnabled = { ...member, user: { ...member.user, twoFactorEnabled: true } };
2021-06-08 01:23:25 +05:30
export const paginationData = {
current_page: 1,
per_page: 5,
total_items: 10,
param_name: 'page',
params: { search_groups: null },
};
export const pagination = {
currentPage: 1,
perPage: 5,
totalItems: 10,
paramName: 'page',
params: { search_groups: null },
};
export const dataAttribute = JSON.stringify({
2021-09-04 01:27:46 +05:30
[MEMBER_TYPES.user]: {
members,
pagination: paginationData,
member_path: '/groups/foo-bar/-/group_members/:id',
ldap_override_path: '/groups/ldap-group/-/group_members/:id/override',
},
2021-06-08 01:23:25 +05:30
source_id: 234,
can_manage_members: true,
});