Commit 8709fb53 authored by Justin Ho Tuan Duong's avatar Justin Ho Tuan Duong Committed by Ezekiel Kigbo

Replace fa-tag(s) with GitLab SVG tag icon

- Fix tag/branch icon too close to text on Pipelines list page
parent 3cb408f1
<script> <script>
import { GlTooltipDirective } from '@gitlab/ui'; import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import CollapsedAssignee from './collapsed_assignee.vue'; import CollapsedAssignee from './collapsed_assignee.vue';
...@@ -12,6 +12,7 @@ export default { ...@@ -12,6 +12,7 @@ export default {
}, },
components: { components: {
CollapsedAssignee, CollapsedAssignee,
GlIcon,
}, },
props: { props: {
users: { users: {
...@@ -102,7 +103,7 @@ export default { ...@@ -102,7 +103,7 @@ export default {
:title="tooltipTitle" :title="tooltipTitle"
class="sidebar-collapsed-icon sidebar-collapsed-user" class="sidebar-collapsed-icon sidebar-collapsed-user"
> >
<i v-if="hasNoUsers" :aria-label="__('None')" class="fa fa-user"> </i> <gl-icon v-if="hasNoUsers" name="user" :aria-label="__('None')" />
<collapsed-assignee <collapsed-assignee
v-for="user in collapsedUsers" v-for="user in collapsedUsers"
:key="user.id" :key="user.id"
......
<script> <script>
import { GlLoadingIcon } from '@gitlab/ui'; import { GlIcon, GlLoadingIcon } from '@gitlab/ui';
import { __, n__, sprintf } from '~/locale'; import { __, n__, sprintf } from '~/locale';
import tooltip from '~/vue_shared/directives/tooltip'; import tooltip from '~/vue_shared/directives/tooltip';
import userAvatarImage from '~/vue_shared/components/user_avatar/user_avatar_image.vue'; import userAvatarImage from '~/vue_shared/components/user_avatar/user_avatar_image.vue';
...@@ -10,6 +10,7 @@ export default { ...@@ -10,6 +10,7 @@ export default {
}, },
components: { components: {
userAvatarImage, userAvatarImage,
GlIcon,
GlLoadingIcon, GlLoadingIcon,
}, },
props: { props: {
...@@ -94,7 +95,7 @@ export default { ...@@ -94,7 +95,7 @@ export default {
data-boundary="viewport" data-boundary="viewport"
@click="onClickCollapsedIcon" @click="onClickCollapsedIcon"
> >
<i class="fa fa-users" aria-hidden="true"> </i> <gl-icon name="users" />
<gl-loading-icon v-if="loading" /> <gl-loading-icon v-if="loading" />
<span v-else data-testid="collapsed-count"> {{ participantCount }} </span> <span v-else data-testid="collapsed-count"> {{ participantCount }} </span>
</div> </div>
......
<script> <script>
import { GlIcon } from '@gitlab/ui';
import tooltip from '~/vue_shared/directives/tooltip'; import tooltip from '~/vue_shared/directives/tooltip';
export default { export default {
...@@ -6,6 +7,9 @@ export default { ...@@ -6,6 +7,9 @@ export default {
directives: { directives: {
tooltip, tooltip,
}, },
components: {
GlIcon,
},
props: { props: {
containerClass: { containerClass: {
type: String, type: String,
...@@ -47,7 +51,7 @@ export default { ...@@ -47,7 +51,7 @@ export default {
data-boundary="viewport" data-boundary="viewport"
@click="click" @click="click"
> >
<i v-if="showIcon" class="fa fa-calendar" aria-hidden="true"> </i> <gl-icon v-if="showIcon" name="calendar" />
<slot> <slot>
<span> {{ text }} </span> <span> {{ text }} </span>
</slot> </slot>
......
<script> <script>
import { GlIcon } from '@gitlab/ui';
import { s__, sprintf } from '~/locale'; import { s__, sprintf } from '~/locale';
import tooltip from '~/vue_shared/directives/tooltip'; import tooltip from '~/vue_shared/directives/tooltip';
...@@ -6,6 +7,9 @@ export default { ...@@ -6,6 +7,9 @@ export default {
directives: { directives: {
tooltip, tooltip,
}, },
components: {
GlIcon,
},
props: { props: {
labels: { labels: {
type: Array, type: Array,
...@@ -49,7 +53,7 @@ export default { ...@@ -49,7 +53,7 @@ export default {
data-boundary="viewport" data-boundary="viewport"
@click="handleClick" @click="handleClick"
> >
<i aria-hidden="true" data-hidden="true" class="fa fa-tags"> </i> <gl-icon name="labels" />
<span>{{ labels.length }}</span> <span>{{ labels.length }}</span>
</div> </div>
</template> </template>
...@@ -234,8 +234,8 @@ ...@@ -234,8 +234,8 @@
.title { .title {
color: $gl-text-color; color: $gl-text-color;
margin-bottom: $gl-padding-8; margin-bottom: $gl-padding-4;
line-height: 1; line-height: $gl-line-height-20;
.avatar { .avatar {
margin-left: 0; margin-left: 0;
......
...@@ -193,7 +193,6 @@ ...@@ -193,7 +193,6 @@
.icon-container { .icon-container {
display: inline-block; display: inline-block;
width: 10px;
&.commit-icon { &.commit-icon {
width: 15px; width: 15px;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
- release = @releases.find { |release| release.tag == tag.name } - release = @releases.find { |release| release.tag == tag.name }
%li.flex-row.allow-wrap %li.flex-row.allow-wrap
.row-main-content .row-main-content
= icon('tag') = sprite_icon('tag')
= link_to tag.name, project_tag_path(@project, tag.name), class: 'item-title ref-name gl-ml-2' = link_to tag.name, project_tag_path(@project, tag.name), class: 'item-title ref-name'
- if protected_tag?(@project, tag) - if protected_tag?(@project, tag)
%span.badge.badge-success.gl-ml-2 %span.badge.badge-success.gl-ml-2
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
.nav-text .nav-text
.title .title
%span.item-title.ref-name{ data: { qa_selector: 'tag_name_content' } } %span.item-title.ref-name{ data: { qa_selector: 'tag_name_content' } }
= icon('tag') = sprite_icon('tag')
= @tag.name = @tag.name
- if protected_tag?(@project, @tag) - if protected_tag?(@project, @tag)
%span.badge.badge-success %span.badge.badge-success
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
= _('None') = _('None')
.title.hide-collapsed .title.hide-collapsed
= _('Milestone') = _('Milestone')
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true') = loading_icon(css_class: 'gl-vertical-align-text-bottom hidden block-loading')
- if can_edit_issuable - if can_edit_issuable
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right', data: { qa_selector: "edit_milestone_link", track_label: "right_sidebar", track_property: "milestone", track_event: "click_edit_button", track_value: "" } = link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right', data: { qa_selector: "edit_milestone_link", track_label: "right_sidebar", track_property: "milestone", track_event: "click_edit_button", track_value: "" }
.value.hide-collapsed .value.hide-collapsed
...@@ -65,12 +65,12 @@ ...@@ -65,12 +65,12 @@
- if issuable_sidebar.has_key?(:due_date) - if issuable_sidebar.has_key?(:due_date)
.block.due_date .block.due_date
.sidebar-collapsed-icon.has-tooltip{ data: { placement: 'left', container: 'body', html: 'true', boundary: 'viewport' }, title: sidebar_due_date_tooltip_label(issuable_sidebar[:due_date]) } .sidebar-collapsed-icon.has-tooltip{ data: { placement: 'left', container: 'body', html: 'true', boundary: 'viewport' }, title: sidebar_due_date_tooltip_label(issuable_sidebar[:due_date]) }
= icon('calendar', 'aria-hidden': 'true') = sprite_icon('calendar')
%span.js-due-date-sidebar-value %span.js-due-date-sidebar-value
= issuable_sidebar[:due_date].try(:to_s, :medium) || _('None') = issuable_sidebar[:due_date].try(:to_s, :medium) || _('None')
.title.hide-collapsed .title.hide-collapsed
= _('Due date') = _('Due date')
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true') = loading_icon(css_class: 'gl-vertical-align-text-bottom hidden block-loading')
- if can_edit_issuable - if can_edit_issuable
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right', data: { track_label: "right_sidebar", track_property: "due_date", track_event: "click_edit_button", track_value: "" } = link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right', data: { track_label: "right_sidebar", track_property: "due_date", track_event: "click_edit_button", track_value: "" }
.value.hide-collapsed .value.hide-collapsed
...@@ -101,12 +101,12 @@ ...@@ -101,12 +101,12 @@
- selected_labels = issuable_sidebar[:labels] - selected_labels = issuable_sidebar[:labels]
.block.labels .block.labels
.sidebar-collapsed-icon.js-sidebar-labels-tooltip{ title: issuable_labels_tooltip(selected_labels), data: { placement: "left", container: "body", boundary: 'viewport' } } .sidebar-collapsed-icon.js-sidebar-labels-tooltip{ title: issuable_labels_tooltip(selected_labels), data: { placement: "left", container: "body", boundary: 'viewport' } }
= icon('tags', 'aria-hidden': 'true') = sprite_icon('labels')
%span %span
= selected_labels.size = selected_labels.size
.title.hide-collapsed .title.hide-collapsed
= _('Labels') = _('Labels')
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true') = loading_icon(css_class: 'gl-vertical-align-text-bottom hidden block-loading')
- if can_edit_issuable - if can_edit_issuable
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right', data: { qa_selector: "edit_labels_link", track_label: "right_sidebar", track_property: "labels", track_event: "click_edit_button", track_value: "" } = link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right', data: { qa_selector: "edit_labels_link", track_label: "right_sidebar", track_property: "labels", track_event: "click_edit_button", track_value: "" }
.value.issuable-show-labels.dont-hide.hide-collapsed{ class: ("has-labels" if selected_labels.any?), data: { qa_selector: 'labels_block' } } .value.issuable-show-labels.dont-hide.hide-collapsed{ class: ("has-labels" if selected_labels.any?), data: { qa_selector: 'labels_block' } }
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
= dropdown_footer add_content_class: true do = dropdown_footer add_content_class: true do
%button.btn.btn-success.sidebar-move-issue-confirmation-button.js-move-issue-confirmation-button{ type: 'button', disabled: true } %button.btn.btn-success.sidebar-move-issue-confirmation-button.js-move-issue-confirmation-button{ type: 'button', disabled: true }
= _('Move') = _('Move')
= icon('spinner spin', class: 'sidebar-move-issue-confirmation-loading-icon') = loading_icon(css_class: 'gl-vertical-align-text-bottom sidebar-move-issue-confirmation-loading-icon')
-# haml-lint:disable InlineJavaScript -# haml-lint:disable InlineJavaScript
%script.js-sidebar-options{ type: "application/json" }= issuable_sidebar_options(issuable_sidebar).to_json.html_safe %script.js-sidebar-options{ type: "application/json" }= issuable_sidebar_options(issuable_sidebar).to_json.html_safe
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#js-vue-sidebar-assignees{ data: { field: issuable_type, signed_in: signed_in } } #js-vue-sidebar-assignees{ data: { field: issuable_type, signed_in: signed_in } }
.title.hide-collapsed .title.hide-collapsed
= _('Assignee') = _('Assignee')
.spinner.spinner-sm.align-bottom = loading_icon(css_class: 'gl-vertical-align-text-bottom')
.selectbox.hide-collapsed .selectbox.hide-collapsed
- if assignees.none? - if assignees.none?
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
- if current_user && current_user.admin? - if current_user && current_user.admin?
= link_to [:admin, @user], class: link_classes + 'btn btn-default', title: s_('UserProfile|View user in admin area'), = link_to [:admin, @user], class: link_classes + 'btn btn-default', title: s_('UserProfile|View user in admin area'),
data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= icon('users') = sprite_icon('user')
.profile-header{ class: [('with-no-profile-tabs' if profile_tabs.empty?)] } .profile-header{ class: [('with-no-profile-tabs' if profile_tabs.empty?)] }
.avatar-holder .avatar-holder
......
---
title: Replace fa-tag(s) icons with GitLab SVG icons
merge_request: 38979
author:
type: changed
...@@ -38,7 +38,7 @@ RSpec.describe 'Assign labels to an epic', :js do ...@@ -38,7 +38,7 @@ RSpec.describe 'Assign labels to an epic', :js do
context 'when labels icon is clicked on collapsed sidebar' do context 'when labels icon is clicked on collapsed sidebar' do
before do before do
page.within('aside.right-sidebar') do page.within('aside.right-sidebar') do
find('.fa-tags').click find('[data-testid="labels-icon"]').click
end end
wait_for_requests wait_for_requests
end end
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { trimText } from 'helpers/text_helper'; import { trimText } from 'helpers/text_helper';
import { GlIcon } from '@gitlab/ui';
import Assignee from '~/sidebar/components/assignees/assignees.vue'; import Assignee from '~/sidebar/components/assignees/assignees.vue';
import UsersMock from './mock_data'; import UsersMock from './mock_data';
import UsersMockHelper from '../helpers/user_mock_data_helper'; import UsersMockHelper from '../helpers/user_mock_data_helper';
...@@ -29,10 +30,12 @@ describe('Assignee component', () => { ...@@ -29,10 +30,12 @@ describe('Assignee component', () => {
it('displays no assignee icon when collapsed', () => { it('displays no assignee icon when collapsed', () => {
createWrapper(); createWrapper();
const collapsedChildren = findCollapsedChildren(); const collapsedChildren = findCollapsedChildren();
const userIcon = collapsedChildren.at(0).find(GlIcon);
expect(collapsedChildren.length).toBe(1); expect(collapsedChildren.length).toBe(1);
expect(collapsedChildren.at(0).attributes('aria-label')).toBe('None'); expect(collapsedChildren.at(0).attributes('aria-label')).toBe('None');
expect(collapsedChildren.at(0).classes()).toContain('fa', 'fa-user'); expect(userIcon.exists()).toBe(true);
expect(userIcon.props('name')).toBe('user');
}); });
it('displays only "None" when no users are assigned and the issue is read-only', () => { it('displays only "None" when no users are assigned and the issue is read-only', () => {
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlIcon } from '@gitlab/ui';
import UsersMockHelper from 'helpers/user_mock_data_helper'; import UsersMockHelper from 'helpers/user_mock_data_helper';
import CollapsedAssigneeList from '~/sidebar/components/assignees/collapsed_assignee_list.vue'; import CollapsedAssigneeList from '~/sidebar/components/assignees/collapsed_assignee_list.vue';
import CollapsedAssignee from '~/sidebar/components/assignees/collapsed_assignee.vue'; import CollapsedAssignee from '~/sidebar/components/assignees/collapsed_assignee.vue';
...@@ -20,7 +21,7 @@ describe('CollapsedAssigneeList component', () => { ...@@ -20,7 +21,7 @@ describe('CollapsedAssigneeList component', () => {
}); });
} }
const findNoUsersIcon = () => wrapper.find('i[aria-label=None]'); const findNoUsersIcon = () => wrapper.find(GlIcon);
const findAvatarCounter = () => wrapper.find('.avatar-counter'); const findAvatarCounter = () => wrapper.find('.avatar-counter');
const findAssignees = () => wrapper.findAll(CollapsedAssignee); const findAssignees = () => wrapper.findAll(CollapsedAssignee);
const getTooltipTitle = () => wrapper.attributes('title'); const getTooltipTitle = () => wrapper.attributes('title');
...@@ -38,6 +39,7 @@ describe('CollapsedAssigneeList component', () => { ...@@ -38,6 +39,7 @@ describe('CollapsedAssigneeList component', () => {
it('has no users', () => { it('has no users', () => {
expect(findNoUsersIcon().exists()).toBe(true); expect(findNoUsersIcon().exists()).toBe(true);
expect(findNoUsersIcon().props('name')).toBe('user');
}); });
}); });
......
...@@ -87,7 +87,7 @@ describe('DropdownValueCollapsedComponent', () => { ...@@ -87,7 +87,7 @@ describe('DropdownValueCollapsedComponent', () => {
}); });
it('renders tags icon element', () => { it('renders tags icon element', () => {
expect(vm.$el.querySelector('.fa-tags')).not.toBeNull(); expect(vm.$el.querySelector('[data-testid="labels-icon"]')).not.toBeNull();
}); });
it('renders labels count', () => { it('renders labels count', () => {
......
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