diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /app/assets/javascripts/issues_list | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'app/assets/javascripts/issues_list')
17 files changed, 299 insertions, 149 deletions
diff --git a/app/assets/javascripts/issues_list/components/issuable.vue b/app/assets/javascripts/issues_list/components/issuable.vue index 60b01a6d37f..6dc7460b037 100644 --- a/app/assets/javascripts/issues_list/components/issuable.vue +++ b/app/assets/javascripts/issues_list/components/issuable.vue @@ -315,7 +315,7 @@ export default { <span v-if="isJiraIssue" v-safe-html="jiraLogo" - class="svg-container jira-logo-container" + class="svg-container logo-container" data-testid="jira-logo" ></span> {{ referencePath }} diff --git a/app/assets/javascripts/issues_list/components/issues_list_app.vue b/app/assets/javascripts/issues_list/components/issues_list_app.vue index ee0429c0432..8e37339fca6 100644 --- a/app/assets/javascripts/issues_list/components/issues_list_app.vue +++ b/app/assets/javascripts/issues_list/components/issues_list_app.vue @@ -9,11 +9,12 @@ import { GlTooltipDirective, } from '@gitlab/ui'; import fuzzaldrinPlus from 'fuzzaldrin-plus'; -import { cloneDeep } from 'lodash'; import getIssuesQuery from 'ee_else_ce/issues_list/queries/get_issues.query.graphql'; +import getIssuesCountsQuery from 'ee_else_ce/issues_list/queries/get_issues_counts.query.graphql'; import createFlash from '~/flash'; import { TYPE_USER } from '~/graphql_shared/constants'; import { convertToGraphQLId, getIdFromGraphQLId } from '~/graphql_shared/utils'; +import { ITEM_TYPE } from '~/groups/constants'; import CsvImportExportButtons from '~/issuable/components/csv_import_export_buttons.vue'; import IssuableByEmail from '~/issuable/components/issuable_by_email.vue'; import IssuableList from '~/issuable_list/components/issuable_list_root.vue'; @@ -21,7 +22,6 @@ import { IssuableListTabs, IssuableStates } from '~/issuable_list/constants'; import { CREATED_DESC, i18n, - issuesCountSmartQueryBase, MAX_LIST_SIZE, PAGE_SIZE, PARAM_DUE_DATE, @@ -117,9 +117,15 @@ export default { exportCsvPath: { default: '', }, + fullPath: { + default: '', + }, groupEpicsPath: { default: '', }, + hasAnyIssues: { + default: false, + }, hasBlockedIssuesFeature: { default: false, }, @@ -132,17 +138,14 @@ export default { hasMultipleIssueAssigneesFeature: { default: false, }, - hasProjectIssues: { - default: false, - }, initialEmail: { default: '', }, - isSignedIn: { + isProject: { default: false, }, - issuesPath: { - default: '', + isSignedIn: { + default: false, }, jiraIntegrationPath: { default: '', @@ -150,9 +153,6 @@ export default { newIssuePath: { default: '', }, - projectPath: { - default: '', - }, rssPath: { default: '', }, @@ -164,18 +164,16 @@ export default { }, }, data() { - const filterTokens = getFilterTokens(window.location.search); const state = getParameterByName(PARAM_STATE); const sortKey = getSortKey(getParameterByName(PARAM_SORT)); const defaultSortKey = state === IssuableStates.Closed ? UPDATED_DESC : CREATED_DESC; - this.initialFilterTokens = cloneDeep(filterTokens); - return { dueDateFilter: getDueDateValue(getParameterByName(PARAM_DUE_DATE)), exportCsvPathWithQuery: this.getExportCsvPathWithQuery(), - filterTokens, + filterTokens: getFilterTokens(window.location.search), issues: [], + issuesCounts: {}, pageInfo: {}, pageParams: getInitialPageParams(sortKey), showBulkEditSidebar: false, @@ -189,61 +187,47 @@ export default { variables() { return this.queryVariables; }, - update: ({ project }) => project?.issues.nodes ?? [], + update(data) { + return data[this.namespace]?.issues.nodes ?? []; + }, result({ data }) { - this.pageInfo = data.project?.issues.pageInfo ?? {}; + this.pageInfo = data[this.namespace]?.issues.pageInfo ?? {}; this.exportCsvPathWithQuery = this.getExportCsvPathWithQuery(); }, error(error) { createFlash({ message: this.$options.i18n.errorFetchingIssues, captureError: true, error }); }, skip() { - return !this.hasProjectIssues; + return !this.hasAnyIssues; }, debounce: 200, }, - countOpened: { - ...issuesCountSmartQueryBase, + issuesCounts: { + query: getIssuesCountsQuery, variables() { - return { - ...this.queryVariables, - state: IssuableStates.Opened, - }; + return this.queryVariables; }, - skip() { - return !this.hasProjectIssues; + update(data) { + return data[this.namespace] ?? {}; }, - }, - countClosed: { - ...issuesCountSmartQueryBase, - variables() { - return { - ...this.queryVariables, - state: IssuableStates.Closed, - }; + error(error) { + createFlash({ message: this.$options.i18n.errorFetchingCounts, captureError: true, error }); }, skip() { - return !this.hasProjectIssues; + return !this.hasAnyIssues; }, - }, - countAll: { - ...issuesCountSmartQueryBase, - variables() { - return { - ...this.queryVariables, - state: IssuableStates.All, - }; - }, - skip() { - return !this.hasProjectIssues; + debounce: 200, + context: { + isSingleRequest: true, }, }, }, computed: { queryVariables() { return { + fullPath: this.fullPath, + isProject: this.isProject, isSignedIn: this.isSignedIn, - projectPath: this.projectPath, search: this.searchQuery, sort: this.sortKey, state: this.state, @@ -251,6 +235,9 @@ export default { ...this.apiFilterParams, }; }, + namespace() { + return this.isProject ? ITEM_TYPE.PROJECT : ITEM_TYPE.GROUP; + }, hasSearch() { return this.searchQuery || Object.keys(this.urlFilterParams).length; }, @@ -263,6 +250,9 @@ export default { isOpenTab() { return this.state === IssuableStates.Opened; }, + showCsvButtons() { + return this.isProject && this.isSignedIn; + }, apiFilterParams() { return convertToApiParams(this.filterTokens); }, @@ -405,10 +395,11 @@ export default { return getSortOptions(this.hasIssueWeightsFeature, this.hasBlockedIssuesFeature); }, tabCounts() { + const { openedIssues, closedIssues, allIssues } = this.issuesCounts; return { - [IssuableStates.Opened]: this.countOpened, - [IssuableStates.Closed]: this.countClosed, - [IssuableStates.All]: this.countAll, + [IssuableStates.Opened]: openedIssues?.count, + [IssuableStates.Closed]: closedIssues?.count, + [IssuableStates.All]: allIssues?.count, }; }, currentTabCount() { @@ -465,39 +456,41 @@ export default { return this.$apollo .query({ query: searchLabelsQuery, - variables: { projectPath: this.projectPath, search }, + variables: { fullPath: this.fullPath, search, isProject: this.isProject }, }) - .then(({ data }) => data.project.labels.nodes); + .then(({ data }) => data[this.namespace]?.labels.nodes); }, fetchMilestones(search) { return this.$apollo .query({ query: searchMilestonesQuery, - variables: { projectPath: this.projectPath, search }, + variables: { fullPath: this.fullPath, search, isProject: this.isProject }, }) - .then(({ data }) => data.project.milestones.nodes); + .then(({ data }) => data[this.namespace]?.milestones.nodes); }, fetchIterations(search) { const id = Number(search); const variables = !search || Number.isNaN(id) - ? { projectPath: this.projectPath, search } - : { projectPath: this.projectPath, id }; + ? { fullPath: this.fullPath, search, isProject: this.isProject } + : { fullPath: this.fullPath, id, isProject: this.isProject }; return this.$apollo .query({ query: searchIterationsQuery, variables, }) - .then(({ data }) => data.project.iterations.nodes); + .then(({ data }) => data[this.namespace]?.iterations.nodes); }, fetchUsers(search) { return this.$apollo .query({ query: searchUsersQuery, - variables: { projectPath: this.projectPath, search }, + variables: { fullPath: this.fullPath, search, isProject: this.isProject }, }) - .then(({ data }) => data.project.projectMembers.nodes.map((member) => member.user)); + .then(({ data }) => + data[this.namespace]?.[`${this.namespace}Members`].nodes.map((member) => member.user), + ); }, getExportCsvPathWithQuery() { return `${this.exportCsvPath}${window.location.search}`; @@ -578,19 +571,20 @@ export default { } return axios - .put(joinPaths(this.issuesPath, issueToMove.iid, 'reorder'), { + .put(joinPaths(issueToMove.webPath, 'reorder'), { move_before_id: isMovingToBeginning ? null : getIdFromGraphQLId(moveBeforeId), move_after_id: isMovingToEnd ? null : getIdFromGraphQLId(moveAfterId), + group_full_path: this.isProject ? undefined : this.fullPath, }) .then(() => { const serializedVariables = JSON.stringify(this.queryVariables); - this.$apollo.mutate({ + return this.$apollo.mutate({ mutation: reorderIssuesMutation, - variables: { oldIndex, newIndex, serializedVariables }, + variables: { oldIndex, newIndex, namespace: this.namespace, serializedVariables }, }); }) - .catch(() => { - createFlash({ message: this.$options.i18n.reorderError }); + .catch((error) => { + createFlash({ message: this.$options.i18n.reorderError, captureError: true, error }); }); }, handleSort(sortKey) { @@ -607,13 +601,13 @@ export default { </script> <template> - <div v-if="hasProjectIssues"> + <div v-if="hasAnyIssues"> <issuable-list - :namespace="projectPath" + :namespace="fullPath" recent-searches-storage-key="issues" :search-input-placeholder="$options.i18n.searchPlaceholder" :search-tokens="searchTokens" - :initial-filter-value="initialFilterTokens" + :initial-filter-value="filterTokens" :sort-options="sortOptions" :initial-sort-by="sortKey" :issuables="issues" @@ -653,7 +647,7 @@ export default { :aria-label="$options.i18n.calendarLabel" /> <csv-import-export-buttons - v-if="isSignedIn" + v-if="showCsvButtons" class="gl-md-mr-3" :export-csv-path="exportCsvPathWithQuery" :issuable-count="currentTabCount" @@ -766,6 +760,7 @@ export default { {{ $options.i18n.newIssueLabel }} </gl-button> <csv-import-export-buttons + v-if="showCsvButtons" class="gl-mr-3" :export-csv-path="exportCsvPathWithQuery" :issuable-count="currentTabCount" diff --git a/app/assets/javascripts/issues_list/constants.js b/app/assets/javascripts/issues_list/constants.js index 3f5b0d1feb5..5bdc1bd9f90 100644 --- a/app/assets/javascripts/issues_list/constants.js +++ b/app/assets/javascripts/issues_list/constants.js @@ -1,5 +1,3 @@ -import getIssuesCountQuery from 'ee_else_ce/issues_list/queries/get_issues_count.query.graphql'; -import createFlash from '~/flash'; import { __, s__ } from '~/locale'; import { FILTER_ANY, @@ -22,6 +20,7 @@ const MILESTONE_DUE = 'milestone_due'; const POPULARITY = 'popularity'; const WEIGHT = 'weight'; const LABEL_PRIORITY = 'label_priority'; +const TITLE = 'title'; export const RELATIVE_POSITION = 'relative_position'; export const LOADING_LIST_ITEMS_LENGTH = 8; export const PAGE_SIZE = 20; @@ -43,6 +42,8 @@ export const sortOrderMap = { relative_position: { order_by: RELATIVE_POSITION, sort: ASC }, weight_desc: { order_by: WEIGHT, sort: DESC }, weight: { order_by: WEIGHT, sort: ASC }, + title: { order_by: TITLE, sort: ASC }, + title_desc: { order_by: TITLE, sort: DESC }, }; export const availableSortOptionsJira = [ @@ -146,6 +147,8 @@ 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'; @@ -163,6 +166,7 @@ const LABEL_PRIORITY_ASC_SORT = 'label_priority_asc'; const POPULARITY_ASC_SORT = 'popularity_asc'; const WEIGHT_DESC_SORT = 'weight_desc'; const BLOCKING_ISSUES_DESC_SORT = 'blocking_issues_desc'; +const TITLE_DESC_SORT = 'title_desc'; export const urlSortParams = { [PRIORITY_ASC]: PRIORITY_ASC_SORT, @@ -183,6 +187,8 @@ export const urlSortParams = { [WEIGHT_ASC]: WEIGHT, [WEIGHT_DESC]: WEIGHT_DESC_SORT, [BLOCKING_ISSUES_DESC]: BLOCKING_ISSUES_DESC_SORT, + [TITLE_ASC]: TITLE, + [TITLE_DESC]: TITLE_DESC_SORT, }; export const MAX_LIST_SIZE = 10; @@ -351,15 +357,3 @@ export const filters = { }, }, }; - -export const issuesCountSmartQueryBase = { - query: getIssuesCountQuery, - context: { - isSingleRequest: true, - }, - update: ({ project }) => project?.issues.count, - error(error) { - createFlash({ message: i18n.errorFetchingCounts, captureError: true, error }); - }, - debounce: 200, -}; diff --git a/app/assets/javascripts/issues_list/index.js b/app/assets/javascripts/issues_list/index.js index dcc7ee72273..e89e3e8e681 100644 --- a/app/assets/javascripts/issues_list/index.js +++ b/app/assets/javascripts/issues_list/index.js @@ -85,17 +85,17 @@ export function mountIssuesListApp() { const resolvers = { Mutation: { - reorderIssues: (_, { oldIndex, newIndex, serializedVariables }, { cache }) => { + reorderIssues: (_, { oldIndex, newIndex, namespace, serializedVariables }, { cache }) => { const variables = JSON.parse(serializedVariables); const sourceData = cache.readQuery({ query: getIssuesQuery, variables }); const data = produce(sourceData, (draftData) => { - const issues = draftData.project.issues.nodes.slice(); + const issues = draftData[namespace].issues.nodes.slice(); const issueToMove = issues[oldIndex]; issues.splice(oldIndex, 1); issues.splice(newIndex, 0, issueToMove); - draftData.project.issues.nodes = issues; + draftData[namespace].issues.nodes = issues; }); cache.writeQuery({ query: getIssuesQuery, variables, data }); @@ -118,23 +118,23 @@ export function mountIssuesListApp() { emailsHelpPagePath, emptyStateSvgPath, exportCsvPath, + fullPath, groupEpicsPath, + hasAnyIssues, hasBlockedIssuesFeature, hasIssuableHealthStatusFeature, hasIssueWeightsFeature, hasIterationsFeature, hasMultipleIssueAssigneesFeature, - hasProjectIssues, importCsvIssuesPath, initialEmail, + isProject, isSignedIn, - issuesPath, jiraIntegrationPath, markdownHelpPath, maxAttachmentSize, newIssuePath, projectImportJiraPath, - projectPath, quickActionsHelpPath, resetPath, rssPath, @@ -150,18 +150,18 @@ export function mountIssuesListApp() { calendarPath, canBulkUpdate: parseBoolean(canBulkUpdate), emptyStateSvgPath, + fullPath, groupEpicsPath, + hasAnyIssues: parseBoolean(hasAnyIssues), hasBlockedIssuesFeature: parseBoolean(hasBlockedIssuesFeature), hasIssuableHealthStatusFeature: parseBoolean(hasIssuableHealthStatusFeature), hasIssueWeightsFeature: parseBoolean(hasIssueWeightsFeature), hasIterationsFeature: parseBoolean(hasIterationsFeature), hasMultipleIssueAssigneesFeature: parseBoolean(hasMultipleIssueAssigneesFeature), - hasProjectIssues: parseBoolean(hasProjectIssues), + isProject: parseBoolean(isProject), isSignedIn: parseBoolean(isSignedIn), - issuesPath, jiraIntegrationPath, newIssuePath, - projectPath, rssPath, showNewIssueLink: parseBoolean(showNewIssueLink), signInPath, @@ -172,9 +172,9 @@ export function mountIssuesListApp() { importCsvIssuesPath, maxAttachmentSize, projectImportJiraPath, - showExportButton: parseBoolean(hasProjectIssues), + showExportButton: parseBoolean(hasAnyIssues), showImportButton: parseBoolean(canImportIssues), - showLabel: !parseBoolean(hasProjectIssues), + showLabel: !parseBoolean(hasAnyIssues), // For IssuableByEmail component emailsHelpPagePath, initialEmail, diff --git a/app/assets/javascripts/issues_list/queries/get_issues.query.graphql b/app/assets/javascripts/issues_list/queries/get_issues.query.graphql index 30a01b4c3b0..6df72cf6596 100644 --- a/app/assets/javascripts/issues_list/queries/get_issues.query.graphql +++ b/app/assets/javascripts/issues_list/queries/get_issues.query.graphql @@ -1,9 +1,10 @@ #import "~/graphql_shared/fragments/pageInfo.fragment.graphql" #import "./issue.fragment.graphql" -query getProjectIssues( +query getIssues( + $isProject: Boolean = false $isSignedIn: Boolean = false - $projectPath: ID! + $fullPath: ID! $search: String $sort: IssueSort $state: IssuableState @@ -20,7 +21,35 @@ query getProjectIssues( $firstPageSize: Int $lastPageSize: Int ) { - project(fullPath: $projectPath) { + group(fullPath: $fullPath) @skip(if: $isProject) { + issues( + includeSubgroups: true + search: $search + sort: $sort + state: $state + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + types: $types + not: $not + before: $beforeCursor + after: $afterCursor + first: $firstPageSize + last: $lastPageSize + ) { + pageInfo { + ...PageInfo + } + nodes { + ...IssueFragment + reference(full: true) + } + } + } + project(fullPath: $fullPath) @include(if: $isProject) { issues( search: $search sort: $sort diff --git a/app/assets/javascripts/issues_list/queries/get_issues_count.query.graphql b/app/assets/javascripts/issues_list/queries/get_issues_count.query.graphql deleted file mode 100644 index e6896131da9..00000000000 --- a/app/assets/javascripts/issues_list/queries/get_issues_count.query.graphql +++ /dev/null @@ -1,30 +0,0 @@ -query getProjectIssuesCount( - $projectPath: ID! - $search: String - $state: IssuableState - $assigneeId: String - $assigneeUsernames: [String!] - $authorUsername: String - $labelName: [String] - $milestoneTitle: [String] - $milestoneWildcardId: MilestoneWildcardId - $types: [IssueType!] - $not: NegatedIssueFilterInput -) { - project(fullPath: $projectPath) { - issues( - search: $search - state: $state - assigneeId: $assigneeId - assigneeUsernames: $assigneeUsernames - authorUsername: $authorUsername - labelName: $labelName - milestoneTitle: $milestoneTitle - milestoneWildcardId: $milestoneWildcardId - types: $types - not: $not - ) { - count - } - } -} diff --git a/app/assets/javascripts/issues_list/queries/get_issues_counts.query.graphql b/app/assets/javascripts/issues_list/queries/get_issues_counts.query.graphql new file mode 100644 index 00000000000..7bcdbbb28fc --- /dev/null +++ b/app/assets/javascripts/issues_list/queries/get_issues_counts.query.graphql @@ -0,0 +1,105 @@ +query getIssuesCount( + $isProject: Boolean = false + $fullPath: ID! + $search: String + $assigneeId: String + $assigneeUsernames: [String!] + $authorUsername: String + $labelName: [String] + $milestoneTitle: [String] + $milestoneWildcardId: MilestoneWildcardId + $types: [IssueType!] + $not: NegatedIssueFilterInput +) { + group(fullPath: $fullPath) @skip(if: $isProject) { + openedIssues: issues( + includeSubgroups: true + state: opened + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + types: $types + not: $not + ) { + count + } + closedIssues: issues( + includeSubgroups: true + state: closed + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + types: $types + not: $not + ) { + count + } + allIssues: issues( + includeSubgroups: true + state: all + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + types: $types + not: $not + ) { + count + } + } + project(fullPath: $fullPath) @include(if: $isProject) { + openedIssues: issues( + state: opened + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + types: $types + not: $not + ) { + count + } + closedIssues: issues( + state: closed + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + types: $types + not: $not + ) { + count + } + allIssues: issues( + state: all + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + types: $types + not: $not + ) { + count + } + } +} diff --git a/app/assets/javascripts/issues_list/queries/issue.fragment.graphql b/app/assets/javascripts/issues_list/queries/issue.fragment.graphql index 633b06eced8..9c46cb3ef64 100644 --- a/app/assets/javascripts/issues_list/queries/issue.fragment.graphql +++ b/app/assets/javascripts/issues_list/queries/issue.fragment.graphql @@ -13,6 +13,7 @@ fragment IssueFragment on Issue { updatedAt upvotes userDiscussionsCount @include(if: $isSignedIn) + webPath webUrl assignees { nodes { diff --git a/app/assets/javascripts/issues_list/queries/iteration.fragment.graphql b/app/assets/javascripts/issues_list/queries/iteration.fragment.graphql new file mode 100644 index 00000000000..78a368089a8 --- /dev/null +++ b/app/assets/javascripts/issues_list/queries/iteration.fragment.graphql @@ -0,0 +1,4 @@ +fragment Iteration on Iteration { + id + title +} diff --git a/app/assets/javascripts/issues_list/queries/label.fragment.graphql b/app/assets/javascripts/issues_list/queries/label.fragment.graphql new file mode 100644 index 00000000000..bb1d8f1ac9b --- /dev/null +++ b/app/assets/javascripts/issues_list/queries/label.fragment.graphql @@ -0,0 +1,6 @@ +fragment Label on Label { + id + color + textColor + title +} diff --git a/app/assets/javascripts/issues_list/queries/milestone.fragment.graphql b/app/assets/javascripts/issues_list/queries/milestone.fragment.graphql new file mode 100644 index 00000000000..3cdf69bf585 --- /dev/null +++ b/app/assets/javascripts/issues_list/queries/milestone.fragment.graphql @@ -0,0 +1,4 @@ +fragment Milestone on Milestone { + id + title +} diff --git a/app/assets/javascripts/issues_list/queries/reorder_issues.mutation.graphql b/app/assets/javascripts/issues_list/queries/reorder_issues.mutation.graphql index 5927e3e83c7..160026a4742 100644 --- a/app/assets/javascripts/issues_list/queries/reorder_issues.mutation.graphql +++ b/app/assets/javascripts/issues_list/queries/reorder_issues.mutation.graphql @@ -1,7 +1,13 @@ -mutation reorderIssues($oldIndex: Int, $newIndex: Int, $serializedVariables: String) { +mutation reorderIssues( + $oldIndex: Int + $newIndex: Int + $namespace: String + $serializedVariables: String +) { reorderIssues( oldIndex: $oldIndex newIndex: $newIndex + namespace: $namespace serializedVariables: $serializedVariables ) @client } diff --git a/app/assets/javascripts/issues_list/queries/search_iterations.query.graphql b/app/assets/javascripts/issues_list/queries/search_iterations.query.graphql index 11d9dcea573..93600c62905 100644 --- a/app/assets/javascripts/issues_list/queries/search_iterations.query.graphql +++ b/app/assets/javascripts/issues_list/queries/search_iterations.query.graphql @@ -1,9 +1,17 @@ -query searchIterations($projectPath: ID!, $search: String, $id: ID) { - project(fullPath: $projectPath) { - iterations(title: $search, id: $id) { +#import "./iteration.fragment.graphql" + +query searchIterations($fullPath: ID!, $search: String, $id: ID, $isProject: Boolean = false) { + group(fullPath: $fullPath) @skip(if: $isProject) { + iterations(title: $search, id: $id, includeAncestors: true) { nodes { - id - title + ...Iteration + } + } + } + project(fullPath: $fullPath) @include(if: $isProject) { + iterations(title: $search, id: $id, includeAncestors: true) { + nodes { + ...Iteration } } } diff --git a/app/assets/javascripts/issues_list/queries/search_labels.query.graphql b/app/assets/javascripts/issues_list/queries/search_labels.query.graphql index de884e1221c..1515bd91da3 100644 --- a/app/assets/javascripts/issues_list/queries/search_labels.query.graphql +++ b/app/assets/javascripts/issues_list/queries/search_labels.query.graphql @@ -1,11 +1,17 @@ -query searchLabels($projectPath: ID!, $search: String) { - project(fullPath: $projectPath) { +#import "./label.fragment.graphql" + +query searchLabels($fullPath: ID!, $search: String, $isProject: Boolean = false) { + group(fullPath: $fullPath) @skip(if: $isProject) { + labels(searchTerm: $search, includeAncestorGroups: true, includeDescendantGroups: true) { + nodes { + ...Label + } + } + } + project(fullPath: $fullPath) @include(if: $isProject) { labels(searchTerm: $search, includeAncestorGroups: true) { nodes { - id - color - textColor - title + ...Label } } } diff --git a/app/assets/javascripts/issues_list/queries/search_milestones.query.graphql b/app/assets/javascripts/issues_list/queries/search_milestones.query.graphql index 91f74fd220b..8c6c50e9dc2 100644 --- a/app/assets/javascripts/issues_list/queries/search_milestones.query.graphql +++ b/app/assets/javascripts/issues_list/queries/search_milestones.query.graphql @@ -1,9 +1,17 @@ -query searchMilestones($projectPath: ID!, $search: String) { - project(fullPath: $projectPath) { +#import "./milestone.fragment.graphql" + +query searchMilestones($fullPath: ID!, $search: String, $isProject: Boolean = false) { + group(fullPath: $fullPath) @skip(if: $isProject) { + milestones(searchTitle: $search, includeAncestors: true, includeDescendants: true) { + nodes { + ...Milestone + } + } + } + project(fullPath: $fullPath) @include(if: $isProject) { milestones(searchTitle: $search, includeAncestors: true) { nodes { - id - title + ...Milestone } } } diff --git a/app/assets/javascripts/issues_list/queries/search_users.query.graphql b/app/assets/javascripts/issues_list/queries/search_users.query.graphql index 953157cfe3a..0211fc66235 100644 --- a/app/assets/javascripts/issues_list/queries/search_users.query.graphql +++ b/app/assets/javascripts/issues_list/queries/search_users.query.graphql @@ -1,12 +1,20 @@ -query searchUsers($projectPath: ID!, $search: String) { - project(fullPath: $projectPath) { +#import "./user.fragment.graphql" + +query searchUsers($fullPath: ID!, $search: String, $isProject: Boolean = false) { + group(fullPath: $fullPath) @skip(if: $isProject) { + groupMembers(search: $search) { + nodes { + user { + ...User + } + } + } + } + project(fullPath: $fullPath) @include(if: $isProject) { projectMembers(search: $search) { nodes { user { - id - avatarUrl - name - username + ...User } } } diff --git a/app/assets/javascripts/issues_list/queries/user.fragment.graphql b/app/assets/javascripts/issues_list/queries/user.fragment.graphql new file mode 100644 index 00000000000..3e5bc0f7b93 --- /dev/null +++ b/app/assets/javascripts/issues_list/queries/user.fragment.graphql @@ -0,0 +1,6 @@ +fragment User on User { + id + avatarUrl + name + username +} |