2021-03-11 19:13:27 +05:30
|
|
|
import { IssuableType } from '~/issue_show/constants';
|
2021-04-17 20:07:23 +05:30
|
|
|
import epicConfidentialQuery from '~/sidebar/queries/epic_confidential.query.graphql';
|
2021-06-08 01:23:25 +05:30
|
|
|
import epicDueDateQuery from '~/sidebar/queries/epic_due_date.query.graphql';
|
|
|
|
import epicParticipantsQuery from '~/sidebar/queries/epic_participants.query.graphql';
|
|
|
|
import epicStartDateQuery from '~/sidebar/queries/epic_start_date.query.graphql';
|
|
|
|
import epicSubscribedQuery from '~/sidebar/queries/epic_subscribed.query.graphql';
|
|
|
|
import issuableAssigneesSubscription from '~/sidebar/queries/issuable_assignees.subscription.graphql';
|
2021-04-17 20:07:23 +05:30
|
|
|
import issueConfidentialQuery from '~/sidebar/queries/issue_confidential.query.graphql';
|
2021-04-29 21:17:54 +05:30
|
|
|
import issueDueDateQuery from '~/sidebar/queries/issue_due_date.query.graphql';
|
2021-04-17 20:07:23 +05:30
|
|
|
import issueReferenceQuery from '~/sidebar/queries/issue_reference.query.graphql';
|
2021-06-08 01:23:25 +05:30
|
|
|
import issueSubscribedQuery from '~/sidebar/queries/issue_subscribed.query.graphql';
|
2021-04-17 20:07:23 +05:30
|
|
|
import mergeRequestReferenceQuery from '~/sidebar/queries/merge_request_reference.query.graphql';
|
2021-06-08 01:23:25 +05:30
|
|
|
import mergeRequestSubscribed from '~/sidebar/queries/merge_request_subscribed.query.graphql';
|
|
|
|
import updateEpicConfidentialMutation from '~/sidebar/queries/update_epic_confidential.mutation.graphql';
|
|
|
|
import updateEpicDueDateMutation from '~/sidebar/queries/update_epic_due_date.mutation.graphql';
|
|
|
|
import updateEpicStartDateMutation from '~/sidebar/queries/update_epic_start_date.mutation.graphql';
|
|
|
|
import updateEpicSubscriptionMutation from '~/sidebar/queries/update_epic_subscription.mutation.graphql';
|
2021-04-17 20:07:23 +05:30
|
|
|
import updateIssueConfidentialMutation from '~/sidebar/queries/update_issue_confidential.mutation.graphql';
|
2021-04-29 21:17:54 +05:30
|
|
|
import updateIssueDueDateMutation from '~/sidebar/queries/update_issue_due_date.mutation.graphql';
|
2021-06-08 01:23:25 +05:30
|
|
|
import updateIssueSubscriptionMutation from '~/sidebar/queries/update_issue_subscription.mutation.graphql';
|
|
|
|
import updateMergeRequestSubscriptionMutation from '~/sidebar/queries/update_merge_request_subscription.mutation.graphql';
|
|
|
|
import getIssueAssignees from '~/vue_shared/components/sidebar/queries/get_issue_assignees.query.graphql';
|
|
|
|
import issueParticipantsQuery from '~/vue_shared/components/sidebar/queries/get_issue_participants.query.graphql';
|
|
|
|
import getIssueTimelogsQuery from '~/vue_shared/components/sidebar/queries/get_issue_timelogs.query.graphql';
|
|
|
|
import getMergeRequestAssignees from '~/vue_shared/components/sidebar/queries/get_mr_assignees.query.graphql';
|
2021-03-11 19:13:27 +05:30
|
|
|
import getMergeRequestParticipants from '~/vue_shared/components/sidebar/queries/get_mr_participants.query.graphql';
|
2021-06-08 01:23:25 +05:30
|
|
|
import getMrTimelogsQuery from '~/vue_shared/components/sidebar/queries/get_mr_timelogs.query.graphql';
|
|
|
|
import updateIssueAssigneesMutation from '~/vue_shared/components/sidebar/queries/update_issue_assignees.mutation.graphql';
|
|
|
|
import updateMergeRequestAssigneesMutation from '~/vue_shared/components/sidebar/queries/update_mr_assignees.mutation.graphql';
|
2021-03-11 19:13:27 +05:30
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
export const ASSIGNEES_DEBOUNCE_DELAY = 250;
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
export const assigneesQueries = {
|
|
|
|
[IssuableType.Issue]: {
|
2021-06-08 01:23:25 +05:30
|
|
|
query: getIssueAssignees,
|
|
|
|
subscription: issuableAssigneesSubscription,
|
|
|
|
mutation: updateIssueAssigneesMutation,
|
|
|
|
},
|
|
|
|
[IssuableType.MergeRequest]: {
|
|
|
|
query: getMergeRequestAssignees,
|
|
|
|
mutation: updateMergeRequestAssigneesMutation,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const participantsQueries = {
|
|
|
|
[IssuableType.Issue]: {
|
|
|
|
query: issueParticipantsQuery,
|
2021-03-11 19:13:27 +05:30
|
|
|
},
|
|
|
|
[IssuableType.MergeRequest]: {
|
|
|
|
query: getMergeRequestParticipants,
|
2021-06-08 01:23:25 +05:30
|
|
|
},
|
|
|
|
[IssuableType.Epic]: {
|
|
|
|
query: epicParticipantsQuery,
|
2021-03-11 19:13:27 +05:30
|
|
|
},
|
|
|
|
};
|
2021-04-17 20:07:23 +05:30
|
|
|
|
|
|
|
export const confidentialityQueries = {
|
|
|
|
[IssuableType.Issue]: {
|
|
|
|
query: issueConfidentialQuery,
|
|
|
|
mutation: updateIssueConfidentialMutation,
|
|
|
|
},
|
|
|
|
[IssuableType.Epic]: {
|
|
|
|
query: epicConfidentialQuery,
|
2021-06-08 01:23:25 +05:30
|
|
|
mutation: updateEpicConfidentialMutation,
|
2021-04-17 20:07:23 +05:30
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const referenceQueries = {
|
|
|
|
[IssuableType.Issue]: {
|
|
|
|
query: issueReferenceQuery,
|
|
|
|
},
|
|
|
|
[IssuableType.MergeRequest]: {
|
|
|
|
query: mergeRequestReferenceQuery,
|
|
|
|
},
|
|
|
|
};
|
2021-04-29 21:17:54 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
export const dateTypes = {
|
|
|
|
start: 'startDate',
|
|
|
|
due: 'dueDate',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const dateFields = {
|
|
|
|
[dateTypes.start]: {
|
|
|
|
isDateFixed: 'startDateIsFixed',
|
|
|
|
dateFixed: 'startDateFixed',
|
|
|
|
dateFromMilestones: 'startDateFromMilestones',
|
|
|
|
},
|
|
|
|
[dateTypes.due]: {
|
|
|
|
isDateFixed: 'dueDateIsFixed',
|
|
|
|
dateFixed: 'dueDateFixed',
|
|
|
|
dateFromMilestones: 'dueDateFromMilestones',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const subscribedQueries = {
|
|
|
|
[IssuableType.Issue]: {
|
|
|
|
query: issueSubscribedQuery,
|
|
|
|
mutation: updateIssueSubscriptionMutation,
|
|
|
|
},
|
|
|
|
[IssuableType.Epic]: {
|
|
|
|
query: epicSubscribedQuery,
|
|
|
|
mutation: updateEpicSubscriptionMutation,
|
|
|
|
},
|
|
|
|
[IssuableType.MergeRequest]: {
|
|
|
|
query: mergeRequestSubscribed,
|
|
|
|
mutation: updateMergeRequestSubscriptionMutation,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
export const dueDateQueries = {
|
|
|
|
[IssuableType.Issue]: {
|
|
|
|
query: issueDueDateQuery,
|
|
|
|
mutation: updateIssueDueDateMutation,
|
|
|
|
},
|
2021-06-08 01:23:25 +05:30
|
|
|
[IssuableType.Epic]: {
|
|
|
|
query: epicDueDateQuery,
|
|
|
|
mutation: updateEpicDueDateMutation,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const startDateQueries = {
|
|
|
|
[IssuableType.Epic]: {
|
|
|
|
query: epicStartDateQuery,
|
|
|
|
mutation: updateEpicStartDateMutation,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const timelogQueries = {
|
|
|
|
[IssuableType.Issue]: {
|
|
|
|
query: getIssueTimelogsQuery,
|
|
|
|
},
|
|
|
|
[IssuableType.MergeRequest]: {
|
|
|
|
query: getMrTimelogsQuery,
|
|
|
|
},
|
2021-04-29 21:17:54 +05:30
|
|
|
};
|