2020-11-24 15:15:51 +05:30
|
|
|
import { __, sprintf } from '~/locale';
|
2023-04-23 21:23:45 +05:30
|
|
|
import { TYPE_EPIC, TYPE_ISSUE } from '~/issues/constants';
|
2020-11-24 15:15:51 +05:30
|
|
|
|
|
|
|
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: {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: sprintf(
|
2020-11-24 15:15:51 +05:30
|
|
|
__(' 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,
|
|
|
|
),
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_EPIC]: sprintf(
|
2020-11-24 15:15:51 +05:30
|
|
|
__(' or %{emphasisStart}&epic id%{emphasisEnd}'),
|
|
|
|
{ emphasisStart: '<', emphasisEnd: '>' },
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
[issuableTypesMap.MERGE_REQUEST]: sprintf(
|
|
|
|
__(' or %{emphasisStart}!merge request id%{emphasisEnd}'),
|
|
|
|
{ emphasisStart: '<', emphasisEnd: '>' },
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
},
|
|
|
|
false: {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: '',
|
|
|
|
[TYPE_EPIC]: '',
|
|
|
|
[issuableTypesMap.MERGE_REQUEST]: __(' or references'),
|
2020-11-24 15:15:51 +05:30
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const inputPlaceholderTextMap = {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: __('Paste issue link'),
|
2022-07-23 23:45:48 +05:30
|
|
|
[issuableTypesMap.INCIDENT]: __('Paste link'),
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_EPIC]: __('Paste epic link'),
|
2020-11-24 15:15:51 +05:30
|
|
|
[issuableTypesMap.MERGE_REQUEST]: __('Enter merge request URLs'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const inputPlaceholderConfidentialTextMap = {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: __('Paste confidential issue link'),
|
|
|
|
[TYPE_EPIC]: __('Paste confidential epic link'),
|
2020-11-24 15:15:51 +05:30
|
|
|
[issuableTypesMap.MERGE_REQUEST]: __('Enter merge request URLs'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const relatedIssuesRemoveErrorMap = {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: __('An error occurred while removing issues.'),
|
|
|
|
[TYPE_EPIC]: __('An error occurred while removing epics.'),
|
2020-11-24 15:15:51 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export const pathIndeterminateErrorMap = {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: __('We could not determine the path to remove the issue'),
|
|
|
|
[TYPE_EPIC]: __('We could not determine the path to remove the epic'),
|
2020-11-24 15:15:51 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export const itemAddFailureTypesMap = {
|
|
|
|
NOT_FOUND: 'not_found',
|
|
|
|
MAX_NUMBER_OF_CHILD_EPICS: 'conflict',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const addRelatedIssueErrorMap = {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: __('Issue cannot be found.'),
|
|
|
|
[TYPE_EPIC]: __('Epic cannot be found.'),
|
2020-11-24 15:15:51 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
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 = {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: 'issues',
|
2022-07-23 23:45:48 +05:30
|
|
|
[issuableTypesMap.INCIDENT]: 'issues',
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_EPIC]: 'epic',
|
2020-11-24 15:15:51 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export const PathIdSeparator = {
|
|
|
|
Epic: '&',
|
|
|
|
Issue: '#',
|
|
|
|
};
|
2022-04-04 11:22:00 +05:30
|
|
|
|
|
|
|
export const issuablesBlockHeaderTextMap = {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: __('Linked items'),
|
2022-08-27 11:52:29 +05:30
|
|
|
[issuableTypesMap.INCIDENT]: __('Linked incidents or issues'),
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_EPIC]: __('Linked epics'),
|
2022-04-04 11:22:00 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export const issuablesBlockHelpTextMap = {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: __('Learn more about linking issues'),
|
2023-01-13 00:05:48 +05:30
|
|
|
[issuableTypesMap.INCIDENT]: __('Learn more about linking issues and incidents'),
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_EPIC]: __('Learn more about linking epics'),
|
2022-04-04 11:22:00 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export const issuablesBlockAddButtonTextMap = {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: __('Add a related issue'),
|
|
|
|
[TYPE_EPIC]: __('Add a related epic'),
|
2022-04-04 11:22:00 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export const issuablesFormCategoryHeaderTextMap = {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: __('The current issue'),
|
2022-07-23 23:45:48 +05:30
|
|
|
[issuableTypesMap.INCIDENT]: __('The current incident'),
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_EPIC]: __('The current epic'),
|
2022-04-04 11:22:00 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export const issuablesFormInputTextMap = {
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_ISSUE]: __('the following issues'),
|
2022-08-27 11:52:29 +05:30
|
|
|
[issuableTypesMap.INCIDENT]: __('the following incidents or issues'),
|
2023-04-23 21:23:45 +05:30
|
|
|
[TYPE_EPIC]: __('the following epics'),
|
2022-04-04 11:22:00 +05:30
|
|
|
};
|