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
Boxiang Sun
gitlab-ce
Commits
6bae610c
Commit
6bae610c
authored
Oct 26, 2017
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace showAny for NamespaceSelect by isFilter
parent
fcc82ab6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
8 deletions
+5
-8
app/assets/javascripts/namespace_select.js
app/assets/javascripts/namespace_select.js
+3
-6
app/views/admin/projects/index.html.haml
app/views/admin/projects/index.html.haml
+1
-1
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+1
-1
No files found.
app/assets/javascripts/namespace_select.js
View file @
6bae610c
...
...
@@ -3,16 +3,13 @@ import Api from './api';
export
default
class
NamespaceSelect
{
constructor
(
opts
)
{
var
fieldName
,
showAny
;
const
isFilter
=
opts
.
dropdown
.
dataset
.
isFilter
===
'
true
'
;
var
fieldName
;
this
.
dropdown
=
$
(
opts
.
dropdown
);
showAny
=
true
;
fieldName
=
'
namespace_id
'
;
if
(
this
.
dropdown
.
attr
(
'
data-field-name
'
))
{
fieldName
=
this
.
dropdown
.
data
(
'
fieldName
'
);
}
if
(
this
.
dropdown
.
attr
(
'
data-show-any
'
))
{
showAny
=
this
.
dropdown
.
data
(
'
showAny
'
);
}
this
.
dropdown
.
glDropdown
({
filterable
:
true
,
selectable
:
true
,
...
...
@@ -31,7 +28,7 @@ export default class NamespaceSelect {
data
:
function
(
term
,
dataCallback
)
{
return
Api
.
namespaces
(
term
,
function
(
namespaces
)
{
var
anyNamespace
;
if
(
showAny
)
{
if
(
isFilter
)
{
anyNamespace
=
{
text
:
'
Any namespace
'
,
id
:
null
...
...
app/views/admin/projects/index.html.haml
View file @
6bae610c
...
...
@@ -14,7 +14,7 @@
=
hidden_field_tag
:namespace_id
,
params
[
:namespace_id
]
-
namespace
=
Namespace
.
find
(
params
[
:namespace_id
])
-
toggle_text
=
"
#{
namespace
.
kind
}
:
#{
namespace
.
full_path
}
"
=
dropdown_toggle
(
toggle_text
,
{
toggle:
'dropdown'
},
{
toggle_class:
'js-namespace-select large'
})
=
dropdown_toggle
(
toggle_text
,
{
toggle:
'dropdown'
,
is_filter:
'true'
},
{
toggle_class:
'js-namespace-select large'
})
.dropdown-menu.dropdown-select.dropdown-menu-align-right
=
dropdown_title
(
'Namespaces'
)
=
dropdown_filter
(
"Search for Namespace"
)
...
...
app/views/admin/projects/show.html.haml
View file @
6bae610c
...
...
@@ -115,7 +115,7 @@
=
f
.
label
:new_namespace_id
,
"Namespace"
,
class:
'control-label'
.col-sm-10
.dropdown
=
dropdown_toggle
(
'Search for Namespace'
,
{
toggle:
'dropdown'
,
field_name:
'new_namespace_id'
,
show_any:
'false'
},
{
toggle_class:
'js-namespace-select large'
})
=
dropdown_toggle
(
'Search for Namespace'
,
{
toggle:
'dropdown'
,
field_name:
'new_namespace_id'
},
{
toggle_class:
'js-namespace-select large'
})
.dropdown-menu.dropdown-select
=
dropdown_title
(
'Namespaces'
)
=
dropdown_filter
(
"Search for Namespace"
)
...
...
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