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
1bd4cd44
Commit
1bd4cd44
authored
Sep 06, 2017
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport getAllParams and other nav changes from service desk.
parent
5f6545f3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
6 deletions
+52
-6
app/assets/javascripts/filtered_search/filtered_search_manager.js
...ts/javascripts/filtered_search/filtered_search_manager.js
+15
-2
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+1
-1
app/views/projects/issues/_issues.html.haml
app/views/projects/issues/_issues.html.haml
+3
-1
app/views/projects/issues/_nav_btns.html.haml
app/views/projects/issues/_nav_btns.html.haml
+11
-2
spec/javascripts/filtered_search/filtered_search_manager_spec.js
...vascripts/filtered_search/filtered_search_manager_spec.js
+22
-0
No files found.
app/assets/javascripts/filtered_search/filtered_search_manager.js
View file @
1bd4cd44
...
@@ -332,7 +332,14 @@ class FilteredSearchManager {
...
@@ -332,7 +332,14 @@ class FilteredSearchManager {
const
removeElements
=
[];
const
removeElements
=
[];
[].
forEach
.
call
(
this
.
tokensContainer
.
children
,
(
t
)
=>
{
[].
forEach
.
call
(
this
.
tokensContainer
.
children
,
(
t
)
=>
{
if
(
t
.
classList
.
contains
(
'
js-visual-token
'
))
{
let
canClearToken
=
t
.
classList
.
contains
(
'
js-visual-token
'
);
if
(
canClearToken
)
{
const
tokenKey
=
t
.
querySelector
(
'
.name
'
).
textContent
.
trim
();
canClearToken
=
this
.
canEdit
&&
this
.
canEdit
(
tokenKey
);
}
if
(
canClearToken
)
{
removeElements
.
push
(
t
);
removeElements
.
push
(
t
);
}
}
});
});
...
@@ -411,8 +418,14 @@ class FilteredSearchManager {
...
@@ -411,8 +418,14 @@ class FilteredSearchManager {
});
});
}
}
// allows for modifying params array when a param can't be included in the URL (e.g. Service Desk)
getAllParams
(
urlParams
)
{
return
this
.
modifyUrlParams
?
this
.
modifyUrlParams
(
urlParams
)
:
urlParams
;
}
loadSearchParamsFromURL
()
{
loadSearchParamsFromURL
()
{
const
params
=
gl
.
utils
.
getUrlParamsArray
();
const
urlParams
=
gl
.
utils
.
getUrlParamsArray
();
const
params
=
this
.
getAllParams
(
urlParams
);
const
usernameParams
=
this
.
getUsernameParams
();
const
usernameParams
=
this
.
getUsernameParams
();
let
hasFilteredSearch
=
false
;
let
hasFilteredSearch
=
false
;
...
...
app/views/layouts/nav/sidebar/_project.html.haml
View file @
1bd4cd44
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
%span
.badge.count.issue_counter.fly-out-badge
%span
.badge.count.issue_counter.fly-out-badge
=
number_with_delimiter
(
@project
.
open_issues_count
)
=
number_with_delimiter
(
@project
.
open_issues_count
)
%li
.divider.fly-out-top-item
%li
.divider.fly-out-top-item
=
nav_link
(
controller: :issues
)
do
=
nav_link
(
controller: :issues
,
action: :index
)
do
=
link_to
project_issues_path
(
@project
),
title:
'Issues'
do
=
link_to
project_issues_path
(
@project
),
title:
'Issues'
do
%span
%span
List
List
...
...
app/views/projects/issues/_issues.html.haml
View file @
1bd4cd44
-
empty_state_path
=
local_assigns
.
fetch
(
:empty_state_path
,
'shared/empty_states/issues'
)
%ul
.content-list.issues-list.issuable-list
%ul
.content-list.issues-list.issuable-list
=
render
partial:
"projects/issues/issue"
,
collection:
@issues
=
render
partial:
"projects/issues/issue"
,
collection:
@issues
-
if
@issues
.
blank?
-
if
@issues
.
blank?
=
render
'shared/empty_states/issues'
=
render
empty_state_path
-
if
@issues
.
present?
-
if
@issues
.
present?
=
paginate
@issues
,
theme:
"gitlab"
,
total_pages:
@total_pages
=
paginate
@issues
,
theme:
"gitlab"
,
total_pages:
@total_pages
app/views/projects/issues/_nav_btns.html.haml
View file @
1bd4cd44
=
link_to
params
.
merge
(
rss_url_options
),
class:
'btn btn-default append-right-10 has-tooltip'
,
title:
'Subscribe'
do
-
show_rss_button
=
local_assigns
.
fetch
(
:show_rss_button
,
true
)
=
icon
(
'rss'
)
-
show_export_button
=
local_assigns
.
fetch
(
:show_export_button
,
true
)
-
if
show_rss_button
=
link_to
params
.
merge
(
rss_url_options
),
class:
'btn btn-default append-right-10 has-tooltip'
,
title:
'Subscribe'
do
=
icon
(
'rss'
)
-
if
show_export_button
=
render
'projects/issues/export_issues/button'
-
if
@can_bulk_update
-
if
@can_bulk_update
=
button_tag
"Edit issues"
,
class:
"btn btn-default append-right-10 js-bulk-update-toggle"
=
button_tag
"Edit issues"
,
class:
"btn btn-default append-right-10 js-bulk-update-toggle"
=
link_to
"New issue"
,
new_project_issue_path
(
@project
,
=
link_to
"New issue"
,
new_project_issue_path
(
@project
,
issue:
{
assignee_id:
issues_finder
.
assignee
.
try
(
:id
),
issue:
{
assignee_id:
issues_finder
.
assignee
.
try
(
:id
),
milestone_id:
issues_finder
.
milestones
.
first
.
try
(
:id
)
}),
milestone_id:
issues_finder
.
milestones
.
first
.
try
(
:id
)
}),
...
...
spec/javascripts/filtered_search/filtered_search_manager_spec.js
View file @
1bd4cd44
...
@@ -411,4 +411,26 @@ describe('Filtered Search Manager', () => {
...
@@ -411,4 +411,26 @@ describe('Filtered Search Manager', () => {
expect
(
document
.
querySelector
(
'
.filtered-search-box
'
).
classList
.
contains
(
'
focus
'
)).
toEqual
(
false
);
expect
(
document
.
querySelector
(
'
.filtered-search-box
'
).
classList
.
contains
(
'
focus
'
)).
toEqual
(
false
);
});
});
});
});
describe
(
'
getAllParams
'
,
()
=>
{
beforeEach
(()
=>
{
this
.
paramsArr
=
[
'
key=value
'
,
'
otherkey=othervalue
'
];
initializeManager
();
});
it
(
'
correctly modifies params when custom modifier is passed
'
,
()
=>
{
const
modifedParams
=
manager
.
getAllParams
.
call
({
modifyUrlParams
:
paramsArr
=>
paramsArr
.
reverse
(),
},
[].
concat
(
this
.
paramsArr
));
expect
(
modifedParams
[
0
]).
toBe
(
this
.
paramsArr
[
1
]);
});
it
(
'
does not modify params when no custom modifier is passed
'
,
()
=>
{
const
modifedParams
=
manager
.
getAllParams
.
call
({},
this
.
paramsArr
);
expect
(
modifedParams
[
1
]).
toBe
(
this
.
paramsArr
[
1
]);
});
});
});
});
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