diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-06 21:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-06 21:09:03 +0300 |
commit | 2b6716fbb2c0ec50bd019b3e08aff2c3b95f11fa (patch) | |
tree | 11974f309192a11e73ac883af5b9dfba4d595867 /app/assets/javascripts/issues | |
parent | 67fa8362ae35ab6134454aa74ad536eb405dff29 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/issues')
6 files changed, 285 insertions, 2 deletions
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 eb7e85bde41..150016ed99d 100644 --- a/app/assets/javascripts/issues/list/components/issues_list_app.vue +++ b/app/assets/javascripts/issues/list/components/issues_list_app.vue @@ -13,6 +13,8 @@ import fuzzaldrinPlus from 'fuzzaldrin-plus'; import IssueCardTimeInfo from 'ee_else_ce/issues/list/components/issue_card_time_info.vue'; 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 getIssuesWithoutCrmQuery from 'ee_else_ce/issues/list/queries/get_issues_without_crm.query.graphql'; +import getIssuesCountsWithoutCrmQuery from 'ee_else_ce/issues/list/queries/get_issues_counts_without_crm.query.graphql'; import createFlash, { FLASH_TYPES } from '~/flash'; import { TYPE_USER } from '~/graphql_shared/constants'; import { convertToGraphQLId, getIdFromGraphQLId } from '~/graphql_shared/utils'; @@ -154,7 +156,9 @@ export default { }, apollo: { issues: { - query: getIssuesQuery, + query() { + return this.hasCrmParameter ? getIssuesQuery : getIssuesWithoutCrmQuery; + }, variables() { return this.queryVariables; }, @@ -178,7 +182,9 @@ export default { debounce: 200, }, issuesCounts: { - query: getIssuesCountsQuery, + query() { + return this.hasCrmParameter ? getIssuesCountsQuery : getIssuesCountsWithoutCrmQuery; + }, variables() { return this.queryVariables; }, @@ -390,6 +396,12 @@ export default { ...this.urlFilterParams, }; }, + hasCrmParameter() { + return ( + window.location.search.includes('crm_contact_id=') || + window.location.search.includes('crm_organization_id=') + ); + }, }, watch: { $route(newValue, oldValue) { diff --git a/app/assets/javascripts/issues/list/constants.js b/app/assets/javascripts/issues/list/constants.js index d4e2cdcfb1d..4541191730a 100644 --- a/app/assets/javascripts/issues/list/constants.js +++ b/app/assets/javascripts/issues/list/constants.js @@ -132,6 +132,8 @@ export const TOKEN_TYPE_CONFIDENTIAL = 'confidential'; export const TOKEN_TYPE_ITERATION = 'iteration'; export const TOKEN_TYPE_EPIC = 'epic_id'; export const TOKEN_TYPE_WEIGHT = 'weight'; +export const TOKEN_TYPE_CONTACT = 'crm_contact'; +export const TOKEN_TYPE_ORGANIZATION = 'crm_organization'; export const filters = { [TOKEN_TYPE_AUTHOR]: { @@ -294,4 +296,24 @@ export const filters = { }, }, }, + [TOKEN_TYPE_CONTACT]: { + [API_PARAM]: { + [NORMAL_FILTER]: 'crmContactId', + }, + [URL_PARAM]: { + [OPERATOR_IS]: { + [NORMAL_FILTER]: 'crm_contact_id', + }, + }, + }, + [TOKEN_TYPE_ORGANIZATION]: { + [API_PARAM]: { + [NORMAL_FILTER]: 'crmOrganizationId', + }, + [URL_PARAM]: { + [OPERATOR_IS]: { + [NORMAL_FILTER]: 'crm_organization_id', + }, + }, + }, }; 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 ec24ea7c56a..dcc0db786b7 100644 --- a/app/assets/javascripts/issues/list/queries/get_issues.query.graphql +++ b/app/assets/javascripts/issues/list/queries/get_issues.query.graphql @@ -20,6 +20,8 @@ query getIssues( $releaseTag: [String!] $releaseTagWildcardId: ReleaseTagWildcardId $types: [IssueType!] + $crmContactId: String + $crmOrganizationId: String $not: NegatedIssueFilterInput $beforeCursor: String $afterCursor: String @@ -43,6 +45,8 @@ query getIssues( milestoneWildcardId: $milestoneWildcardId myReactionEmoji: $myReactionEmoji types: $types + crmContactId: $crmContactId + crmOrganizationId: $crmOrganizationId not: $not before: $beforeCursor after: $afterCursor @@ -76,6 +80,8 @@ query getIssues( releaseTag: $releaseTag releaseTagWildcardId: $releaseTagWildcardId types: $types + crmContactId: $crmContactId + crmOrganizationId: $crmOrganizationId not: $not before: $beforeCursor after: $afterCursor 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 index 58e7ce32e7c..c1aee772167 100644 --- a/app/assets/javascripts/issues/list/queries/get_issues_counts.query.graphql +++ b/app/assets/javascripts/issues/list/queries/get_issues_counts.query.graphql @@ -14,6 +14,8 @@ query getIssuesCount( $releaseTag: [String!] $releaseTagWildcardId: ReleaseTagWildcardId $types: [IssueType!] + $crmContactId: String + $crmOrganizationId: String $not: NegatedIssueFilterInput ) { group(fullPath: $fullPath) @skip(if: $isProject) { @@ -32,6 +34,8 @@ query getIssuesCount( milestoneWildcardId: $milestoneWildcardId myReactionEmoji: $myReactionEmoji types: $types + crmContactId: $crmContactId + crmOrganizationId: $crmOrganizationId not: $not ) { count @@ -50,6 +54,8 @@ query getIssuesCount( milestoneWildcardId: $milestoneWildcardId myReactionEmoji: $myReactionEmoji types: $types + crmContactId: $crmContactId + crmOrganizationId: $crmOrganizationId not: $not ) { count @@ -68,6 +74,8 @@ query getIssuesCount( milestoneWildcardId: $milestoneWildcardId myReactionEmoji: $myReactionEmoji types: $types + crmContactId: $crmContactId + crmOrganizationId: $crmOrganizationId not: $not ) { count @@ -90,6 +98,8 @@ query getIssuesCount( releaseTag: $releaseTag releaseTagWildcardId: $releaseTagWildcardId types: $types + crmContactId: $crmContactId + crmOrganizationId: $crmOrganizationId not: $not ) { count @@ -109,6 +119,8 @@ query getIssuesCount( releaseTag: $releaseTag releaseTagWildcardId: $releaseTagWildcardId types: $types + crmContactId: $crmContactId + crmOrganizationId: $crmOrganizationId not: $not ) { count @@ -128,6 +140,8 @@ query getIssuesCount( releaseTag: $releaseTag releaseTagWildcardId: $releaseTagWildcardId types: $types + crmContactId: $crmContactId + crmOrganizationId: $crmOrganizationId not: $not ) { count diff --git a/app/assets/javascripts/issues/list/queries/get_issues_counts_without_crm.query.graphql b/app/assets/javascripts/issues/list/queries/get_issues_counts_without_crm.query.graphql new file mode 100644 index 00000000000..ab91aab1218 --- /dev/null +++ b/app/assets/javascripts/issues/list/queries/get_issues_counts_without_crm.query.graphql @@ -0,0 +1,136 @@ +query getIssuesCountWithoutCrm( + $isProject: Boolean = false + $fullPath: ID! + $iid: String + $search: String + $assigneeId: String + $assigneeUsernames: [String!] + $authorUsername: String + $confidential: Boolean + $labelName: [String] + $milestoneTitle: [String] + $milestoneWildcardId: MilestoneWildcardId + $myReactionEmoji: String + $releaseTag: [String!] + $releaseTagWildcardId: ReleaseTagWildcardId + $types: [IssueType!] + $not: NegatedIssueFilterInput +) { + group(fullPath: $fullPath) @skip(if: $isProject) { + id + openedIssues: issues( + includeSubgroups: true + state: opened + iid: $iid + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + confidential: $confidential + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + myReactionEmoji: $myReactionEmoji + types: $types + not: $not + ) { + count + } + closedIssues: issues( + includeSubgroups: true + state: closed + iid: $iid + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + confidential: $confidential + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + myReactionEmoji: $myReactionEmoji + types: $types + not: $not + ) { + count + } + allIssues: issues( + includeSubgroups: true + state: all + iid: $iid + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + confidential: $confidential + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + myReactionEmoji: $myReactionEmoji + types: $types + not: $not + ) { + count + } + } + project(fullPath: $fullPath) @include(if: $isProject) { + id + openedIssues: issues( + state: opened + iid: $iid + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + confidential: $confidential + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + myReactionEmoji: $myReactionEmoji + releaseTag: $releaseTag + releaseTagWildcardId: $releaseTagWildcardId + types: $types + not: $not + ) { + count + } + closedIssues: issues( + state: closed + iid: $iid + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + confidential: $confidential + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + myReactionEmoji: $myReactionEmoji + releaseTag: $releaseTag + releaseTagWildcardId: $releaseTagWildcardId + types: $types + not: $not + ) { + count + } + allIssues: issues( + state: all + iid: $iid + search: $search + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + confidential: $confidential + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + myReactionEmoji: $myReactionEmoji + releaseTag: $releaseTag + releaseTagWildcardId: $releaseTagWildcardId + types: $types + not: $not + ) { + count + } + } +} diff --git a/app/assets/javascripts/issues/list/queries/get_issues_without_crm.query.graphql b/app/assets/javascripts/issues/list/queries/get_issues_without_crm.query.graphql new file mode 100644 index 00000000000..94948bb7d34 --- /dev/null +++ b/app/assets/javascripts/issues/list/queries/get_issues_without_crm.query.graphql @@ -0,0 +1,93 @@ +#import "~/graphql_shared/fragments/page_info.fragment.graphql" +#import "./issue.fragment.graphql" + +query getIssuesWithoutCrm( + $isProject: Boolean = false + $isSignedIn: Boolean = false + $fullPath: ID! + $iid: String + $search: String + $sort: IssueSort + $state: IssuableState + $assigneeId: String + $assigneeUsernames: [String!] + $authorUsername: String + $confidential: Boolean + $labelName: [String] + $milestoneTitle: [String] + $milestoneWildcardId: MilestoneWildcardId + $myReactionEmoji: String + $releaseTag: [String!] + $releaseTagWildcardId: ReleaseTagWildcardId + $types: [IssueType!] + $not: NegatedIssueFilterInput + $beforeCursor: String + $afterCursor: String + $firstPageSize: Int + $lastPageSize: Int +) { + group(fullPath: $fullPath) @skip(if: $isProject) { + id + issues( + includeSubgroups: true + iid: $iid + search: $search + sort: $sort + state: $state + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + confidential: $confidential + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + myReactionEmoji: $myReactionEmoji + 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) { + id + issues( + iid: $iid + search: $search + sort: $sort + state: $state + assigneeId: $assigneeId + assigneeUsernames: $assigneeUsernames + authorUsername: $authorUsername + confidential: $confidential + labelName: $labelName + milestoneTitle: $milestoneTitle + milestoneWildcardId: $milestoneWildcardId + myReactionEmoji: $myReactionEmoji + releaseTag: $releaseTag + releaseTagWildcardId: $releaseTagWildcardId + types: $types + not: $not + before: $beforeCursor + after: $afterCursor + first: $firstPageSize + last: $lastPageSize + ) { + pageInfo { + ...PageInfo + } + nodes { + ...IssueFragment + } + } + } +} |