Commit 814f4691 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '224534-replace-fa-times-with-gitlab-svg-close-icon-forms' into 'master'

Replace fa-times with GitLab SVG close icon - Forms

See merge request gitlab-org/gitlab!40587
parents ce673d68 0fc520b0
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
class="js-issue-token-remove-button" class="js-issue-token-remove-button"
@click="onRemoveRequest" @click="onRemoveRequest"
> >
<i class="fa fa-times" aria-hidden="true"></i> <gl-icon name="close" aria-hidden="true" />
</button> </button>
</div> </div>
</template> </template>
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import fuzzaldrinPlus from 'fuzzaldrin-plus'; import fuzzaldrinPlus from 'fuzzaldrin-plus';
import Mousetrap from 'mousetrap'; import Mousetrap from 'mousetrap';
import VirtualList from 'vue-virtual-scroll-list'; import VirtualList from 'vue-virtual-scroll-list';
import { GlIcon } from '@gitlab/ui';
import Item from './item.vue'; import Item from './item.vue';
import { UP_KEY_CODE, DOWN_KEY_CODE, ENTER_KEY_CODE, ESC_KEY_CODE } from '~/lib/utils/keycodes'; import { UP_KEY_CODE, DOWN_KEY_CODE, ENTER_KEY_CODE, ESC_KEY_CODE } from '~/lib/utils/keycodes';
...@@ -13,6 +14,7 @@ const originalStopCallback = Mousetrap.prototype.stopCallback; ...@@ -13,6 +14,7 @@ const originalStopCallback = Mousetrap.prototype.stopCallback;
export default { export default {
components: { components: {
GlIcon,
Item, Item,
VirtualList, VirtualList,
}, },
...@@ -235,12 +237,13 @@ export default { ...@@ -235,12 +237,13 @@ export default {
aria-hidden="true" aria-hidden="true"
class="fa fa-search dropdown-input-search" class="fa fa-search dropdown-input-search"
></i> ></i>
<i <gl-icon
:aria-label="__('Clear search input')" name="close"
class="dropdown-input-clear"
role="button" role="button"
class="fa fa-times dropdown-input-clear" :aria-label="__('Clear search input')"
@click="clearSearchInput" @click="clearSearchInput"
></i> />
</div> </div>
<div> <div>
<virtual-list ref="virtualScrollList" :size="listHeight" :remain="listShowCount" wtag="ul"> <virtual-list ref="virtualScrollList" :size="listHeight" :remain="listShowCount" wtag="ul">
......
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
} }
} }
.fa-times { .clear-search-icon {
right: 10px; right: 10px;
color: $gray-darkest; color: $gray-darkest;
} }
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
outline: none; outline: none;
z-index: 1; z-index: 1;
&:hover .fa-times { &:hover .clear-search-icon {
color: $common-gray-dark; color: $common-gray-dark;
} }
} }
......
...@@ -618,7 +618,6 @@ $award-emoji-width-xs: 90%; ...@@ -618,7 +618,6 @@ $award-emoji-width-xs: 90%;
$search-input-border-color: rgba($blue-400, 0.8); $search-input-border-color: rgba($blue-400, 0.8);
$search-input-width: 200px; $search-input-width: 200px;
$search-input-xl-width: 320px; $search-input-xl-width: 320px;
$location-icon-color: #e7e9ed;
/* /*
* Notes * Notes
......
...@@ -84,7 +84,8 @@ ...@@ -84,7 +84,8 @@
color: var(--ide-input-border, $gl-text-color-tertiary); color: var(--ide-input-border, $gl-text-color-tertiary);
} }
.dropdown-input .fa { .dropdown-input .fa,
.dropdown-input .dropdown-input-clear {
color: var(--ide-input-border, $dropdown-input-fa-color); color: var(--ide-input-border, $dropdown-input-fa-color);
} }
......
...@@ -1268,18 +1268,10 @@ pre.light-well { ...@@ -1268,18 +1268,10 @@ pre.light-well {
position: relative; position: relative;
.clear-icon { .clear-icon {
@extend .fa-times;
display: none; display: none;
position: absolute; position: absolute;
right: 7px; right: 9px;
top: 7px; top: 9px;
color: $location-icon-color;
&::before {
font-family: FontAwesome;
font-weight: $gl-font-weight-normal;
font-style: normal;
}
} }
&.has-value { &.has-value {
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
{{name}} {{name}}
= button_tag class: %w[clear-search hidden] do = button_tag class: %w[clear-search hidden] do
= icon('times') = sprite_icon('close', size: 16, css_class: 'clear-search-icon')
.filter-dropdown-container .filter-dropdown-container
= render 'sort_dropdown' = render 'sort_dropdown'
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
.float-right .float-right
%span.light.vertical-align-middle= group_member.human_access %span.light.vertical-align-middle= group_member.human_access
- unless group_member.owner? - unless group_member.owner?
= link_to group_group_member_path(group, group_member), data: { confirm: remove_member_message(group_member) }, method: :delete, remote: true, class: "btn-sm btn btn-remove gl-ml-3", title: 'Remove user from group' do = link_to group_group_member_path(group, group_member), data: { confirm: remove_member_message(group_member), testid: 'remove-user' }, method: :delete, remote: true, class: "btn btn-sm btn-danger gl-button btn-icon gl-ml-3", title: _('Remove user from group') do
%i.fa.fa-times.fa-inverse = sprite_icon('close', size: 16, css_class: 'gl-icon')
.row .row
.col-md-6 .col-md-6
...@@ -46,5 +46,5 @@ ...@@ -46,5 +46,5 @@
%span.light.vertical-align-middle= member.human_access %span.light.vertical-align-middle= member.human_access
- if member.respond_to? :project - if member.respond_to? :project
= link_to project_project_member_path(project, member), data: { confirm: remove_member_message(member) }, remote: true, method: :delete, class: "btn-sm btn btn-remove gl-ml-3", title: 'Remove user from project' do = link_to project_project_member_path(project, member), data: { confirm: remove_member_message(member) }, remote: true, method: :delete, class: "btn btn-sm btn-danger gl-button btn-icon gl-ml-3", title: 'Remove user from project' do
%i.fa.fa-times = sprite_icon('close', size: 16, css_class: 'gl-icon')
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
%span.light Secondary email: %span.light Secondary email:
%strong %strong
= render partial: 'shared/email_with_badge', locals: { email: email.email, verified: email.confirmed? } = render partial: 'shared/email_with_badge', locals: { email: email.email, verified: email.confirmed? }
= link_to remove_email_admin_user_path(@user, email), data: { confirm: "Are you sure you want to remove #{email.email}?" }, method: :delete, class: "btn-sm btn btn-remove float-right", title: 'Remove secondary email', id: "remove_email_#{email.id}" do = link_to remove_email_admin_user_path(@user, email), data: { confirm: "Are you sure you want to remove #{email.email}?" }, method: :delete, class: "btn btn-sm btn-danger gl-button btn-icon float-right", title: 'Remove secondary email', id: "remove_email_#{email.id}" do
%i.fa.fa-times = sprite_icon('close', size: 16, css_class: 'gl-icon')
%li %li
%span.light ID: %span.light ID:
%strong %strong
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
{{name}} {{name}}
= button_tag class: 'clear-search hidden' do = button_tag class: 'clear-search hidden' do
= icon('times') = sprite_icon('close', size: 16, css_class: 'clear-search-icon')
.filter-dropdown-container .filter-dropdown-container
= render 'admin/runners/sort_dropdown' = render 'admin/runners/sort_dropdown'
......
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
= render_if_exists 'shared/issuable/filter_epic', type: type = render_if_exists 'shared/issuable/filter_epic', type: type
%button.clear-search.hidden{ type: 'button' } %button.clear-search.hidden{ type: 'button' }
= icon('times') = sprite_icon('close', size: 16, css_class: 'clear-search-icon')
.filter-dropdown-container.d-flex.flex-column.flex-md-row .filter-dropdown-container.d-flex.flex-column.flex-md-row
- if type == :boards - if type == :boards
#js-board-labels-toggle #js-board-labels-toggle
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
data: { id: role_id, el_id: dom_id } data: { id: role_id, el_id: dom_id }
.clearable-input.member-form-control.d-sm-inline-block .clearable-input.member-form-control.d-sm-inline-block
= text_field_tag 'group_link[expires_at]', group_link.expires_at, class: 'form-control js-access-expiration-date js-member-update-control', placeholder: _('Expiration date'), id: "member_expires_at_#{group.id}", disabled: !can_admin_member = text_field_tag 'group_link[expires_at]', group_link.expires_at, class: 'form-control js-access-expiration-date js-member-update-control', placeholder: _('Expiration date'), id: "member_expires_at_#{group.id}", disabled: !can_admin_member
%i.clear-icon.js-clear-input = sprite_icon('close', size: 16, css_class: 'clear-icon js-clear-input gl-text-gray-200')
- if can_admin_member - if can_admin_member
= link_to group_link_path, = link_to group_link_path,
method: :delete, method: :delete,
......
...@@ -22,5 +22,5 @@ ...@@ -22,5 +22,5 @@
= label_tag :expires_at, _('Access expiration date'), class: 'label-bold' = label_tag :expires_at, _('Access expiration date'), class: 'label-bold'
.clearable-input .clearable-input
= text_field_tag :expires_at, nil, class: 'form-control js-access-expiration-date-groups', placeholder: _('Expiration date'), id: 'expires_at_groups' = text_field_tag :expires_at, nil, class: 'form-control js-access-expiration-date-groups', placeholder: _('Expiration date'), id: 'expires_at_groups'
%i.clear-icon.js-clear-input = sprite_icon('close', size: 16, css_class: 'clear-icon js-clear-input gl-text-gray-200')
= submit_tag _("Invite"), class: "btn btn-success", data: { qa_selector: 'invite_group_button' } = submit_tag _("Invite"), class: "btn btn-success", data: { qa_selector: 'invite_group_button' }
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
- link_start = %q{<a href="%{url}">}.html_safe % { url: permissions_docs_path } - link_start = %q{<a href="%{url}">}.html_safe % { url: permissions_docs_path }
= _("%{link_start}Read more%{link_end} about role permissions").html_safe % { link_start: link_start, link_end: '</a>'.html_safe } = _("%{link_start}Read more%{link_end} about role permissions").html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
.form-group .form-group
= label_tag :expires_at, _('Access expiration date'), class: 'label-bold'
.clearable-input .clearable-input
= label_tag :expires_at, _('Access expiration date'), class: 'label-bold'
= text_field_tag :expires_at, nil, class: 'form-control js-access-expiration-date', placeholder: 'Expiration date' = text_field_tag :expires_at, nil, class: 'form-control js-access-expiration-date', placeholder: 'Expiration date'
%i.clear-icon.js-clear-input = sprite_icon('close', size: 16, css_class: 'clear-icon js-clear-input gl-text-gray-200')
= submit_tag _("Invite"), class: "btn btn-success", data: { qa_selector: 'invite_member_button' } = submit_tag _("Invite"), class: "btn btn-success", data: { qa_selector: 'invite_member_button' }
- if can_import_members - if can_import_members
= link_to _("Import"), import_path, class: "btn btn-default", title: _("Import members from another project") = link_to _("Import"), import_path, class: "btn btn-default", title: _("Import members from another project")
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
placeholder: _('Expiration date'), placeholder: _('Expiration date'),
id: "member_expires_at_#{member.id}", id: "member_expires_at_#{member.id}",
data: { el_id: dom_id(member) } data: { el_id: dom_id(member) }
%i.clear-icon.js-clear-input = sprite_icon('close', size: 16, css_class: 'clear-icon js-clear-input gl-text-gray-200')
- else - else
%span.member-access-text.user-access-role= member.human_access %span.member-access-text.user-access-role= member.human_access
......
---
title: Replace fa-times with GitLab SVG close icon in forms
merge_request: 40587
author:
type: performance
<script> <script>
import { GlIcon } from '@gitlab/ui';
export default { export default {
components: {
GlIcon,
},
data() { data() {
return { return {
query: '', query: '',
...@@ -27,12 +32,11 @@ export default { ...@@ -27,12 +32,11 @@ export default {
@keyup="handleInputChange" @keyup="handleInputChange"
/> />
<i class="fa fa-search dropdown-input-search" aria-hidden="true" data-hidden="true"></i> <i class="fa fa-search dropdown-input-search" aria-hidden="true" data-hidden="true"></i>
<i <gl-icon
role="button" name="close"
class="fa fa-times dropdown-input-clear" class="dropdown-input-clear"
aria-hidden="true" aria-hidden="true"
data-hidden="true"
@click="handleInputClear" @click="handleInputClear"
></i> />
</div> </div>
</template> </template>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
{{ title }} {{ title }}
%button.clear-search.hidden{ type: 'button' } %button.clear-search.hidden{ type: 'button' }
= icon('times') = sprite_icon('close', size: 16, css_class: 'clear-search-icon')
- unless hide_sort_dropdown - unless hide_sort_dropdown
.filter-dropdown-container .filter-dropdown-container
= render 'shared/epic/sort_dropdown', hide_extra_sort_options: hide_extra_sort_options = render 'shared/epic/sort_dropdown', hide_extra_sort_options: hide_extra_sort_options
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
data: { el_id: dom_id(member), endpoint: override_group_group_member_path(group, member) } } data: { el_id: dom_id(member), endpoint: override_group_group_member_path(group, member) } }
.spinner.mr-1 .spinner.mr-1
Change permissions Change permissions
%button.btn.btn-default.js-ldap-permissions{ type: 'button', %button.btn.btn-default.btn-icon.gl-button.js-ldap-permissions{ type: 'button',
'aria-label' => 'Close permissions override', 'aria-label' => 'Close permissions override',
data: { el_id: dom_id(member) } } data: { el_id: dom_id(member) } }
= icon('times') = sprite_icon('close', size: 16, css_class: 'gl-icon gl-text-black-normal!')
...@@ -36,7 +36,7 @@ describe('ListFilter', () => { ...@@ -36,7 +36,7 @@ describe('ListFilter', () => {
it('clears input field and emits `onSearchInput` event with empty value', () => { it('clears input field and emits `onSearchInput` event with empty value', () => {
expect(input.element.value).toBe('foobar'); expect(input.element.value).toBe('foobar');
wrapper.find('.dropdown-input-clear').trigger('click'); wrapper.find('.dropdown-input-clear').vm.$emit('click');
return Vue.nextTick().then(() => { return Vue.nextTick().then(() => {
expect(input.element.value).toBe(''); expect(input.element.value).toBe('');
...@@ -75,7 +75,7 @@ describe('ListFilter', () => { ...@@ -75,7 +75,7 @@ describe('ListFilter', () => {
it('renders search input icons', () => { it('renders search input icons', () => {
expect(wrapper.find('i.fa.fa-search.dropdown-input-search').exists()).toBe(true); expect(wrapper.find('i.fa.fa-search.dropdown-input-search').exists()).toBe(true);
expect(wrapper.find('i.fa.fa-times.dropdown-input-clear').exists()).toBe(true); expect(wrapper.find('.dropdown-input-clear').exists()).toBe(true);
}); });
}); });
}); });
...@@ -20959,6 +20959,9 @@ msgstr "" ...@@ -20959,6 +20959,9 @@ msgstr ""
msgid "Remove user & report" msgid "Remove user & report"
msgstr "" msgstr ""
msgid "Remove user from group"
msgstr ""
msgid "Removed" msgid "Removed"
msgstr "" msgstr ""
......
...@@ -537,7 +537,7 @@ RSpec.describe "Admin::Users" do ...@@ -537,7 +537,7 @@ RSpec.describe "Admin::Users" do
it 'allows group membership to be revoked', :js do it 'allows group membership to be revoked', :js do
page.within(first('.group_member')) do page.within(first('.group_member')) do
accept_confirm { find('.btn-remove').click } accept_confirm { find('.btn[data-testid="remove-user"]').click }
end end
wait_for_requests wait_for_requests
......
...@@ -84,7 +84,7 @@ describe('File finder item spec', () => { ...@@ -84,7 +84,7 @@ describe('File finder item spec', () => {
waitForPromises() waitForPromises()
.then(() => { .then(() => {
vm.$el.querySelector('.dropdown-input-clear').click(); vm.clearSearchInput();
}) })
.then(waitForPromises) .then(waitForPromises)
.then(() => { .then(() => {
...@@ -94,13 +94,13 @@ describe('File finder item spec', () => { ...@@ -94,13 +94,13 @@ describe('File finder item spec', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('clear button focues search input', done => { it('clear button focuses search input', done => {
jest.spyOn(vm.$refs.searchInput, 'focus').mockImplementation(() => {}); jest.spyOn(vm.$refs.searchInput, 'focus').mockImplementation(() => {});
vm.searchText = 'index'; vm.searchText = 'index';
waitForPromises() waitForPromises()
.then(() => { .then(() => {
vm.$el.querySelector('.dropdown-input-clear').click(); vm.clearSearchInput();
}) })
.then(waitForPromises) .then(waitForPromises)
.then(() => { .then(() => {
......
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