Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/sidebar')
-rw-r--r--app/assets/javascripts/sidebar/components/assignees/assignees_realtime.vue2
-rw-r--r--app/assets/javascripts/sidebar/components/assignees/collapsed_assignee_list.vue3
-rw-r--r--app/assets/javascripts/sidebar/components/assignees/sidebar_assignees_widget.vue2
-rw-r--r--app/assets/javascripts/sidebar/components/assignees/sidebar_invite_members.vue2
-rw-r--r--app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue13
-rw-r--r--app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_form.vue27
-rw-r--r--app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_widget.vue3
-rw-r--r--app/assets/javascripts/sidebar/components/copy/sidebar_reference_widget.vue2
-rw-r--r--app/assets/javascripts/sidebar/components/date/sidebar_date_widget.vue3
-rw-r--r--app/assets/javascripts/sidebar/components/incidents/sidebar_escalation_status.vue7
-rw-r--r--app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js3
-rw-r--r--app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents.vue3
-rw-r--r--app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view.vue24
-rw-r--r--app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue13
-rw-r--r--app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_footer.vue15
-rw-r--r--app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue2
-rw-r--r--app/assets/javascripts/sidebar/components/participants/participants.vue11
-rw-r--r--app/assets/javascripts/sidebar/components/participants/sidebar_participants_widget.vue2
-rw-r--r--app/assets/javascripts/sidebar/components/reviewers/collapsed_reviewer_list.vue3
-rw-r--r--app/assets/javascripts/sidebar/components/sidebar_dropdown.vue2
-rw-r--r--app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue2
-rw-r--r--app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue3
-rw-r--r--app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue24
-rw-r--r--app/assets/javascripts/sidebar/components/time_tracking/report.vue2
-rw-r--r--app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue9
-rw-r--r--app/assets/javascripts/sidebar/components/todo_toggle/sidebar_todo_widget.vue3
-rw-r--r--app/assets/javascripts/sidebar/constants.js268
-rw-r--r--app/assets/javascripts/sidebar/queries/constants.js291
-rw-r--r--app/assets/javascripts/sidebar/queries/test_case_confidential.query.graphql9
-rw-r--r--app/assets/javascripts/sidebar/queries/update_test_case_confidential.mutation.graphql9
30 files changed, 430 insertions, 332 deletions
diff --git a/app/assets/javascripts/sidebar/components/assignees/assignees_realtime.vue b/app/assets/javascripts/sidebar/components/assignees/assignees_realtime.vue
index 319699b88f3..cf77a5ca82c 100644
--- a/app/assets/javascripts/sidebar/components/assignees/assignees_realtime.vue
+++ b/app/assets/javascripts/sidebar/components/assignees/assignees_realtime.vue
@@ -1,6 +1,6 @@
<script>
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
-import { assigneesQueries } from '../../constants';
+import { assigneesQueries } from '../../queries/constants';
export default {
subscription: null,
diff --git a/app/assets/javascripts/sidebar/components/assignees/collapsed_assignee_list.vue b/app/assets/javascripts/sidebar/components/assignees/collapsed_assignee_list.vue
index 577c01c50ff..8a912b00df1 100644
--- a/app/assets/javascripts/sidebar/components/assignees/collapsed_assignee_list.vue
+++ b/app/assets/javascripts/sidebar/components/assignees/collapsed_assignee_list.vue
@@ -84,7 +84,8 @@ export default {
if (mergeLength === this.users.length) {
return '';
- } else if (mergeLength > 0) {
+ }
+ if (mergeLength > 0) {
return sprintf(__('%{mergeLength}/%{usersLength} can merge'), {
mergeLength,
usersLength: this.users.length,
diff --git a/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees_widget.vue b/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees_widget.vue
index ae81dcb95de..4ff12824008 100644
--- a/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees_widget.vue
+++ b/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees_widget.vue
@@ -6,7 +6,7 @@ import { TYPE_ALERT, TYPE_ISSUE, TYPE_MERGE_REQUEST } from '~/issues/constants';
import { __, n__ } from '~/locale';
import UserSelect from '~/vue_shared/components/user_select/user_select.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
-import { assigneesQueries } from '../../constants';
+import { assigneesQueries } from '../../queries/constants';
import SidebarEditableItem from '../sidebar_editable_item.vue';
import SidebarAssigneesRealtime from './assignees_realtime.vue';
import IssuableAssignees from './issuable_assignees.vue';
diff --git a/app/assets/javascripts/sidebar/components/assignees/sidebar_invite_members.vue b/app/assets/javascripts/sidebar/components/assignees/sidebar_invite_members.vue
index b41d126be68..232cdcd2198 100644
--- a/app/assets/javascripts/sidebar/components/assignees/sidebar_invite_members.vue
+++ b/app/assets/javascripts/sidebar/components/assignees/sidebar_invite_members.vue
@@ -15,7 +15,7 @@ export default {
},
computed: {
triggerSource() {
- return `${this.issuableType}-assignee-dropdown`;
+ return `${this.issuableType}_assignee_dropdown`;
},
},
};
diff --git a/app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue b/app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue
index 930e7ff12d9..ef7f12f273f 100644
--- a/app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue
+++ b/app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue
@@ -1,4 +1,5 @@
<script>
+import { GlButton } from '@gitlab/ui';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { TYPE_ISSUE, TYPE_MERGE_REQUEST } from '~/issues/constants';
import { __, sprintf } from '~/locale';
@@ -9,6 +10,7 @@ const DEFAULT_RENDER_COUNT = 5;
export default {
components: {
+ GlButton,
AssigneeAvatarLink,
UserNameWithStatus,
},
@@ -97,10 +99,11 @@ export default {
</assignee-avatar-link>
</div>
</div>
- <div v-if="renderShowMoreSection" class="user-list-more gl-hover-text-blue-800">
- <button
- type="button"
- class="btn-link gl-button gl-reset-color!"
+ <div v-if="renderShowMoreSection" class="gl-hover-text-blue-800" data-testid="user-list-more">
+ <gl-button
+ category="tertiary"
+ size="small"
+ data-testid="user-list-more-button"
data-qa-selector="more_assignees_link"
@click="toggleShowLess"
>
@@ -108,7 +111,7 @@ export default {
{{ hiddenAssigneesLabel }}
</template>
<template v-else>{{ __('- show less') }}</template>
- </button>
+ </gl-button>
</div>
</div>
</template>
diff --git a/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_form.vue b/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_form.vue
index 3038cec03eb..7a1853b1b46 100644
--- a/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_form.vue
+++ b/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_form.vue
@@ -1,9 +1,9 @@
<script>
import { GlSprintf, GlButton } from '@gitlab/ui';
import { createAlert } from '~/alert';
-import { TYPE_ISSUE } from '~/issues/constants';
+import { TYPE_ISSUE, TYPE_TEST_CASE, IssuableTypeText } from '~/issues/constants';
import { __, sprintf } from '~/locale';
-import { confidentialityQueries } from '../../constants';
+import { confidentialityQueries } from '../../queries/constants';
export default {
i18n: {
@@ -11,7 +11,7 @@ export default {
'You are going to turn on confidentiality. Only %{context} members with %{strongStart}%{permissions}%{strongEnd} can view or be notified about this %{issuableType}.',
),
confidentialityOffWarning: __(
- 'You are going to turn off the confidentiality. This means %{strongStart}everyone%{strongEnd} will be able to see and leave a comment on this %{issuableType}.',
+ 'You are going to turn off the confidentiality. This means %{strongStart}everyone%{strongEnd} will be able to see%{commentText} this %{issuableType}.',
),
},
components: {
@@ -56,11 +56,17 @@ export default {
isIssue() {
return this.issuableType === TYPE_ISSUE;
},
+ isTestCase() {
+ return this.issuableType === TYPE_TEST_CASE;
+ },
+ isIssueOrTestCase() {
+ return this.isIssue || this.isTestCase;
+ },
context() {
- return this.isIssue ? __('project') : __('group');
+ return this.isIssueOrTestCase ? __('project') : __('group');
},
workspacePath() {
- return this.isIssue
+ return this.isIssueOrTestCase
? {
projectPath: this.fullPath,
}
@@ -73,6 +79,12 @@ export default {
? __('at least the Reporter role, the author, and assignees')
: __('at least the Reporter role');
},
+ issuableTypeText() {
+ return IssuableTypeText[this.issuableType];
+ },
+ commentText() {
+ return this.isTestCase ? '' : __(' and leave a comment on');
+ },
},
methods: {
submitForm() {
@@ -108,7 +120,7 @@ export default {
message: sprintf(
__('Something went wrong while setting %{issuableType} confidentiality.'),
{
- issuableType: this.issuableType,
+ issuableType: this.issuableTypeText,
},
),
});
@@ -135,7 +147,8 @@ export default {
</strong>
</template>
<template #context>{{ context }}</template>
- <template #issuableType>{{ issuableType }}</template>
+ <template #commentText>{{ commentText }}</template>
+ <template #issuableType>{{ issuableTypeText }}</template>
</gl-sprintf>
</p>
<div class="sidebar-item-warning-message-actions">
diff --git a/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_widget.vue b/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_widget.vue
index 9177baec246..295d37671cc 100644
--- a/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_widget.vue
+++ b/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_widget.vue
@@ -3,7 +3,8 @@ import produce from 'immer';
import Vue from 'vue';
import { createAlert } from '~/alert';
import { __, sprintf } from '~/locale';
-import { confidentialityQueries, Tracking } from '../../constants';
+import { Tracking } from '../../constants';
+import { confidentialityQueries } from '../../queries/constants';
import SidebarEditableItem from '../sidebar_editable_item.vue';
import SidebarConfidentialityContent from './sidebar_confidentiality_content.vue';
import SidebarConfidentialityForm from './sidebar_confidentiality_form.vue';
diff --git a/app/assets/javascripts/sidebar/components/copy/sidebar_reference_widget.vue b/app/assets/javascripts/sidebar/components/copy/sidebar_reference_widget.vue
index 3287539e502..7a488bb379f 100644
--- a/app/assets/javascripts/sidebar/components/copy/sidebar_reference_widget.vue
+++ b/app/assets/javascripts/sidebar/components/copy/sidebar_reference_widget.vue
@@ -1,6 +1,6 @@
<script>
import { __ } from '~/locale';
-import { referenceQueries } from '../../constants';
+import { referenceQueries } from '../../queries/constants';
import CopyableField from './copyable_field.vue';
export default {
diff --git a/app/assets/javascripts/sidebar/components/date/sidebar_date_widget.vue b/app/assets/javascripts/sidebar/components/date/sidebar_date_widget.vue
index 5a9545f3460..89bc4b126d6 100644
--- a/app/assets/javascripts/sidebar/components/date/sidebar_date_widget.vue
+++ b/app/assets/javascripts/sidebar/components/date/sidebar_date_widget.vue
@@ -4,7 +4,8 @@ import { createAlert } from '~/alert';
import { TYPE_ISSUE } from '~/issues/constants';
import { dateInWords, formatDate, parsePikadayDate } from '~/lib/utils/datetime_utility';
import { __, sprintf } from '~/locale';
-import { dateFields, dateTypes, dueDateQueries, startDateQueries, Tracking } from '../../constants';
+import { dateFields, dateTypes, Tracking } from '../../constants';
+import { dueDateQueries, startDateQueries } from '../../queries/constants';
import SidebarEditableItem from '../sidebar_editable_item.vue';
import SidebarFormattedDate from './sidebar_formatted_date.vue';
import SidebarInheritDate from './sidebar_inherit_date.vue';
diff --git a/app/assets/javascripts/sidebar/components/incidents/sidebar_escalation_status.vue b/app/assets/javascripts/sidebar/components/incidents/sidebar_escalation_status.vue
index 6db332a82da..576043963de 100644
--- a/app/assets/javascripts/sidebar/components/incidents/sidebar_escalation_status.vue
+++ b/app/assets/javascripts/sidebar/components/incidents/sidebar_escalation_status.vue
@@ -3,11 +3,8 @@ import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { createAlert } from '~/alert';
import { logError } from '~/lib/logger';
import EscalationStatus from 'ee_else_ce/sidebar/components/incidents/escalation_status.vue';
-import {
- escalationStatusQuery,
- escalationStatusMutation,
- INCIDENTS_I18N as i18n,
-} from '../../constants';
+import { INCIDENTS_I18N as i18n } from '../../constants';
+import { escalationStatusQuery, escalationStatusMutation } from '../../queries/constants';
import { getStatusLabel } from '../../utils';
import SidebarEditableItem from '../sidebar_editable_item.vue';
diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js b/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js
index 03ace6286e0..3ab7757d34d 100644
--- a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js
+++ b/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js
@@ -19,7 +19,8 @@ export const dropdownButtonText = (state, getters) => {
if (!selectedLabels.length) {
return state.dropdownButtonText || __('Label');
- } else if (selectedLabels.length > 1) {
+ }
+ if (selectedLabels.length > 1) {
return sprintf(s__('LabelSelect|%{firstLabelName} +%{remainingLabelCount} more'), {
firstLabelName: selectedLabels[0].title,
remainingLabelCount: selectedLabels.length - 1,
diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents.vue
index 53582aacabd..a513c247be7 100644
--- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents.vue
+++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents.vue
@@ -101,7 +101,8 @@ export default {
buttonText() {
if (!this.localSelectedLabels.length) {
return this.dropdownButtonText || __('Label');
- } else if (this.localSelectedLabels.length > 1) {
+ }
+ if (this.localSelectedLabels.length > 1) {
return sprintf(s__('LabelSelect|%{firstLabelName} +%{remainingLabelCount} more'), {
firstLabelName: this.localSelectedLabels[0].title,
remainingLabelCount: this.localSelectedLabels.length - 1,
diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view.vue
index 45778640957..93e3cfba309 100644
--- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view.vue
+++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view.vue
@@ -1,4 +1,5 @@
<script>
+import { get } from 'lodash';
import {
GlAlert,
GlTooltipDirective,
@@ -11,8 +12,7 @@ import produce from 'immer';
import { createAlert } from '~/alert';
import { WORKSPACE_GROUP } from '~/issues/constants';
import { __ } from '~/locale';
-import { workspaceLabelsQueries } from '../../../constants';
-import createLabelMutation from './graphql/create_label.mutation.graphql';
+import { workspaceLabelsQueries, workspaceCreateLabelMutation } from '../../../queries/constants';
import { DEFAULT_LABEL_COLOR } from './constants';
const errorMessage = __('Error creating label.');
@@ -68,13 +68,19 @@ export default {
return Object.keys(colorsMap).map((color) => ({ [color]: colorsMap[color] }));
},
mutationVariables() {
- const attributePath = this.labelCreateType === WORKSPACE_GROUP ? 'groupPath' : 'projectPath';
-
- return {
+ const variables = {
title: this.labelTitle,
color: this.selectedColor,
- [attributePath]: this.attrWorkspacePath,
};
+
+ if (this.labelCreateType) {
+ const attributePath =
+ this.labelCreateType === WORKSPACE_GROUP ? 'groupPath' : 'projectPath';
+
+ return { ...variables, [attributePath]: this.attrWorkspacePath };
+ }
+
+ return variables;
},
},
methods: {
@@ -88,7 +94,7 @@ export default {
this.selectedColor = this.getColorCode(color);
},
updateLabelsInCache(store, label) {
- const { query } = workspaceLabelsQueries[this.workspaceType];
+ const { query, dataPath } = workspaceLabelsQueries[this.workspaceType];
const sourceData = store.readQuery({
query,
@@ -97,7 +103,7 @@ export default {
const collator = new Intl.Collator('en');
const data = produce(sourceData, (draftData) => {
- const { nodes } = draftData.workspace.labels;
+ const { nodes } = get(draftData, dataPath);
nodes.push(label);
nodes.sort((a, b) => collator.compare(a.title, b.title));
});
@@ -114,7 +120,7 @@ export default {
const {
data: { labelCreate },
} = await this.$apollo.mutate({
- mutation: createLabelMutation,
+ mutation: workspaceCreateLabelMutation[this.workspaceType],
variables: this.mutationVariables,
update: (
store,
diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue
index 19fe78aca87..fc8834a97d4 100644
--- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue
+++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue
@@ -4,7 +4,7 @@ import fuzzaldrinPlus from 'fuzzaldrin-plus';
import { createAlert } from '~/alert';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { __ } from '~/locale';
-import { workspaceLabelsQueries } from '../../../constants';
+import { workspaceLabelsQueries } from '../../../queries/constants';
import LabelItem from './label_item.vue';
export default {
@@ -135,6 +135,16 @@ export default {
this.handleLabelClick(this.visibleLabels[0]);
}
},
+ handleFocus(event, index) {
+ if (index === 0 && event.target.classList.contains('is-focused')) {
+ event.target.classList.remove('is-focused');
+
+ // Focus next element (if available) as the first item was already focused.
+ if (event.target.parentNode?.nextElementSibling?.querySelector('button')) {
+ event.target.parentNode.nextElementSibling.querySelector('button').focus();
+ }
+ }
+ },
},
};
</script>
@@ -157,6 +167,7 @@ export default {
:active="shouldHighlightFirstItem && index === 0"
active-class="is-focused"
data-testid="labels-list"
+ @focus.native.capture="handleFocus($event, index)"
@click.native.capture.stop="handleLabelClick(label)"
>
<label-item :label="label" />
diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_footer.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_footer.vue
index e67e704ffb8..d6b43698766 100644
--- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_footer.vue
+++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_footer.vue
@@ -13,7 +13,13 @@ export default {
},
footerManageLabelTitle: {
type: String,
- required: true,
+ required: false,
+ default: '',
+ },
+ },
+ computed: {
+ showManageLabelsItem() {
+ return this.footerManageLabelTitle && this.labelsManagePath;
},
},
};
@@ -28,7 +34,12 @@ export default {
>
{{ footerCreateLabelTitle }}
</gl-dropdown-item>
- <gl-dropdown-item :href="labelsManagePath" @click.capture.native.stop>
+ <gl-dropdown-item
+ v-if="showManageLabelsItem"
+ data-testid="manage-labels-button"
+ :href="labelsManagePath"
+ @click.capture.native.stop
+ >
{{ footerManageLabelTitle }}
</gl-dropdown-item>
</div>
diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue
index 74c3f08a47b..f9a9cc316c1 100644
--- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue
+++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue
@@ -7,7 +7,7 @@ import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { TYPE_EPIC, TYPE_ISSUE, TYPE_MERGE_REQUEST, TYPE_TEST_CASE } from '~/issues/constants';
import { __ } from '~/locale';
-import { issuableLabelsQueries } from '../../../constants';
+import { issuableLabelsQueries } from '../../../queries/constants';
import SidebarEditableItem from '../../sidebar_editable_item.vue';
import { DEBOUNCE_DROPDOWN_DELAY, VARIANT_SIDEBAR } from './constants';
import DropdownContents from './dropdown_contents.vue';
diff --git a/app/assets/javascripts/sidebar/components/participants/participants.vue b/app/assets/javascripts/sidebar/components/participants/participants.vue
index 7b288e15a3e..99d36a61632 100644
--- a/app/assets/javascripts/sidebar/components/participants/participants.vue
+++ b/app/assets/javascripts/sidebar/components/participants/participants.vue
@@ -138,13 +138,10 @@ export default {
</a>
</div>
</div>
- <div v-if="hasMoreParticipants" class="participants-more hide-collapsed">
- <gl-button
- variant="link"
- button-text-classes="gl-text-secondary"
- @click="toggleMoreParticipants"
- >{{ toggleLabel }}</gl-button
- >
+ <div v-if="hasMoreParticipants" class="hide-collapsed">
+ <gl-button category="tertiary" size="small" @click="toggleMoreParticipants">{{
+ toggleLabel
+ }}</gl-button>
</div>
</div>
</template>
diff --git a/app/assets/javascripts/sidebar/components/participants/sidebar_participants_widget.vue b/app/assets/javascripts/sidebar/components/participants/sidebar_participants_widget.vue
index b0556e22a8d..b764d660d63 100644
--- a/app/assets/javascripts/sidebar/components/participants/sidebar_participants_widget.vue
+++ b/app/assets/javascripts/sidebar/components/participants/sidebar_participants_widget.vue
@@ -1,6 +1,6 @@
<script>
import { __ } from '~/locale';
-import { participantsQueries } from '../../constants';
+import { participantsQueries } from '../../queries/constants';
import Participants from './participants.vue';
export default {
diff --git a/app/assets/javascripts/sidebar/components/reviewers/collapsed_reviewer_list.vue b/app/assets/javascripts/sidebar/components/reviewers/collapsed_reviewer_list.vue
index 88a74784dd2..415c40b4779 100644
--- a/app/assets/javascripts/sidebar/components/reviewers/collapsed_reviewer_list.vue
+++ b/app/assets/javascripts/sidebar/components/reviewers/collapsed_reviewer_list.vue
@@ -52,7 +52,8 @@ export default {
if (mergeLength === this.users.length) {
return '';
- } else if (mergeLength > 0) {
+ }
+ if (mergeLength > 0) {
return sprintf(__('%{mergeLength}/%{usersLength} can merge'), {
mergeLength,
usersLength: this.users.length,
diff --git a/app/assets/javascripts/sidebar/components/sidebar_dropdown.vue b/app/assets/javascripts/sidebar/components/sidebar_dropdown.vue
index 50b4284cde0..c9450244b40 100644
--- a/app/assets/javascripts/sidebar/components/sidebar_dropdown.vue
+++ b/app/assets/javascripts/sidebar/components/sidebar_dropdown.vue
@@ -20,13 +20,13 @@ import {
defaultEpicSort,
dropdowni18nText,
epicIidPattern,
- issuableAttributesQueries,
IssuableAttributeState,
IssuableAttributeType,
IssuableAttributeTypeKeyMap,
LocalizedIssuableAttributeType,
noAttributeId,
} from 'ee_else_ce/sidebar/constants';
+import { issuableAttributesQueries } from 'ee_else_ce/sidebar/queries/constants';
import { createAlert } from '~/alert';
import { PathIdSeparator } from '~/related_issues/constants';
diff --git a/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue b/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
index 4721c6fee61..7fde43a360d 100644
--- a/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
+++ b/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
@@ -11,10 +11,10 @@ import {
dropdowni18nText,
LocalizedIssuableAttributeType,
IssuableAttributeTypeKeyMap,
- issuableAttributesQueries,
IssuableAttributeType,
Tracking,
} from 'ee_else_ce/sidebar/constants';
+import { issuableAttributesQueries } from 'ee_else_ce/sidebar/queries/constants';
import SidebarDropdown from './sidebar_dropdown.vue';
import SidebarEditableItem from './sidebar_editable_item.vue';
diff --git a/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue b/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue
index d6e1847aecb..568962cddc7 100644
--- a/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue
+++ b/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue
@@ -13,7 +13,8 @@ import { isLoggedIn } from '~/lib/utils/common_utils';
import { __, sprintf } from '~/locale';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import toast from '~/vue_shared/plugins/global_toast';
-import { subscribedQueries, Tracking } from '../../constants';
+import { Tracking } from '../../constants';
+import { subscribedQueries } from '../../queries/constants';
import SidebarEditableItem from '../sidebar_editable_item.vue';
const ICON_ON = 'notifications';
diff --git a/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue b/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue
index 465f971717f..ac05ae3896b 100644
--- a/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue
+++ b/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue
@@ -42,11 +42,14 @@ export default {
divClass() {
if (this.showComparisonState) {
return 'compare';
- } else if (this.showEstimateOnlyState) {
+ }
+ if (this.showEstimateOnlyState) {
return 'estimate-only';
- } else if (this.showSpentOnlyState) {
+ }
+ if (this.showSpentOnlyState) {
return 'spend-only';
- } else if (this.showNoTimeTrackingState) {
+ }
+ if (this.showNoTimeTrackingState) {
return 'no-tracking';
}
@@ -55,9 +58,11 @@ export default {
spanClass() {
if (this.showComparisonState) {
return '';
- } else if (this.showEstimateOnlyState || this.showSpentOnlyState) {
+ }
+ if (this.showEstimateOnlyState || this.showSpentOnlyState) {
return 'bold';
- } else if (this.showNoTimeTrackingState) {
+ }
+ if (this.showNoTimeTrackingState) {
return 'no-value collapse-truncated-title gl-pt-2 gl-px-3 gl-font-sm';
}
@@ -66,11 +71,14 @@ export default {
text() {
if (this.showComparisonState) {
return `${this.timeSpentHumanReadable} / ${this.timeEstimateHumanReadable}`;
- } else if (this.showEstimateOnlyState) {
+ }
+ if (this.showEstimateOnlyState) {
return `-- / ${this.timeEstimateHumanReadable}`;
- } else if (this.showSpentOnlyState) {
+ }
+ if (this.showSpentOnlyState) {
return `${this.timeSpentHumanReadable} / --`;
- } else if (this.showNoTimeTrackingState) {
+ }
+ if (this.showNoTimeTrackingState) {
return __('None');
}
diff --git a/app/assets/javascripts/sidebar/components/time_tracking/report.vue b/app/assets/javascripts/sidebar/components/time_tracking/report.vue
index 70d8024f46a..9bd4c7f5c68 100644
--- a/app/assets/javascripts/sidebar/components/time_tracking/report.vue
+++ b/app/assets/javascripts/sidebar/components/time_tracking/report.vue
@@ -7,7 +7,7 @@ import { convertToGraphQLId } from '~/graphql_shared/utils';
import { TYPE_ISSUE } from '~/issues/constants';
import { formatDate, parseSeconds, stringifyTime } from '~/lib/utils/datetime_utility';
import { __, s__ } from '~/locale';
-import { timelogQueries } from '../../constants';
+import { timelogQueries } from '../../queries/constants';
import deleteTimelogMutation from '../../queries/delete_timelog.mutation.graphql';
const TIME_DATE_FORMAT = 'mmmm d, yyyy, HH:MM ("UTC:" o)';
diff --git a/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue b/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
index 1d427a871e1..aff592d48e0 100644
--- a/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
+++ b/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
@@ -12,7 +12,8 @@ import { TYPE_ISSUE, TYPE_MERGE_REQUEST } from '~/issues/constants';
import { BV_SHOW_MODAL } from '~/lib/utils/constants';
import { s__, __ } from '~/locale';
-import { HOW_TO_TRACK_TIME, timeTrackingQueries } from '../../constants';
+import { HOW_TO_TRACK_TIME } from '../../constants';
+import { timeTrackingQueries } from '../../queries/constants';
import eventHub from '../../event_hub';
import TimeTrackingCollapsedState from './collapsed_state.vue';
import TimeTrackingComparisonPane from './comparison_pane.vue';
@@ -122,9 +123,11 @@ export default {
// 3. issuableIid and fullPath are not provided
if (!this.issuableType || !timeTrackingQueries[this.issuableType]) {
return true;
- } else if (this.initialTimeTracking) {
+ }
+ if (this.initialTimeTracking) {
return true;
- } else if (!this.issuableIid || !this.fullPath) {
+ }
+ if (!this.issuableIid || !this.fullPath) {
return true;
}
return false;
diff --git a/app/assets/javascripts/sidebar/components/todo_toggle/sidebar_todo_widget.vue b/app/assets/javascripts/sidebar/components/todo_toggle/sidebar_todo_widget.vue
index 551d306a9c4..1099dcb832f 100644
--- a/app/assets/javascripts/sidebar/components/todo_toggle/sidebar_todo_widget.vue
+++ b/app/assets/javascripts/sidebar/components/todo_toggle/sidebar_todo_widget.vue
@@ -6,7 +6,8 @@ import { TYPE_MERGE_REQUEST } from '~/issues/constants';
import { __, sprintf } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import Tracking from '~/tracking';
-import { todoQueries, TodoMutationTypes, todoMutations } from '../../constants';
+import { TodoMutationTypes } from '../../constants';
+import { todoQueries, todoMutations } from '../../queries/constants';
import { todoLabel } from '../../utils';
import TodoButton from './todo_button.vue';
diff --git a/app/assets/javascripts/sidebar/constants.js b/app/assets/javascripts/sidebar/constants.js
index 0f82182c6e2..f13f613733b 100644
--- a/app/assets/javascripts/sidebar/constants.js
+++ b/app/assets/javascripts/sidebar/constants.js
@@ -1,173 +1,10 @@
import { invert } from 'lodash';
import { s__, __, sprintf } from '~/locale';
-import updateIssueLabelsMutation from '~/boards/graphql/issue_set_labels.mutation.graphql';
-import userSearchQuery from '~/graphql_shared/queries/users_search.query.graphql';
-import userSearchWithMRPermissionsQuery from '~/graphql_shared/queries/users_search_with_mr_permissions.graphql';
-import {
- TYPE_ALERT,
- TYPE_EPIC,
- TYPE_ISSUE,
- TYPE_MERGE_REQUEST,
- TYPE_TEST_CASE,
- WORKSPACE_GROUP,
- WORKSPACE_PROJECT,
-} from '~/issues/constants';
-import updateAlertAssigneesMutation from '~/vue_shared/alert_details/graphql/mutations/alert_set_assignees.mutation.graphql';
-import issuableDatesUpdatedSubscription from '../graphql_shared/subscriptions/work_item_dates.subscription.graphql';
-import updateTestCaseLabelsMutation from './components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql';
-import epicLabelsQuery from './components/labels/labels_select_widget/graphql/epic_labels.query.graphql';
-import updateEpicLabelsMutation from './components/labels/labels_select_widget/graphql/epic_update_labels.mutation.graphql';
-import groupLabelsQuery from './components/labels/labels_select_widget/graphql/group_labels.query.graphql';
-import issueLabelsQuery from './components/labels/labels_select_widget/graphql/issue_labels.query.graphql';
-import mergeRequestLabelsQuery from './components/labels/labels_select_widget/graphql/merge_request_labels.query.graphql';
-import projectLabelsQuery from './components/labels/labels_select_widget/graphql/project_labels.query.graphql';
-import epicConfidentialQuery from './queries/epic_confidential.query.graphql';
-import epicDueDateQuery from './queries/epic_due_date.query.graphql';
-import epicParticipantsQuery from './queries/epic_participants.query.graphql';
-import epicReferenceQuery from './queries/epic_reference.query.graphql';
-import epicStartDateQuery from './queries/epic_start_date.query.graphql';
-import epicSubscribedQuery from './queries/epic_subscribed.query.graphql';
-import epicTodoQuery from './queries/epic_todo.query.graphql';
-import issuableAssigneesSubscription from './queries/issuable_assignees.subscription.graphql';
-import issueConfidentialQuery from './queries/issue_confidential.query.graphql';
-import issueDueDateQuery from './queries/issue_due_date.query.graphql';
-import issueReferenceQuery from './queries/issue_reference.query.graphql';
-import issueSubscribedQuery from './queries/issue_subscribed.query.graphql';
-import issueTimeTrackingQuery from './queries/issue_time_tracking.query.graphql';
-import issueTodoQuery from './queries/issue_todo.query.graphql';
-import mergeRequestMilestone from './queries/merge_request_milestone.query.graphql';
-import mergeRequestReferenceQuery from './queries/merge_request_reference.query.graphql';
-import mergeRequestSubscribed from './queries/merge_request_subscribed.query.graphql';
-import mergeRequestTimeTrackingQuery from './queries/merge_request_time_tracking.query.graphql';
-import mergeRequestTodoQuery from './queries/merge_request_todo.query.graphql';
-import todoCreateMutation from './queries/todo_create.mutation.graphql';
-import todoMarkDoneMutation from './queries/todo_mark_done.mutation.graphql';
-import updateEpicConfidentialMutation from './queries/update_epic_confidential.mutation.graphql';
-import updateEpicDueDateMutation from './queries/update_epic_due_date.mutation.graphql';
-import updateEpicStartDateMutation from './queries/update_epic_start_date.mutation.graphql';
-import updateEpicSubscriptionMutation from './queries/update_epic_subscription.mutation.graphql';
-import updateIssueConfidentialMutation from './queries/update_issue_confidential.mutation.graphql';
-import updateIssueDueDateMutation from './queries/update_issue_due_date.mutation.graphql';
-import updateIssueSubscriptionMutation from './queries/update_issue_subscription.mutation.graphql';
-import mergeRequestMilestoneMutation from './queries/update_merge_request_milestone.mutation.graphql';
-import updateMergeRequestLabelsMutation from './queries/update_merge_request_labels.mutation.graphql';
-import updateMergeRequestSubscriptionMutation from './queries/update_merge_request_subscription.mutation.graphql';
-import getAlertAssignees from './queries/get_alert_assignees.query.graphql';
-import getIssueAssignees from './queries/get_issue_assignees.query.graphql';
-import issueParticipantsQuery from './queries/get_issue_participants.query.graphql';
-import getIssueTimelogsQuery from './queries/get_issue_timelogs.query.graphql';
-import getMergeRequestAssignees from './queries/get_mr_assignees.query.graphql';
-import getMergeRequestParticipants from './queries/get_mr_participants.query.graphql';
-import getMrTimelogsQuery from './queries/get_mr_timelogs.query.graphql';
-import updateIssueAssigneesMutation from './queries/update_issue_assignees.mutation.graphql';
-import updateMergeRequestAssigneesMutation from './queries/update_mr_assignees.mutation.graphql';
-import getEscalationStatusQuery from './queries/escalation_status.query.graphql';
-import updateEscalationStatusMutation from './queries/update_escalation_status.mutation.graphql';
-import groupMilestonesQuery from './queries/group_milestones.query.graphql';
-import projectIssueMilestoneMutation from './queries/project_issue_milestone.mutation.graphql';
-import projectIssueMilestoneQuery from './queries/project_issue_milestone.query.graphql';
-import projectMilestonesQuery from './queries/project_milestones.query.graphql';
export const defaultEpicSort = 'TITLE_ASC';
export const epicIidPattern = /^&(?<iid>\d+)$/;
-export const assigneesQueries = {
- [TYPE_ISSUE]: {
- query: getIssueAssignees,
- subscription: issuableAssigneesSubscription,
- mutation: updateIssueAssigneesMutation,
- },
- [TYPE_MERGE_REQUEST]: {
- query: getMergeRequestAssignees,
- mutation: updateMergeRequestAssigneesMutation,
- },
- [TYPE_ALERT]: {
- query: getAlertAssignees,
- mutation: updateAlertAssigneesMutation,
- },
-};
-
-export const participantsQueries = {
- [TYPE_ISSUE]: {
- query: issueParticipantsQuery,
- },
- [TYPE_MERGE_REQUEST]: {
- query: getMergeRequestParticipants,
- },
- [TYPE_EPIC]: {
- query: epicParticipantsQuery,
- },
- [TYPE_ALERT]: {
- query: '',
- skipQuery: true,
- },
-};
-
-export const userSearchQueries = {
- [TYPE_ISSUE]: {
- query: userSearchQuery,
- },
- [TYPE_MERGE_REQUEST]: {
- query: userSearchWithMRPermissionsQuery,
- },
-};
-
-export const confidentialityQueries = {
- [TYPE_ISSUE]: {
- query: issueConfidentialQuery,
- mutation: updateIssueConfidentialMutation,
- },
- [TYPE_EPIC]: {
- query: epicConfidentialQuery,
- mutation: updateEpicConfidentialMutation,
- },
-};
-
-export const referenceQueries = {
- [TYPE_ISSUE]: {
- query: issueReferenceQuery,
- },
- [TYPE_MERGE_REQUEST]: {
- query: mergeRequestReferenceQuery,
- },
- [TYPE_EPIC]: {
- query: epicReferenceQuery,
- },
-};
-
-export const workspaceLabelsQueries = {
- [WORKSPACE_PROJECT]: {
- query: projectLabelsQuery,
- },
- [WORKSPACE_GROUP]: {
- query: groupLabelsQuery,
- },
-};
-
-export const issuableLabelsQueries = {
- [TYPE_ISSUE]: {
- issuableQuery: issueLabelsQuery,
- mutation: updateIssueLabelsMutation,
- mutationName: 'updateIssue',
- },
- [TYPE_MERGE_REQUEST]: {
- issuableQuery: mergeRequestLabelsQuery,
- mutation: updateMergeRequestLabelsMutation,
- mutationName: 'mergeRequestSetLabels',
- },
- [TYPE_EPIC]: {
- issuableQuery: epicLabelsQuery,
- mutation: updateEpicLabelsMutation,
- mutationName: 'updateEpic',
- },
- [TYPE_TEST_CASE]: {
- issuableQuery: issueLabelsQuery,
- mutation: updateTestCaseLabelsMutation,
- mutationName: 'updateTestCaseLabels',
- },
-};
-
export const dateTypes = {
start: 'startDate',
due: 'dueDate',
@@ -186,91 +23,13 @@ export const dateFields = {
},
};
-export const subscribedQueries = {
- [TYPE_ISSUE]: {
- query: issueSubscribedQuery,
- mutation: updateIssueSubscriptionMutation,
- },
- [TYPE_EPIC]: {
- query: epicSubscribedQuery,
- mutation: updateEpicSubscriptionMutation,
- },
- [TYPE_MERGE_REQUEST]: {
- query: mergeRequestSubscribed,
- mutation: updateMergeRequestSubscriptionMutation,
- },
-};
-
export const Tracking = {
editEvent: 'click_edit_button',
rightSidebarLabel: 'right_sidebar',
};
-export const timeTrackingQueries = {
- [TYPE_ISSUE]: {
- query: issueTimeTrackingQuery,
- },
- [TYPE_MERGE_REQUEST]: {
- query: mergeRequestTimeTrackingQuery,
- },
-};
-
-export const dueDateQueries = {
- [TYPE_ISSUE]: {
- query: issueDueDateQuery,
- mutation: updateIssueDueDateMutation,
- subscription: issuableDatesUpdatedSubscription,
- },
- [TYPE_EPIC]: {
- query: epicDueDateQuery,
- mutation: updateEpicDueDateMutation,
- },
-};
-
-export const startDateQueries = {
- [TYPE_EPIC]: {
- query: epicStartDateQuery,
- mutation: updateEpicStartDateMutation,
- },
-};
-
-export const timelogQueries = {
- [TYPE_ISSUE]: {
- query: getIssueTimelogsQuery,
- },
- [TYPE_MERGE_REQUEST]: {
- query: getMrTimelogsQuery,
- },
-};
-
export const noAttributeId = null;
-export const issuableMilestoneQueries = {
- [TYPE_ISSUE]: {
- query: projectIssueMilestoneQuery,
- mutation: projectIssueMilestoneMutation,
- },
- [TYPE_MERGE_REQUEST]: {
- query: mergeRequestMilestone,
- mutation: mergeRequestMilestoneMutation,
- },
-};
-
-export const milestonesQueries = {
- [TYPE_ISSUE]: {
- query: {
- [WORKSPACE_GROUP]: groupMilestonesQuery,
- [WORKSPACE_PROJECT]: projectMilestonesQuery,
- },
- },
- [TYPE_MERGE_REQUEST]: {
- query: {
- [WORKSPACE_GROUP]: groupMilestonesQuery,
- [WORKSPACE_PROJECT]: projectMilestonesQuery,
- },
- },
-};
-
export const IssuableAttributeType = {
Milestone: 'milestone',
};
@@ -285,35 +44,11 @@ export const IssuableAttributeState = {
[IssuableAttributeType.Milestone]: 'active',
};
-export const issuableAttributesQueries = {
- [IssuableAttributeType.Milestone]: {
- current: issuableMilestoneQueries,
- list: milestonesQueries,
- },
-};
-
-export const todoQueries = {
- [TYPE_EPIC]: {
- query: epicTodoQuery,
- },
- [TYPE_ISSUE]: {
- query: issueTodoQuery,
- },
- [TYPE_MERGE_REQUEST]: {
- query: mergeRequestTodoQuery,
- },
-};
-
export const TodoMutationTypes = {
Create: 'create',
MarkDone: 'mark-done',
};
-export const todoMutations = {
- [TodoMutationTypes.Create]: todoCreateMutation,
- [TodoMutationTypes.MarkDone]: todoMarkDoneMutation,
-};
-
export function dropdowni18nText(issuableAttribute, issuableType) {
return {
noAttribute: sprintf(s__('DropdownWidget|No %{issuableAttribute}'), {
@@ -362,9 +97,6 @@ export function dropdowni18nText(issuableAttribute, issuableType) {
};
}
-export const escalationStatusQuery = getEscalationStatusQuery;
-export const escalationStatusMutation = updateEscalationStatusMutation;
-
export const HOW_TO_TRACK_TIME = __('How to track time');
export const statusDropdownOptions = [
diff --git a/app/assets/javascripts/sidebar/queries/constants.js b/app/assets/javascripts/sidebar/queries/constants.js
new file mode 100644
index 00000000000..0844abc4599
--- /dev/null
+++ b/app/assets/javascripts/sidebar/queries/constants.js
@@ -0,0 +1,291 @@
+import updateIssueLabelsMutation from '~/boards/graphql/issue_set_labels.mutation.graphql';
+import userAutocompleteQuery from '~/graphql_shared/queries/project_autocomplete_users.query.graphql';
+import userAutocompleteWithMRPermissionsQuery from '~/graphql_shared/queries/project_autocomplete_users_with_mr_permissions.query.graphql';
+import issuableDatesUpdatedSubscription from '~/graphql_shared/subscriptions/work_item_dates.subscription.graphql';
+import {
+ TYPE_ALERT,
+ TYPE_EPIC,
+ TYPE_ISSUE,
+ TYPE_MERGE_REQUEST,
+ TYPE_TEST_CASE,
+ WORKSPACE_GROUP,
+ WORKSPACE_PROJECT,
+} from '~/issues/constants';
+import updateAlertAssigneesMutation from '~/vue_shared/alert_details/graphql/mutations/alert_set_assignees.mutation.graphql';
+import abuseReportLabelsQuery from '~/admin/abuse_report/components/graphql/abuse_report_labels.query.graphql';
+import createAbuseReportLabelMutation from '~/admin/abuse_report/components/graphql/create_abuse_report_label.mutation.graphql';
+import createGroupOrProjectLabelMutation from '../components/labels/labels_select_widget/graphql/create_label.mutation.graphql';
+import updateTestCaseLabelsMutation from '../components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql';
+import epicLabelsQuery from '../components/labels/labels_select_widget/graphql/epic_labels.query.graphql';
+import updateEpicLabelsMutation from '../components/labels/labels_select_widget/graphql/epic_update_labels.mutation.graphql';
+import groupLabelsQuery from '../components/labels/labels_select_widget/graphql/group_labels.query.graphql';
+import issueLabelsQuery from '../components/labels/labels_select_widget/graphql/issue_labels.query.graphql';
+import mergeRequestLabelsQuery from '../components/labels/labels_select_widget/graphql/merge_request_labels.query.graphql';
+import projectLabelsQuery from '../components/labels/labels_select_widget/graphql/project_labels.query.graphql';
+import { IssuableAttributeType, TodoMutationTypes } from '../constants';
+import epicConfidentialQuery from './epic_confidential.query.graphql';
+import epicDueDateQuery from './epic_due_date.query.graphql';
+import epicParticipantsQuery from './epic_participants.query.graphql';
+import epicReferenceQuery from './epic_reference.query.graphql';
+import epicStartDateQuery from './epic_start_date.query.graphql';
+import epicSubscribedQuery from './epic_subscribed.query.graphql';
+import epicTodoQuery from './epic_todo.query.graphql';
+import issuableAssigneesSubscription from './issuable_assignees.subscription.graphql';
+import issueConfidentialQuery from './issue_confidential.query.graphql';
+import issueDueDateQuery from './issue_due_date.query.graphql';
+import issueReferenceQuery from './issue_reference.query.graphql';
+import issueSubscribedQuery from './issue_subscribed.query.graphql';
+import issueTimeTrackingQuery from './issue_time_tracking.query.graphql';
+import issueTodoQuery from './issue_todo.query.graphql';
+import mergeRequestMilestone from './merge_request_milestone.query.graphql';
+import mergeRequestReferenceQuery from './merge_request_reference.query.graphql';
+import mergeRequestSubscribed from './merge_request_subscribed.query.graphql';
+import mergeRequestTimeTrackingQuery from './merge_request_time_tracking.query.graphql';
+import mergeRequestTodoQuery from './merge_request_todo.query.graphql';
+import todoCreateMutation from './todo_create.mutation.graphql';
+import todoMarkDoneMutation from './todo_mark_done.mutation.graphql';
+import updateEpicConfidentialMutation from './update_epic_confidential.mutation.graphql';
+import updateEpicDueDateMutation from './update_epic_due_date.mutation.graphql';
+import updateEpicStartDateMutation from './update_epic_start_date.mutation.graphql';
+import updateEpicSubscriptionMutation from './update_epic_subscription.mutation.graphql';
+import updateIssueConfidentialMutation from './update_issue_confidential.mutation.graphql';
+import updateIssueDueDateMutation from './update_issue_due_date.mutation.graphql';
+import updateIssueSubscriptionMutation from './update_issue_subscription.mutation.graphql';
+import mergeRequestMilestoneMutation from './update_merge_request_milestone.mutation.graphql';
+import updateMergeRequestLabelsMutation from './update_merge_request_labels.mutation.graphql';
+import updateMergeRequestSubscriptionMutation from './update_merge_request_subscription.mutation.graphql';
+import getAlertAssignees from './get_alert_assignees.query.graphql';
+import getIssueAssignees from './get_issue_assignees.query.graphql';
+import issueParticipantsQuery from './get_issue_participants.query.graphql';
+import getIssueTimelogsQuery from './get_issue_timelogs.query.graphql';
+import getMergeRequestAssignees from './get_mr_assignees.query.graphql';
+import getMergeRequestParticipants from './get_mr_participants.query.graphql';
+import getMrTimelogsQuery from './get_mr_timelogs.query.graphql';
+import updateIssueAssigneesMutation from './update_issue_assignees.mutation.graphql';
+import updateMergeRequestAssigneesMutation from './update_mr_assignees.mutation.graphql';
+import getEscalationStatusQuery from './escalation_status.query.graphql';
+import updateEscalationStatusMutation from './update_escalation_status.mutation.graphql';
+import groupMilestonesQuery from './group_milestones.query.graphql';
+import projectIssueMilestoneMutation from './project_issue_milestone.mutation.graphql';
+import projectIssueMilestoneQuery from './project_issue_milestone.query.graphql';
+import projectMilestonesQuery from './project_milestones.query.graphql';
+import testCaseConfidentialQuery from './test_case_confidential.query.graphql';
+import updateTestCaseConfidentialMutation from './update_test_case_confidential.mutation.graphql';
+
+export const assigneesQueries = {
+ [TYPE_ISSUE]: {
+ query: getIssueAssignees,
+ subscription: issuableAssigneesSubscription,
+ mutation: updateIssueAssigneesMutation,
+ },
+ [TYPE_MERGE_REQUEST]: {
+ query: getMergeRequestAssignees,
+ mutation: updateMergeRequestAssigneesMutation,
+ },
+ [TYPE_ALERT]: {
+ query: getAlertAssignees,
+ mutation: updateAlertAssigneesMutation,
+ },
+};
+
+export const participantsQueries = {
+ [TYPE_ISSUE]: {
+ query: issueParticipantsQuery,
+ },
+ [TYPE_MERGE_REQUEST]: {
+ query: getMergeRequestParticipants,
+ },
+ [TYPE_EPIC]: {
+ query: epicParticipantsQuery,
+ },
+ [TYPE_ALERT]: {
+ query: '',
+ skipQuery: true,
+ },
+};
+
+export const userSearchQueries = {
+ [TYPE_ISSUE]: {
+ query: userAutocompleteQuery,
+ },
+ [TYPE_MERGE_REQUEST]: {
+ query: userAutocompleteWithMRPermissionsQuery,
+ },
+};
+
+export const confidentialityQueries = {
+ [TYPE_ISSUE]: {
+ query: issueConfidentialQuery,
+ mutation: updateIssueConfidentialMutation,
+ },
+ [TYPE_EPIC]: {
+ query: epicConfidentialQuery,
+ mutation: updateEpicConfidentialMutation,
+ },
+ [TYPE_TEST_CASE]: {
+ query: testCaseConfidentialQuery,
+ mutation: updateTestCaseConfidentialMutation,
+ },
+};
+
+export const referenceQueries = {
+ [TYPE_ISSUE]: {
+ query: issueReferenceQuery,
+ },
+ [TYPE_MERGE_REQUEST]: {
+ query: mergeRequestReferenceQuery,
+ },
+ [TYPE_EPIC]: {
+ query: epicReferenceQuery,
+ },
+};
+
+export const workspaceLabelsQueries = {
+ [WORKSPACE_PROJECT]: {
+ query: projectLabelsQuery,
+ dataPath: 'workspace.labels',
+ },
+ [WORKSPACE_GROUP]: {
+ query: groupLabelsQuery,
+ dataPath: 'workspace.labels',
+ },
+ abuseReport: {
+ query: abuseReportLabelsQuery,
+ dataPath: 'labels',
+ },
+};
+
+export const workspaceCreateLabelMutation = {
+ [WORKSPACE_PROJECT]: createGroupOrProjectLabelMutation,
+ [WORKSPACE_GROUP]: createGroupOrProjectLabelMutation,
+ abuseReport: createAbuseReportLabelMutation,
+};
+
+export const issuableLabelsQueries = {
+ [TYPE_ISSUE]: {
+ issuableQuery: issueLabelsQuery,
+ mutation: updateIssueLabelsMutation,
+ mutationName: 'updateIssue',
+ },
+ [TYPE_MERGE_REQUEST]: {
+ issuableQuery: mergeRequestLabelsQuery,
+ mutation: updateMergeRequestLabelsMutation,
+ mutationName: 'mergeRequestSetLabels',
+ },
+ [TYPE_EPIC]: {
+ issuableQuery: epicLabelsQuery,
+ mutation: updateEpicLabelsMutation,
+ mutationName: 'updateEpic',
+ },
+ [TYPE_TEST_CASE]: {
+ issuableQuery: issueLabelsQuery,
+ mutation: updateTestCaseLabelsMutation,
+ mutationName: 'updateTestCaseLabels',
+ },
+};
+
+export const subscribedQueries = {
+ [TYPE_ISSUE]: {
+ query: issueSubscribedQuery,
+ mutation: updateIssueSubscriptionMutation,
+ },
+ [TYPE_EPIC]: {
+ query: epicSubscribedQuery,
+ mutation: updateEpicSubscriptionMutation,
+ },
+ [TYPE_MERGE_REQUEST]: {
+ query: mergeRequestSubscribed,
+ mutation: updateMergeRequestSubscriptionMutation,
+ },
+};
+
+export const timeTrackingQueries = {
+ [TYPE_ISSUE]: {
+ query: issueTimeTrackingQuery,
+ },
+ [TYPE_MERGE_REQUEST]: {
+ query: mergeRequestTimeTrackingQuery,
+ },
+};
+
+export const dueDateQueries = {
+ [TYPE_ISSUE]: {
+ query: issueDueDateQuery,
+ mutation: updateIssueDueDateMutation,
+ subscription: issuableDatesUpdatedSubscription,
+ },
+ [TYPE_EPIC]: {
+ query: epicDueDateQuery,
+ mutation: updateEpicDueDateMutation,
+ },
+};
+
+export const startDateQueries = {
+ [TYPE_EPIC]: {
+ query: epicStartDateQuery,
+ mutation: updateEpicStartDateMutation,
+ },
+};
+
+export const timelogQueries = {
+ [TYPE_ISSUE]: {
+ query: getIssueTimelogsQuery,
+ },
+ [TYPE_MERGE_REQUEST]: {
+ query: getMrTimelogsQuery,
+ },
+};
+
+export const issuableMilestoneQueries = {
+ [TYPE_ISSUE]: {
+ query: projectIssueMilestoneQuery,
+ mutation: projectIssueMilestoneMutation,
+ },
+ [TYPE_MERGE_REQUEST]: {
+ query: mergeRequestMilestone,
+ mutation: mergeRequestMilestoneMutation,
+ },
+};
+
+export const milestonesQueries = {
+ [TYPE_ISSUE]: {
+ query: {
+ [WORKSPACE_GROUP]: groupMilestonesQuery,
+ [WORKSPACE_PROJECT]: projectMilestonesQuery,
+ },
+ },
+ [TYPE_MERGE_REQUEST]: {
+ query: {
+ [WORKSPACE_GROUP]: groupMilestonesQuery,
+ [WORKSPACE_PROJECT]: projectMilestonesQuery,
+ },
+ },
+};
+
+export const issuableAttributesQueries = {
+ [IssuableAttributeType.Milestone]: {
+ current: issuableMilestoneQueries,
+ list: milestonesQueries,
+ },
+};
+
+export const todoQueries = {
+ [TYPE_EPIC]: {
+ query: epicTodoQuery,
+ },
+ [TYPE_ISSUE]: {
+ query: issueTodoQuery,
+ },
+ [TYPE_MERGE_REQUEST]: {
+ query: mergeRequestTodoQuery,
+ },
+};
+
+export const todoMutations = {
+ [TodoMutationTypes.Create]: todoCreateMutation,
+ [TodoMutationTypes.MarkDone]: todoMarkDoneMutation,
+};
+
+export const escalationStatusQuery = getEscalationStatusQuery;
+
+export const escalationStatusMutation = updateEscalationStatusMutation;
diff --git a/app/assets/javascripts/sidebar/queries/test_case_confidential.query.graphql b/app/assets/javascripts/sidebar/queries/test_case_confidential.query.graphql
new file mode 100644
index 00000000000..d8959b5ce3f
--- /dev/null
+++ b/app/assets/javascripts/sidebar/queries/test_case_confidential.query.graphql
@@ -0,0 +1,9 @@
+query testCaseConfidential($fullPath: ID!, $iid: String) {
+ workspace: project(fullPath: $fullPath) {
+ id
+ issuable: issue(iid: $iid) {
+ id
+ confidential
+ }
+ }
+}
diff --git a/app/assets/javascripts/sidebar/queries/update_test_case_confidential.mutation.graphql b/app/assets/javascripts/sidebar/queries/update_test_case_confidential.mutation.graphql
new file mode 100644
index 00000000000..4094907cb95
--- /dev/null
+++ b/app/assets/javascripts/sidebar/queries/update_test_case_confidential.mutation.graphql
@@ -0,0 +1,9 @@
+mutation updateTestCaseConfidential($input: IssueSetConfidentialInput!) {
+ issuableSetConfidential: issueSetConfidential(input: $input) {
+ issuable: issue {
+ id
+ confidential
+ }
+ errors
+ }
+}