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
40df9a8a
Commit
40df9a8a
authored
Jan 28, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
3339b689
632b7768
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
47 additions
and
11 deletions
+47
-11
app/assets/javascripts/gfm_auto_complete.js
app/assets/javascripts/gfm_auto_complete.js
+6
-4
app/assets/javascripts/pages/projects/project.js
app/assets/javascripts/pages/projects/project.js
+2
-1
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-1
changelogs/unreleased/296667-fix-branch-change-with-line-selected.yml
...nreleased/296667-fix-branch-change-with-line-selected.yml
+5
-0
changelogs/unreleased/36705-search-across-full-name-for-assignee-autocomplete.yml
...705-search-across-full-name-for-assignee-autocomplete.yml
+5
-0
ee/changelogs/unreleased/296776-issues-created-from-vulnerabilities-set-to-confidential-by-defa.yml
...ated-from-vulnerabilities-set-to-confidential-by-defa.yml
+5
-0
ee/spec/controllers/projects/issues_controller_spec.rb
ee/spec/controllers/projects/issues_controller_spec.rb
+9
-1
spec/features/issues/gfm_autocomplete_spec.rb
spec/features/issues/gfm_autocomplete_spec.rb
+10
-0
spec/frontend/gfm_auto_complete_spec.js
spec/frontend/gfm_auto_complete_spec.js
+4
-4
No files found.
app/assets/javascripts/gfm_auto_complete.js
View file @
40df9a8a
...
...
@@ -14,6 +14,10 @@ function sanitize(str) {
return
str
.
replace
(
/<
(?:
.|
\n)
*
?
>/gm
,
''
);
}
function
createMemberSearchString
(
member
)
{
return
`
${
member
.
name
.
replace
(
/ /g
,
''
)}
${
member
.
username
}
`
;
}
export
function
membersBeforeSave
(
members
)
{
return
members
.
map
((
member
)
=>
{
const
GROUP_TYPE
=
'
Group
'
;
...
...
@@ -40,7 +44,7 @@ export function membersBeforeSave(members) {
username
:
member
.
username
,
avatarTag
:
autoCompleteAvatar
.
length
===
1
?
txtAvatar
:
imgAvatar
,
title
:
sanitize
(
title
),
search
:
sanitize
(
`
${
member
.
username
}
${
member
.
name
}
`
),
search
:
sanitize
(
createMemberSearchString
(
member
)
),
icon
:
avatarIcon
,
availability
:
member
?.
availability
,
};
...
...
@@ -298,9 +302,7 @@ class GfmAutoComplete {
// Cache assignees list for easier filtering later
assignees
=
SidebarMediator
.
singleton
?.
store
?.
assignees
?.
map
(
(
assignee
)
=>
`
${
assignee
.
username
}
${
assignee
.
name
}
`
,
)
||
[];
SidebarMediator
.
singleton
?.
store
?.
assignees
?.
map
(
createMemberSearchString
)
||
[];
const
match
=
GfmAutoComplete
.
defaultMatcher
(
flag
,
subtext
,
this
.
app
.
controllers
);
return
match
&&
match
.
length
?
match
[
1
]
:
null
;
...
...
app/assets/javascripts/pages/projects/project.js
View file @
40df9a8a
...
...
@@ -126,8 +126,9 @@ export default class Project {
const
refs
=
this
.
fullData
.
Branches
.
concat
(
this
.
fullData
.
Tags
);
const
currentRef
=
refs
.
find
((
ref
)
=>
loc
.
indexOf
(
ref
)
>
-
1
);
if
(
currentRef
)
{
const
targetPath
=
loc
.
split
(
currentRef
)[
1
].
slice
(
1
);
const
targetPath
=
loc
.
split
(
currentRef
)[
1
].
slice
(
1
)
.
split
(
'
#
'
)[
0
]
;
selectedUrl
.
searchParams
.
set
(
'
path
'
,
targetPath
);
selectedUrl
.
hash
=
window
.
location
.
hash
;
}
}
...
...
app/controllers/projects/issues_controller.rb
View file @
40df9a8a
...
...
@@ -105,7 +105,7 @@ class Projects::IssuesController < Projects::ApplicationController
build_params
=
issue_create_params
.
merge
(
merge_request_to_resolve_discussions_of:
params
[
:merge_request_to_resolve_discussions_of
],
discussion_to_resolve:
params
[
:discussion_to_resolve
],
confidential:
!!
Gitlab
::
Utils
.
to_boolean
(
params
[
:issue
]
[
:confidential
])
confidential:
!!
Gitlab
::
Utils
.
to_boolean
(
issue_create_params
[
:confidential
])
)
service
=
::
Issues
::
BuildService
.
new
(
project
,
current_user
,
build_params
)
...
...
changelogs/unreleased/296667-fix-branch-change-with-line-selected.yml
0 → 100644
View file @
40df9a8a
---
title
:
Fix bug branch change with line selected
merge_request
:
52285
author
:
type
:
fixed
changelogs/unreleased/36705-search-across-full-name-for-assignee-autocomplete.yml
0 → 100644
View file @
40df9a8a
---
title
:
Search across full name for mentions autocomplete
merge_request
:
52488
author
:
type
:
added
ee/changelogs/unreleased/296776-issues-created-from-vulnerabilities-set-to-confidential-by-defa.yml
0 → 100644
View file @
40df9a8a
---
title
:
Issues created from Vulnerabilities set to Confidential by default
merge_request
:
52127
author
:
type
:
changed
ee/spec/controllers/projects/issues_controller_spec.rb
View file @
40df9a8a
...
...
@@ -69,11 +69,19 @@ RSpec.describe Projects::IssuesController do
let
(
:vulnerability
)
{
create
(
:vulnerability
,
project:
project
,
findings:
[
finding
])
}
let
(
:vulnerability_field
)
{
"<input type=
\"
hidden
\"
name=
\"
vulnerability_id
\"
id=
\"
vulnerability_id
\"
value=
\"
#{
vulnerability
.
id
}
\"
/>"
}
subject
{
get
:new
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
vulnerability_id:
vulnerability
.
id
}
}
it
'sets the vulnerability_id'
do
get
:new
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
vulnerability_id:
vulnerability
.
id
}
subject
expect
(
response
.
body
).
to
include
(
vulnerability_field
)
end
it
'sets the confidential flag to true by default'
do
subject
expect
(
assigns
(
:issue
).
confidential
).
to
eq
(
true
)
end
end
end
...
...
spec/features/issues/gfm_autocomplete_spec.rb
View file @
40df9a8a
...
...
@@ -183,6 +183,16 @@ RSpec.describe 'GFM autocomplete', :js do
expect
(
find
(
'#at-view-users'
)).
to
have_content
(
user
.
name
)
end
it
'searches across full name for assignees'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note-body'
).
native
.
send_keys
(
'@speciąlsome'
)
end
wait_for_requests
expect
(
find
(
'.atwho-view li'
,
visible:
true
)).
to
have_content
(
user
.
name
)
end
it
'selects the first item for non-assignee dropdowns if a query is entered'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note-body'
).
native
.
send_keys
(
':1'
)
...
...
spec/frontend/gfm_auto_complete_spec.js
View file @
40df9a8a
...
...
@@ -493,7 +493,7 @@ describe('GfmAutoComplete', () => {
username
:
'
my-group
'
,
avatarTag
:
'
<div class="avatar rect-avatar center avatar-inline s26">M</div>
'
,
title
:
'
My Group (2)
'
,
search
:
'
my-group My G
roup
'
,
search
:
'
MyGroup my-g
roup
'
,
icon
:
''
,
},
]);
...
...
@@ -506,7 +506,7 @@ describe('GfmAutoComplete', () => {
avatarTag
:
'
<img src="./group.jpg" alt="my-group" class="avatar rect-avatar avatar-inline center s26"/>
'
,
title
:
'
My Group (2)
'
,
search
:
'
my-group My G
roup
'
,
search
:
'
MyGroup my-g
roup
'
,
icon
:
''
,
},
]);
...
...
@@ -519,7 +519,7 @@ describe('GfmAutoComplete', () => {
avatarTag
:
'
<img src="./group.jpg" alt="my-group" class="avatar rect-avatar avatar-inline center s26"/>
'
,
title
:
'
My Group
'
,
search
:
'
my-group My G
roup
'
,
search
:
'
MyGroup my-g
roup
'
,
icon
:
'
<svg class="s16 vertical-align-middle gl-ml-2"><use xlink:href="undefined#notifications-off" /></svg>
'
,
},
...
...
@@ -537,7 +537,7 @@ describe('GfmAutoComplete', () => {
avatarTag
:
'
<img src="./users.jpg" alt="my-user" class="avatar avatar-inline center s26"/>
'
,
title
:
'
My User
'
,
search
:
'
my-user My U
ser
'
,
search
:
'
MyUser my-u
ser
'
,
icon
:
''
,
},
]);
...
...
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