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
5522a5ff
Commit
5522a5ff
authored
Jul 01, 2021
by
Andrew Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search for epics by iid if search starts with &
Changelog: added EE: true
parent
8327d4d4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
9 deletions
+47
-9
app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
...avascripts/sidebar/components/sidebar_dropdown_widget.vue
+28
-4
app/assets/javascripts/sidebar/constants.js
app/assets/javascripts/sidebar/constants.js
+2
-0
ee/app/assets/javascripts/sidebar/queries/group_epics.query.graphql
...ets/javascripts/sidebar/queries/group_epics.query.graphql
+2
-0
ee/spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
...ontend/sidebar/components/sidebar_dropdown_widget_spec.js
+15
-3
spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
...ontend/sidebar/components/sidebar_dropdown_widget_spec.js
+0
-2
No files found.
app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
View file @
5522a5ff
...
...
@@ -22,6 +22,7 @@ import {
issuableAttributesQueries
,
noAttributeId
,
defaultEpicSort
,
epicIidPattern
,
}
from
'
~/sidebar/constants
'
;
export
default
{
...
...
@@ -118,17 +119,37 @@ export default {
return
query
;
},
skip
()
{
if
(
this
.
isEpic
&&
this
.
searchTerm
.
startsWith
(
'
&
'
)
&&
this
.
searchTerm
.
length
<
2
)
{
return
true
;
}
return
!
this
.
editing
;
},
debounce
:
250
,
variables
()
{
return
{
if
(
!
this
.
isEpic
)
{
return
{
fullPath
:
this
.
attrWorkspacePath
,
title
:
this
.
searchTerm
,
state
:
this
.
$options
.
IssuableAttributeState
[
this
.
issuableAttribute
],
};
}
const
variables
=
{
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
,
sort
:
defaultEpicSort
,
};
if
(
epicIidPattern
.
test
(
this
.
searchTerm
))
{
const
matches
=
this
.
searchTerm
.
match
(
epicIidPattern
);
variables
.
iidStartsWith
=
matches
.
groups
.
iid
;
}
else
if
(
this
.
searchTerm
!==
''
)
{
variables
.
in
=
'
TITLE
'
;
variables
.
title
=
this
.
searchTerm
;
}
return
variables
;
},
update
(
data
)
{
if
(
data
?.
workspace
)
{
...
...
@@ -214,6 +235,9 @@ export default {
),
};
},
isEpic
()
{
return
this
.
issuableAttribute
===
IssuableType
.
Epic
;
},
},
methods
:
{
updateAttribute
(
attributeId
)
{
...
...
app/assets/javascripts/sidebar/constants.js
View file @
5522a5ff
...
...
@@ -48,6 +48,8 @@ export const ASSIGNEES_DEBOUNCE_DELAY = DEFAULT_DEBOUNCE_AND_THROTTLE_MS;
export
const
defaultEpicSort
=
'
TITLE_ASC
'
;
export
const
epicIidPattern
=
/^&
(?<
iid>
\d
+
)
$/
;
export
const
assigneesQueries
=
{
[
IssuableType
.
Issue
]:
{
query
:
getIssueAssignees
,
...
...
ee/app/assets/javascripts/sidebar/queries/group_epics.query.graphql
View file @
5522a5ff
...
...
@@ -5,6 +5,7 @@ query issueEpics(
$title
:
String
$state
:
EpicState
$in
:
[
IssuableSearchableField
!]
$iidStartsWith
:
String
)
{
workspace
:
group
(
fullPath
:
$fullPath
)
{
attributes
:
epics
(
...
...
@@ -13,6 +14,7 @@ query issueEpics(
state
:
$state
includeAncestorGroups
:
true
includeDescendantGroups
:
false
iidStartsWith
:
$iidStartsWith
)
{
nodes
{
...
EpicFragment
...
...
ee/spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
View file @
5522a5ff
...
...
@@ -452,7 +452,6 @@ describe('SidebarDropdownWidget', () => {
fullPath
:
mockIssue
.
groupPath
,
sort
:
'
TITLE_ASC
'
,
state
:
'
opened
'
,
title
:
''
,
});
});
...
...
@@ -501,8 +500,21 @@ describe('SidebarDropdownWidget', () => {
fullPath
:
mockIssue
.
groupPath
,
sort
:
'
TITLE_ASC
'
,
state
:
'
opened
'
,
title
:
''
,
in
:
undefined
,
});
});
it
(
'
sends a groupEpics query for an IID with the entered search term "&1"
'
,
async
()
=>
{
findSearchBox
().
vm
.
$emit
(
'
input
'
,
'
&1
'
);
await
wrapper
.
vm
.
$nextTick
();
// Account for debouncing
jest
.
runAllTimers
();
expect
(
groupEpicsSpy
).
toHaveBeenNthCalledWith
(
2
,
{
fullPath
:
mockIssue
.
groupPath
,
iidStartsWith
:
'
1
'
,
sort
:
'
TITLE_ASC
'
,
state
:
'
opened
'
,
});
});
});
...
...
spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
View file @
5522a5ff
...
...
@@ -451,7 +451,6 @@ describe('SidebarDropdownWidget', () => {
expect
(
projectMilestonesSpy
).
toHaveBeenNthCalledWith
(
1
,
{
fullPath
:
mockIssue
.
projectPath
,
sort
:
null
,
state
:
'
active
'
,
title
:
''
,
});
...
...
@@ -478,7 +477,6 @@ describe('SidebarDropdownWidget', () => {
expect
(
projectMilestonesSpy
).
toHaveBeenNthCalledWith
(
2
,
{
fullPath
:
mockIssue
.
projectPath
,
sort
:
null
,
state
:
'
active
'
,
title
:
mockSearchTerm
,
});
...
...
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