Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
fbadc2d0
Commit
fbadc2d0
authored
Jan 25, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Swimlanes - Support negated filters
Add support for not filters on Swimlanes
parent
42dffc6c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
55 additions
and
14 deletions
+55
-14
app/assets/javascripts/boards/boards_util.js
app/assets/javascripts/boards/boards_util.js
+13
-1
app/assets/javascripts/boards/constants.js
app/assets/javascripts/boards/constants.js
+2
-0
app/assets/javascripts/boards/stores/actions.js
app/assets/javascripts/boards/stores/actions.js
+2
-0
ee/app/assets/javascripts/boards/stores/actions.js
ee/app/assets/javascripts/boards/stores/actions.js
+6
-0
ee/changelogs/unreleased/299504-epic-swimlanes-negated-filters-not-filtering.yml
...d/299504-epic-swimlanes-negated-filters-not-filtering.yml
+5
-0
ee/spec/features/issues/filtered_search/filter_issues_by_iteration_spec.rb
...issues/filtered_search/filter_issues_by_iteration_spec.rb
+5
-8
ee/spec/frontend/boards/stores/actions_spec.js
ee/spec/frontend/boards/stores/actions_spec.js
+4
-4
spec/frontend/boards/boards_util_spec.js
spec/frontend/boards/boards_util_spec.js
+17
-0
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/actions_spec.js
+1
-1
No files found.
app/assets/javascripts/boards/boards_util.js
View file @
fbadc2d0
import
{
sortBy
}
from
'
lodash
'
;
import
{
ListType
,
NOT_FILTER
}
from
'
./constants
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
ListType
}
from
'
./constants
'
;
export
function
getMilestone
()
{
return
null
;
...
...
@@ -144,6 +144,17 @@ export function isListDraggable(list) {
return
list
.
listType
!==
ListType
.
backlog
&&
list
.
listType
!==
ListType
.
closed
;
}
export
function
transformNotFilters
(
filters
)
{
return
Object
.
keys
(
filters
)
.
filter
((
key
)
=>
key
.
startsWith
(
NOT_FILTER
))
.
reduce
((
obj
,
key
)
=>
{
return
{
...
obj
,
[
key
.
substring
(
4
,
key
.
length
-
1
)]:
filters
[
key
],
};
},
{});
}
// EE-specific feature. Find the implementation in the `ee/`-folder
export
function
transformBoardConfig
()
{
return
''
;
...
...
@@ -157,4 +168,5 @@ export default {
fullLabelId
,
fullIterationId
,
isListDraggable
,
transformNotFilters
,
};
app/assets/javascripts/boards/constants.js
View file @
fbadc2d0
...
...
@@ -16,6 +16,8 @@ export const inactiveId = 0;
export
const
ISSUABLE
=
'
issuable
'
;
export
const
LIST
=
'
list
'
;
export
const
NOT_FILTER
=
'
not[
'
;
export
default
{
BoardType
,
ListType
,
...
...
app/assets/javascripts/boards/stores/actions.js
View file @
fbadc2d0
...
...
@@ -16,6 +16,7 @@ import {
formatIssue
,
formatIssueInput
,
updateListPosition
,
transformNotFilters
,
}
from
'
../boards_util
'
;
import
listsIssuesQuery
from
'
../graphql/lists_issues.query.graphql
'
;
import
boardLabelsQuery
from
'
../graphql/board_labels.query.graphql
'
;
...
...
@@ -66,6 +67,7 @@ export default {
'
releaseTag
'
,
'
search
'
,
]);
filterParams
.
not
=
transformNotFilters
(
filters
);
commit
(
types
.
SET_FILTERS
,
filterParams
);
},
...
...
ee/app/assets/javascripts/boards/stores/actions.js
View file @
fbadc2d0
...
...
@@ -15,6 +15,7 @@ import {
formatListIssues
,
formatListsPageInfo
,
fullBoardId
,
transformNotFilters
,
}
from
'
~/boards/boards_util
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
eventHub
from
'
~/boards/eventhub
'
;
...
...
@@ -87,6 +88,8 @@ export default {
'
weight
'
,
]);
filterParams
.
not
=
transformNotFilters
(
filters
);
if
(
filters
.
groupBy
===
GroupByParamType
.
epic
)
{
dispatch
(
'
setEpicSwimlanes
'
);
}
...
...
@@ -97,6 +100,9 @@ export default {
}
else
if
(
filterParams
.
epicId
)
{
filterParams
.
epicId
=
fullEpicId
(
filterParams
.
epicId
);
}
if
(
filterParams
.
not
.
epicId
)
{
filterParams
.
not
.
epicId
=
fullEpicId
(
filterParams
.
not
.
epicId
);
}
if
(
filters
.
iterationId
===
IterationFilterType
.
any
||
...
...
ee/changelogs/unreleased/299504-epic-swimlanes-negated-filters-not-filtering.yml
0 → 100644
View file @
fbadc2d0
---
title
:
Swimlanes - Support negated filters
merge_request
:
52449
author
:
type
:
fixed
ee/spec/features/issues/filtered_search/filter_issues_by_iteration_spec.rb
View file @
fbadc2d0
...
...
@@ -79,6 +79,9 @@ RSpec.describe 'Filter issues by iteration', :js do
context
'when filtering by negated iteration'
do
before
do
# iterationWildCardId is not yet supported by graphQL https://gitlab.com/gitlab-org/gitlab/-/issues/300115
stub_feature_flags
(
graphql_board_lists:
false
)
page
.
within
(
'.filtered-search-wrapper'
)
do
find
(
'.filtered-search'
).
set
(
'iter'
)
click_button
(
'Iteration'
)
...
...
@@ -164,17 +167,11 @@ RSpec.describe 'Filter issues by iteration', :js do
end
before
do
# iterationWildCardId is not yet supported by graphQL https://gitlab.com/gitlab-org/gitlab/-/issues/300115
stub_feature_flags
(
graphql_board_lists:
false
)
sign_in
user
end
it_behaves_like
'filters by iteration'
context
'when graphql_board_lists is disabled'
do
before
do
stub_feature_flags
(
graphql_board_lists:
false
)
end
it_behaves_like
'filters by iteration'
end
end
end
ee/spec/frontend/boards/stores/actions_spec.js
View file @
fbadc2d0
...
...
@@ -37,7 +37,7 @@ describe('setFilters', () => {
};
const
filters
=
{
labelName
:
'
label
'
,
epicId
:
1
};
const
updatedFilters
=
{
labelName
:
'
label
'
,
epicId
:
'
gid://gitlab/Epic/1
'
};
const
updatedFilters
=
{
labelName
:
'
label
'
,
epicId
:
'
gid://gitlab/Epic/1
'
,
not
:
{}
};
return
testAction
(
actions
.
setFilters
,
...
...
@@ -54,7 +54,7 @@ describe('setFilters', () => {
};
const
filters
=
{
labelName
:
'
label
'
,
epicId
:
'
None
'
};
const
updatedFilters
=
{
labelName
:
'
label
'
,
epicWildcardId
:
'
NONE
'
};
const
updatedFilters
=
{
labelName
:
'
label
'
,
epicWildcardId
:
'
NONE
'
,
not
:
{}
};
return
testAction
(
actions
.
setFilters
,
...
...
@@ -71,7 +71,7 @@ describe('setFilters', () => {
};
const
filters
=
{
labelName
:
'
label
'
,
iterationId
:
'
None
'
};
const
updatedFilters
=
{
labelName
:
'
label
'
,
iterationWildcardId
:
'
NONE
'
};
const
updatedFilters
=
{
labelName
:
'
label
'
,
iterationWildcardId
:
'
NONE
'
,
not
:
{}
};
return
testAction
(
actions
.
setFilters
,
...
...
@@ -88,7 +88,7 @@ describe('setFilters', () => {
};
const
filters
=
{
labelName
:
'
label
'
,
epicId
:
1
,
groupBy
:
'
epic
'
};
const
updatedFilters
=
{
labelName
:
'
label
'
,
epicId
:
'
gid://gitlab/Epic/1
'
};
const
updatedFilters
=
{
labelName
:
'
label
'
,
epicId
:
'
gid://gitlab/Epic/1
'
,
not
:
{}
};
return
testAction
(
actions
.
setFilters
,
...
...
spec/frontend/boards/boards_util_spec.js
0 → 100644
View file @
fbadc2d0
import
{
transformNotFilters
}
from
'
~/boards/boards_util
'
;
describe
(
'
transformNotFilters
'
,
()
=>
{
const
filters
=
{
'
not[labelName]
'
:
[
'
label
'
],
'
not[assigneeUsername]
'
:
'
assignee
'
,
};
it
(
'
formats not filters, transforms epicId to fullEpicId
'
,
()
=>
{
const
result
=
transformNotFilters
(
filters
);
expect
(
result
).
toEqual
({
labelName
:
[
'
label
'
],
assigneeUsername
:
'
assignee
'
,
});
});
});
spec/frontend/boards/stores/actions_spec.js
View file @
fbadc2d0
...
...
@@ -71,7 +71,7 @@ describe('setFilters', () => {
actions
.
setFilters
,
filters
,
state
,
[{
type
:
types
.
SET_FILTERS
,
payload
:
filters
}],
[{
type
:
types
.
SET_FILTERS
,
payload
:
{
...
filters
,
not
:
{}
}
}],
[],
done
,
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment