Commit 4fec2e3d authored by Micael Bergeron's avatar Micael Bergeron

Migrate `fa-thumbs-up/down` → `thumbs-up/down`

This MR replace the `fa-thumbs-up/down` from FontAwesome to
`thumb-up/down` from gitlab-svgs.
parent dba80652
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// TODO: need to move this component to graphql - https://gitlab.com/gitlab-org/gitlab/-/issues/221246 // TODO: need to move this component to graphql - https://gitlab.com/gitlab-org/gitlab/-/issues/221246
import { escape, isNumber } from 'lodash'; import { escape, isNumber } from 'lodash';
import { GlLink, GlTooltipDirective as GlTooltip, GlSprintf, GlLabel } from '@gitlab/ui'; import { GlLink, GlTooltipDirective as GlTooltip, GlSprintf, GlLabel, GlIcon } from '@gitlab/ui';
import { import {
dateInWords, dateInWords,
formatDate, formatDate,
...@@ -18,7 +18,6 @@ import { ...@@ -18,7 +18,6 @@ import {
import { sprintf, __ } from '~/locale'; import { sprintf, __ } from '~/locale';
import initUserPopovers from '~/user_popovers'; import initUserPopovers from '~/user_popovers';
import { mergeUrlParams } from '~/lib/utils/url_utility'; import { mergeUrlParams } from '~/lib/utils/url_utility';
import Icon from '~/vue_shared/components/icon.vue';
import IssueAssignees from '~/vue_shared/components/issue/issue_assignees.vue'; import IssueAssignees from '~/vue_shared/components/issue/issue_assignees.vue';
import { isScopedLabel } from '~/lib/utils/common_utils'; import { isScopedLabel } from '~/lib/utils/common_utils';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
...@@ -28,10 +27,10 @@ export default { ...@@ -28,10 +27,10 @@ export default {
openedAgo: __('opened %{timeAgoString} by %{user}'), openedAgo: __('opened %{timeAgoString} by %{user}'),
}, },
components: { components: {
Icon,
IssueAssignees, IssueAssignees,
GlLink, GlLink,
GlLabel, GlLabel,
GlIcon,
GlSprintf, GlSprintf,
}, },
directives: { directives: {
...@@ -153,14 +152,14 @@ export default { ...@@ -153,14 +152,14 @@ export default {
value: this.issuable.upvotes, value: this.issuable.upvotes,
title: __('Upvotes'), title: __('Upvotes'),
class: 'js-upvotes', class: 'js-upvotes',
faicon: 'fa-thumbs-up', icon: 'thumb-up',
}, },
{ {
key: 'downvotes', key: 'downvotes',
value: this.issuable.downvotes, value: this.issuable.downvotes,
title: __('Downvotes'), title: __('Downvotes'),
class: 'js-downvotes', class: 'js-downvotes',
faicon: 'fa-thumbs-down', icon: 'thumb-down',
}, },
]; ];
}, },
...@@ -294,7 +293,7 @@ export default { ...@@ -294,7 +293,7 @@ export default {
:title="__('Weight')" :title="__('Weight')"
class="d-none d-sm-inline-block js-weight" class="d-none d-sm-inline-block js-weight"
> >
<icon name="weight" class="align-text-bottom" /> <gl-icon name="weight" class="align-text-bottom" />
{{ issuable.weight }} {{ issuable.weight }}
</span> </span>
</div> </div>
...@@ -318,11 +317,10 @@ export default { ...@@ -318,11 +317,10 @@ export default {
v-if="meta.value" v-if="meta.value"
:key="meta.key" :key="meta.key"
v-gl-tooltip v-gl-tooltip
:class="['d-none d-sm-inline-block ml-2', meta.class]" :class="['d-none d-sm-inline-block ml-2 vertical-align-middle', meta.class]"
:title="meta.title" :title="meta.title"
> >
<icon v-if="meta.icon" :name="meta.icon" /> <gl-icon v-if="meta.icon" :name="meta.icon" />
<i v-else :class="['fa', meta.faicon]"></i>
{{ meta.value }} {{ meta.value }}
</span> </span>
</template> </template>
......
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
- if upvotes > 0 - if upvotes > 0
%li.issuable-upvotes.d-none.d-sm-block.has-tooltip{ title: _('Upvotes') } %li.issuable-upvotes.d-none.d-sm-block.has-tooltip{ title: _('Upvotes') }
= icon('thumbs-up') = sprite_icon('thumb-up', size: 16, css_class: "vertical-align-middle")
= upvotes = upvotes
- if downvotes > 0 - if downvotes > 0
%li.issuable-downvotes.d-none.d-sm-block.has-tooltip{ title: _('Downvotes') } %li.issuable-downvotes.d-none.d-sm-block.has-tooltip{ title: _('Downvotes') }
= icon('thumbs-down') = sprite_icon('thumb-down', size: 16, css_class: "vertical-align-middle")
= downvotes = downvotes
%li.issuable-comments.d-none.d-sm-block %li.issuable-comments.d-none.d-sm-block
......
---
title: Normalize the 'thumb-up', 'thumb-down' icon.
merge_request: 35988
author:
type: other
...@@ -28,8 +28,8 @@ RSpec.describe 'issuable list', :js do ...@@ -28,8 +28,8 @@ RSpec.describe 'issuable list', :js do
it "counts upvotes, downvotes and notes count for each #{issuable_type.to_s.humanize}" do it "counts upvotes, downvotes and notes count for each #{issuable_type.to_s.humanize}" do
visit_issuable_list(issuable_type) visit_issuable_list(issuable_type)
expect(first('.fa-thumbs-up').find(:xpath, '..')).to have_content(1) expect(first('.issuable-upvotes')).to have_content(1)
expect(first('.fa-thumbs-down').find(:xpath, '..')).to have_content(1) expect(first('.issuable-downvotes')).to have_content(1)
expect(first('.fa-comments').find(:xpath, '..')).to have_content(2) expect(first('.fa-comments').find(:xpath, '..')).to have_content(2)
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