2020-11-24 15:15:51 +05:30
|
|
|
import { __, sprintf } from '~/locale';
|
|
|
|
|
|
|
|
export const issuableTypesMap = {
|
|
|
|
ISSUE: 'issue',
|
2022-07-23 23:45:48 +05:30
|
|
|
INCIDENT: 'incident',
|
2020-11-24 15:15:51 +05:30
|
|
|
EPIC: 'epic',
|
|
|
|
MERGE_REQUEST: 'merge_request',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const linkedIssueTypesMap = {
|
|
|
|
BLOCKS: 'blocks',
|
|
|
|
IS_BLOCKED_BY: 'is_blocked_by',
|
|
|
|
RELATES_TO: 'relates_to',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const linkedIssueTypesTextMap = {
|
|
|
|
[linkedIssueTypesMap.RELATES_TO]: __('Relates to'),
|
|
|
|
[linkedIssueTypesMap.BLOCKS]: __('Blocks'),
|
|
|
|
[linkedIssueTypesMap.IS_BLOCKED_BY]: __('Is blocked by'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const autoCompleteTextMap = {
|
|
|
|
true: {
|
|
|
|
[issuableTypesMap.ISSUE]: sprintf(
|
|
|
|
__(' or %{emphasisStart}#issue id%{emphasisEnd}'),
|
|
|
|
{ emphasisStart: '<', emphasisEnd: '>' },
|
|
|
|
false,
|
|
|
|
),
|
2022-07-23 23:45:48 +05:30
|
|
|
[issuableTypesMap.INCIDENT]: sprintf(
|
|
|
|
__(' or %{emphasisStart}#id%{emphasisEnd}'),
|
|
|
|
{ emphasisStart: '<', emphasisEnd: '>' },
|
|
|
|
false,
|
|
|
|
),
|
2020-11-24 15:15:51 +05:30
|
|
|
[issuableTypesMap.EPIC]: sprintf(
|
|
|
|
__(' or %{emphasisStart}&epic id%{emphasisEnd}'),
|
|
|
|
{ emphasisStart: '<', emphasisEnd: '>' },
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
[issuableTypesMap.MERGE_REQUEST]: sprintf(
|
|
|
|
__(' or %{emphasisStart}!merge request id%{emphasisEnd}'),
|
|
|
|
{ emphasisStart: '<', emphasisEnd: '>' },
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
},
|
|
|
|
false: {
|
|
|
|
[issuableTypesMap.ISSUE]: '',
|
|
|
|
[issuableTypesMap.EPIC]: '',
|
|
|
|
[issuableTypesMap.MERGE_REQUEST]: __(' or references (e.g. path/to/project!merge_request_id)'),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const inputPlaceholderTextMap = {
|
|
|
|
[issuableTypesMap.ISSUE]: __('Paste issue link'),
|
2022-07-23 23:45:48 +05:30
|
|
|
[issuableTypesMap.INCIDENT]: __('Paste link'),
|
2020-11-24 15:15:51 +05:30
|
|
|
[issuableTypesMap.EPIC]: __('Paste epic link'),
|
|
|
|
[issuableTypesMap.MERGE_REQUEST]: __('Enter merge request URLs'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const inputPlaceholderConfidentialTextMap = {
|
|
|
|
[issuableTypesMap.ISSUE]: __('Paste confidential issue link'),
|
|
|
|
[issuableTypesMap.EPIC]: __('Paste confidential epic link'),
|
|
|
|
[issuableTypesMap.MERGE_REQUEST]: __('Enter merge request URLs'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const relatedIssuesRemoveErrorMap = {
|
|
|
|
[issuableTypesMap.ISSUE]: __('An error occurred while removing issues.'),
|
|
|
|
[issuableTypesMap.EPIC]: __('An error occurred while removing epics.'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const pathIndeterminateErrorMap = {
|
|
|
|
[issuableTypesMap.ISSUE]: __('We could not determine the path to remove the issue'),
|
|
|
|
[issuableTypesMap.EPIC]: __('We could not determine the path to remove the epic'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const itemAddFailureTypesMap = {
|
|
|
|
NOT_FOUND: 'not_found',
|
|
|
|
MAX_NUMBER_OF_CHILD_EPICS: 'conflict',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const addRelatedIssueErrorMap = {
|
|
|
|
[issuableTypesMap.ISSUE]: __('Issue cannot be found.'),
|
|
|
|
[issuableTypesMap.EPIC]: __('Epic cannot be found.'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const addRelatedItemErrorMap = {
|
|
|
|
[itemAddFailureTypesMap.MAX_NUMBER_OF_CHILD_EPICS]: __(
|
|
|
|
'This epic already has the maximum number of child epics.',
|
|
|
|
),
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* These are used to map issuableType to the correct icon.
|
|
|
|
* Since these are never used for any display purposes, don't wrap
|
|
|
|
* them inside i18n functions.
|
|
|
|
*/
|
|
|
|
export const issuableIconMap = {
|
|
|
|
[issuableTypesMap.ISSUE]: 'issues',
|
2022-07-23 23:45:48 +05:30
|
|
|
[issuableTypesMap.INCIDENT]: 'issues',
|
2020-11-24 15:15:51 +05:30
|
|
|
[issuableTypesMap.EPIC]: 'epic',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const PathIdSeparator = {
|
|
|
|
Epic: '&',
|
|
|
|
Issue: '#',
|
|
|
|
};
|
2022-04-04 11:22:00 +05:30
|
|
|
|
|
|
|
export const issuablesBlockHeaderTextMap = {
|
2022-08-27 11:52:29 +05:30
|
|
|
[issuableTypesMap.ISSUE]: __('Linked items'),
|
|
|
|
[issuableTypesMap.INCIDENT]: __('Linked incidents or issues'),
|
2022-04-04 11:22:00 +05:30
|
|
|
[issuableTypesMap.EPIC]: __('Linked epics'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const issuablesBlockHelpTextMap = {
|
|
|
|
[issuableTypesMap.ISSUE]: __('Read more about related issues'),
|
|
|
|
[issuableTypesMap.EPIC]: __('Read more about related epics'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const issuablesBlockAddButtonTextMap = {
|
|
|
|
[issuableTypesMap.ISSUE]: __('Add a related issue'),
|
|
|
|
[issuableTypesMap.EPIC]: __('Add a related epic'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const issuablesFormCategoryHeaderTextMap = {
|
|
|
|
[issuableTypesMap.ISSUE]: __('The current issue'),
|
2022-07-23 23:45:48 +05:30
|
|
|
[issuableTypesMap.INCIDENT]: __('The current incident'),
|
2022-04-04 11:22:00 +05:30
|
|
|
[issuableTypesMap.EPIC]: __('The current epic'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const issuablesFormInputTextMap = {
|
2022-08-27 11:52:29 +05:30
|
|
|
[issuableTypesMap.ISSUE]: __('the following issues'),
|
|
|
|
[issuableTypesMap.INCIDENT]: __('the following incidents or issues'),
|
|
|
|
[issuableTypesMap.EPIC]: __('the following epics'),
|
2022-04-04 11:22:00 +05:30
|
|
|
};
|