Commit a97ed09f authored by fguibert's avatar fguibert Committed by Florie Guibert

Clean up issue_boards_filtered_search feature flag

Changelog: other
parent 753c690d
...@@ -8,8 +8,6 @@ import BoardAddNewColumnTrigger from '~/boards/components/board_add_new_column_t ...@@ -8,8 +8,6 @@ import BoardAddNewColumnTrigger from '~/boards/components/board_add_new_column_t
import BoardApp from '~/boards/components/board_app.vue'; import BoardApp from '~/boards/components/board_app.vue';
import '~/boards/filters/due_date_filters'; import '~/boards/filters/due_date_filters';
import { issuableTypes } from '~/boards/constants'; import { issuableTypes } from '~/boards/constants';
import eventHub from '~/boards/eventhub';
import FilteredSearchBoards from '~/boards/filtered_search_boards';
import initBoardsFilteredSearch from '~/boards/mount_filtered_search_issue_boards'; import initBoardsFilteredSearch from '~/boards/mount_filtered_search_issue_boards';
import store from '~/boards/stores'; import store from '~/boards/stores';
import toggleFocusMode from '~/boards/toggle_focus'; import toggleFocusMode from '~/boards/toggle_focus';
...@@ -50,17 +48,6 @@ function mountBoardApp(el) { ...@@ -50,17 +48,6 @@ function mountBoardApp(el) {
}, },
}); });
if (!gon?.features?.issueBoardsFilteredSearch) {
// Warning: FilteredSearchBoards has an implicit dependency on the Vuex state 'boardConfig'
// Improve this situation in the future.
const filterManager = new FilteredSearchBoards({ path: '' }, true, []);
filterManager.setup();
eventHub.$on('updateTokens', () => {
filterManager.updateTokens();
});
}
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Vue({ new Vue({
el, el,
...@@ -110,10 +97,8 @@ export default () => { ...@@ -110,10 +97,8 @@ export default () => {
} }
}); });
if (gon?.features?.issueBoardsFilteredSearch) { const { releasesFetchPath } = $boardApp.dataset;
const { releasesFetchPath } = $boardApp.dataset; initBoardsFilteredSearch(apolloProvider, isLoggedIn(), releasesFetchPath);
initBoardsFilteredSearch(apolloProvider, isLoggedIn(), releasesFetchPath);
}
mountBoardApp($boardApp); mountBoardApp($boardApp);
......
...@@ -7,7 +7,6 @@ class Groups::BoardsController < Groups::ApplicationController ...@@ -7,7 +7,6 @@ class Groups::BoardsController < Groups::ApplicationController
before_action :assign_endpoint_vars before_action :assign_endpoint_vars
before_action do before_action do
push_frontend_feature_flag(:issue_boards_filtered_search, group, default_enabled: :yaml)
push_frontend_feature_flag(:board_multi_select, group, default_enabled: :yaml) push_frontend_feature_flag(:board_multi_select, group, default_enabled: :yaml)
push_frontend_feature_flag(:iteration_cadences, group, default_enabled: :yaml) push_frontend_feature_flag(:iteration_cadences, group, default_enabled: :yaml)
experiment(:prominent_create_board_btn, subject: current_user) do |e| experiment(:prominent_create_board_btn, subject: current_user) do |e|
......
...@@ -7,7 +7,6 @@ class Projects::BoardsController < Projects::ApplicationController ...@@ -7,7 +7,6 @@ class Projects::BoardsController < Projects::ApplicationController
before_action :check_issues_available! before_action :check_issues_available!
before_action :assign_endpoint_vars before_action :assign_endpoint_vars
before_action do before_action do
push_frontend_feature_flag(:issue_boards_filtered_search, project&.group, default_enabled: :yaml)
push_frontend_feature_flag(:board_multi_select, project, default_enabled: :yaml) push_frontend_feature_flag(:board_multi_select, project, default_enabled: :yaml)
push_frontend_feature_flag(:iteration_cadences, project&.group, default_enabled: :yaml) push_frontend_feature_flag(:iteration_cadences, project&.group, default_enabled: :yaml)
experiment(:prominent_create_board_btn, subject: current_user) do |e| experiment(:prominent_create_board_btn, subject: current_user) do |e|
......
...@@ -5,10 +5,6 @@ ...@@ -5,10 +5,6 @@
- placeholder = local_assigns[:placeholder] || _('Search or filter results...') - placeholder = local_assigns[:placeholder] || _('Search or filter results...')
- block_css_class = type != :productivity_analytics ? 'row-content-block second-block' : '' - block_css_class = type != :productivity_analytics ? 'row-content-block second-block' : ''
- is_epic_board = board&.to_type == "EpicBoard" - is_epic_board = board&.to_type == "EpicBoard"
- if @group.present?
- ff_resource = @group
- else
- ff_resource = board&.resource_parent&.group
- if is_epic_board - if is_epic_board
- user_can_admin_list = can?(current_user, :admin_epic_board_list, board.resource_parent) - user_can_admin_list = can?(current_user, :admin_epic_board_list, board.resource_parent)
...@@ -31,7 +27,7 @@ ...@@ -31,7 +27,7 @@
= check_box_tag checkbox_id, nil, false, class: "check-all-issues left" = check_box_tag checkbox_id, nil, false, class: "check-all-issues left"
- if is_epic_board - if is_epic_board
#js-board-filtered-search{ data: { full_path: @group&.full_path } } #js-board-filtered-search{ data: { full_path: @group&.full_path } }
- elsif Feature.enabled?(:issue_boards_filtered_search, ff_resource, default_enabled: :yaml) && board - elsif board
#js-issue-board-filtered-search #js-issue-board-filtered-search
- else - else
.issues-other-filters.filtered-search-wrapper.d-flex.flex-column.flex-md-row .issues-other-filters.filtered-search-wrapper.d-flex.flex-column.flex-md-row
......
---
name: issue_boards_filtered_search
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61752
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/331649
milestone: '14.1'
type: development
group: group::product planning
default_enabled: true
...@@ -20,7 +20,6 @@ RSpec.describe 'Issue board filters', :js do ...@@ -20,7 +20,6 @@ RSpec.describe 'Issue board filters', :js do
let(:filter_submit) { find('.gl-search-box-by-click-search-button') } let(:filter_submit) { find('.gl-search-box-by-click-search-button') }
before do before do
stub_feature_flags(issue_boards_filtered_search: true)
stub_licensed_features(epics: true, iterations: true) stub_licensed_features(epics: true, iterations: true)
project.add_maintainer(user) project.add_maintainer(user)
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe 'Scoped issue boards', :js do RSpec.describe 'Scoped issue boards', :js do
include FilteredSearchHelpers
include MobileHelpers include MobileHelpers
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
...@@ -23,6 +22,10 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -23,6 +22,10 @@ RSpec.describe 'Scoped issue boards', :js do
let(:edit_board) { find('.btn', text: 'Edit board') } let(:edit_board) { find('.btn', text: 'Edit board') }
let(:view_scope) { find('.btn', text: 'View scope') } let(:view_scope) { find('.btn', text: 'View scope') }
let(:board_title) { find('.boards-selector-wrapper .dropdown-menu-toggle') } let(:board_title) { find('.boards-selector-wrapper .dropdown-menu-toggle') }
let(:filtered_search) { find('[data-testid="issue-board-filtered-search"]') }
let(:filter_input) { find('.gl-filtered-search-last-item')}
let(:filter_first_suggestion) { find('.gl-filtered-search-suggestion-list').first('.gl-filtered-search-suggestion') }
let(:filter_submit) { find('.gl-search-box-by-click-search-button') }
before do before do
allow_next_instance_of(ApplicationHelper) do |helper| allow_next_instance_of(ApplicationHelper) do |helper|
...@@ -53,22 +56,22 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -53,22 +56,22 @@ RSpec.describe 'Scoped issue boards', :js do
it 'creates board filtering by milestone' do it 'creates board filtering by milestone' do
create_board_milestone(milestone.title) create_board_milestone(milestone.title)
expect(page).to have_css('.js-visual-token') expect(page).to have_css('.gl-filtered-search-token')
expect(find('.tokens-container')).to have_content(:all, milestone.title) expect(find('.gl-filtered-search-scrollable')).to have_content(:all, milestone.title)
expect(page).to have_selector('.board-card', count: 1) expect(page).to have_selector('.board-card', count: 1)
end end
it 'creates board filtering by No milestone' do it 'creates board filtering by No milestone' do
create_board_milestone('No milestone') create_board_milestone('No milestone')
expect(find('.tokens-container')).to have_content("") expect(find('.gl-filtered-search-scrollable')).to have_content("")
expect(page).to have_selector('.board-card', count: 2) expect(page).to have_selector('.board-card', count: 2)
end end
it 'creates board filtering by Any Milestone' do it 'creates board filtering by Any Milestone' do
create_board_milestone('Any Milestone') create_board_milestone('Any Milestone')
expect(find('.tokens-container')).to have_content("") expect(find('.gl-filtered-search-scrollable')).to have_content("")
expect(page).to have_selector('.board-card', count: 3) expect(page).to have_selector('.board-card', count: 3)
end end
...@@ -89,17 +92,17 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -89,17 +92,17 @@ RSpec.describe 'Scoped issue boards', :js do
it 'creates board filtering by one label' do it 'creates board filtering by one label' do
create_board_label(label_1.title) create_board_label(label_1.title)
expect(page).to have_css('.js-visual-token') expect(page).to have_css('.gl-filtered-search-token')
expect(find('.tokens-container')).to have_content(:all, label_1.title) expect(find('.gl-filtered-search-scrollable')).to have_content(:all, label_1.title)
expect(page).to have_selector('.board-card', count: 2) expect(page).to have_selector('.board-card', count: 2)
end end
it 'creates board filtering by multiple labels' do it 'creates board filtering by multiple labels' do
create_board_label([label_1.title, label_2.title]) create_board_label([label_1.title, label_2.title])
expect(page).to have_css('.js-visual-token') expect(page).to have_css('.gl-filtered-search-token')
expect(find('.tokens-container')).to have_content(:all, label_1.title) expect(find('.gl-filtered-search-scrollable')).to have_content(:all, label_1.title)
expect(find('.tokens-container')).to have_content(:all, label_2.title) expect(find('.gl-filtered-search-scrollable')).to have_content(:all, label_2.title)
expect(page).to have_selector('.board-card', count: 1) expect(page).to have_selector('.board-card', count: 1)
end end
...@@ -134,14 +137,14 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -134,14 +137,14 @@ RSpec.describe 'Scoped issue boards', :js do
it 'creates board filtering by assignee' do it 'creates board filtering by assignee' do
create_board_assignee(user.name) create_board_assignee(user.name)
expect(page).to have_css('.js-visual-token') expect(page).to have_css('.gl-filtered-search-token')
expect(find('.tokens-container')).to have_content(:all, user.name) expect(find('.gl-filtered-search-scrollable')).to have_content(:all, user.name)
expect(page).to have_selector('.board-card', count: 1) expect(page).to have_selector('.board-card', count: 1)
# Does not display assignee in search hint # Does not display assignee in search hint
filtered_search.click filtered_search.click
page.within('#js-dropdown-hint') do page.within('.gl-filtered-search-suggestion-list') do
expect(page).to have_content('Label') expect(page).to have_content('Label')
expect(page).not_to have_content('Assignee') expect(page).not_to have_content('Assignee')
end end
...@@ -150,7 +153,7 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -150,7 +153,7 @@ RSpec.describe 'Scoped issue boards', :js do
it 'creates board filtering by "Any assignee"' do it 'creates board filtering by "Any assignee"' do
create_board_assignee('Any assignee') create_board_assignee('Any assignee')
expect(page).not_to have_css('.js-visual-token') expect(page).not_to have_css('.gl-filtered-search-token')
expect(page).to have_selector('.board-card', count: 3) expect(page).to have_selector('.board-card', count: 3)
end end
...@@ -175,7 +178,7 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -175,7 +178,7 @@ RSpec.describe 'Scoped issue boards', :js do
# Does not display assignee in search hint # Does not display assignee in search hint
filtered_search.click filtered_search.click
page.within('#js-dropdown-hint') do page.within('.gl-filtered-search-suggestion-list') do
expect(page).to have_content('Label') expect(page).to have_content('Label')
expect(page).not_to have_content('Weight') expect(page).not_to have_content('Weight')
end end
...@@ -238,14 +241,14 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -238,14 +241,14 @@ RSpec.describe 'Scoped issue boards', :js do
it 'sets board milestone' do it 'sets board milestone' do
update_board_milestone(milestone.title) update_board_milestone(milestone.title)
expect(find('.tokens-container')).to have_content(:all, milestone.title) expect(find('.gl-filtered-search-scrollable')).to have_content(:all, milestone.title)
expect(page).to have_selector('.board-card', count: 1) expect(page).to have_selector('.board-card', count: 1)
end end
it 'sets board to any milestone' do it 'sets board to any milestone' do
update_board_milestone('Any Milestone') update_board_milestone('Any Milestone')
expect(find('.tokens-container')).not_to have_content(milestone.title) expect(find('.gl-filtered-search-scrollable')).not_to have_content(milestone.title)
find('.board-card', match: :first) find('.board-card', match: :first)
...@@ -257,7 +260,7 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -257,7 +260,7 @@ RSpec.describe 'Scoped issue boards', :js do
it 'sets board to upcoming milestone' do it 'sets board to upcoming milestone' do
update_board_milestone('Upcoming') update_board_milestone('Upcoming')
expect(find('.tokens-container')).not_to have_content(milestone.title) expect(find('.gl-filtered-search-scrollable')).not_to have_content(milestone.title)
find('.board', match: :first) find('.board', match: :first)
...@@ -268,7 +271,7 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -268,7 +271,7 @@ RSpec.describe 'Scoped issue boards', :js do
update_board_milestone(milestone.title) update_board_milestone(milestone.title)
filtered_search.click filtered_search.click
page.within('#js-dropdown-hint') do page.within('.gl-filtered-search-suggestion-list') do
expect(page).to have_content('Label') expect(page).to have_content('Label')
expect(page).not_to have_content('Milestone') expect(page).not_to have_content('Milestone')
end end
...@@ -360,8 +363,8 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -360,8 +363,8 @@ RSpec.describe 'Scoped issue boards', :js do
update_board_label(label_title) update_board_label(label_title)
expect(page).to have_css('.js-visual-token') expect(page).to have_css('.gl-filtered-search-token')
expect(find('.tokens-container')).to have_content(:all, label_title) expect(find('.gl-filtered-search-scrollable')).to have_content(:all, label_title)
expect(page).to have_selector('.board-card', count: 2) expect(page).to have_selector('.board-card', count: 2)
end end
...@@ -379,9 +382,9 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -379,9 +382,9 @@ RSpec.describe 'Scoped issue boards', :js do
update_board_label(label_2_title) update_board_label(label_2_title)
expect(page).to have_css('.js-visual-token') expect(page).to have_css('.gl-filtered-search-token')
expect(find('.tokens-container')).to have_content(:all, label_title) expect(find('.gl-filtered-search-scrollable')).to have_content(:all, label_title)
expect(find('.tokens-container')).to have_content(:all, label_2_title) expect(find('.gl-filtered-search-scrollable')).to have_content(:all, label_2_title)
expect(page).to have_selector('.board-card', count: 1) expect(page).to have_selector('.board-card', count: 1)
end end
...@@ -395,7 +398,7 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -395,7 +398,7 @@ RSpec.describe 'Scoped issue boards', :js do
update_board_label(label_title) update_board_label(label_title)
input_filtered_search("label=~#{label_2_title}") set_filter('label', label_2_title)
expect(page).to have_selector('.board-card', count: 0) expect(page).to have_selector('.board-card', count: 0)
end end
...@@ -423,8 +426,8 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -423,8 +426,8 @@ RSpec.describe 'Scoped issue boards', :js do
it 'sets board assignee' do it 'sets board assignee' do
update_board_assignee(user.name) update_board_assignee(user.name)
expect(page).to have_css('.js-visual-token') expect(page).to have_css('.gl-filtered-search-token')
expect(find('.tokens-container')).to have_content(:all, user.name) expect(find('.gl-filtered-search-scrollable')).to have_content(:all, user.name)
expect(page).to have_selector('.board-card', count: 1) expect(page).to have_selector('.board-card', count: 1)
end end
...@@ -432,7 +435,7 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -432,7 +435,7 @@ RSpec.describe 'Scoped issue boards', :js do
it 'sets board to Any assignee' do it 'sets board to Any assignee' do
update_board_assignee('Any assignee') update_board_assignee('Any assignee')
expect(page).not_to have_css('.js-visual-token') expect(page).not_to have_css('.gl-filtered-search-token')
expect(page).to have_selector('.board-card', count: 3) expect(page).to have_selector('.board-card', count: 3)
end end
...@@ -440,7 +443,7 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -440,7 +443,7 @@ RSpec.describe 'Scoped issue boards', :js do
update_board_assignee(user.name) update_board_assignee(user.name)
filtered_search.click filtered_search.click
page.within('#js-dropdown-hint') do page.within('.gl-filtered-search-suggestion-list') do
expect(page).to have_content('Label') expect(page).to have_content('Label')
expect(page).not_to have_content('Assignee') expect(page).not_to have_content('Assignee')
end end
...@@ -467,7 +470,7 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -467,7 +470,7 @@ RSpec.describe 'Scoped issue boards', :js do
update_board_weight(1) update_board_weight(1)
filtered_search.click filtered_search.click
page.within('#js-dropdown-hint') do page.within('.gl-filtered-search-suggestion-list') do
expect(page).to have_content('Label') expect(page).to have_content('Label')
expect(page).not_to have_content('Weight') expect(page).not_to have_content('Weight')
end end
...@@ -650,4 +653,12 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -650,4 +653,12 @@ RSpec.describe 'Scoped issue boards', :js do
def click_on_board_modal def click_on_board_modal
find('.board-config-modal .modal-content').click find('.board-config-modal .modal-content').click
end end
def set_filter(type, filter_value)
filter_input.click
filter_input.set("#{type}:")
filter_first_suggestion.click # Select `=` operator
click_on filter_value
filter_submit.click
end
end end
...@@ -33,6 +33,10 @@ RSpec.describe 'epics swimlanes filtering', :js do ...@@ -33,6 +33,10 @@ RSpec.describe 'epics swimlanes filtering', :js do
let(:all_issues) { [confidential_issue, issue1, issue2, issue3, issue4, issue5, issue6, issue7, issue8] } let(:all_issues) { [confidential_issue, issue1, issue2, issue3, issue4, issue5, issue6, issue7, issue8] }
let(:filter_input) { find('.gl-filtered-search-term-input')}
let(:filter_first_suggestion) { find('.gl-filtered-search-suggestion-list').first('.gl-filtered-search-suggestion') }
let(:filter_submit) { find('.gl-search-box-by-click-search-button') }
before_all do before_all do
project.add_maintainer(user) project.add_maintainer(user)
project.add_maintainer(user2) project.add_maintainer(user2)
...@@ -120,18 +124,20 @@ RSpec.describe 'epics swimlanes filtering', :js do ...@@ -120,18 +124,20 @@ RSpec.describe 'epics swimlanes filtering', :js do
end end
def set_filter(type, text) def set_filter(type, text)
find('.filtered-search').native.send_keys("#{type}:=#{text}") filter_input.click
filter_input.set("#{type}:")
filter_first_suggestion.click # Select `=` operator
end end
def submit_filter def submit_filter
find('.filtered-search').native.send_keys(:enter) filter_submit.click
end end
def click_filter_link(link_text) def click_filter_link(link_text)
page.within('.filtered-search-box') do page.within('.gl-filtered-search-suggestion-list') do
expect(page).to have_button(link_text) expect(page).to have_link(link_text)
click_button(link_text) click_on link_text
end end
end end
end end
...@@ -32,6 +32,7 @@ RSpec.describe 'User visits issue boards', :js do ...@@ -32,6 +32,7 @@ RSpec.describe 'User visits issue boards', :js do
shared_examples "visiting board path" do shared_examples "visiting board path" do
before do before do
stub_const('GitlabSchema::DEFAULT_MAX_COMPLEXITY', 300)
visit board_path visit board_path
wait_for_requests wait_for_requests
......
...@@ -19,24 +19,32 @@ RSpec.describe 'Filter issues by iteration', :js do ...@@ -19,24 +19,32 @@ RSpec.describe 'Filter issues by iteration', :js do
let_it_be(:iteration_2_issue) { create(:issue, project: project, iteration: iteration_2) } let_it_be(:iteration_2_issue) { create(:issue, project: project, iteration: iteration_2) }
let_it_be(:no_iteration_issue) { create(:issue, project: project) } let_it_be(:no_iteration_issue) { create(:issue, project: project) }
let(:filter_input) { find('.gl-filtered-search-term-input')}
let(:filter_first_suggestion) { find('.gl-filtered-search-suggestion-list').first('.gl-filtered-search-suggestion') }
let(:filter_submit) { find('.gl-search-box-by-click-search-button') }
shared_examples 'filters by iteration' do shared_examples 'filters by iteration' do
context 'when iterations are not available' do context 'when iterations are not available' do
before do before do
stub_licensed_features(iterations: false) stub_licensed_features(iterations: false)
stub_feature_flags(vue_issues_list: true)
visit page_path visit page_path
end end
it 'does not show the iteration filter option' do it 'does not show the iteration filter option' do
find('.filtered-search').set('iter') filter_input.click
expect(find('#js-dropdown-hint')).not_to have_selector('.filter-dropdown .filter-dropdown-item', text: 'Iteration') page.within('.gl-filtered-search-suggestion-list') do
expect(page).not_to have_content('Iteration')
end
end end
end end
context 'when iterations are available' do context 'when iterations are available' do
before do before do
stub_licensed_features(iterations: true) stub_licensed_features(iterations: true)
stub_feature_flags(vue_issues_list: true)
visit page_path visit page_path
...@@ -67,7 +75,7 @@ RSpec.describe 'Filter issues by iteration', :js do ...@@ -67,7 +75,7 @@ RSpec.describe 'Filter issues by iteration', :js do
context 'when passing specific iteration by title' do context 'when passing specific iteration by title' do
before do before do
input_filtered_search("iteration:=\"#{iteration_1.title}\"") set_filter('iteration', iteration_1.title)
end end
it_behaves_like 'filters issues by iteration' it_behaves_like 'filters issues by iteration'
...@@ -75,7 +83,7 @@ RSpec.describe 'Filter issues by iteration', :js do ...@@ -75,7 +83,7 @@ RSpec.describe 'Filter issues by iteration', :js do
context 'when passing Current iteration' do context 'when passing Current iteration' do
before do before do
input_filtered_search("iteration:=Current", extra_space: false) set_filter('iteration', 'Current')
end end
it_behaves_like 'filters issues by iteration' it_behaves_like 'filters issues by iteration'
...@@ -85,15 +93,7 @@ RSpec.describe 'Filter issues by iteration', :js do ...@@ -85,15 +93,7 @@ RSpec.describe 'Filter issues by iteration', :js do
before do before do
visit page_path visit page_path
page.within('.filtered-search-wrapper') do set_negated_filter('iteration', iteration_title)
find('.filtered-search').set('iter')
click_button('Iteration')
find('.btn-helptext', text: 'is not').click
click_button(iteration_title)
find('.filtered-search').send_keys(:enter)
end
end end
context 'with specific iteration' do context 'with specific iteration' do
...@@ -186,4 +186,20 @@ RSpec.describe 'Filter issues by iteration', :js do ...@@ -186,4 +186,20 @@ RSpec.describe 'Filter issues by iteration', :js do
it_behaves_like 'filters by iteration' it_behaves_like 'filters by iteration'
end end
def set_filter(type, filter_value)
filter_input.click
filter_input.set("#{type}:")
filter_first_suggestion.click # Select `=` operator
click_on filter_value
filter_submit.click
end
def set_negated_filter(type, filter_value)
filter_input.click
filter_input.set("#{type}:")
click_on '!='
click_on filter_value
filter_submit.click
end
end end
...@@ -22,8 +22,6 @@ RSpec.describe 'Issue board filters', :js do ...@@ -22,8 +22,6 @@ RSpec.describe 'Issue board filters', :js do
let(:filter_submit) { find('.gl-search-box-by-click-search-button') } let(:filter_submit) { find('.gl-search-box-by-click-search-button') }
before do before do
stub_feature_flags(issue_boards_filtered_search: true)
project.add_maintainer(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
......
...@@ -13,6 +13,10 @@ RSpec.describe 'Project issue boards', :js do ...@@ -13,6 +13,10 @@ RSpec.describe 'Project issue boards', :js do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:user2) { create(:user) } let_it_be(:user2) { create(:user) }
let(:filtered_search) { find('[data-testid="issue-board-filtered-search"]') }
let(:filter_input) { find('.gl-filtered-search-term-input') }
let(:filter_submit) { find('.gl-search-box-by-click-search-button') }
context 'signed in user' do context 'signed in user' do
before do before do
project.add_maintainer(user) project.add_maintainer(user)
...@@ -90,8 +94,7 @@ RSpec.describe 'Project issue boards', :js do ...@@ -90,8 +94,7 @@ RSpec.describe 'Project issue boards', :js do
end end
it 'search closed list' do it 'search closed list' do
find('.filtered-search').set(issue8.title) set_filter_and_search_by_token_value(issue8.title)
find('.filtered-search').native.send_keys(:enter)
wait_for_requests wait_for_requests
...@@ -101,8 +104,7 @@ RSpec.describe 'Project issue boards', :js do ...@@ -101,8 +104,7 @@ RSpec.describe 'Project issue boards', :js do
end end
it 'search list' do it 'search list' do
find('.filtered-search').set(issue5.title) set_filter_and_search_by_token_value(issue5.title)
find('.filtered-search').native.send_keys(:enter)
wait_for_requests wait_for_requests
...@@ -111,26 +113,6 @@ RSpec.describe 'Project issue boards', :js do ...@@ -111,26 +113,6 @@ RSpec.describe 'Project issue boards', :js do
expect(find('.board:nth-child(4)')).to have_selector('.board-card', count: 0) expect(find('.board:nth-child(4)')).to have_selector('.board-card', count: 0)
end end
context 'search list negation queries' do
before do
visit_project_board_path_without_query_limit(project, board)
end
it 'does not have the != option' do
find('.filtered-search').set('label:')
wait_for_requests
within('#js-dropdown-operator') do
tokens = all(:css, 'li.filter-dropdown-item')
expect(tokens.count).to eq(2)
button = tokens[0].find('button')
expect(button).to have_content('=')
button = tokens[1].find('button')
expect(button).to have_content('!=')
end
end
end
it 'allows user to delete board' do it 'allows user to delete board' do
remove_list remove_list
...@@ -309,8 +291,8 @@ RSpec.describe 'Project issue boards', :js do ...@@ -309,8 +291,8 @@ RSpec.describe 'Project issue boards', :js do
context 'filtering' do context 'filtering' do
it 'filters by author' do it 'filters by author' do
set_filter("author", user2.username) set_filter("author", user2.username)
click_filter_link(user2.username) click_on user2.username
submit_filter filter_submit.click
wait_for_requests wait_for_requests
wait_for_board_cards(2, 1) wait_for_board_cards(2, 1)
...@@ -319,8 +301,8 @@ RSpec.describe 'Project issue boards', :js do ...@@ -319,8 +301,8 @@ RSpec.describe 'Project issue boards', :js do
it 'filters by assignee' do it 'filters by assignee' do
set_filter("assignee", user.username) set_filter("assignee", user.username)
click_filter_link(user.username) click_on user.username
submit_filter filter_submit.click
wait_for_requests wait_for_requests
...@@ -330,8 +312,8 @@ RSpec.describe 'Project issue boards', :js do ...@@ -330,8 +312,8 @@ RSpec.describe 'Project issue boards', :js do
it 'filters by milestone' do it 'filters by milestone' do
set_filter("milestone", "\"#{milestone.title}") set_filter("milestone", "\"#{milestone.title}")
click_filter_link(milestone.title) click_on milestone.title
submit_filter filter_submit.click
wait_for_requests wait_for_requests
wait_for_board_cards(2, 1) wait_for_board_cards(2, 1)
...@@ -341,8 +323,8 @@ RSpec.describe 'Project issue boards', :js do ...@@ -341,8 +323,8 @@ RSpec.describe 'Project issue boards', :js do
it 'filters by label' do it 'filters by label' do
set_filter("label", testing.title) set_filter("label", testing.title)
click_filter_link(testing.title) click_on testing.title
submit_filter filter_submit.click
wait_for_requests wait_for_requests
wait_for_board_cards(2, 1) wait_for_board_cards(2, 1)
...@@ -351,8 +333,10 @@ RSpec.describe 'Project issue boards', :js do ...@@ -351,8 +333,10 @@ RSpec.describe 'Project issue boards', :js do
it 'filters by label with encoded character' do it 'filters by label with encoded character' do
set_filter("label", a_plus.title) set_filter("label", a_plus.title)
click_filter_link(a_plus.title) # This one is a char encoding issue like the & issue
submit_filter click_on a_plus.title
filter_submit.click
wait_for_requests
wait_for_board_cards(1, 1) wait_for_board_cards(1, 1)
wait_for_empty_boards((2..4)) wait_for_empty_boards((2..4))
...@@ -360,8 +344,8 @@ RSpec.describe 'Project issue boards', :js do ...@@ -360,8 +344,8 @@ RSpec.describe 'Project issue boards', :js do
it 'filters by label with space after reload', :quarantine do it 'filters by label with space after reload', :quarantine do
set_filter("label", "\"#{accepting.title}") set_filter("label", "\"#{accepting.title}")
click_filter_link(accepting.title) click_on accepting.title
submit_filter filter_submit.click
# Test after reload # Test after reload
page.evaluate_script 'window.location.reload()' page.evaluate_script 'window.location.reload()'
...@@ -384,13 +368,13 @@ RSpec.describe 'Project issue boards', :js do ...@@ -384,13 +368,13 @@ RSpec.describe 'Project issue boards', :js do
it 'removes filtered labels' do it 'removes filtered labels' do
inspect_requests(inject_headers: { 'X-GITLAB-DISABLE-SQL-QUERY-LIMIT' => 'https://gitlab.com/gitlab-org/gitlab/-/issues/323426' }) do inspect_requests(inject_headers: { 'X-GITLAB-DISABLE-SQL-QUERY-LIMIT' => 'https://gitlab.com/gitlab-org/gitlab/-/issues/323426' }) do
set_filter("label", testing.title) set_filter("label", testing.title)
click_filter_link(testing.title) click_on testing.title
submit_filter filter_submit.click
wait_for_board_cards(2, 1) wait_for_board_cards(2, 1)
find('.clear-search').click find('[data-testid="filtered-search-clear-button"]').click
submit_filter filter_submit.click
end end
wait_for_board_cards(2, 8) wait_for_board_cards(2, 8)
...@@ -400,9 +384,9 @@ RSpec.describe 'Project issue boards', :js do ...@@ -400,9 +384,9 @@ RSpec.describe 'Project issue boards', :js do
create_list(:labeled_issue, 30, project: project, labels: [planning, testing]) create_list(:labeled_issue, 30, project: project, labels: [planning, testing])
set_filter("label", testing.title) set_filter("label", testing.title)
click_filter_link(testing.title) click_on testing.title
inspect_requests(inject_headers: { 'X-GITLAB-DISABLE-SQL-QUERY-LIMIT' => 'https://gitlab.com/gitlab-org/gitlab/-/issues/323426' }) do inspect_requests(inject_headers: { 'X-GITLAB-DISABLE-SQL-QUERY-LIMIT' => 'https://gitlab.com/gitlab-org/gitlab/-/issues/323426' }) do
submit_filter filter_submit.click
end end
wait_for_requests wait_for_requests
...@@ -442,10 +426,10 @@ RSpec.describe 'Project issue boards', :js do ...@@ -442,10 +426,10 @@ RSpec.describe 'Project issue boards', :js do
it 'filters by multiple labels', :quarantine do it 'filters by multiple labels', :quarantine do
set_filter("label", testing.title) set_filter("label", testing.title)
click_filter_link(testing.title) click_on testing.title
set_filter("label", bug.title) set_filter("label", bug.title)
click_filter_link(bug.title) click_on bug.title
submit_filter submit_filter
...@@ -463,7 +447,7 @@ RSpec.describe 'Project issue boards', :js do ...@@ -463,7 +447,7 @@ RSpec.describe 'Project issue boards', :js do
wait_for_requests wait_for_requests
end end
page.within('.tokens-container') do page.within('.gl-filtered-search-token') do
expect(page).to have_content(bug.title) expect(page).to have_content(bug.title)
end end
...@@ -561,19 +545,26 @@ RSpec.describe 'Project issue boards', :js do ...@@ -561,19 +545,26 @@ RSpec.describe 'Project issue boards', :js do
end end
end end
def set_filter_and_search_by_token_value(value)
filter_input.click
filter_input.set(value)
filter_submit.click
end
def set_filter(type, text) def set_filter(type, text)
find('.filtered-search').native.send_keys("#{type}:=#{text}") filter_input.click
filter_input.native.send_keys("#{type}:=#{text}")
end end
def submit_filter def submit_filter
find('.filtered-search').native.send_keys(:enter) filter_input.native.send_keys(:enter)
end end
def click_filter_link(link_text) def click_filter_link(link_text)
page.within('.filtered-search-box') do page.within(filtered_search) do
expect(page).to have_button(link_text) expect(page).to have_button(link_text)
click_button(link_text) click_on link_text
end end
end end
......
...@@ -179,38 +179,6 @@ RSpec.describe 'Labels Hierarchy', :js do ...@@ -179,38 +179,6 @@ RSpec.describe 'Labels Hierarchy', :js do
it_behaves_like 'assigning labels from sidebar' it_behaves_like 'assigning labels from sidebar'
end end
context 'on project board issue sidebar' do
let(:board) { create(:board, project: project_1) }
before do
project_1.add_developer(user)
visit project_board_path(project_1, board)
wait_for_requests
find('.board-card').click
end
it_behaves_like 'assigning labels from sidebar'
end
context 'on group board issue sidebar' do
let(:board) { create(:board, group: parent) }
before do
parent.add_developer(user)
visit group_board_path(parent, board)
wait_for_requests
find('.board-card').click
end
it_behaves_like 'assigning labels from sidebar'
end
end end
context 'issuable filtering' do context 'issuable filtering' do
...@@ -242,29 +210,5 @@ RSpec.describe 'Labels Hierarchy', :js do ...@@ -242,29 +210,5 @@ RSpec.describe 'Labels Hierarchy', :js do
it_behaves_like 'filtering by ancestor labels for groups' it_behaves_like 'filtering by ancestor labels for groups'
end end
context 'on project boards filter' do
let(:board) { create(:board, project: project_1) }
before do
project_1.add_developer(user)
visit project_board_path(project_1, board)
end
it_behaves_like 'filtering by ancestor labels for projects', true
end
context 'on group boards filter' do
let(:board) { create(:board, group: parent) }
before do
parent.add_developer(user)
visit group_board_path(parent, board)
end
it_behaves_like 'filtering by ancestor labels for groups', true
end
end end
end end
...@@ -304,8 +304,6 @@ RSpec.configure do |config| ...@@ -304,8 +304,6 @@ RSpec.configure do |config|
# As we're ready to change `master` usages to `main`, let's enable it # As we're ready to change `master` usages to `main`, let's enable it
stub_feature_flags(main_branch_over_master: false) stub_feature_flags(main_branch_over_master: false)
stub_feature_flags(issue_boards_filtered_search: false)
# Disable issue respositioning to avoid heavy load on database when importing big projects. # Disable issue respositioning to avoid heavy load on database when importing big projects.
# This is only turned on when app is handling heavy project imports. # This is only turned on when app is handling heavy project imports.
# Can be removed when we find a better way to deal with the problem. # Can be removed when we find a better way to deal with the problem.
......
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