debian-mirror-gitlab/app/assets/javascripts/issues/list/constants.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

400 lines
12 KiB
JavaScript
Raw Normal View History

2021-06-08 01:23:25 +05:30
import { __, s__ } from '~/locale';
import {
FILTER_ANY,
FILTER_CURRENT,
FILTER_NONE,
2021-10-27 15:23:28 +05:30
FILTER_STARTED,
FILTER_UPCOMING,
2021-06-08 01:23:25 +05:30
OPERATOR_IS,
2023-03-04 22:38:38 +05:30
OPERATOR_NOT,
2023-01-13 00:05:48 +05:30
OPERATOR_OR,
TOKEN_TYPE_ASSIGNEE,
TOKEN_TYPE_AUTHOR,
TOKEN_TYPE_CONFIDENTIAL,
TOKEN_TYPE_CONTACT,
TOKEN_TYPE_EPIC,
2022-11-25 23:54:43 +05:30
TOKEN_TYPE_HEALTH,
2023-01-13 00:05:48 +05:30
TOKEN_TYPE_ITERATION,
TOKEN_TYPE_LABEL,
TOKEN_TYPE_MILESTONE,
TOKEN_TYPE_MY_REACTION,
TOKEN_TYPE_ORGANIZATION,
TOKEN_TYPE_RELEASE,
TOKEN_TYPE_TYPE,
TOKEN_TYPE_WEIGHT,
2023-03-04 22:38:38 +05:30
TOKEN_TYPE_SEARCH_WITHIN,
2021-06-08 01:23:25 +05:30
} from '~/vue_shared/components/filtered_search_bar/constants';
2022-08-27 11:52:29 +05:30
import {
WORK_ITEM_TYPE_ENUM_INCIDENT,
WORK_ITEM_TYPE_ENUM_ISSUE,
WORK_ITEM_TYPE_ENUM_TEST_CASE,
2022-11-25 23:54:43 +05:30
WORK_ITEM_TYPE_ENUM_TASK,
2022-08-27 11:52:29 +05:30
} from '~/work_items/constants';
2020-07-28 23:09:34 +05:30
2023-03-04 22:38:38 +05:30
export const ISSUE_REFERENCE = /^#\d+$/;
export const MAX_LIST_SIZE = 10;
export const PARAM_ASSIGNEE_ID = 'assignee_id';
export const PARAM_FIRST_PAGE_SIZE = 'first_page_size';
export const PARAM_LAST_PAGE_SIZE = 'last_page_size';
export const PARAM_PAGE_AFTER = 'page_after';
export const PARAM_PAGE_BEFORE = 'page_before';
export const PARAM_SORT = 'sort';
export const PARAM_STATE = 'state';
export const RELATIVE_POSITION = 'relative_position';
export const BLOCKING_ISSUES_ASC = 'BLOCKING_ISSUES_ASC';
export const BLOCKING_ISSUES_DESC = 'BLOCKING_ISSUES_DESC';
export const CLOSED_AT_ASC = 'CLOSED_AT_ASC';
export const CLOSED_AT_DESC = 'CLOSED_AT_DESC';
export const CREATED_ASC = 'CREATED_ASC';
export const CREATED_DESC = 'CREATED_DESC';
export const DUE_DATE_ASC = 'DUE_DATE_ASC';
export const DUE_DATE_DESC = 'DUE_DATE_DESC';
export const HEALTH_STATUS_ASC = 'HEALTH_STATUS_ASC';
export const HEALTH_STATUS_DESC = 'HEALTH_STATUS_DESC';
export const LABEL_PRIORITY_ASC = 'LABEL_PRIORITY_ASC';
export const LABEL_PRIORITY_DESC = 'LABEL_PRIORITY_DESC';
export const MILESTONE_DUE_ASC = 'MILESTONE_DUE_ASC';
export const MILESTONE_DUE_DESC = 'MILESTONE_DUE_DESC';
export const POPULARITY_ASC = 'POPULARITY_ASC';
export const POPULARITY_DESC = 'POPULARITY_DESC';
export const PRIORITY_ASC = 'PRIORITY_ASC';
export const PRIORITY_DESC = 'PRIORITY_DESC';
export const RELATIVE_POSITION_ASC = 'RELATIVE_POSITION_ASC';
export const TITLE_ASC = 'TITLE_ASC';
export const TITLE_DESC = 'TITLE_DESC';
export const UPDATED_ASC = 'UPDATED_ASC';
export const UPDATED_DESC = 'UPDATED_DESC';
export const WEIGHT_ASC = 'WEIGHT_ASC';
export const WEIGHT_DESC = 'WEIGHT_DESC';
export const API_PARAM = 'apiParam';
export const URL_PARAM = 'urlParam';
export const NORMAL_FILTER = 'normalFilter';
export const SPECIAL_FILTER = 'specialFilter';
export const ALTERNATIVE_FILTER = 'alternativeFilter';
2021-06-08 01:23:25 +05:30
export const i18n = {
calendarLabel: __('Subscribe to calendar'),
closed: __('CLOSED'),
closedMoved: __('CLOSED (MOVED)'),
confidentialNo: __('No'),
confidentialYes: __('Yes'),
downvotes: __('Downvotes'),
editIssues: __('Edit issues'),
2021-09-30 23:02:18 +05:30
errorFetchingCounts: __('An error occurred while getting issue counts'),
2021-06-08 01:23:25 +05:30
errorFetchingIssues: __('An error occurred while loading issues'),
2022-01-26 12:08:38 +05:30
issueRepositioningMessage: __(
'Issues are being rebalanced at the moment, so manual reordering is disabled.',
),
2021-06-08 01:23:25 +05:30
jiraIntegrationMessage: s__(
'JiraService|%{jiraDocsLinkStart}Enable the Jira integration%{jiraDocsLinkEnd} to view your Jira issues in GitLab.',
),
jiraIntegrationSecondaryMessage: s__('JiraService|This feature requires a Premium plan.'),
jiraIntegrationTitle: s__('JiraService|Using Jira for issue tracking?'),
newIssueLabel: __('New issue'),
2022-07-23 23:45:48 +05:30
newProjectLabel: __('New project'),
2021-06-08 01:23:25 +05:30
noClosedIssuesTitle: __('There are no closed issues'),
2022-07-23 23:45:48 +05:30
noGroupIssuesSignedInDescription: __(
'Issues exist in projects, so to create an issue, first create a project.',
),
2021-06-08 01:23:25 +05:30
noOpenIssuesDescription: __('To keep this project going, create a new issue'),
noOpenIssuesTitle: __('There are no open issues'),
2023-03-04 22:38:38 +05:30
noIssuesDescription: __('Learn more about issues.'),
noIssuesTitle: __('Use issues to collaborate on ideas, solve problems, and plan work'),
2021-06-08 01:23:25 +05:30
noIssuesSignedOutButtonText: __('Register / Sign In'),
2023-04-23 21:23:45 +05:30
noSearchNoFilterTitle: __('Please select at least one filter to see results'),
2021-06-08 01:23:25 +05:30
noSearchResultsDescription: __('To widen your search, change or remove filters above'),
noSearchResultsTitle: __('Sorry, your filter produced no results'),
relatedMergeRequests: __('Related merge requests'),
reorderError: __('An error occurred while reordering issues.'),
rssLabel: __('Subscribe to RSS feed'),
2021-09-30 23:02:18 +05:30
searchPlaceholder: __('Search or filter results...'),
2021-06-08 01:23:25 +05:30
upvotes: __('Upvotes'),
2023-03-04 22:38:38 +05:30
titles: __('Titles'),
descriptions: __('Descriptions'),
2021-06-08 01:23:25 +05:30
};
export const urlSortParams = {
2022-01-26 12:08:38 +05:30
[PRIORITY_ASC]: 'priority',
[PRIORITY_DESC]: 'priority_desc',
[CREATED_ASC]: 'created_asc',
[CREATED_DESC]: 'created_date',
[UPDATED_ASC]: 'updated_asc',
[UPDATED_DESC]: 'updated_desc',
2023-03-04 22:38:38 +05:30
[CLOSED_AT_ASC]: 'closed_at',
[CLOSED_AT_DESC]: 'closed_at_desc',
2022-01-26 12:08:38 +05:30
[MILESTONE_DUE_ASC]: 'milestone',
[MILESTONE_DUE_DESC]: 'milestone_due_desc',
[DUE_DATE_ASC]: 'due_date',
[DUE_DATE_DESC]: 'due_date_desc',
[POPULARITY_ASC]: 'popularity_asc',
[POPULARITY_DESC]: 'popularity',
[LABEL_PRIORITY_ASC]: 'label_priority',
[LABEL_PRIORITY_DESC]: 'label_priority_desc',
2021-09-30 23:02:18 +05:30
[RELATIVE_POSITION_ASC]: RELATIVE_POSITION,
2023-03-04 22:38:38 +05:30
[TITLE_ASC]: 'title_asc',
[TITLE_DESC]: 'title_desc',
[HEALTH_STATUS_ASC]: 'health_status_asc',
[HEALTH_STATUS_DESC]: 'health_status_desc',
2022-01-26 12:08:38 +05:30
[WEIGHT_ASC]: 'weight',
[WEIGHT_DESC]: 'weight_desc',
[BLOCKING_ISSUES_ASC]: 'blocking_issues_asc',
[BLOCKING_ISSUES_DESC]: 'blocking_issues_desc',
2021-06-08 01:23:25 +05:30
};
2022-06-21 17:19:12 +05:30
export const specialFilterValues = [
2021-10-27 15:23:28 +05:30
FILTER_NONE,
FILTER_ANY,
FILTER_CURRENT,
FILTER_UPCOMING,
FILTER_STARTED,
];
2021-06-08 01:23:25 +05:30
2023-03-04 22:38:38 +05:30
export const TYPE_TOKEN_OBJECTIVE_OPTION = {
icon: 'issue-type-objective',
title: 'objective',
value: 'objective',
};
export const TYPE_TOKEN_KEY_RESULT_OPTION = {
2023-03-17 16:20:25 +05:30
icon: 'issue-type-keyresult',
2023-03-04 22:38:38 +05:30
title: 'key_result',
value: 'key_result',
};
2022-08-27 11:52:29 +05:30
2022-11-25 23:54:43 +05:30
// This should be consistent with Issue::TYPES_FOR_LIST in the backend
// https://gitlab.com/gitlab-org/gitlab/-/blob/1379c2d7bffe2a8d809f23ac5ef9b4114f789c07/app/models/issue.rb#L48
2022-08-27 11:52:29 +05:30
export const defaultWorkItemTypes = [
WORK_ITEM_TYPE_ENUM_ISSUE,
WORK_ITEM_TYPE_ENUM_INCIDENT,
WORK_ITEM_TYPE_ENUM_TEST_CASE,
2022-11-25 23:54:43 +05:30
WORK_ITEM_TYPE_ENUM_TASK,
2022-08-27 11:52:29 +05:30
];
export const defaultTypeTokenOptions = [
{ icon: 'issue-type-issue', title: 'issue', value: 'issue' },
{ icon: 'issue-type-incident', title: 'incident', value: 'incident' },
{ icon: 'issue-type-test-case', title: 'test_case', value: 'test_case' },
2023-03-04 22:38:38 +05:30
{ icon: 'issue-type-task', title: 'task', value: 'task' },
2022-08-27 11:52:29 +05:30
];
2021-06-08 01:23:25 +05:30
export const filters = {
2021-09-04 01:27:46 +05:30
[TOKEN_TYPE_AUTHOR]: {
2021-06-08 01:23:25 +05:30
[API_PARAM]: {
2021-09-30 23:02:18 +05:30
[NORMAL_FILTER]: 'authorUsername',
2023-03-04 22:38:38 +05:30
[ALTERNATIVE_FILTER]: 'authorUsernames',
2021-06-08 01:23:25 +05:30
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'author_username',
},
2023-03-04 22:38:38 +05:30
[OPERATOR_NOT]: {
2021-06-08 01:23:25 +05:30
[NORMAL_FILTER]: 'not[author_username]',
},
2023-03-04 22:38:38 +05:30
[OPERATOR_OR]: {
[ALTERNATIVE_FILTER]: 'or[author_username]',
},
},
},
[TOKEN_TYPE_SEARCH_WITHIN]: {
[API_PARAM]: {
[NORMAL_FILTER]: 'in',
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'in',
},
2021-04-29 21:17:54 +05:30
},
},
2021-09-04 01:27:46 +05:30
[TOKEN_TYPE_ASSIGNEE]: {
2021-06-08 01:23:25 +05:30
[API_PARAM]: {
2021-09-30 23:02:18 +05:30
[NORMAL_FILTER]: 'assigneeUsernames',
[SPECIAL_FILTER]: 'assigneeId',
2021-06-08 01:23:25 +05:30
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'assignee_username[]',
[SPECIAL_FILTER]: 'assignee_id',
[ALTERNATIVE_FILTER]: 'assignee_username',
},
2023-03-04 22:38:38 +05:30
[OPERATOR_NOT]: {
2021-06-08 01:23:25 +05:30
[NORMAL_FILTER]: 'not[assignee_username][]',
},
2023-01-13 00:05:48 +05:30
[OPERATOR_OR]: {
[NORMAL_FILTER]: 'or[assignee_username][]',
},
2021-04-29 21:17:54 +05:30
},
},
2021-09-04 01:27:46 +05:30
[TOKEN_TYPE_MILESTONE]: {
2021-06-08 01:23:25 +05:30
[API_PARAM]: {
2021-09-30 23:02:18 +05:30
[NORMAL_FILTER]: 'milestoneTitle',
2021-10-27 15:23:28 +05:30
[SPECIAL_FILTER]: 'milestoneWildcardId',
2021-06-08 01:23:25 +05:30
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'milestone_title',
2021-10-27 15:23:28 +05:30
[SPECIAL_FILTER]: 'milestone_title',
2021-06-08 01:23:25 +05:30
},
2023-03-04 22:38:38 +05:30
[OPERATOR_NOT]: {
2021-06-08 01:23:25 +05:30
[NORMAL_FILTER]: 'not[milestone_title]',
2022-07-16 23:28:13 +05:30
[SPECIAL_FILTER]: 'not[milestone_title]',
2021-06-08 01:23:25 +05:30
},
2021-04-29 21:17:54 +05:30
},
},
2021-09-04 01:27:46 +05:30
[TOKEN_TYPE_LABEL]: {
2021-06-08 01:23:25 +05:30
[API_PARAM]: {
2021-09-30 23:02:18 +05:30
[NORMAL_FILTER]: 'labelName',
[SPECIAL_FILTER]: 'labelName',
2023-03-17 16:20:25 +05:30
[ALTERNATIVE_FILTER]: 'labelNames',
2021-06-08 01:23:25 +05:30
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'label_name[]',
2021-09-30 23:02:18 +05:30
[SPECIAL_FILTER]: 'label_name[]',
2021-12-11 22:18:48 +05:30
[ALTERNATIVE_FILTER]: 'label_name',
2021-06-08 01:23:25 +05:30
},
2023-03-04 22:38:38 +05:30
[OPERATOR_NOT]: {
2021-06-08 01:23:25 +05:30
[NORMAL_FILTER]: 'not[label_name][]',
},
2023-03-17 16:20:25 +05:30
[OPERATOR_OR]: {
[ALTERNATIVE_FILTER]: 'or[label_name][]',
},
2021-04-29 21:17:54 +05:30
},
},
2021-10-27 15:23:28 +05:30
[TOKEN_TYPE_TYPE]: {
[API_PARAM]: {
[NORMAL_FILTER]: 'types',
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'type[]',
2021-12-11 22:18:48 +05:30
},
2023-03-04 22:38:38 +05:30
[OPERATOR_NOT]: {
2021-12-11 22:18:48 +05:30
[NORMAL_FILTER]: 'not[type][]',
},
},
},
[TOKEN_TYPE_RELEASE]: {
[API_PARAM]: {
[NORMAL_FILTER]: 'releaseTag',
[SPECIAL_FILTER]: 'releaseTagWildcardId',
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'release_tag',
[SPECIAL_FILTER]: 'release_tag',
},
2023-03-04 22:38:38 +05:30
[OPERATOR_NOT]: {
2021-12-11 22:18:48 +05:30
[NORMAL_FILTER]: 'not[release_tag]',
2021-10-27 15:23:28 +05:30
},
},
},
2021-09-04 01:27:46 +05:30
[TOKEN_TYPE_MY_REACTION]: {
2021-06-08 01:23:25 +05:30
[API_PARAM]: {
2021-09-30 23:02:18 +05:30
[NORMAL_FILTER]: 'myReactionEmoji',
[SPECIAL_FILTER]: 'myReactionEmoji',
2021-06-08 01:23:25 +05:30
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'my_reaction_emoji',
[SPECIAL_FILTER]: 'my_reaction_emoji',
},
2023-03-04 22:38:38 +05:30
[OPERATOR_NOT]: {
2021-12-11 22:18:48 +05:30
[NORMAL_FILTER]: 'not[my_reaction_emoji]',
},
2021-04-29 21:17:54 +05:30
},
},
2021-09-04 01:27:46 +05:30
[TOKEN_TYPE_CONFIDENTIAL]: {
2021-06-08 01:23:25 +05:30
[API_PARAM]: {
2021-09-30 23:02:18 +05:30
[NORMAL_FILTER]: 'confidential',
2021-06-08 01:23:25 +05:30
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'confidential',
},
2021-04-29 21:17:54 +05:30
},
},
2021-09-04 01:27:46 +05:30
[TOKEN_TYPE_ITERATION]: {
2021-06-08 01:23:25 +05:30
[API_PARAM]: {
2021-09-30 23:02:18 +05:30
[NORMAL_FILTER]: 'iterationId',
[SPECIAL_FILTER]: 'iterationWildcardId',
2021-06-08 01:23:25 +05:30
},
[URL_PARAM]: {
[OPERATOR_IS]: {
2021-09-30 23:02:18 +05:30
[NORMAL_FILTER]: 'iteration_id',
2021-06-08 01:23:25 +05:30
[SPECIAL_FILTER]: 'iteration_id',
},
2023-03-04 22:38:38 +05:30
[OPERATOR_NOT]: {
2021-09-30 23:02:18 +05:30
[NORMAL_FILTER]: 'not[iteration_id]',
2022-07-16 23:28:13 +05:30
[SPECIAL_FILTER]: 'not[iteration_id]',
2021-06-08 01:23:25 +05:30
},
2021-04-29 21:17:54 +05:30
},
},
2021-09-04 01:27:46 +05:30
[TOKEN_TYPE_EPIC]: {
2021-06-08 01:23:25 +05:30
[API_PARAM]: {
2021-09-30 23:02:18 +05:30
[NORMAL_FILTER]: 'epicId',
[SPECIAL_FILTER]: 'epicId',
2021-06-08 01:23:25 +05:30
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'epic_id',
[SPECIAL_FILTER]: 'epic_id',
},
2023-03-04 22:38:38 +05:30
[OPERATOR_NOT]: {
2021-06-08 01:23:25 +05:30
[NORMAL_FILTER]: 'not[epic_id]',
},
2021-04-29 21:17:54 +05:30
},
},
2021-09-04 01:27:46 +05:30
[TOKEN_TYPE_WEIGHT]: {
2021-06-08 01:23:25 +05:30
[API_PARAM]: {
2021-09-30 23:02:18 +05:30
[NORMAL_FILTER]: 'weight',
[SPECIAL_FILTER]: 'weight',
2021-06-08 01:23:25 +05:30
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'weight',
[SPECIAL_FILTER]: 'weight',
},
2023-03-04 22:38:38 +05:30
[OPERATOR_NOT]: {
2021-06-08 01:23:25 +05:30
[NORMAL_FILTER]: 'not[weight]',
},
2021-04-29 21:17:54 +05:30
},
},
2022-10-11 01:57:18 +05:30
[TOKEN_TYPE_HEALTH]: {
[API_PARAM]: {
2023-03-17 16:20:25 +05:30
[NORMAL_FILTER]: 'healthStatusFilter',
[SPECIAL_FILTER]: 'healthStatusFilter',
2022-10-11 01:57:18 +05:30
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'health_status',
2022-11-25 23:54:43 +05:30
[SPECIAL_FILTER]: 'health_status',
2022-10-11 01:57:18 +05:30
},
2023-03-17 16:20:25 +05:30
[OPERATOR_NOT]: {
[NORMAL_FILTER]: 'not[health_status]',
},
2022-10-11 01:57:18 +05:30
},
},
2022-07-16 23:28:13 +05:30
[TOKEN_TYPE_CONTACT]: {
[API_PARAM]: {
[NORMAL_FILTER]: 'crmContactId',
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'crm_contact_id',
},
},
},
[TOKEN_TYPE_ORGANIZATION]: {
[API_PARAM]: {
[NORMAL_FILTER]: 'crmOrganizationId',
},
[URL_PARAM]: {
[OPERATOR_IS]: {
[NORMAL_FILTER]: 'crm_organization_id',
},
},
},
2021-06-08 01:23:25 +05:30
};