constants.js 2.4 KB
Newer Older
1
import { __, s__ } from '~/locale';
2

3 4
export const TYPE_USER = 'user';
export const TYPE_GROUP = 'group';
Mark Chao's avatar
Mark Chao committed
5
export const TYPE_HIDDEN_GROUPS = 'hidden_groups';
6

7 8 9 10 11 12
export const BRANCH_FETCH_DELAY = 250;
export const ANY_BRANCH = {
  id: null,
  name: __('Any branch'),
};

13 14
export const RULE_TYPE_FALLBACK = 'fallback';
export const RULE_TYPE_REGULAR = 'regular';
15
export const RULE_TYPE_REPORT_APPROVER = 'report_approver';
16
export const RULE_TYPE_CODE_OWNER = 'code_owner';
17 18
export const RULE_TYPE_ANY_APPROVER = 'any_approver';
export const RULE_NAME_ANY_APPROVER = 'All Members';
19 20 21

export const VULNERABILITY_CHECK_NAME = 'Vulnerability-Check';
export const LICENSE_CHECK_NAME = 'License-Check';
22
export const COVERAGE_CHECK_NAME = 'Coverage-Check';
23

24
export const LICENSE_SCANNING = 'license_scanning';
Fernando's avatar
Fernando committed
25

26 27
export const APPROVAL_RULE_CONFIGS = {
  [VULNERABILITY_CHECK_NAME]: {
28 29 30
    title: s__('SecurityApprovals|Vulnerability-Check'),
    popoverText: s__(
      'SecurityApprovals|A merge request approval is required when a security report contains a new vulnerability of high, critical, or unknown severity.',
31
    ),
32
    documentationText: s__('SecurityApprovals|Learn more about Vulnerability-Check'),
33 34
  },
  [LICENSE_CHECK_NAME]: {
35 36 37
    title: s__('SecurityApprovals|License-Check'),
    popoverText: s__(
      'SecurityApprovals|A merge request approval is required when the license compliance report contains a denied license.',
38
    ),
39 40 41 42 43 44 45 46
    documentationText: s__('SecurityApprovals|Learn more about License-Check'),
  },
  [COVERAGE_CHECK_NAME]: {
    title: s__('SecurityApprovals|Coverage-Check'),
    popoverText: s__(
      'SecurityApprovals|A merge request approval is required when test coverage declines.',
    ),
    documentationText: s__('SecurityApprovals|Learn more about Coverage-Check'),
47 48
  },
};
49 50

export const APPROVALS_HELP_PATH = 'user/project/merge_requests/merge_request_approvals';
51 52 53 54 55 56 57 58 59 60 61 62 63

export const APPROVAL_SETTINGS_I18N = {
  authorApprovalLabel: __('Prevent MR approvals by the author.'),
  preventMrApprovalRuleEditLabel: __('Prevent users from modifying MR approval rules.'),
  preventCommittersApprovalLabel: __(
    'Prevent approval of merge requests by merge request committers.',
  ),
  requireUserPasswordLabel: __('Require user password for approvals.'),
  removeApprovalsOnPushLabel: __(
    'Remove all approvals in a merge request when new commits are pushed to its source branch.',
  ),
  saveChanges: __('Save changes'),
};