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
0ad14603
Commit
0ad14603
authored
Jun 24, 2019
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove baseEndpoint from search dropdwon
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
45a01b65
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
15 deletions
+15
-15
app/assets/javascripts/filtered_search/available_dropdown_mappings.js
...avascripts/filtered_search/available_dropdown_mappings.js
+3
-3
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
...ripts/filtered_search/filtered_search_dropdown_manager.js
+3
-3
app/assets/javascripts/filtered_search/filtered_search_manager.js
...ts/javascripts/filtered_search/filtered_search_manager.js
+2
-1
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+2
-3
app/views/admin/runners/index.html.haml
app/views/admin/runners/index.html.haml
+1
-1
spec/helpers/search_helper_spec.rb
spec/helpers/search_helper_spec.rb
+3
-3
spec/javascripts/filtered_search/visual_token_value_spec.js
spec/javascripts/filtered_search/visual_token_value_spec.js
+1
-1
No files found.
app/assets/javascripts/filtered_search/available_dropdown_mappings.js
View file @
0ad14603
...
...
@@ -10,7 +10,7 @@ import { mergeUrlParams } from '../lib/utils/url_utility';
export
default
class
AvailableDropdownMappings
{
constructor
(
container
,
base
Endpoint
,
runnerTags
Endpoint
,
labelsEndpoint
,
milestonesEndpoint
,
groupsOnly
,
...
...
@@ -18,7 +18,7 @@ export default class AvailableDropdownMappings {
includeDescendantGroups
,
)
{
this
.
container
=
container
;
this
.
baseEndpoint
=
base
Endpoint
;
this
.
runnerTagsEndpoint
=
runnerTags
Endpoint
;
this
.
labelsEndpoint
=
labelsEndpoint
;
this
.
milestonesEndpoint
=
milestonesEndpoint
;
this
.
groupsOnly
=
groupsOnly
;
...
...
@@ -149,7 +149,7 @@ export default class AvailableDropdownMappings {
}
getRunnerTagsEndpoint
()
{
return
`
${
this
.
baseEndpoint
}
/admin/runners/tag_list
.json`
;
return
`
${
this
.
runnerTagsEndpoint
}
.json`
;
}
getMergeRequestTargetBranchesEndpoint
()
{
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
View file @
0ad14603
...
...
@@ -8,7 +8,7 @@ import FilteredSearchVisualTokens from './filtered_search_visual_tokens';
export
default
class
FilteredSearchDropdownManager
{
constructor
({
base
Endpoint
=
''
,
runnerTags
Endpoint
=
''
,
labelsEndpoint
=
''
,
milestonesEndpoint
=
''
,
tokenizer
,
...
...
@@ -19,7 +19,7 @@ export default class FilteredSearchDropdownManager {
filteredSearchTokenKeys
,
})
{
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
baseEndpoint
=
base
Endpoint
.
replace
(
/
\/
$/
,
''
);
this
.
runnerTagsEndpoint
=
runnerTags
Endpoint
.
replace
(
/
\/
$/
,
''
);
this
.
labelsEndpoint
=
labelsEndpoint
.
replace
(
/
\/
$/
,
''
);
this
.
milestonesEndpoint
=
milestonesEndpoint
.
replace
(
/
\/
$/
,
''
);
this
.
tokenizer
=
tokenizer
;
...
...
@@ -51,7 +51,7 @@ export default class FilteredSearchDropdownManager {
const
supportedTokens
=
this
.
filteredSearchTokenKeys
.
getKeys
();
const
availableMappings
=
new
AvailableDropdownMappings
(
this
.
container
,
this
.
base
Endpoint
,
this
.
runnerTags
Endpoint
,
this
.
labelsEndpoint
,
this
.
milestonesEndpoint
,
this
.
groupsOnly
,
...
...
app/assets/javascripts/filtered_search/filtered_search_manager.js
View file @
0ad14603
...
...
@@ -85,7 +85,8 @@ export default class FilteredSearchManager {
if
(
this
.
filteredSearchInput
)
{
this
.
tokenizer
=
FilteredSearchTokenizer
;
this
.
dropdownManager
=
new
FilteredSearchDropdownManager
({
baseEndpoint
:
this
.
filteredSearchInput
.
getAttribute
(
'
data-base-endpoint
'
)
||
''
,
runnerTagsEndpoint
:
this
.
filteredSearchInput
.
getAttribute
(
'
data-runner-tags-endpoint
'
)
||
''
,
labelsEndpoint
:
this
.
filteredSearchInput
.
getAttribute
(
'
data-labels-endpoint
'
)
||
''
,
milestonesEndpoint
:
this
.
filteredSearchInput
.
getAttribute
(
'
data-milestones-endpoint
'
)
||
''
,
tokenizer
:
this
.
tokenizer
,
...
...
app/helpers/search_helper.rb
View file @
0ad14603
...
...
@@ -169,18 +169,17 @@ module SearchHelper
autocomplete:
'off'
}
opts
[
:data
][
'runner-tags-endpoint'
]
=
tag_list_admin_runners_path
if
@project
.
present?
opts
[
:data
][
'project-id'
]
=
@project
.
id
opts
[
:data
][
'base-endpoint'
]
=
project_path
(
@project
)
opts
[
:data
][
'labels-endpoint'
]
=
project_labels_path
(
@project
)
opts
[
:data
][
'milestones-endpoint'
]
=
project_milestones_path
(
@project
)
elsif
@group
.
present?
opts
[
:data
][
'group-id'
]
=
@group
.
id
opts
[
:data
][
'base-endpoint'
]
=
group_canonical_path
(
@group
)
opts
[
:data
][
'labels-endpoint'
]
=
group_labels_path
(
@group
)
opts
[
:data
][
'milestones-endpoint'
]
=
group_milestones_path
(
@group
)
else
opts
[
:data
][
'base-endpoint'
]
=
root_dashboard_path
opts
[
:data
][
'labels-endpoint'
]
=
dashboard_labels_path
opts
[
:data
][
'milestones-endpoint'
]
=
dashboard_milestones_path
end
...
...
app/views/admin/runners/index.html.haml
View file @
0ad14603
...
...
@@ -58,7 +58,7 @@
.scroll-container
%ul
.tokens-container.list-unstyled
%li
.input-token
%input
.form-control.filtered-search
{
{
id:
'filtered-search-runners'
,
placeholder:
_
(
'Search or filter results...'
)
}
}
%input
.form-control.filtered-search
{
search_filter_input_options
(
'runners'
)
}
#js-dropdown-hint
.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown
%ul
{
data:
{
dropdown:
true
}
}
%li
.filter-dropdown-item
{
data:
{
action:
'submit'
}
}
...
...
spec/helpers/search_helper_spec.rb
View file @
0ad14603
...
...
@@ -114,7 +114,7 @@ describe SearchHelper do
end
it
'includes project endpoints'
do
expect
(
search_filter_input_options
(
''
)[
:data
][
'
base-endpoint'
]).
to
eq
(
project_path
(
@project
)
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'
runner-tags-endpoint'
]).
to
eq
(
tag_list_admin_runners_path
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'labels-endpoint'
]).
to
eq
(
project_labels_path
(
@project
))
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
project_milestones_path
(
@project
))
end
...
...
@@ -134,7 +134,7 @@ describe SearchHelper do
end
it
'includes group endpoints'
do
expect
(
search_filter_input_options
(
''
)[
:data
][
'
base-endpoint'
]).
to
eq
(
"/groups
#{
group_path
(
@group
)
}
"
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'
runner-tags-endpoint'
]).
to
eq
(
tag_list_admin_runners_path
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'labels-endpoint'
]).
to
eq
(
group_labels_path
(
@group
))
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
group_milestones_path
(
@group
))
end
...
...
@@ -147,7 +147,7 @@ describe SearchHelper do
end
it
'includes dashboard endpoints'
do
expect
(
search_filter_input_options
(
''
)[
:data
][
'
base-endpoint'
]).
to
eq
(
"/dashboard"
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'
runner-tags-endpoint'
]).
to
eq
(
tag_list_admin_runners_path
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'labels-endpoint'
]).
to
eq
(
dashboard_labels_path
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
dashboard_milestones_path
)
end
...
...
spec/javascripts/filtered_search/visual_token_value_spec.js
View file @
0ad14603
...
...
@@ -155,7 +155,7 @@ describe('Filtered Search Visual Tokens', () => {
`
);
const
filteredSearchInput
=
document
.
querySelector
(
'
.filtered-search
'
);
filteredSearchInput
.
dataset
.
baseEndpoint
=
dummyEndpoint
;
filteredSearchInput
.
dataset
.
runnerTagsEndpoint
=
`
${
dummyEndpoint
}
/admin/runners/tag_list`
;
filteredSearchInput
.
dataset
.
labelsEndpoint
=
`
${
dummyEndpoint
}
/-/labels`
;
filteredSearchInput
.
dataset
.
milestonesEndpoint
=
`
${
dummyEndpoint
}
/-/milestones`
;
...
...
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