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
9e93ea8e
Commit
9e93ea8e
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
88c8d177
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 @
9e93ea8e
...
@@ -10,7 +10,7 @@ import { mergeUrlParams } from '../lib/utils/url_utility';
...
@@ -10,7 +10,7 @@ import { mergeUrlParams } from '../lib/utils/url_utility';
export
default
class
AvailableDropdownMappings
{
export
default
class
AvailableDropdownMappings
{
constructor
(
constructor
(
container
,
container
,
base
Endpoint
,
runnerTags
Endpoint
,
labelsEndpoint
,
labelsEndpoint
,
milestonesEndpoint
,
milestonesEndpoint
,
groupsOnly
,
groupsOnly
,
...
@@ -18,7 +18,7 @@ export default class AvailableDropdownMappings {
...
@@ -18,7 +18,7 @@ export default class AvailableDropdownMappings {
includeDescendantGroups
,
includeDescendantGroups
,
)
{
)
{
this
.
container
=
container
;
this
.
container
=
container
;
this
.
baseEndpoint
=
base
Endpoint
;
this
.
runnerTagsEndpoint
=
runnerTags
Endpoint
;
this
.
labelsEndpoint
=
labelsEndpoint
;
this
.
labelsEndpoint
=
labelsEndpoint
;
this
.
milestonesEndpoint
=
milestonesEndpoint
;
this
.
milestonesEndpoint
=
milestonesEndpoint
;
this
.
groupsOnly
=
groupsOnly
;
this
.
groupsOnly
=
groupsOnly
;
...
@@ -149,7 +149,7 @@ export default class AvailableDropdownMappings {
...
@@ -149,7 +149,7 @@ export default class AvailableDropdownMappings {
}
}
getRunnerTagsEndpoint
()
{
getRunnerTagsEndpoint
()
{
return
`
${
this
.
baseEndpoint
}
/admin/runners/tag_list
.json`
;
return
`
${
this
.
runnerTagsEndpoint
}
.json`
;
}
}
getMergeRequestTargetBranchesEndpoint
()
{
getMergeRequestTargetBranchesEndpoint
()
{
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
View file @
9e93ea8e
...
@@ -8,7 +8,7 @@ import FilteredSearchVisualTokens from './filtered_search_visual_tokens';
...
@@ -8,7 +8,7 @@ import FilteredSearchVisualTokens from './filtered_search_visual_tokens';
export
default
class
FilteredSearchDropdownManager
{
export
default
class
FilteredSearchDropdownManager
{
constructor
({
constructor
({
base
Endpoint
=
''
,
runnerTags
Endpoint
=
''
,
labelsEndpoint
=
''
,
labelsEndpoint
=
''
,
milestonesEndpoint
=
''
,
milestonesEndpoint
=
''
,
tokenizer
,
tokenizer
,
...
@@ -19,7 +19,7 @@ export default class FilteredSearchDropdownManager {
...
@@ -19,7 +19,7 @@ export default class FilteredSearchDropdownManager {
filteredSearchTokenKeys
,
filteredSearchTokenKeys
,
})
{
})
{
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
baseEndpoint
=
base
Endpoint
.
replace
(
/
\/
$/
,
''
);
this
.
runnerTagsEndpoint
=
runnerTags
Endpoint
.
replace
(
/
\/
$/
,
''
);
this
.
labelsEndpoint
=
labelsEndpoint
.
replace
(
/
\/
$/
,
''
);
this
.
labelsEndpoint
=
labelsEndpoint
.
replace
(
/
\/
$/
,
''
);
this
.
milestonesEndpoint
=
milestonesEndpoint
.
replace
(
/
\/
$/
,
''
);
this
.
milestonesEndpoint
=
milestonesEndpoint
.
replace
(
/
\/
$/
,
''
);
this
.
tokenizer
=
tokenizer
;
this
.
tokenizer
=
tokenizer
;
...
@@ -51,7 +51,7 @@ export default class FilteredSearchDropdownManager {
...
@@ -51,7 +51,7 @@ export default class FilteredSearchDropdownManager {
const
supportedTokens
=
this
.
filteredSearchTokenKeys
.
getKeys
();
const
supportedTokens
=
this
.
filteredSearchTokenKeys
.
getKeys
();
const
availableMappings
=
new
AvailableDropdownMappings
(
const
availableMappings
=
new
AvailableDropdownMappings
(
this
.
container
,
this
.
container
,
this
.
base
Endpoint
,
this
.
runnerTags
Endpoint
,
this
.
labelsEndpoint
,
this
.
labelsEndpoint
,
this
.
milestonesEndpoint
,
this
.
milestonesEndpoint
,
this
.
groupsOnly
,
this
.
groupsOnly
,
...
...
app/assets/javascripts/filtered_search/filtered_search_manager.js
View file @
9e93ea8e
...
@@ -85,7 +85,8 @@ export default class FilteredSearchManager {
...
@@ -85,7 +85,8 @@ export default class FilteredSearchManager {
if
(
this
.
filteredSearchInput
)
{
if
(
this
.
filteredSearchInput
)
{
this
.
tokenizer
=
FilteredSearchTokenizer
;
this
.
tokenizer
=
FilteredSearchTokenizer
;
this
.
dropdownManager
=
new
FilteredSearchDropdownManager
({
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
'
)
||
''
,
labelsEndpoint
:
this
.
filteredSearchInput
.
getAttribute
(
'
data-labels-endpoint
'
)
||
''
,
milestonesEndpoint
:
this
.
filteredSearchInput
.
getAttribute
(
'
data-milestones-endpoint
'
)
||
''
,
milestonesEndpoint
:
this
.
filteredSearchInput
.
getAttribute
(
'
data-milestones-endpoint
'
)
||
''
,
tokenizer
:
this
.
tokenizer
,
tokenizer
:
this
.
tokenizer
,
...
...
app/helpers/search_helper.rb
View file @
9e93ea8e
...
@@ -169,18 +169,17 @@ module SearchHelper
...
@@ -169,18 +169,17 @@ module SearchHelper
autocomplete:
'off'
autocomplete:
'off'
}
}
opts
[
:data
][
'runner-tags-endpoint'
]
=
tag_list_admin_runners_path
if
@project
.
present?
if
@project
.
present?
opts
[
:data
][
'project-id'
]
=
@project
.
id
opts
[
:data
][
'project-id'
]
=
@project
.
id
opts
[
:data
][
'base-endpoint'
]
=
project_path
(
@project
)
opts
[
:data
][
'labels-endpoint'
]
=
project_labels_path
(
@project
)
opts
[
:data
][
'labels-endpoint'
]
=
project_labels_path
(
@project
)
opts
[
:data
][
'milestones-endpoint'
]
=
project_milestones_path
(
@project
)
opts
[
:data
][
'milestones-endpoint'
]
=
project_milestones_path
(
@project
)
elsif
@group
.
present?
elsif
@group
.
present?
opts
[
:data
][
'group-id'
]
=
@group
.
id
opts
[
:data
][
'group-id'
]
=
@group
.
id
opts
[
:data
][
'base-endpoint'
]
=
group_canonical_path
(
@group
)
opts
[
:data
][
'labels-endpoint'
]
=
group_labels_path
(
@group
)
opts
[
:data
][
'labels-endpoint'
]
=
group_labels_path
(
@group
)
opts
[
:data
][
'milestones-endpoint'
]
=
group_milestones_path
(
@group
)
opts
[
:data
][
'milestones-endpoint'
]
=
group_milestones_path
(
@group
)
else
else
opts
[
:data
][
'base-endpoint'
]
=
root_dashboard_path
opts
[
:data
][
'labels-endpoint'
]
=
dashboard_labels_path
opts
[
:data
][
'labels-endpoint'
]
=
dashboard_labels_path
opts
[
:data
][
'milestones-endpoint'
]
=
dashboard_milestones_path
opts
[
:data
][
'milestones-endpoint'
]
=
dashboard_milestones_path
end
end
...
...
app/views/admin/runners/index.html.haml
View file @
9e93ea8e
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
.scroll-container
.scroll-container
%ul
.tokens-container.list-unstyled
%ul
.tokens-container.list-unstyled
%li
.input-token
%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
#js-dropdown-hint
.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown
%ul
{
data:
{
dropdown:
true
}
}
%ul
{
data:
{
dropdown:
true
}
}
%li
.filter-dropdown-item
{
data:
{
action:
'submit'
}
}
%li
.filter-dropdown-item
{
data:
{
action:
'submit'
}
}
...
...
spec/helpers/search_helper_spec.rb
View file @
9e93ea8e
...
@@ -114,7 +114,7 @@ describe SearchHelper do
...
@@ -114,7 +114,7 @@ describe SearchHelper do
end
end
it
'includes project endpoints'
do
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
][
'labels-endpoint'
]).
to
eq
(
project_labels_path
(
@project
))
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
project_milestones_path
(
@project
))
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
project_milestones_path
(
@project
))
end
end
...
@@ -134,7 +134,7 @@ describe SearchHelper do
...
@@ -134,7 +134,7 @@ describe SearchHelper do
end
end
it
'includes group endpoints'
do
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
][
'labels-endpoint'
]).
to
eq
(
group_labels_path
(
@group
))
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
group_milestones_path
(
@group
))
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
group_milestones_path
(
@group
))
end
end
...
@@ -147,7 +147,7 @@ describe SearchHelper do
...
@@ -147,7 +147,7 @@ describe SearchHelper do
end
end
it
'includes dashboard endpoints'
do
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
][
'labels-endpoint'
]).
to
eq
(
dashboard_labels_path
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
dashboard_milestones_path
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
dashboard_milestones_path
)
end
end
...
...
spec/javascripts/filtered_search/visual_token_value_spec.js
View file @
9e93ea8e
...
@@ -155,7 +155,7 @@ describe('Filtered Search Visual Tokens', () => {
...
@@ -155,7 +155,7 @@ describe('Filtered Search Visual Tokens', () => {
`
);
`
);
const
filteredSearchInput
=
document
.
querySelector
(
'
.filtered-search
'
);
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
.
labelsEndpoint
=
`
${
dummyEndpoint
}
/-/labels`
;
filteredSearchInput
.
dataset
.
milestonesEndpoint
=
`
${
dummyEndpoint
}
/-/milestones`
;
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