Commit f2ce671b authored by Enrique Alcántara's avatar Enrique Alcántara

Merge branch '237337-revisit-history-icon-on-recent-search' into 'master'

Use history icon on recent search filter tab only on mobile

See merge request gitlab-org/gitlab!39557
parents 2ac47a71 6a84587f
...@@ -307,23 +307,6 @@ ...@@ -307,23 +307,6 @@
color: $gl-text-color; color: $gl-text-color;
border-color: $border-color; border-color: $border-color;
} }
svg {
height: 14px;
width: 14px;
vertical-align: middle;
margin-bottom: 4px;
}
.dropdown-toggle-text {
display: inline-block;
color: inherit;
.fa {
vertical-align: middle;
color: inherit;
}
}
} }
.filtered-search-history-dropdown { .filtered-search-history-dropdown {
......
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
.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
.filtered-search-box .filtered-search-box
- if type != :boards_modal && type != :boards - if type != :boards_modal && type != :boards
= dropdown_tag(_('Recent searches'), - text = tag.span(sprite_icon('history'), class: "d-md-none") + tag.span(_('Recent searches'), class: "d-none d-md-inline")
= dropdown_tag(text,
options: { wrapper_class: "filtered-search-history-dropdown-wrapper", options: { wrapper_class: "filtered-search-history-dropdown-wrapper",
toggle_class: "btn filtered-search-history-dropdown-toggle-button", toggle_class: "btn filtered-search-history-dropdown-toggle-button",
dropdown_class: "filtered-search-history-dropdown", dropdown_class: "filtered-search-history-dropdown",
......
---
title: Use history icon on recent search filter tab only on mobile
merge_request: 39557
author: Takuya Noguchi
type: fixed
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe 'Recent searches', :js do RSpec.describe 'Recent searches', :js do
include FilteredSearchHelpers include FilteredSearchHelpers
include MobileHelpers
let(:project_1) { create(:project, :public) } let(:project_1) { create(:project, :public) }
let(:project_2) { create(:project, :public) } let(:project_2) { create(:project, :public) }
...@@ -104,4 +105,24 @@ RSpec.describe 'Recent searches', :js do ...@@ -104,4 +105,24 @@ RSpec.describe 'Recent searches', :js do
expect(find('.flash-alert')).to have_text('An error occurred while parsing recent searches') expect(find('.flash-alert')).to have_text('An error occurred while parsing recent searches')
end end
context 'on tablet/mobile screen' do
it 'shows only the history icon in the dropdown' do
resize_screen_sm
visit project_issues_path(project_1)
expect(find('.filtered-search-history-dropdown-wrapper')).to have_selector('svg', visible: true)
expect(find('.filtered-search-history-dropdown-wrapper')).to have_selector('span', text: 'Recent searches', visible: false)
end
end
context 'on PC screen' do
it 'shows only the Recent searches text in the dropdown' do
restore_window_size
visit project_issues_path(project_1)
expect(find('.filtered-search-history-dropdown-wrapper')).to have_selector('svg', visible: false)
expect(find('.filtered-search-history-dropdown-wrapper')).to have_selector('span', text: 'Recent searches', visible: true)
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