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
cea78902
Commit
cea78902
authored
Apr 14, 2021
by
Eulyeon Ko
Committed by
Eulyeon Ko
Apr 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for assignee wildcard on boards
Adds support on the frontend
parent
7de56dcd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
85 additions
and
32 deletions
+85
-32
app/assets/javascripts/boards/boards_util.js
app/assets/javascripts/boards/boards_util.js
+30
-1
app/assets/javascripts/boards/constants.js
app/assets/javascripts/boards/constants.js
+14
-0
app/assets/javascripts/boards/stores/actions.js
app/assets/javascripts/boards/stores/actions.js
+7
-11
ee/app/assets/javascripts/boards/constants.js
ee/app/assets/javascripts/boards/constants.js
+2
-0
ee/app/assets/javascripts/boards/stores/actions.js
ee/app/assets/javascripts/boards/stores/actions.js
+10
-15
ee/changelogs/unreleased/280781-support-assignee-wildcard-filtering-boards-frontend.yml
...1-support-assignee-wildcard-filtering-boards-frontend.yml
+5
-0
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/actions_spec.js
+17
-5
No files found.
app/assets/javascripts/boards/boards_util.js
View file @
cea78902
import
{
sortBy
,
cloneDeep
}
from
'
lodash
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
ListType
,
NOT_FILTER
}
from
'
./constants
'
;
import
{
ListType
,
NOT_FILTER
,
AssigneeIdParamValues
}
from
'
./constants
'
;
export
function
getMilestone
()
{
return
null
;
...
...
@@ -186,6 +186,35 @@ export function transformNotFilters(filters) {
},
{});
}
export
function
getSupportedParams
(
filters
,
supportedFilters
)
{
return
supportedFilters
.
reduce
((
acc
,
f
)
=>
{
/**
* TODO the API endpoint for the classic boards
* accepts assignee wildcard value as 'assigneeId' param -
* while the GraphQL query accepts the value in 'assigneWildcardId' field.
* Once we deprecate the classics boards,
* we should change the filtered search bar to use 'asssigneeWildcardId' as a token name.
*/
if
(
f
===
'
assigneeId
'
&&
filters
[
f
])
{
return
AssigneeIdParamValues
.
includes
(
filters
[
f
])
?
{
...
acc
,
assigneeWildcardId
:
filters
[
f
].
toUpperCase
(),
}
:
acc
;
}
if
(
filters
[
f
])
{
return
{
...
acc
,
[
f
]:
filters
[
f
],
};
}
return
acc
;
},
{});
}
// EE-specific feature. Find the implementation in the `ee/`-folder
export
function
transformBoardConfig
()
{
return
''
;
...
...
app/assets/javascripts/boards/constants.js
View file @
cea78902
...
...
@@ -5,6 +5,20 @@ import boardBlockingIssuesQuery from './graphql/board_blocking_issues.query.grap
import
issueSetSubscriptionMutation
from
'
./graphql/issue_set_subscription.mutation.graphql
'
;
import
issueSetTitleMutation
from
'
./graphql/issue_set_title.mutation.graphql
'
;
export
const
SupportedFilters
=
[
'
assigneeUsername
'
,
'
authorUsername
'
,
'
labelName
'
,
'
milestoneTitle
'
,
'
releaseTag
'
,
'
search
'
,
'
myReactionEmoji
'
,
'
assigneeId
'
,
];
/* eslint-disable-next-line @gitlab/require-i18n-strings */
export
const
AssigneeIdParamValues
=
[
'
Any
'
,
'
None
'
];
export
const
issuableTypes
=
{
issue
:
'
issue
'
,
epic
:
'
epic
'
,
...
...
app/assets/javascripts/boards/stores/actions.js
View file @
cea78902
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
pick
}
from
'
lodash
'
;
import
createBoardListMutation
from
'
ee_else_ce/boards/graphql/board_list_create.mutation.graphql
'
;
import
boardListsQuery
from
'
ee_else_ce/boards/graphql/board_lists.query.graphql
'
;
import
issueMoveListMutation
from
'
ee_else_ce/boards/graphql/issue_move_list.mutation.graphql
'
;
...
...
@@ -11,6 +10,7 @@ import {
ISSUABLE
,
titleQueries
,
subscriptionQueries
,
SupportedFilters
,
}
from
'
~/boards/constants
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
createGqClient
,
{
fetchPolicies
}
from
'
~/lib/graphql
'
;
...
...
@@ -27,6 +27,7 @@ import {
transformNotFilters
,
moveItemListHelper
,
getMoveData
,
getSupportedParams
,
}
from
'
../boards_util
'
;
import
boardLabelsQuery
from
'
../graphql/board_labels.query.graphql
'
;
import
destroyBoardListMutation
from
'
../graphql/board_list_destroy.mutation.graphql
'
;
...
...
@@ -65,16 +66,11 @@ export default {
},
setFilters
:
({
commit
},
filters
)
=>
{
const
filterParams
=
pick
(
filters
,
[
'
assigneeUsername
'
,
'
authorUsername
'
,
'
labelName
'
,
'
milestoneTitle
'
,
'
releaseTag
'
,
'
search
'
,
'
myReactionEmoji
'
,
]);
filterParams
.
not
=
transformNotFilters
(
filters
);
const
filterParams
=
{
...
getSupportedParams
(
filters
,
SupportedFilters
),
not
:
transformNotFilters
(
filters
),
};
commit
(
types
.
SET_FILTERS
,
filterParams
);
},
...
...
ee/app/assets/javascripts/boards/constants.js
View file @
cea78902
...
...
@@ -10,6 +10,8 @@ export const EpicFilterType = {
none
:
'
None
'
,
};
export
const
SupportedFiltersEE
=
[
'
epicId
'
,
'
iterationTitle
'
,
'
weight
'
];
export
const
IterationFilterType
=
{
any
:
'
Any
'
,
none
:
'
None
'
,
...
...
ee/app/assets/javascripts/boards/stores/actions.js
View file @
cea78902
import
{
pick
}
from
'
lodash
'
;
import
{
formatBoardLists
,
formatListIssues
,
...
...
@@ -6,8 +5,9 @@ import {
fullBoardId
,
transformNotFilters
,
getMoveData
,
getSupportedParams
,
}
from
'
~/boards/boards_util
'
;
import
{
BoardType
}
from
'
~/boards/constants
'
;
import
{
BoardType
,
SupportedFilters
}
from
'
~/boards/constants
'
;
import
eventHub
from
'
~/boards/eventhub
'
;
import
listsIssuesQuery
from
'
~/boards/graphql/lists_issues.query.graphql
'
;
import
actionsCE
from
'
~/boards/stores/actions
'
;
...
...
@@ -28,7 +28,12 @@ import {
formatEpicListsPageInfo
,
}
from
'
../boards_util
'
;
import
{
EpicFilterType
,
IterationFilterType
,
GroupByParamType
}
from
'
../constants
'
;
import
{
EpicFilterType
,
IterationFilterType
,
GroupByParamType
,
SupportedFiltersEE
,
}
from
'
../constants
'
;
import
epicQuery
from
'
../graphql/epic.query.graphql
'
;
import
createEpicBoardListMutation
from
'
../graphql/epic_board_list_create.mutation.graphql
'
;
import
epicBoardListsQuery
from
'
../graphql/epic_board_lists.query.graphql
'
;
...
...
@@ -116,18 +121,8 @@ export default {
...
actionsCE
,
setFilters
:
({
commit
,
dispatch
,
getters
},
filters
)
=>
{
const
filterParams
=
pick
(
filters
,
[
'
assigneeUsername
'
,
'
authorUsername
'
,
'
epicId
'
,
'
labelName
'
,
'
milestoneTitle
'
,
'
iterationTitle
'
,
'
releaseTag
'
,
'
search
'
,
'
weight
'
,
'
myReactionEmoji
'
,
]);
const
supportedFilters
=
[...
SupportedFilters
,
...
SupportedFiltersEE
];
const
filterParams
=
getSupportedParams
(
filters
,
supportedFilters
);
// Temporarily disabled until negated filters are supported for epic boards
if
(
!
getters
.
isEpicBoard
)
{
...
...
ee/changelogs/unreleased/280781-support-assignee-wildcard-filtering-boards-frontend.yml
0 → 100644
View file @
cea78902
---
title
:
Support filtering by assignee wildcard in epic swimlanes
merge_request
:
59348
author
:
type
:
fixed
spec/frontend/boards/stores/actions_spec.js
View file @
cea78902
...
...
@@ -66,20 +66,32 @@ describe('setInitialBoardData', () => {
});
describe
(
'
setFilters
'
,
()
=>
{
it
(
'
should commit mutation SET_FILTERS
'
,
(
done
)
=>
{
it
.
each
([
[
'
with correct filters as payload
'
,
{
filters
:
{
labelName
:
'
label
'
},
updatedFilters
:
{
labelName
:
'
label
'
,
not
:
{}
},
},
],
[
'
and updates assigneeWildcardId
'
,
{
filters
:
{
assigneeId
:
'
None
'
},
updatedFilters
:
{
assigneeWildcardId
:
'
NONE
'
,
not
:
{}
},
},
],
])(
'
should commit mutation SET_FILTERS %s
'
,
(
_
,
{
filters
,
updatedFilters
})
=>
{
const
state
=
{
filters
:
{},
};
const
filters
=
{
labelName
:
'
label
'
};
testAction
(
actions
.
setFilters
,
filters
,
state
,
[{
type
:
types
.
SET_FILTERS
,
payload
:
{
...
filters
,
not
:
{}
}
}],
[{
type
:
types
.
SET_FILTERS
,
payload
:
updatedFilters
}],
[],
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