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
2f08c27c
Commit
2f08c27c
authored
Jul 13, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search epic by title in issues
Changelog: changed
parent
bd7f09e2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
3 deletions
+35
-3
app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
...avascripts/sidebar/components/sidebar_dropdown_widget.vue
+1
-0
ee/app/assets/javascripts/sidebar/queries/group_epics.query.graphql
...ets/javascripts/sidebar/queries/group_epics.query.graphql
+7
-1
ee/spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
...ontend/sidebar/components/sidebar_dropdown_widget_spec.js
+27
-2
No files found.
app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
View file @
2f08c27c
...
...
@@ -125,6 +125,7 @@ export default {
return
{
fullPath
:
this
.
attrWorkspacePath
,
title
:
this
.
searchTerm
,
in
:
this
.
searchTerm
&&
this
.
issuableAttribute
===
IssuableType
.
Epic
?
'
TITLE
'
:
undefined
,
state
:
this
.
$options
.
IssuableAttributeState
[
this
.
issuableAttribute
],
sort
:
this
.
issuableAttribute
===
IssuableType
.
Epic
?
defaultEpicSort
:
null
,
};
...
...
ee/app/assets/javascripts/sidebar/queries/group_epics.query.graphql
View file @
2f08c27c
#import "./epic.fragment.graphql"
query
issueEpics
(
$fullPath
:
ID
!,
$title
:
String
,
$state
:
EpicState
)
{
query
issueEpics
(
$fullPath
:
ID
!
$title
:
String
$state
:
EpicState
$in
:
[
IssuableSearchableField
!]
)
{
workspace
:
group
(
fullPath
:
$fullPath
)
{
attributes
:
epics
(
search
:
$title
in
:
$in
state
:
$state
includeAncestorGroups
:
true
includeDescendantGroups
:
false
...
...
ee/spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
View file @
2f08c27c
...
...
@@ -456,7 +456,7 @@ describe('SidebarDropdownWidget', () => {
});
});
describe
(
'
when a user is searching
'
,
()
=>
{
describe
(
'
when a user is searching
epics
'
,
()
=>
{
const
mockSearchTerm
=
'
foobar
'
;
beforeEach
(
async
()
=>
{
...
...
@@ -466,7 +466,7 @@ describe('SidebarDropdownWidget', () => {
await
clickEdit
();
});
it
(
'
sends a groupEpics query with the entered search term "foo"
'
,
async
()
=>
{
it
(
'
sends a groupEpics query with the entered search term "foo"
and in TITLE param
'
,
async
()
=>
{
findSearchBox
().
vm
.
$emit
(
'
input
'
,
mockSearchTerm
);
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -478,6 +478,31 @@ describe('SidebarDropdownWidget', () => {
sort
:
'
TITLE_ASC
'
,
state
:
'
opened
'
,
title
:
mockSearchTerm
,
in
:
'
TITLE
'
,
});
});
});
describe
(
'
when a user is not searching
'
,
()
=>
{
beforeEach
(
async
()
=>
{
groupEpicsSpy
=
jest
.
fn
().
mockResolvedValueOnce
(
emptyGroupEpicsResponse
);
await
createComponentWithApollo
({
groupEpicsSpy
});
await
clickEdit
();
});
it
(
'
sends a groupEpics query with empty title and undefined in param
'
,
async
()
=>
{
await
wrapper
.
vm
.
$nextTick
();
// Account for debouncing
jest
.
runAllTimers
();
expect
(
groupEpicsSpy
).
toHaveBeenNthCalledWith
(
1
,
{
fullPath
:
mockIssue
.
groupPath
,
sort
:
'
TITLE_ASC
'
,
state
:
'
opened
'
,
title
:
''
,
in
:
undefined
,
});
});
});
...
...
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