diff options
Diffstat (limited to 'app/assets/javascripts/issues_list/queries')
13 files changed, 216 insertions, 55 deletions
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 +} |