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
72ca5cbe
Commit
72ca5cbe
authored
Mar 02, 2020
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add JS to enable ES EE functionality
- Update changelog
parent
17515f04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
ee/app/assets/javascripts/pages/admin/application_settings/index.js
...ets/javascripts/pages/admin/application_settings/index.js
+71
-0
No files found.
ee/app/assets/javascripts/pages/admin/application_settings/index.js
View file @
72ca5cbe
...
...
@@ -2,6 +2,77 @@ import '~/pages/admin/application_settings/index';
import
groupsSelect
from
'
~/groups_select
'
;
import
'
select2/select2
'
;
import
$
from
'
jquery
'
;
import
{
s__
}
from
'
~/locale
'
;
import
Api
from
'
~/api
'
;
const
onLimitCheckboxChange
=
(
checked
,
$limitByNamespaces
,
$limitByProjects
)
=>
{
$limitByNamespaces
.
find
(
'
.select2
'
).
select2
(
'
data
'
,
null
);
$limitByNamespaces
.
find
(
'
.select2
'
).
select2
(
'
data
'
,
null
);
$limitByNamespaces
.
toggleClass
(
'
hidden
'
,
!
checked
);
$limitByProjects
.
toggleClass
(
'
hidden
'
,
!
checked
);
};
const
getDropdownConfig
=
(
placeholder
,
apiPath
,
textProp
)
=>
({
placeholder
,
multiple
:
true
,
initSelection
(
$el
,
callback
)
{
callback
(
$el
.
data
(
'
selected
'
));
},
ajax
:
{
url
:
Api
.
buildUrl
(
apiPath
),
dataType
:
'
JSON
'
,
quietMillis
:
250
,
data
(
search
)
{
return
{
search
,
};
},
results
(
data
)
{
return
{
results
:
data
.
map
(
entity
=>
({
id
:
entity
.
id
,
text
:
entity
[
textProp
],
})),
};
},
},
});
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
groupsSelect
();
// ElasticSearch
const
$container
=
$
(
'
#js-elasticsearch-settings
'
);
$container
.
find
(
'
.js-limit-checkbox
'
)
.
on
(
'
change
'
,
e
=>
onLimitCheckboxChange
(
e
.
currentTarget
.
checked
,
$container
.
find
(
'
.js-limit-namespaces
'
),
$container
.
find
(
'
.js-limit-projects
'
),
),
);
$container
.
find
(
'
.js-elasticsearch-namespaces
'
)
.
select2
(
getDropdownConfig
(
s__
(
'
Elastic|None. Select namespaces to index.
'
),
Api
.
namespacesPath
,
'
full_path
'
,
),
);
$container
.
find
(
'
.js-elasticsearch-projects
'
)
.
select2
(
getDropdownConfig
(
s__
(
'
Elastic|None. Select projects to index.
'
),
Api
.
projectsPath
,
'
name_with_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