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
453aadde
Commit
453aadde
authored
Aug 25, 2020
by
Kushal Pandya
Committed by
Simon Knox
Aug 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make milestone search async
Adds async search support within milestone select dropdown.
parent
8db4eca6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
app/assets/javascripts/milestone_select.js
app/assets/javascripts/milestone_select.js
+5
-0
spec/features/issues/user_edits_issue_spec.rb
spec/features/issues/user_edits_issue_spec.rb
+21
-0
No files found.
app/assets/javascripts/milestone_select.js
View file @
453aadde
...
...
@@ -76,6 +76,10 @@ export default class MilestoneSelect {
let
getMilestones
=
Api
.
projectMilestones
;
const
reqParams
=
{
state
:
'
active
'
,
include_parent_milestones
:
true
};
if
(
term
)
{
reqParams
.
search
=
term
.
trim
();
}
if
(
!
contextId
)
{
contextId
=
$dropdown
.
get
(
0
).
dataset
.
groupId
;
delete
reqParams
.
include_parent_milestones
;
...
...
@@ -162,6 +166,7 @@ export default class MilestoneSelect {
`
;
},
filterable
:
true
,
filterRemote
:
true
,
search
:
{
fields
:
[
'
title
'
],
},
...
...
spec/features/issues/user_edits_issue_spec.rb
View file @
453aadde
...
...
@@ -4,13 +4,17 @@ require "spec_helper"
RSpec
.
describe
"Issues > User edits issue"
,
:js
do
let_it_be
(
:project
)
{
create
(
:project_empty_repo
,
:public
)
}
let_it_be
(
:project_with_milestones
)
{
create
(
:project_empty_repo
,
:public
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
user
,
assignees:
[
user
])
}
let_it_be
(
:issue_with_milestones
)
{
create
(
:issue
,
project:
project_with_milestones
,
author:
user
,
assignees:
[
user
])
}
let_it_be
(
:label
)
{
create
(
:label
,
project:
project
)
}
let_it_be
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let_it_be
(
:milestones
)
{
create_list
(
:milestone
,
25
,
project:
project_with_milestones
)
}
before
do
project
.
add_developer
(
user
)
project_with_milestones
.
add_developer
(
user
)
sign_in
(
user
)
end
...
...
@@ -218,6 +222,23 @@ RSpec.describe "Issues > User edits issue", :js do
end
end
end
it
'allows user to search milestone'
do
visit
project_issue_path
(
project_with_milestones
,
issue_with_milestones
)
page
.
within
(
'.milestone'
)
do
click_link
'Edit'
wait_for_requests
# We need to enclose search string in quotes for exact match as all the milestone titles
# within tests are prefixed with `My title`.
find
(
'.dropdown-input-field'
,
visible:
true
).
send_keys
"
\"
#{
milestones
[
0
].
title
}
\"
"
wait_for_requests
page
.
within
'.dropdown-content'
do
expect
(
page
).
to
have_content
milestones
[
0
].
title
end
end
end
end
context
'by unauthorized user'
do
...
...
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