Commit 1b0d13bf authored by Justin Ho's avatar Justin Ho

Update fa-question-circle icon in Vue and HAML

Update from `fa-question-circle` to GitLab SVG `information-o`.
parent 9c4d9f98
<script> <script>
import { GlLink, GlSprintf } from '@gitlab/ui'; import { GlIcon, GlLink, GlSprintf } from '@gitlab/ui';
import { __ } from '../../locale'; import { __ } from '../../locale';
import { deprecatedCreateFlash as createFlash } from '../../flash'; import { deprecatedCreateFlash as createFlash } from '../../flash';
import Api from '../../api'; import Api from '../../api';
...@@ -8,6 +8,7 @@ import Dropdown from './dropdown.vue'; ...@@ -8,6 +8,7 @@ import Dropdown from './dropdown.vue';
export default { export default {
components: { components: {
GlIcon,
GlLink, GlLink,
GlSprintf, GlSprintf,
Dropdown, Dropdown,
...@@ -136,7 +137,7 @@ export default { ...@@ -136,7 +137,7 @@ export default {
target="_blank" target="_blank"
> >
<span class="sr-only">{{ __('Read more') }}</span> <span class="sr-only">{{ __('Read more') }}</span>
<i class="fa fa-question-circle" aria-hidden="true"></i> <gl-icon name="question-o" />
</gl-link> </gl-link>
</p> </p>
</div> </div>
......
<script> <script>
import { GlLink } from '@gitlab/ui'; import { GlIcon, GlLink } from '@gitlab/ui';
export default { export default {
name: 'SidebarDetailRow', name: 'SidebarDetailRow',
components: { components: {
GlIcon,
GlLink, GlLink,
}, },
props: { props: {
...@@ -37,7 +38,7 @@ export default { ...@@ -37,7 +38,7 @@ export default {
<span v-if="hasTitle" class="font-weight-bold">{{ title }}:</span> {{ value }} <span v-if="hasTitle" class="font-weight-bold">{{ title }}:</span> {{ value }}
<span v-if="hasHelpURL" class="help-button float-right"> <span v-if="hasHelpURL" class="help-button float-right">
<gl-link :href="helpUrl" target="_blank" rel="noopener noreferrer nofollow"> <gl-link :href="helpUrl" target="_blank" rel="noopener noreferrer nofollow">
<i class="fa fa-question-circle" aria-hidden="true"></i> <gl-icon name="question-o" />
</gl-link> </gl-link>
</span> </span>
</p> </p>
......
<script> <script>
import { GlIcon } from '@gitlab/ui';
export default { export default {
components: {
GlIcon,
},
props: { props: {
label: { label: {
type: String, type: String,
...@@ -25,7 +30,7 @@ export default { ...@@ -25,7 +30,7 @@ export default {
<label v-if="label" class="label-bold"> <label v-if="label" class="label-bold">
{{ label }} {{ label }}
<a v-if="helpPath" :href="helpPath" target="_blank"> <a v-if="helpPath" :href="helpPath" target="_blank">
<i aria-hidden="true" data-hidden="true" class="fa fa-question-circle"> </i> <gl-icon name="question-o" />
</a> </a>
</label> </label>
<span v-if="helpText" class="form-text text-muted"> {{ helpText }} </span> <slot></slot> <span v-if="helpText" class="form-text text-muted"> {{ helpText }} </span> <slot></slot>
......
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
<div class="title hide-collapsed"> <div class="title hide-collapsed">
{{ __('Time tracking') }} {{ __('Time tracking') }}
<div v-if="!showHelpState" class="help-button float-right" @click="toggleHelpState(true)"> <div v-if="!showHelpState" class="help-button float-right" @click="toggleHelpState(true)">
<i class="fa fa-question-circle" aria-hidden="true"> </i> <gl-icon name="question-o" />
</div> </div>
<div <div
v-if="showHelpState" v-if="showHelpState"
......
<script> <script>
import { GlSprintf } from '@gitlab/ui'; import { GlIcon, GlSprintf } from '@gitlab/ui';
import tooltip from '../../vue_shared/directives/tooltip'; import tooltip from '../../vue_shared/directives/tooltip';
import { __ } from '../../locale'; import { __ } from '../../locale';
...@@ -9,6 +9,7 @@ export default { ...@@ -9,6 +9,7 @@ export default {
tooltipTitle: __('A user with write access to the source branch selected this option'), tooltipTitle: __('A user with write access to the source branch selected this option'),
}, },
components: { components: {
GlIcon,
GlSprintf, GlSprintf,
}, },
directives: { directives: {
...@@ -26,12 +27,11 @@ export default { ...@@ -26,12 +27,11 @@ export default {
</template> </template>
</gl-sprintf> </gl-sprintf>
</span> </span>
<i <gl-icon
v-tooltip v-tooltip
:title="$options.i18n.tooltipTitle" :title="$options.i18n.tooltipTitle"
:aria-label="$options.i18n.tooltipTitle" :aria-label="$options.i18n.tooltipTitle"
class="fa fa-question-circle" name="question-o"
> />
</i>
</p> </p>
</template> </template>
<script> <script>
import { GlIcon } from '@gitlab/ui';
import { sprintf, s__ } from '~/locale'; import { sprintf, s__ } from '~/locale';
import tooltip from '~/vue_shared/directives/tooltip'; import tooltip from '~/vue_shared/directives/tooltip';
import statusIcon from '../mr_widget_status_icon.vue'; import statusIcon from '../mr_widget_status_icon.vue';
...@@ -9,6 +10,7 @@ export default { ...@@ -9,6 +10,7 @@ export default {
tooltip, tooltip,
}, },
components: { components: {
GlIcon,
statusIcon, statusIcon,
}, },
props: { props: {
...@@ -50,7 +52,7 @@ export default { ...@@ -50,7 +52,7 @@ export default {
<span class="bold js-branch-text"> <span class="bold js-branch-text">
<span class="capitalize"> {{ missingBranchName }} </span> <span class="capitalize"> {{ missingBranchName }} </span>
{{ s__('mrWidget|branch does not exist.') }} {{ missingBranchNameMessage }} {{ s__('mrWidget|branch does not exist.') }} {{ missingBranchNameMessage }}
<i v-tooltip :title="message" :aria-label="message" class="fa fa-question-circle"> </i> <gl-icon v-tooltip :title="message" :aria-label="message" name="question-o" />
</span> </span>
</div> </div>
</div> </div>
......
...@@ -84,10 +84,6 @@ ...@@ -84,10 +84,6 @@
color: $white; color: $white;
} }
.fa-question-circle::before {
content: '\f059';
}
.fa-chevron-down::before { .fa-chevron-down::before {
content: '\f078'; content: '\f078';
} }
......
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
= render 'by_email_description' = render 'by_email_description'
%p %p
This is a private email address This is a private email address
%span<
%a{ href: 'https://docs.gitlab.com/ee/development/emails.html#email-namespace', target: "_blank", rel: "noopener" } = link_to help_page_path('development/emails', anchor: 'email-namespace'), target: '_blank', rel: 'noopener', aria: { label: 'Learn more about incoming email addresses' } do
%i.fa.fa-question-circle{ 'aria-label': "Learn more about incoming email addresses" } = sprite_icon('question-o')
generated just for you. generated just for you.
......
...@@ -40,19 +40,23 @@ ...@@ -40,19 +40,23 @@
%li.stage-header.pl-5 %li.stage-header.pl-5
%span.stage-name.font-weight-bold %span.stage-name.font-weight-bold
{{ s__('ProjectLifecycle|Stage') }} {{ s__('ProjectLifecycle|Stage') }}
%i.has-tooltip.fa.fa-question-circle{ "data-placement" => "top", title: _("The phase of the development lifecycle."), "aria-hidden" => "true" } %span.has-tooltip{ "data-placement" => "top", title: _("The phase of the development lifecycle."), "aria-hidden" => "true" }
= sprite_icon('question-o')
%li.median-header %li.median-header
%span.stage-name.font-weight-bold %span.stage-name.font-weight-bold
{{ __('Median') }} {{ __('Median') }}
%i.has-tooltip.fa.fa-question-circle{ "data-placement" => "top", title: _("The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6."), "aria-hidden" => "true" } %span.has-tooltip{ "data-placement" => "top", title: _("The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6."), "aria-hidden" => "true" }
= sprite_icon('question-o')
%li.event-header.pl-3 %li.event-header.pl-3
%span.stage-name.font-weight-bold %span.stage-name.font-weight-bold
{{ currentStage ? __(currentStage.legend) : __('Related Issues') }} {{ currentStage ? __(currentStage.legend) : __('Related Issues') }}
%i.has-tooltip.fa.fa-question-circle{ "data-placement" => "top", title: _("The collection of events added to the data gathered for that stage."), "aria-hidden" => "true" } %span.has-tooltip{ "data-placement" => "top", title: _("The collection of events added to the data gathered for that stage."), "aria-hidden" => "true" }
= sprite_icon('question-o')
%li.total-time-header.pr-5.text-right %li.total-time-header.pr-5.text-right
%span.stage-name.font-weight-bold %span.stage-name.font-weight-bold
{{ __('Time') }} {{ __('Time') }}
%i.has-tooltip.fa.fa-question-circle{ "data-placement" => "top", title: _("The time taken by each data entry gathered by that stage."), "aria-hidden" => "true" } %span.has-tooltip{ "data-placement" => "top", title: _("The time taken by each data entry gathered by that stage."), "aria-hidden" => "true" }
= sprite_icon('question-o')
.stage-panel-body .stage-panel-body
%nav.stage-nav %nav.stage-nav
%ul %ul
......
...@@ -335,9 +335,9 @@ You can combine one or more of the following: ...@@ -335,9 +335,9 @@ You can combine one or more of the following:
= link_to 'Help page', help_page_path('user/permissions'), target: '_blank' = link_to 'Help page', help_page_path('user/permissions'), target: '_blank'
``` ```
1. **Linking to a circle icon.** Usually used in settings where a long 1. **Using a question icon.** Usually used in settings where a long
description cannot be used, like near checkboxes. You can basically use description cannot be used, like near checkboxes. You can basically use
any font awesome icon, but prefer the `question-circle`: any GitLab SVG icon, but prefer the `question-o`:
```haml ```haml
= link_to icon('question-circle'), help_page_path('user/permissions') = link_to icon('question-circle'), help_page_path('user/permissions')
......
<script> <script>
import { GlIcon } from '@gitlab/ui';
import tooltip from '~/vue_shared/directives/tooltip'; import tooltip from '~/vue_shared/directives/tooltip';
import statusIcon from '~/vue_merge_request_widget/components/mr_widget_status_icon.vue'; import statusIcon from '~/vue_merge_request_widget/components/mr_widget_status_icon.vue';
export default { export default {
components: { components: {
GlIcon,
statusIcon, statusIcon,
}, },
directives: { directives: {
...@@ -31,7 +33,7 @@ export default { ...@@ -31,7 +33,7 @@ export default {
rel="noopener noreferrer nofollow" rel="noopener noreferrer nofollow"
data-container="body" data-container="body"
> >
<i class="fa fa-question-circle"></i> <gl-icon name="question-o" />
</a> </a>
</div> </div>
</div> </div>
......
...@@ -958,7 +958,7 @@ describe('ee merge request widget options', () => { ...@@ -958,7 +958,7 @@ describe('ee merge request widget options', () => {
vm.mr.state = 'readyToMerge'; vm.mr.state = 'readyToMerge';
vm.$nextTick(() => { vm.$nextTick(() => {
const tooltip = vm.$el.querySelector('.fa-question-circle'); const tooltip = vm.$el.querySelector('[data-testid="question-o-icon"]');
expect(vm.$el.textContent).toContain('Deletes source branch'); expect(vm.$el.textContent).toContain('Deletes source branch');
expect(tooltip.getAttribute('data-original-title')).toBe( expect(tooltip.getAttribute('data-original-title')).toBe(
......
...@@ -33,9 +33,9 @@ exports[`Confidential merge request project form group component renders empty s ...@@ -33,9 +33,9 @@ exports[`Confidential merge request project form group component renders empty s
Read more Read more
</span> </span>
<i <gl-icon-stub
aria-hidden="true" name="question-o"
class="fa fa-question-circle" size="16"
/> />
</gl-link-stub> </gl-link-stub>
</p> </p>
...@@ -76,9 +76,9 @@ exports[`Confidential merge request project form group component renders fork dr ...@@ -76,9 +76,9 @@ exports[`Confidential merge request project form group component renders fork dr
Read more Read more
</span> </span>
<i <gl-icon-stub
aria-hidden="true" name="question-o"
class="fa fa-question-circle" size="16"
/> />
</gl-link-stub> </gl-link-stub>
</p> </p>
......
...@@ -530,7 +530,7 @@ describe('mrWidgetOptions', () => { ...@@ -530,7 +530,7 @@ describe('mrWidgetOptions', () => {
vm.mr.state = 'readyToMerge'; vm.mr.state = 'readyToMerge';
vm.$nextTick(() => { vm.$nextTick(() => {
const tooltip = vm.$el.querySelector('.fa-question-circle'); const tooltip = vm.$el.querySelector('[data-testid="question-o-icon"]');
expect(vm.$el.textContent).toContain('Deletes source branch'); expect(vm.$el.textContent).toContain('Deletes source branch');
expect(tooltip.getAttribute('data-original-title')).toBe( expect(tooltip.getAttribute('data-original-title')).toBe(
......
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