diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-06-24 14:42:33 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-06-24 15:10:15 +0300 |
commit | 9e93ea8e64d8aca7f3b2b7fe7a0c7f8a9bd97be5 (patch) | |
tree | 4a06d7894a13c88d717875745b8bed4322c30ff8 /app | |
parent | 88c8d177f835983a0a47796529906c69376d159d (diff) | |
download | gitlab-ce-9e93ea8e64d8aca7f3b2b7fe7a0c7f8a9bd97be5.tar.gz |
Remove baseEndpoint from search dropdwon63177-follow-up-from-use-scoped-routes-for-labels-and-milestones
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
5 files changed, 11 insertions, 11 deletions
diff --git a/app/assets/javascripts/filtered_search/available_dropdown_mappings.js b/app/assets/javascripts/filtered_search/available_dropdown_mappings.js index 891086b4142..f280f3cd26c 100644 --- a/app/assets/javascripts/filtered_search/available_dropdown_mappings.js +++ b/app/assets/javascripts/filtered_search/available_dropdown_mappings.js @@ -10,7 +10,7 @@ import { mergeUrlParams } from '../lib/utils/url_utility'; export default class AvailableDropdownMappings { constructor( container, - baseEndpoint, + runnerTagsEndpoint, labelsEndpoint, milestonesEndpoint, groupsOnly, @@ -18,7 +18,7 @@ export default class AvailableDropdownMappings { includeDescendantGroups, ) { this.container = container; - this.baseEndpoint = baseEndpoint; + this.runnerTagsEndpoint = runnerTagsEndpoint; 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() { diff --git a/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js b/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js index 1cbfd7f9bb9..835d3bf8a53 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js +++ b/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js @@ -8,7 +8,7 @@ import FilteredSearchVisualTokens from './filtered_search_visual_tokens'; export default class FilteredSearchDropdownManager { constructor({ - baseEndpoint = '', + runnerTagsEndpoint = '', labelsEndpoint = '', milestonesEndpoint = '', tokenizer, @@ -19,7 +19,7 @@ export default class FilteredSearchDropdownManager { filteredSearchTokenKeys, }) { this.container = FilteredSearchContainer.container; - this.baseEndpoint = baseEndpoint.replace(/\/$/, ''); + this.runnerTagsEndpoint = runnerTagsEndpoint.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.baseEndpoint, + this.runnerTagsEndpoint, this.labelsEndpoint, this.milestonesEndpoint, this.groupsOnly, diff --git a/app/assets/javascripts/filtered_search/filtered_search_manager.js b/app/assets/javascripts/filtered_search/filtered_search_manager.js index 450e0725f2e..d1f52b91d9e 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_manager.js +++ b/app/assets/javascripts/filtered_search/filtered_search_manager.js @@ -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, diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index dfa34ad7020..f5c4686a3bf 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -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 diff --git a/app/views/admin/runners/index.html.haml b/app/views/admin/runners/index.html.haml index 2e23b748edb..5129f5d193b 100644 --- a/app/views/admin/runners/index.html.haml +++ b/app/views/admin/runners/index.html.haml @@ -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' } } |