2022-08-25 02:11:18 -04:00
|
|
|
import { s__, sprintf } from '~/locale';
|
|
|
|
import { capitalizeFirstCharacter } from '~/lib/utils/text_utility';
|
2022-03-23 08:07:27 -04:00
|
|
|
|
2022-04-21 08:10:16 -04:00
|
|
|
export const STATE_OPEN = 'OPEN';
|
|
|
|
export const STATE_CLOSED = 'CLOSED';
|
|
|
|
|
|
|
|
export const STATE_EVENT_REOPEN = 'REOPEN';
|
|
|
|
export const STATE_EVENT_CLOSE = 'CLOSE';
|
|
|
|
|
2022-06-02 08:09:21 -04:00
|
|
|
export const TRACKING_CATEGORY_SHOW = 'workItems:show';
|
|
|
|
|
2022-06-29 05:09:41 -04:00
|
|
|
export const TASK_TYPE_NAME = 'Task';
|
2022-05-25 11:08:05 -04:00
|
|
|
|
2022-07-13 23:08:51 -04:00
|
|
|
export const WIDGET_TYPE_ASSIGNEES = 'ASSIGNEES';
|
2022-05-31 05:08:17 -04:00
|
|
|
export const WIDGET_TYPE_DESCRIPTION = 'DESCRIPTION';
|
2022-07-14 08:08:33 -04:00
|
|
|
export const WIDGET_TYPE_LABELS = 'LABELS';
|
2022-09-15 08:13:55 -04:00
|
|
|
export const WIDGET_TYPE_START_AND_DUE_DATE = 'START_AND_DUE_DATE';
|
2022-06-02 08:09:21 -04:00
|
|
|
export const WIDGET_TYPE_WEIGHT = 'WEIGHT';
|
2022-06-17 08:09:20 -04:00
|
|
|
export const WIDGET_TYPE_HIERARCHY = 'HIERARCHY';
|
2022-07-15 11:15:01 -04:00
|
|
|
export const WORK_ITEM_VIEWED_STORAGE_KEY = 'gl-show-work-item-banner';
|
2022-06-17 08:09:20 -04:00
|
|
|
|
2022-07-20 08:08:44 -04:00
|
|
|
export const WORK_ITEM_TYPE_ENUM_INCIDENT = 'INCIDENT';
|
|
|
|
export const WORK_ITEM_TYPE_ENUM_ISSUE = 'ISSUE';
|
|
|
|
export const WORK_ITEM_TYPE_ENUM_TASK = 'TASK';
|
|
|
|
export const WORK_ITEM_TYPE_ENUM_TEST_CASE = 'TEST_CASE';
|
2022-08-15 11:09:53 -04:00
|
|
|
export const WORK_ITEM_TYPE_ENUM_REQUIREMENTS = 'REQUIREMENTS';
|
2022-07-20 08:08:44 -04:00
|
|
|
|
|
|
|
export const i18n = {
|
|
|
|
fetchError: s__('WorkItem|Something went wrong when fetching the work item. Please try again.'),
|
|
|
|
updateError: s__('WorkItem|Something went wrong while updating the work item. Please try again.'),
|
2022-08-17 11:11:57 -04:00
|
|
|
confidentialTooltip: s__(
|
|
|
|
'WorkItem|Only project members with at least the Reporter role, the author, and assignees can view or be notified about this task.',
|
|
|
|
),
|
2022-07-20 08:08:44 -04:00
|
|
|
};
|
2022-06-17 08:09:20 -04:00
|
|
|
|
2022-08-25 02:11:18 -04:00
|
|
|
export const I18N_WORK_ITEM_ERROR_CREATING = s__(
|
|
|
|
'WorkItem|Something went wrong when creating %{workItemType}. Please try again.',
|
|
|
|
);
|
|
|
|
export const I18N_WORK_ITEM_ERROR_UPDATING = s__(
|
|
|
|
'WorkItem|Something went wrong while updating the %{workItemType}. Please try again.',
|
|
|
|
);
|
|
|
|
export const I18N_WORK_ITEM_ERROR_DELETING = s__(
|
|
|
|
'WorkItem|Something went wrong when deleting the %{workItemType}. Please try again.',
|
|
|
|
);
|
|
|
|
export const I18N_WORK_ITEM_DELETE = s__('WorkItem|Delete %{workItemType}');
|
|
|
|
export const I18N_WORK_ITEM_ARE_YOU_SURE_DELETE = s__(
|
|
|
|
'WorkItem|Are you sure you want to delete the %{workItemType}? This action cannot be reversed.',
|
|
|
|
);
|
|
|
|
export const I18N_WORK_ITEM_DELETED = s__('WorkItem|%{workItemType} deleted');
|
|
|
|
|
|
|
|
export const sprintfWorkItem = (msg, workItemTypeArg) => {
|
|
|
|
const workItemType = workItemTypeArg || s__('WorkItem|Work item');
|
|
|
|
return capitalizeFirstCharacter(
|
|
|
|
sprintf(msg, {
|
|
|
|
workItemType: workItemType.toLocaleLowerCase(),
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2022-06-17 08:09:20 -04:00
|
|
|
export const WIDGET_ICONS = {
|
2022-08-15 08:11:43 -04:00
|
|
|
TASK: 'issue-type-task',
|
2022-06-17 08:09:20 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
export const WORK_ITEM_STATUS_TEXT = {
|
|
|
|
CLOSED: s__('WorkItem|Closed'),
|
|
|
|
OPEN: s__('WorkItem|Open'),
|
|
|
|
};
|
2022-08-02 08:09:26 -04:00
|
|
|
|
2022-08-15 11:09:53 -04:00
|
|
|
export const WORK_ITEMS_TYPE_MAP = {
|
|
|
|
[WORK_ITEM_TYPE_ENUM_INCIDENT]: {
|
|
|
|
icon: `issue-type-incident`,
|
|
|
|
name: s__('WorkItem|Incident'),
|
|
|
|
},
|
|
|
|
[WORK_ITEM_TYPE_ENUM_ISSUE]: {
|
|
|
|
icon: `issue-type-issue`,
|
|
|
|
name: s__('WorkItem|Issue'),
|
|
|
|
},
|
|
|
|
[WORK_ITEM_TYPE_ENUM_TASK]: {
|
|
|
|
icon: `issue-type-task`,
|
|
|
|
name: s__('WorkItem|Task'),
|
|
|
|
},
|
|
|
|
[WORK_ITEM_TYPE_ENUM_TEST_CASE]: {
|
|
|
|
icon: `issue-type-test-case`,
|
|
|
|
name: s__('WorkItem|Test case'),
|
|
|
|
},
|
|
|
|
[WORK_ITEM_TYPE_ENUM_REQUIREMENTS]: {
|
|
|
|
icon: `issue-type-requirements`,
|
|
|
|
name: s__('WorkItem|Requirements'),
|
|
|
|
},
|
|
|
|
};
|
2022-09-12 05:13:02 -04:00
|
|
|
|
|
|
|
export const DEFAULT_PAGE_SIZE_ASSIGNEES = 10;
|