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
Jérome Perrin
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
Show 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 */
/* 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
Api
from
'
./api
'
;
import
'
./lib/utils/url_utility
'
;
export
default
class
NamespaceSelect
{
export
default
class
NamespaceSelect
{
constructor
(
opts
)
{
constructor
(
opts
)
{
const
isFilter
=
opts
.
dropdown
.
dataset
.
isFilter
===
'
true
'
;
const
isFilter
=
opts
.
dropdown
.
dataset
.
isFilter
===
'
true
'
;
var
fieldName
;
const
fieldName
=
opts
.
dropdown
.
dataset
.
fieldName
||
'
namespace_id
'
;
this
.
dropdown
=
$
(
opts
.
dropdown
);
fieldName
=
'
namespace_id
'
;
$
(
opts
.
dropdown
).
glDropdown
({
if
(
this
.
dropdown
.
attr
(
'
data-field-name
'
))
{
fieldName
=
this
.
dropdown
.
data
(
'
fieldName
'
);
}
this
.
dropdown
.
glDropdown
({
filterable
:
true
,
filterable
:
true
,
selectable
:
true
,
selectable
:
true
,
filterRemote
:
true
,
filterRemote
:
true
,
...
@@ -27,9 +24,8 @@ export default class NamespaceSelect {
...
@@ -27,9 +24,8 @@ export default class NamespaceSelect {
},
},
data
:
function
(
term
,
dataCallback
)
{
data
:
function
(
term
,
dataCallback
)
{
return
Api
.
namespaces
(
term
,
function
(
namespaces
)
{
return
Api
.
namespaces
(
term
,
function
(
namespaces
)
{
var
anyNamespace
;
if
(
isFilter
)
{
if
(
isFilter
)
{
anyNamespace
=
{
const
anyNamespace
=
{
text
:
'
Any namespace
'
,
text
:
'
Any namespace
'
,
id
:
null
id
:
null
};
};
...
@@ -48,8 +44,13 @@ export default class NamespaceSelect {
...
@@ -48,8 +44,13 @@ export default class NamespaceSelect {
},
},
renderRow
:
this
.
renderRow
,
renderRow
:
this
.
renderRow
,
clicked
(
options
)
{
clicked
(
options
)
{
if
(
!
isFilter
)
{
const
{
e
}
=
options
;
const
{
e
}
=
options
;
return
e
.
preventDefault
();
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