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 ,
OPERATOR _IS _NOT ,
} from '~/vue_shared/components/filtered_search_bar/constants' ;
2020-07-28 23:09:34 +05:30
2021-06-08 01:23:25 +05:30
export const i18n = {
2022-01-26 12:08:38 +05:30
anonymousSearchingMessage : _ _ ( 'You must sign in to search for specific terms.' ) ,
2021-06-08 01:23:25 +05:30
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' ) ,
noClosedIssuesTitle : _ _ ( 'There are no closed issues' ) ,
noOpenIssuesDescription : _ _ ( 'To keep this project going, create a new issue' ) ,
noOpenIssuesTitle : _ _ ( 'There are no open issues' ) ,
noIssuesSignedInDescription : _ _ (
'Issues can be bugs, tasks or ideas to be discussed. Also, issues are searchable and filterable.' ,
) ,
noIssuesSignedInTitle : _ _ (
'The Issue Tracker is the place to add things that need to be improved or solved in a project' ,
) ,
noIssuesSignedOutButtonText : _ _ ( 'Register / Sign In' ) ,
noIssuesSignedOutDescription : _ _ (
'The Issue Tracker is the place to add things that need to be improved or solved in a project. You can register or sign in to create issues for this project.' ,
) ,
noIssuesSignedOutTitle : _ _ ( 'There are no issues to show' ) ,
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' ) ,
} ;
2022-05-07 20:08:51 +05:30
export const ISSUE _REFERENCE = /^#\d+$/ ;
2022-03-02 08:16:31 +05:30
export const MAX _LIST _SIZE = 10 ;
export const PAGE _SIZE = 20 ;
export const PAGE _SIZE _MANUAL = 100 ;
2022-06-21 17:19:12 +05:30
export const PARAM _ASSIGNEE _ID = 'assignee_id' ;
2022-05-07 20:08:51 +05:30
export const PARAM _PAGE _AFTER = 'page_after' ;
export const PARAM _PAGE _BEFORE = 'page_before' ;
2022-07-16 23:28:13 +05:30
export const PARAM _SORT = 'sort' ;
2021-06-08 01:23:25 +05:30
export const PARAM _STATE = 'state' ;
2022-03-02 08:16:31 +05:30
export const RELATIVE _POSITION = 'relative_position' ;
2021-06-08 01:23:25 +05:30
2022-01-26 12:08:38 +05:30
export const BLOCKING _ISSUES _ASC = 'BLOCKING_ISSUES_ASC' ;
2021-04-29 21:17:54 +05:30
export const BLOCKING _ISSUES _DESC = 'BLOCKING_ISSUES_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' ;
2021-09-30 23:02:18 +05:30
export const LABEL _PRIORITY _ASC = 'LABEL_PRIORITY_ASC' ;
2021-04-29 21:17:54 +05:30
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' ;
2021-09-30 23:02:18 +05:30
export const PRIORITY _ASC = 'PRIORITY_ASC' ;
2021-04-29 21:17:54 +05:30
export const PRIORITY _DESC = 'PRIORITY_DESC' ;
2021-09-30 23:02:18 +05:30
export const RELATIVE _POSITION _ASC = 'RELATIVE_POSITION_ASC' ;
2021-11-11 11:23:49 +05:30
export const TITLE _ASC = 'TITLE_ASC' ;
export const TITLE _DESC = 'TITLE_DESC' ;
2021-04-29 21:17:54 +05:30
export const UPDATED _ASC = 'UPDATED_ASC' ;
export const UPDATED _DESC = 'UPDATED_DESC' ;
export const WEIGHT _ASC = 'WEIGHT_ASC' ;
export const WEIGHT _DESC = 'WEIGHT_DESC' ;
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' ,
[ 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 ,
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' ,
[ TITLE _ASC ] : 'title_asc' ,
[ TITLE _DESC ] : 'title_desc' ,
2021-06-08 01:23:25 +05:30
} ;
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' ;
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
2021-09-04 01:27:46 +05:30
export const TOKEN _TYPE _AUTHOR = 'author_username' ;
export const TOKEN _TYPE _ASSIGNEE = 'assignee_username' ;
export const TOKEN _TYPE _MILESTONE = 'milestone' ;
export const TOKEN _TYPE _LABEL = 'labels' ;
2021-10-27 15:23:28 +05:30
export const TOKEN _TYPE _TYPE = 'type' ;
2021-12-11 22:18:48 +05:30
export const TOKEN _TYPE _RELEASE = 'release' ;
2021-09-04 01:27:46 +05:30
export const TOKEN _TYPE _MY _REACTION = 'my_reaction_emoji' ;
export const TOKEN _TYPE _CONFIDENTIAL = 'confidential' ;
export const TOKEN _TYPE _ITERATION = 'iteration' ;
export const TOKEN _TYPE _EPIC = 'epic_id' ;
export const TOKEN _TYPE _WEIGHT = 'weight' ;
2022-07-16 23:28:13 +05:30
export const TOKEN _TYPE _CONTACT = 'crm_contact' ;
export const TOKEN _TYPE _ORGANIZATION = 'crm_organization' ;
2021-09-04 01:27:46 +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' ,
2021-06-08 01:23:25 +05:30
} ,
[ URL _PARAM ] : {
[ OPERATOR _IS ] : {
[ NORMAL _FILTER ] : 'author_username' ,
} ,
[ OPERATOR _IS _NOT ] : {
[ NORMAL _FILTER ] : 'not[author_username]' ,
} ,
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' ,
} ,
[ OPERATOR _IS _NOT ] : {
[ NORMAL _FILTER ] : 'not[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
} ,
[ OPERATOR _IS _NOT ] : {
[ 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' ,
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
} ,
[ OPERATOR _IS _NOT ] : {
[ NORMAL _FILTER ] : 'not[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
} ,
[ OPERATOR _IS _NOT ] : {
[ 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' ,
} ,
[ OPERATOR _IS _NOT ] : {
[ 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' ,
} ,
2021-12-11 22:18:48 +05:30
[ OPERATOR _IS _NOT ] : {
[ 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' ,
} ,
[ OPERATOR _IS _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' ,
} ,
[ OPERATOR _IS _NOT ] : {
[ 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' ,
} ,
[ OPERATOR _IS _NOT ] : {
[ NORMAL _FILTER ] : 'not[weight]' ,
} ,
2021-04-29 21:17:54 +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
} ;