Commit ad2b0ee6 authored by Arthur de Lapertosa Lisboa's avatar Arthur de Lapertosa Lisboa Committed by Phil Hughes

Fix bug in group Runners filtered search

parent 9a1a4e25
import { __ } from '~/locale';
import FilteredSearchTokenKeys from './filtered_search_token_keys';
const tokenKeys = [
{
formattedKey: __('Status'),
key: 'status',
type: 'string',
param: 'status',
symbol: '',
icon: 'messages',
tag: 'status',
},
{
formattedKey: __('Type'),
key: 'type',
type: 'string',
param: 'type',
symbol: '',
icon: 'cube',
tag: 'type',
},
];
const GroupRunnersFilteredSearchTokenKeys = new FilteredSearchTokenKeys(tokenKeys);
export default GroupRunnersFilteredSearchTokenKeys;
...@@ -2,7 +2,7 @@ import initSettingsPanels from '~/settings_panels'; ...@@ -2,7 +2,7 @@ import initSettingsPanels from '~/settings_panels';
import AjaxVariableList from '~/ci_variable_list/ajax_variable_list'; import AjaxVariableList from '~/ci_variable_list/ajax_variable_list';
import initVariableList from '~/ci_variable_list'; import initVariableList from '~/ci_variable_list';
import initFilteredSearch from '~/pages/search/init_filtered_search'; import initFilteredSearch from '~/pages/search/init_filtered_search';
import AdminRunnersFilteredSearchTokenKeys from '~/filtered_search/admin_runners_filtered_search_token_keys'; import GroupRunnersFilteredSearchTokenKeys from '~/filtered_search/group_runners_filtered_search_token_keys';
import { FILTERED_SEARCH } from '~/pages/constants'; import { FILTERED_SEARCH } from '~/pages/constants';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
...@@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', () => {
initFilteredSearch({ initFilteredSearch({
page: FILTERED_SEARCH.ADMIN_RUNNERS, page: FILTERED_SEARCH.ADMIN_RUNNERS,
filteredSearchTokenKeys: AdminRunnersFilteredSearchTokenKeys, filteredSearchTokenKeys: GroupRunnersFilteredSearchTokenKeys,
anchor: FILTERED_SEARCH.GROUP_RUNNERS_ANCHOR, anchor: FILTERED_SEARCH.GROUP_RUNNERS_ANCHOR,
}); });
......
---
title: Fix bug in group runners filtered search
merge_request: 37626
author: Arthur de Lapertosa Lisboa
type: fixed
...@@ -450,5 +450,19 @@ RSpec.describe 'Runners' do ...@@ -450,5 +450,19 @@ RSpec.describe 'Runners' do
expect(all(:link, href: group_runner_path(group, runner)).length).to eq(1) expect(all(:link, href: group_runner_path(group, runner)).length).to eq(1)
end end
end end
context 'filtered search' do
it 'allows user to search by status and type', :js do
visit group_settings_ci_cd_path(group)
find('.filtered-search').click
page.within('#js-dropdown-hint') do
expect(page).to have_content('Status')
expect(page).to have_content('Type')
expect(page).not_to have_content('Tag')
end
end
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment