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
9b520784
Commit
9b520784
authored
Mar 11, 2020
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix assign user dropdown in new issue form
Add default array value in case optional chaining falls through
parent
68e796e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
app/assets/javascripts/gfm_auto_complete.js
app/assets/javascripts/gfm_auto_complete.js
+4
-3
changelogs/unreleased/210005-fix-assignee-quickaction-on-new-issue.yml
...released/210005-fix-assignee-quickaction-on-new-issue.yml
+5
-0
spec/features/issues/gfm_autocomplete_spec.rb
spec/features/issues/gfm_autocomplete_spec.rb
+17
-3
No files found.
app/assets/javascripts/gfm_auto_complete.js
View file @
9b520784
...
...
@@ -251,9 +251,10 @@ class GfmAutoComplete {
});
// Cache assignees list for easier filtering later
assignees
=
SidebarMediator
.
singleton
?.
store
?.
assignees
?.
map
(
assignee
=>
`
${
assignee
.
username
}
${
assignee
.
name
}
`
,
);
assignees
=
SidebarMediator
.
singleton
?.
store
?.
assignees
?.
map
(
assignee
=>
`
${
assignee
.
username
}
${
assignee
.
name
}
`
,
)
||
[];
const
match
=
GfmAutoComplete
.
defaultMatcher
(
flag
,
subtext
,
this
.
app
.
controllers
);
return
match
&&
match
.
length
?
match
[
1
]
:
null
;
...
...
changelogs/unreleased/210005-fix-assignee-quickaction-on-new-issue.yml
0 → 100644
View file @
9b520784
---
title
:
Fix assignee dropdown on new issue page
merge_request
:
26971
author
:
type
:
fixed
spec/features/issues/gfm_autocomplete_spec.rb
View file @
9b520784
...
...
@@ -284,16 +284,17 @@ describe 'GFM autocomplete', :js do
context
'assignees'
do
let
(
:issue_assignee
)
{
create
(
:issue
,
project:
project
)
}
let
(
:unassigned_user
)
{
create
(
:user
)
}
before
do
issue_assignee
.
update
(
assignees:
[
user
])
visit
project_issue_path
(
project
,
issue_assignee
)
wait_for_requests
project
.
add_maintainer
(
unassigned_user
)
end
it
'lists users who are currently not assigned to the issue when using /assign'
do
visit
project_issue_path
(
project
,
issue_assignee
)
note
=
find
(
'#note-body'
)
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
'/as'
)
...
...
@@ -305,6 +306,19 @@ describe 'GFM autocomplete', :js do
wait_for_requests
expect
(
find
(
'#at-view-users .atwho-view-ul'
)).
not_to
have_content
(
user
.
username
)
expect
(
find
(
'#at-view-users .atwho-view-ul'
)).
to
have_content
(
unassigned_user
.
username
)
end
it
'shows dropdown on new issue form'
do
visit
new_project_issue_path
(
project
)
textarea
=
find
(
'#issue_description'
)
textarea
.
native
.
send_keys
(
'/ass'
)
find
(
'.atwho-view li'
,
text:
'/assign'
)
textarea
.
native
.
send_keys
(
:tab
)
expect
(
find
(
'#at-view-users .atwho-view-ul'
)).
to
have_content
(
unassigned_user
.
username
)
expect
(
find
(
'#at-view-users .atwho-view-ul'
)).
to
have_content
(
user
.
username
)
end
end
...
...
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