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 {
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