2020-12-10 18:10:16 +00:00
|
|
|
import { __ } from '~/locale';
|
2020-09-22 15:09:37 +00:00
|
|
|
|
2022-01-14 03:16:05 +00:00
|
|
|
export const FIELD_KEY_ACCOUNT = 'account';
|
|
|
|
export const FIELD_KEY_SOURCE = 'source';
|
|
|
|
export const FIELD_KEY_GRANTED = 'granted';
|
|
|
|
export const FIELD_KEY_INVITED = 'invited';
|
|
|
|
export const FIELD_KEY_REQUESTED = 'requested';
|
|
|
|
export const FIELD_KEY_MAX_ROLE = 'maxRole';
|
|
|
|
export const FIELD_KEY_EXPIRATION = 'expiration';
|
|
|
|
export const FIELD_KEY_LAST_SIGN_IN = 'lastSignIn';
|
|
|
|
export const FIELD_KEY_ACTIONS = 'actions';
|
|
|
|
|
2020-09-22 15:09:37 +00:00
|
|
|
export const FIELDS = [
|
|
|
|
{
|
2022-01-14 03:16:05 +00:00
|
|
|
key: FIELD_KEY_ACCOUNT,
|
2020-09-22 15:09:37 +00:00
|
|
|
label: __('Account'),
|
2020-12-08 09:09:41 +00:00
|
|
|
sort: {
|
2020-12-10 18:10:16 +00:00
|
|
|
asc: 'name_asc',
|
|
|
|
desc: 'name_desc',
|
2020-12-08 09:09:41 +00:00
|
|
|
},
|
2020-09-22 15:09:37 +00:00
|
|
|
},
|
|
|
|
{
|
2022-01-14 03:16:05 +00:00
|
|
|
key: FIELD_KEY_SOURCE,
|
2020-09-22 15:09:37 +00:00
|
|
|
label: __('Source'),
|
|
|
|
thClass: 'col-meta',
|
|
|
|
tdClass: 'col-meta',
|
|
|
|
},
|
|
|
|
{
|
2022-01-14 03:16:05 +00:00
|
|
|
key: FIELD_KEY_GRANTED,
|
2020-09-22 15:09:37 +00:00
|
|
|
label: __('Access granted'),
|
|
|
|
thClass: 'col-meta',
|
|
|
|
tdClass: 'col-meta',
|
2020-12-08 09:09:41 +00:00
|
|
|
sort: {
|
2020-12-10 18:10:16 +00:00
|
|
|
asc: 'last_joined',
|
|
|
|
desc: 'oldest_joined',
|
2020-12-08 09:09:41 +00:00
|
|
|
},
|
2020-09-22 15:09:37 +00:00
|
|
|
},
|
|
|
|
{
|
2022-01-14 03:16:05 +00:00
|
|
|
key: FIELD_KEY_INVITED,
|
2020-09-22 15:09:37 +00:00
|
|
|
label: __('Invited'),
|
|
|
|
thClass: 'col-meta',
|
|
|
|
tdClass: 'col-meta',
|
|
|
|
},
|
|
|
|
{
|
2022-01-14 03:16:05 +00:00
|
|
|
key: FIELD_KEY_REQUESTED,
|
2020-09-22 15:09:37 +00:00
|
|
|
label: __('Requested'),
|
|
|
|
thClass: 'col-meta',
|
|
|
|
tdClass: 'col-meta',
|
|
|
|
},
|
|
|
|
{
|
2022-01-14 03:16:05 +00:00
|
|
|
key: FIELD_KEY_MAX_ROLE,
|
2020-09-22 15:09:37 +00:00
|
|
|
label: __('Max role'),
|
2020-10-13 15:08:53 +00:00
|
|
|
thClass: 'col-max-role',
|
|
|
|
tdClass: 'col-max-role',
|
2020-12-08 09:09:41 +00:00
|
|
|
sort: {
|
2020-12-10 18:10:16 +00:00
|
|
|
asc: 'access_level_asc',
|
|
|
|
desc: 'access_level_desc',
|
2020-12-08 09:09:41 +00:00
|
|
|
},
|
2020-09-22 15:09:37 +00:00
|
|
|
},
|
|
|
|
{
|
2022-01-14 03:16:05 +00:00
|
|
|
key: FIELD_KEY_EXPIRATION,
|
2020-09-22 15:09:37 +00:00
|
|
|
label: __('Expiration'),
|
|
|
|
thClass: 'col-expiration',
|
|
|
|
tdClass: 'col-expiration',
|
|
|
|
},
|
2020-12-08 09:09:41 +00:00
|
|
|
{
|
2022-01-14 03:16:05 +00:00
|
|
|
key: FIELD_KEY_LAST_SIGN_IN,
|
2020-12-10 18:10:16 +00:00
|
|
|
label: __('Last sign-in'),
|
2020-12-08 09:09:41 +00:00
|
|
|
sort: {
|
2020-12-10 18:10:16 +00:00
|
|
|
asc: 'recent_sign_in',
|
|
|
|
desc: 'oldest_sign_in',
|
2020-12-08 09:09:41 +00:00
|
|
|
},
|
|
|
|
},
|
2020-09-22 15:09:37 +00:00
|
|
|
{
|
2022-01-14 03:16:05 +00:00
|
|
|
key: FIELD_KEY_ACTIONS,
|
2020-09-22 15:09:37 +00:00
|
|
|
thClass: 'col-actions',
|
|
|
|
},
|
|
|
|
];
|
2020-09-25 06:09:42 +00:00
|
|
|
|
2020-12-08 09:09:41 +00:00
|
|
|
export const DEFAULT_SORT = {
|
2020-12-10 18:10:16 +00:00
|
|
|
sortByKey: 'account',
|
2020-12-08 09:09:41 +00:00
|
|
|
sortDesc: false,
|
|
|
|
};
|
|
|
|
|
2020-09-25 06:09:42 +00:00
|
|
|
export const AVATAR_SIZE = 48;
|
|
|
|
|
|
|
|
export const MEMBER_TYPES = {
|
|
|
|
user: 'user',
|
|
|
|
group: 'group',
|
|
|
|
invite: 'invite',
|
|
|
|
accessRequest: 'accessRequest',
|
|
|
|
};
|
2020-09-30 09:10:11 +00:00
|
|
|
|
2021-06-23 03:07:43 +00:00
|
|
|
export const TAB_QUERY_PARAM_VALUES = {
|
|
|
|
group: 'groups',
|
|
|
|
invite: 'invited',
|
|
|
|
accessRequest: 'access_requests',
|
|
|
|
};
|
|
|
|
|
2021-10-13 12:12:20 +00:00
|
|
|
/**
|
|
|
|
* This user state value comes from the User model
|
|
|
|
* see the state machine in app/models/user.rb
|
|
|
|
*/
|
|
|
|
export const USER_STATE_BLOCKED_PENDING_APPROVAL = 'blocked_pending_approval';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This and following member state constants' values
|
|
|
|
* come from ee/app/models/ee/member.rb
|
|
|
|
*/
|
|
|
|
export const MEMBER_STATE_CREATED = 0;
|
|
|
|
export const MEMBER_STATE_AWAITING = 1;
|
|
|
|
export const MEMBER_STATE_ACTIVE = 2;
|
|
|
|
|
2022-01-25 21:15:18 +00:00
|
|
|
export const BADGE_LABELS_AWAITING_USER_SIGNUP = __('Awaiting user signup');
|
2021-10-13 12:12:20 +00:00
|
|
|
export const BADGE_LABELS_PENDING_OWNER_APPROVAL = __('Pending owner approval');
|
|
|
|
|
2020-09-30 09:10:11 +00:00
|
|
|
export const DAYS_TO_EXPIRE_SOON = 7;
|
2020-10-12 18:08:31 +00:00
|
|
|
|
|
|
|
export const LEAVE_MODAL_ID = 'member-leave-modal';
|
2020-10-16 15:08:46 +00:00
|
|
|
|
|
|
|
export const REMOVE_GROUP_LINK_MODAL_ID = 'remove-group-link-modal-id';
|
2020-12-03 06:09:47 +00:00
|
|
|
|
|
|
|
export const SEARCH_TOKEN_TYPE = 'filtered-search-term';
|
|
|
|
|
2021-06-23 03:07:43 +00:00
|
|
|
export const SORT_QUERY_PARAM_NAME = 'sort';
|
|
|
|
export const ACTIVE_TAB_QUERY_PARAM_NAME = 'tab';
|
2021-01-21 12:09:05 +00:00
|
|
|
|
|
|
|
export const MEMBER_ACCESS_LEVEL_PROPERTY_NAME = 'access_level';
|
|
|
|
|
|
|
|
export const GROUP_LINK_BASE_PROPERTY_NAME = 'group_link';
|
|
|
|
export const GROUP_LINK_ACCESS_LEVEL_PROPERTY_NAME = 'group_access';
|