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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
f20875ec
Commit
f20875ec
authored
Nov 11, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add username to gon
parent
9c8a86f6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
app/assets/javascripts/search_autocomplete.js.es6
app/assets/javascripts/search_autocomplete.js.es6
+4
-3
lib/gitlab/gon_helper.rb
lib/gitlab/gon_helper.rb
+1
-0
spec/features/search_spec.rb
spec/features/search_spec.rb
+4
-4
No files found.
app/assets/javascripts/search_autocomplete.js.es6
View file @
f20875ec
...
@@ -142,8 +142,9 @@
...
@@ -142,8 +142,9 @@
}
}
getCategoryContents() {
getCategoryContents() {
var dashboardOptions, groupOptions, issuesPath, items, mrPath, name, options, projectOptions, userId, utils;
var dashboardOptions, groupOptions, issuesPath, items, mrPath, name, options, projectOptions, userId, u
serName, u
tils;
userId = gon.current_user_id;
userId = gon.current_user_id;
userName = gon.current_username;
utils = gl.utils, projectOptions = gl.projectOptions, groupOptions = gl.groupOptions, dashboardOptions = gl.dashboardOptions;
utils = gl.utils, projectOptions = gl.projectOptions, groupOptions = gl.groupOptions, dashboardOptions = gl.dashboardOptions;
if (utils.isInGroupsPage() && groupOptions) {
if (utils.isInGroupsPage() && groupOptions) {
options = groupOptions[utils.getGroupSlug()];
options = groupOptions[utils.getGroupSlug()];
...
@@ -158,10 +159,10 @@
...
@@ -158,10 +159,10 @@
header: "" + name
header: "" + name
}, {
}, {
text: 'Issues assigned to me',
text: 'Issues assigned to me',
url: issuesPath + "/?assignee_
id=" + userId
url: issuesPath + "/?assignee_
username=" + userName
}, {
}, {
text: "Issues I've created",
text: "Issues I've created",
url: issuesPath + "/?author_
id=" + userId
url: issuesPath + "/?author_
username=" + userName
}, 'separator', {
}, 'separator', {
text: 'Merge requests assigned to me',
text: 'Merge requests assigned to me',
url: mrPath + "/?assignee_id=" + userId
url: mrPath + "/?assignee_id=" + userId
...
...
lib/gitlab/gon_helper.rb
View file @
f20875ec
...
@@ -13,6 +13,7 @@ module Gitlab
...
@@ -13,6 +13,7 @@ module Gitlab
if
current_user
if
current_user
gon
.
current_user_id
=
current_user
.
id
gon
.
current_user_id
=
current_user
.
id
gon
.
current_username
=
current_user
.
username
end
end
end
end
end
end
...
...
spec/features/search_spec.rb
View file @
f20875ec
...
@@ -169,16 +169,16 @@ describe "Search", feature: true do
...
@@ -169,16 +169,16 @@ describe "Search", feature: true do
find
(
'.dropdown-menu'
).
click_link
'Issues assigned to me'
find
(
'.dropdown-menu'
).
click_link
'Issues assigned to me'
sleep
2
sleep
2
expect
(
page
).
to
have_selector
(
'.
issues-holder
'
)
expect
(
page
).
to
have_selector
(
'.
filtered-search
'
)
expect
(
find
(
'.
js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.
filtered-search'
).
value
).
to
eq
(
"assignee:
#{
user
.
username
}
"
)
end
end
it
'takes user to her issues page when issues authored is clicked'
do
it
'takes user to her issues page when issues authored is clicked'
do
find
(
'.dropdown-menu'
).
click_link
"Issues I've created"
find
(
'.dropdown-menu'
).
click_link
"Issues I've created"
sleep
2
sleep
2
expect
(
page
).
to
have_selector
(
'.
issues-holder
'
)
expect
(
page
).
to
have_selector
(
'.
filtered-search
'
)
expect
(
find
(
'.
js-author-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.
filtered-search'
).
value
).
to
eq
(
"author:
#{
user
.
username
}
"
)
end
end
it
'takes user to her MR page when MR assigned is clicked'
do
it
'takes user to her MR page when MR assigned is clicked'
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