Commit 55f86ef9 authored by Brandon Labuschagne's avatar Brandon Labuschagne

Add not filters for MR Analytics

This commit introduces not filters for
milestones and labels on the MR analytics
fearture.

Changelog: added
EE: true
parent 6dc6937e
......@@ -68,7 +68,6 @@ export default {
initialMilestones: this.milestonesData,
unique: true,
symbol: '%',
operators: OPERATOR_IS_ONLY,
fetchMilestones: this.fetchMilestones,
},
{
......@@ -80,7 +79,6 @@ export default {
initialLabels: this.labelsData,
unique: false,
symbol: '~',
operators: OPERATOR_IS_ONLY,
fetchLabels: this.fetchLabels,
},
{
......
......@@ -52,6 +52,8 @@ export default {
return {
fullPath: this.fullPath,
...options,
notLabels: options['not[labels]'],
notMilestoneTitle: options['not[milestoneTitle]'],
};
},
error() {
......
......@@ -163,7 +163,7 @@ export default {
selectedLabelList: (state) => state.labels.selectedList,
}),
options() {
return filterToQueryObject({
const options = filterToQueryObject({
sourceBranches: this.selectedSourceBranch,
targetBranches: this.selectedTargetBranch,
milestoneTitle: this.selectedMilestone,
......@@ -171,6 +171,12 @@ export default {
assigneeUsername: this.selectedAssignee,
labels: this.selectedLabelList,
});
return {
...options,
notLabels: options['not[labels]'],
notMilestoneTitle: options['not[notMilestoneTitle]'],
};
},
tableDataAvailable() {
return this.throughputTableData.list?.length;
......
......@@ -14,6 +14,8 @@ query getThroughputTableData(
$lastPageSize: Int
$prevPageCursor: String = ""
$nextPageCursor: String = ""
$notLabels: [String!]
$notMilestoneTitle: String
) {
project(fullPath: $fullPath) {
mergeRequests(
......@@ -30,6 +32,7 @@ query getThroughputTableData(
milestoneTitle: $milestoneTitle
sourceBranches: $sourceBranches
targetBranches: $targetBranches
not: { labels: $notLabels, milestoneTitle: $notMilestoneTitle }
) {
pageInfo {
...PageInfo
......
......@@ -32,6 +32,7 @@ export default (startDate = null, endDate = null) => {
milestoneTitle: $milestoneTitle,
sourceBranches: $sourceBranches,
targetBranches: $targetBranches
not: { labels: $notLabels, milestoneTitle: $notMilestoneTitle }
) { count, totalTimeToMerge }
`;
});
......@@ -44,7 +45,9 @@ export default (startDate = null, endDate = null) => {
$assigneeUsername: String,
$milestoneTitle: String,
$sourceBranches: [String!],
$targetBranches: [String!]
$targetBranches: [String!],
$notLabels: [String!],
$notMilestoneTitle: String
) {
throughputChartData: project(fullPath: $fullPath) {
${computedMonthData}
......
......@@ -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) {
May_2020: mergeRequests(
first: 0
......@@ -71,6 +71,7 @@ export const throughputChartQuery = `query ($fullPath: ID!, $labels: [String!],
milestoneTitle: $milestoneTitle
sourceBranches: $sourceBranches
targetBranches: $targetBranches
not: {labels: $notLabels, milestoneTitle: $notMilestoneTitle}
) {
count
totalTimeToMerge
......@@ -85,6 +86,7 @@ export const throughputChartQuery = `query ($fullPath: ID!, $labels: [String!],
milestoneTitle: $milestoneTitle
sourceBranches: $sourceBranches
targetBranches: $targetBranches
not: {labels: $notLabels, milestoneTitle: $notMilestoneTitle}
) {
count
totalTimeToMerge
......@@ -99,6 +101,7 @@ export const throughputChartQuery = `query ($fullPath: ID!, $labels: [String!],
milestoneTitle: $milestoneTitle
sourceBranches: $sourceBranches
targetBranches: $targetBranches
not: {labels: $notLabels, milestoneTitle: $notMilestoneTitle}
) {
count
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