Commit 5b951df0 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '273410-mr-analytics-allow-not-filters-on-labels-and-milestones' into 'master'

MR Analytics - Allow not filters on labels and milestones

See merge request gitlab-org/gitlab!69359
parents 6aa9273e 55f86ef9
...@@ -68,7 +68,6 @@ export default { ...@@ -68,7 +68,6 @@ export default {
initialMilestones: this.milestonesData, initialMilestones: this.milestonesData,
unique: true, unique: true,
symbol: '%', symbol: '%',
operators: OPERATOR_IS_ONLY,
fetchMilestones: this.fetchMilestones, fetchMilestones: this.fetchMilestones,
}, },
{ {
...@@ -80,7 +79,6 @@ export default { ...@@ -80,7 +79,6 @@ export default {
initialLabels: this.labelsData, initialLabels: this.labelsData,
unique: false, unique: false,
symbol: '~', symbol: '~',
operators: OPERATOR_IS_ONLY,
fetchLabels: this.fetchLabels, fetchLabels: this.fetchLabels,
}, },
{ {
......
...@@ -52,6 +52,8 @@ export default { ...@@ -52,6 +52,8 @@ export default {
return { return {
fullPath: this.fullPath, fullPath: this.fullPath,
...options, ...options,
notLabels: options['not[labels]'],
notMilestoneTitle: options['not[milestoneTitle]'],
}; };
}, },
error() { error() {
......
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
selectedLabelList: (state) => state.labels.selectedList, selectedLabelList: (state) => state.labels.selectedList,
}), }),
options() { options() {
return filterToQueryObject({ const options = filterToQueryObject({
sourceBranches: this.selectedSourceBranch, sourceBranches: this.selectedSourceBranch,
targetBranches: this.selectedTargetBranch, targetBranches: this.selectedTargetBranch,
milestoneTitle: this.selectedMilestone, milestoneTitle: this.selectedMilestone,
...@@ -171,6 +171,12 @@ export default { ...@@ -171,6 +171,12 @@ export default {
assigneeUsername: this.selectedAssignee, assigneeUsername: this.selectedAssignee,
labels: this.selectedLabelList, labels: this.selectedLabelList,
}); });
return {
...options,
notLabels: options['not[labels]'],
notMilestoneTitle: options['not[notMilestoneTitle]'],
};
}, },
tableDataAvailable() { tableDataAvailable() {
return this.throughputTableData.list?.length; return this.throughputTableData.list?.length;
......
...@@ -14,6 +14,8 @@ query getThroughputTableData( ...@@ -14,6 +14,8 @@ query getThroughputTableData(
$lastPageSize: Int $lastPageSize: Int
$prevPageCursor: String = "" $prevPageCursor: String = ""
$nextPageCursor: String = "" $nextPageCursor: String = ""
$notLabels: [String!]
$notMilestoneTitle: String
) { ) {
project(fullPath: $fullPath) { project(fullPath: $fullPath) {
mergeRequests( mergeRequests(
...@@ -30,6 +32,7 @@ query getThroughputTableData( ...@@ -30,6 +32,7 @@ query getThroughputTableData(
milestoneTitle: $milestoneTitle milestoneTitle: $milestoneTitle
sourceBranches: $sourceBranches sourceBranches: $sourceBranches
targetBranches: $targetBranches targetBranches: $targetBranches
not: { labels: $notLabels, milestoneTitle: $notMilestoneTitle }
) { ) {
pageInfo { pageInfo {
...PageInfo ...PageInfo
......
...@@ -32,6 +32,7 @@ export default (startDate = null, endDate = null) => { ...@@ -32,6 +32,7 @@ export default (startDate = null, endDate = null) => {
milestoneTitle: $milestoneTitle, milestoneTitle: $milestoneTitle,
sourceBranches: $sourceBranches, sourceBranches: $sourceBranches,
targetBranches: $targetBranches targetBranches: $targetBranches
not: { labels: $notLabels, milestoneTitle: $notMilestoneTitle }
) { count, totalTimeToMerge } ) { count, totalTimeToMerge }
`; `;
}); });
...@@ -44,7 +45,9 @@ export default (startDate = null, endDate = null) => { ...@@ -44,7 +45,9 @@ export default (startDate = null, endDate = null) => {
$assigneeUsername: String, $assigneeUsername: String,
$milestoneTitle: String, $milestoneTitle: String,
$sourceBranches: [String!], $sourceBranches: [String!],
$targetBranches: [String!] $targetBranches: [String!],
$notLabels: [String!],
$notMilestoneTitle: String
) { ) {
throughputChartData: project(fullPath: $fullPath) { throughputChartData: project(fullPath: $fullPath) {
${computedMonthData} ${computedMonthData}
......
...@@ -59,7 +59,7 @@ export const expectedMonthData = [ ...@@ -59,7 +59,7 @@ export const expectedMonthData = [
}, },
]; ];
export const throughputChartQuery = `query ($fullPath: ID!, $labels: [String!], $authorUsername: String, $assigneeUsername: String, $milestoneTitle: String, $sourceBranches: [String!], $targetBranches: [String!]) { export const throughputChartQuery = `query ($fullPath: ID!, $labels: [String!], $authorUsername: String, $assigneeUsername: String, $milestoneTitle: String, $sourceBranches: [String!], $targetBranches: [String!], $notLabels: [String!], $notMilestoneTitle: String) {
throughputChartData: project(fullPath: $fullPath) { throughputChartData: project(fullPath: $fullPath) {
May_2020: mergeRequests( May_2020: mergeRequests(
first: 0 first: 0
...@@ -71,6 +71,7 @@ export const throughputChartQuery = `query ($fullPath: ID!, $labels: [String!], ...@@ -71,6 +71,7 @@ export const throughputChartQuery = `query ($fullPath: ID!, $labels: [String!],
milestoneTitle: $milestoneTitle milestoneTitle: $milestoneTitle
sourceBranches: $sourceBranches sourceBranches: $sourceBranches
targetBranches: $targetBranches targetBranches: $targetBranches
not: {labels: $notLabels, milestoneTitle: $notMilestoneTitle}
) { ) {
count count
totalTimeToMerge totalTimeToMerge
...@@ -85,6 +86,7 @@ export const throughputChartQuery = `query ($fullPath: ID!, $labels: [String!], ...@@ -85,6 +86,7 @@ export const throughputChartQuery = `query ($fullPath: ID!, $labels: [String!],
milestoneTitle: $milestoneTitle milestoneTitle: $milestoneTitle
sourceBranches: $sourceBranches sourceBranches: $sourceBranches
targetBranches: $targetBranches targetBranches: $targetBranches
not: {labels: $notLabels, milestoneTitle: $notMilestoneTitle}
) { ) {
count count
totalTimeToMerge totalTimeToMerge
...@@ -99,6 +101,7 @@ export const throughputChartQuery = `query ($fullPath: ID!, $labels: [String!], ...@@ -99,6 +101,7 @@ export const throughputChartQuery = `query ($fullPath: ID!, $labels: [String!],
milestoneTitle: $milestoneTitle milestoneTitle: $milestoneTitle
sourceBranches: $sourceBranches sourceBranches: $sourceBranches
targetBranches: $targetBranches targetBranches: $targetBranches
not: {labels: $notLabels, milestoneTitle: $notMilestoneTitle}
) { ) {
count count
totalTimeToMerge totalTimeToMerge
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment