debian-mirror-gitlab/app/assets/javascripts/boards/constants.js

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

181 lines
3.9 KiB
JavaScript
Raw Normal View History

2021-06-08 01:23:25 +05:30
import boardListsQuery from 'ee_else_ce/boards/graphql/board_lists.query.graphql';
2023-04-23 21:23:45 +05:30
import { TYPE_ISSUE } from '~/issues/constants';
import { s__, __ } from '~/locale';
2021-04-29 21:17:54 +05:30
import updateEpicSubscriptionMutation from '~/sidebar/queries/update_epic_subscription.mutation.graphql';
import updateEpicTitleMutation from '~/sidebar/queries/update_epic_title.mutation.graphql';
2021-06-08 01:23:25 +05:30
import destroyBoardListMutation from './graphql/board_list_destroy.mutation.graphql';
import updateBoardListMutation from './graphql/board_list_update.mutation.graphql';
2021-04-29 21:17:54 +05:30
import issueSetSubscriptionMutation from './graphql/issue_set_subscription.mutation.graphql';
import issueSetTitleMutation from './graphql/issue_set_title.mutation.graphql';
2023-04-23 21:23:45 +05:30
import groupBoardQuery from './graphql/group_board.query.graphql';
import projectBoardQuery from './graphql/project_board.query.graphql';
import listIssuesQuery from './graphql/lists_issues.query.graphql';
2021-03-11 19:13:27 +05:30
2021-06-08 01:23:25 +05:30
/* eslint-disable-next-line @gitlab/require-i18n-strings */
export const AssigneeIdParamValues = ['Any', 'None'];
2021-04-17 20:07:23 +05:30
export const issuableTypes = {
issue: 'issue',
epic: 'epic',
};
2020-05-24 23:13:21 +05:30
export const BoardType = {
project: 'project',
group: 'group',
};
2019-12-21 20:55:43 +05:30
export const ListType = {
assignee: 'assignee',
milestone: 'milestone',
2021-03-11 19:13:27 +05:30
iteration: 'iteration',
2019-12-21 20:55:43 +05:30
backlog: 'backlog',
closed: 'closed',
label: 'label',
};
2021-03-11 19:13:27 +05:30
export const ListTypeTitles = {
assignee: __('Assignee'),
milestone: __('Milestone'),
iteration: __('Iteration'),
label: __('Label'),
2021-09-04 01:27:46 +05:30
backlog: __('Open'),
2021-03-11 19:13:27 +05:30
};
export const formType = {
new: 'new',
delete: 'delete',
edit: 'edit',
};
2021-09-30 23:02:18 +05:30
export const toggleFormEventPrefix = {
epic: 'toggle-epic-form-',
issue: 'toggle-issue-form-',
};
2022-03-02 08:16:31 +05:30
export const active = 'active';
2020-10-24 23:57:45 +05:30
export const inactiveId = 0;
2020-05-24 23:13:21 +05:30
2020-11-24 15:15:51 +05:30
export const ISSUABLE = 'issuable';
export const LIST = 'list';
2022-03-02 08:16:31 +05:30
export const INCIDENT = 'INCIDENT';
2020-11-24 15:15:51 +05:30
2021-03-11 19:13:27 +05:30
export const flashAnimationDuration = 2000;
2023-04-23 21:23:45 +05:30
export const boardQuery = {
[BoardType.group]: {
query: groupBoardQuery,
},
[BoardType.project]: {
query: projectBoardQuery,
},
};
2021-06-08 01:23:25 +05:30
export const listsQuery = {
2023-04-23 21:23:45 +05:30
[TYPE_ISSUE]: {
2021-06-08 01:23:25 +05:30
query: boardListsQuery,
},
2019-12-21 20:55:43 +05:30
};
2021-04-29 21:17:54 +05:30
2021-06-08 01:23:25 +05:30
export const updateListQueries = {
2023-04-23 21:23:45 +05:30
[TYPE_ISSUE]: {
2021-06-08 01:23:25 +05:30
mutation: updateBoardListMutation,
},
};
export const deleteListQueries = {
2023-04-23 21:23:45 +05:30
[TYPE_ISSUE]: {
2021-06-08 01:23:25 +05:30
mutation: destroyBoardListMutation,
},
};
2021-04-29 21:17:54 +05:30
export const titleQueries = {
2023-04-23 21:23:45 +05:30
[TYPE_ISSUE]: {
2021-04-29 21:17:54 +05:30
mutation: issueSetTitleMutation,
},
[issuableTypes.epic]: {
mutation: updateEpicTitleMutation,
},
};
export const subscriptionQueries = {
2023-04-23 21:23:45 +05:30
[TYPE_ISSUE]: {
2021-04-29 21:17:54 +05:30
mutation: issueSetSubscriptionMutation,
},
[issuableTypes.epic]: {
mutation: updateEpicSubscriptionMutation,
},
};
2021-06-08 01:23:25 +05:30
2023-04-23 21:23:45 +05:30
export const listIssuablesQueries = {
[TYPE_ISSUE]: {
query: listIssuesQuery,
},
};
2021-09-04 01:27:46 +05:30
export const FilterFields = {
2023-04-23 21:23:45 +05:30
[TYPE_ISSUE]: [
2021-09-04 01:27:46 +05:30
'assigneeUsername',
'assigneeWildcardId',
'authorUsername',
2022-01-26 12:08:38 +05:30
'confidential',
2021-09-04 01:27:46 +05:30
'labelName',
'milestoneTitle',
2022-01-26 12:08:38 +05:30
'milestoneWildcardId',
2021-09-04 01:27:46 +05:30
'myReactionEmoji',
'releaseTag',
'search',
2021-10-27 15:23:28 +05:30
'types',
'weight',
2021-09-04 01:27:46 +05:30
],
};
2022-01-26 12:08:38 +05:30
/* eslint-disable @gitlab/require-i18n-strings */
export const AssigneeFilterType = {
any: 'Any',
2022-03-02 08:16:31 +05:30
none: 'None',
2022-01-26 12:08:38 +05:30
};
export const MilestoneFilterType = {
any: 'Any',
none: 'None',
started: 'Started',
upcoming: 'Upcoming',
};
2021-10-27 15:23:28 +05:30
export const DraggableItemTypes = {
card: 'card',
list: 'list',
};
2021-11-11 11:23:49 +05:30
export const MilestoneIDs = {
NONE: 0,
ANY: -1,
};
2021-06-08 01:23:25 +05:30
export default {
BoardType,
ListType,
};
2022-10-11 01:57:18 +05:30
export const DEFAULT_BOARD_LIST_ITEMS_SIZE = 10;
2023-04-23 21:23:45 +05:30
export const BOARD_CARD_MOVE_TO_POSITIONS_START_OPTION = s__('Boards|Move to start of list');
export const BOARD_CARD_MOVE_TO_POSITIONS_END_OPTION = s__('Boards|Move to end of list');
/**
* Actions are stubbed in order to pass validation
* for GlDisclosureDropdown items property
*/
export const BOARD_CARD_MOVE_TO_POSITIONS_OPTIONS = [
{
text: BOARD_CARD_MOVE_TO_POSITIONS_START_OPTION,
action: () => {},
},
{
text: BOARD_CARD_MOVE_TO_POSITIONS_END_OPTION,
action: () => {},
},
];