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
3a023c5e
Commit
3a023c5e
authored
Oct 26, 2017
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make NamespaceSelect change URL when filtering
parent
34d53d2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
app/assets/javascripts/namespace_select.js
app/assets/javascripts/namespace_select.js
+12
-11
changelogs/unreleased/winh-admin-projects-namespace-filter.yml
...elogs/unreleased/winh-admin-projects-namespace-filter.yml
+5
-0
No files found.
app/assets/javascripts/namespace_select.js
View file @
3a023c5e
/* eslint-disable func-names, space-before-function-paren, no-var, comma-dangle, object-shorthand, no-else-return, prefer-template, quotes, prefer-arrow-callback, max-len */
import
Api
from
'
./api
'
;
import
'
./lib/utils/url_utility
'
;
export
default
class
NamespaceSelect
{
constructor
(
opts
)
{
const
isFilter
=
opts
.
dropdown
.
dataset
.
isFilter
===
'
true
'
;
var
fieldName
;
this
.
dropdown
=
$
(
opts
.
dropdown
);
fieldName
=
'
namespace_id
'
;
if
(
this
.
dropdown
.
attr
(
'
data-field-name
'
))
{
fieldName
=
this
.
dropdown
.
data
(
'
fieldName
'
);
}
this
.
dropdown
.
glDropdown
({
const
fieldName
=
opts
.
dropdown
.
dataset
.
fieldName
||
'
namespace_id
'
;
$
(
opts
.
dropdown
).
glDropdown
({
filterable
:
true
,
selectable
:
true
,
filterRemote
:
true
,
...
...
@@ -27,9 +24,8 @@ export default class NamespaceSelect {
},
data
:
function
(
term
,
dataCallback
)
{
return
Api
.
namespaces
(
term
,
function
(
namespaces
)
{
var
anyNamespace
;
if
(
isFilter
)
{
anyNamespace
=
{
const
anyNamespace
=
{
text
:
'
Any namespace
'
,
id
:
null
};
...
...
@@ -48,8 +44,13 @@ export default class NamespaceSelect {
},
renderRow
:
this
.
renderRow
,
clicked
(
options
)
{
const
{
e
}
=
options
;
return
e
.
preventDefault
();
if
(
!
isFilter
)
{
const
{
e
}
=
options
;
e
.
preventDefault
();
}
},
url
(
namespace
)
{
return
gl
.
utils
.
mergeUrlParams
({
[
fieldName
]:
namespace
.
id
},
window
.
location
.
href
);
},
});
}
...
...
changelogs/unreleased/winh-admin-projects-namespace-filter.yml
0 → 100644
View file @
3a023c5e
---
title
:
Make NamespaceSelect change URL when filtering
merge_request
:
14888
author
:
type
:
fixed
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