Commit bf7589ad authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'cngo-add-aria-labels-to-icon-only-buttons-ee' into 'master'

Add aria labels to icon-only buttons

See merge request gitlab-org/gitlab!58460
parents c917b53d 901cdb20
...@@ -4,6 +4,10 @@ import { __ } from '~/locale'; ...@@ -4,6 +4,10 @@ import { __ } from '~/locale';
import { STAGE_SORT_DIRECTION } from './constants'; import { STAGE_SORT_DIRECTION } from './constants';
export default { export default {
i18n: {
moveDownLabel: __('Move down'),
moveUpLabel: __('Move up'),
},
name: 'StageFieldActions', name: 'StageFieldActions',
components: { components: {
GlButton, GlButton,
...@@ -61,7 +65,8 @@ export default { ...@@ -61,7 +65,8 @@ export default {
:data-testid="`stage-action-move-down-${index}`" :data-testid="`stage-action-move-down-${index}`"
:disabled="isLastActiveStage" :disabled="isLastActiveStage"
icon="arrow-down" icon="arrow-down"
:title="__('Move down')" :title="$options.i18n.moveDownLabel"
:aria-label="$options.i18n.moveDownLabel"
@click="$emit('move', { index, direction: $options.STAGE_SORT_DIRECTION.DOWN })" @click="$emit('move', { index, direction: $options.STAGE_SORT_DIRECTION.DOWN })"
/> />
<gl-button <gl-button
...@@ -69,13 +74,15 @@ export default { ...@@ -69,13 +74,15 @@ export default {
:data-testid="`stage-action-move-up-${index}`" :data-testid="`stage-action-move-up-${index}`"
:disabled="isFirstActiveStage" :disabled="isFirstActiveStage"
icon="arrow-up" icon="arrow-up"
:title="__('Move up')" :title="$options.i18n.moveUpLabel"
:aria-label="$options.i18n.moveUpLabel"
@click="$emit('move', { index, direction: $options.STAGE_SORT_DIRECTION.UP })" @click="$emit('move', { index, direction: $options.STAGE_SORT_DIRECTION.UP })"
/> />
</gl-button-group> </gl-button-group>
<gl-button <gl-button
v-gl-tooltip v-gl-tooltip
:title="hideActionTooltip" :title="hideActionTooltip"
:aria-label="hideActionTooltip"
:data-testid="hideActionTestId" :data-testid="hideActionTestId"
:icon="hideActionIcon" :icon="hideActionIcon"
@click="$emit(hideActionEvent, index)" @click="$emit(hideActionEvent, index)"
......
...@@ -244,6 +244,7 @@ export default { ...@@ -244,6 +244,7 @@ export default {
:disabled="isCurrentGroup(item)" :disabled="isCurrentGroup(item)"
category="tertiary" category="tertiary"
icon="remove" icon="remove"
:aria-label="$options.i18n.removeButton"
@click="setSelectedSegment(item)" @click="setSelectedSegment(item)"
/> />
</span> </span>
......
...@@ -32,6 +32,9 @@ export default { ...@@ -32,6 +32,9 @@ export default {
chevronIcon() { chevronIcon() {
return this.collapsed ? 'chevron-right' : 'chevron-down'; return this.collapsed ? 'chevron-right' : 'chevron-down';
}, },
chevronLabel() {
return this.collapsed ? __('Expand') : __('Collapse');
},
statusCheckTimestamp() { statusCheckTimestamp() {
return this.node.lastSuccessfulStatusCheckTimestamp * 1000; return this.node.lastSuccessfulStatusCheckTimestamp * 1000;
}, },
...@@ -49,6 +52,7 @@ export default { ...@@ -49,6 +52,7 @@ export default {
category="tertiary" category="tertiary"
variant="confirm" variant="confirm"
:icon="chevronIcon" :icon="chevronIcon"
:aria-label="chevronLabel"
@click="$emit('collapse')" @click="$emit('collapse')"
/> />
<div <div
......
...@@ -182,6 +182,7 @@ export default { ...@@ -182,6 +182,7 @@ export default {
<gl-button <gl-button
v-gl-tooltip.hover v-gl-tooltip.hover
:title="$options.i18n.fetchIssueTypesButtonLabel" :title="$options.i18n.fetchIssueTypesButtonLabel"
:aria-label="$options.i18n.fetchIssueTypesButtonLabel"
:disabled="!projectKey" :disabled="!projectKey"
icon="retry" icon="retry"
data-testid="fetch-issue-types" data-testid="fetch-issue-types"
......
...@@ -133,6 +133,7 @@ export default { ...@@ -133,6 +133,7 @@ export default {
v-if="canUpdate" v-if="canUpdate"
class="gl-ml-auto" class="gl-ml-auto"
icon="remove" icon="remove"
:aria-label="__('Delete')"
data-testid="delete-button" data-testid="delete-button"
@click="modalVisible = true" @click="modalVisible = true"
/> />
......
...@@ -9,8 +9,12 @@ import { ...@@ -9,8 +9,12 @@ import {
GlTooltipDirective, GlTooltipDirective,
} from '@gitlab/ui'; } from '@gitlab/ui';
import fuzzaldrinPlus from 'fuzzaldrin-plus'; import fuzzaldrinPlus from 'fuzzaldrin-plus';
import { s__ } from '~/locale';
export default { export default {
i18n: {
editProfileLabel: s__('DastProfiles|Edit profile'),
},
name: 'OnDemandScansProfileSelector', name: 'OnDemandScansProfileSelector',
components: { components: {
GlButton, GlButton,
...@@ -125,7 +129,8 @@ export default { ...@@ -125,7 +129,8 @@ export default {
v-gl-tooltip v-gl-tooltip
category="primary" category="primary"
icon="pencil" icon="pencil"
:title="s__('DastProfiles|Edit profile')" :title="$options.i18n.editProfileLabel"
:aria-label="$options.i18n.editProfileLabel"
:href="selectedProfile.editPath" :href="selectedProfile.editPath"
class="gl-absolute gl-right-7" class="gl-absolute gl-right-7"
/> />
......
...@@ -25,6 +25,8 @@ export const i18n = { ...@@ -25,6 +25,8 @@ export const i18n = {
deleteScheduleLabel: s__('OnCallSchedules|Delete schedule'), deleteScheduleLabel: s__('OnCallSchedules|Delete schedule'),
rotationTitle: s__('OnCallSchedules|Rotations'), rotationTitle: s__('OnCallSchedules|Rotations'),
addARotation: s__('OnCallSchedules|Add a rotation'), addARotation: s__('OnCallSchedules|Add a rotation'),
viewPreviousTimeframe: s__('OnCallSchedules|View previous timeframe'),
viewNextTimeframe: s__('OnCallSchedules|View next timeframe'),
presetTypeLabels: { presetTypeLabels: {
DAYS: s__('OnCallSchedules|1 day'), DAYS: s__('OnCallSchedules|1 day'),
WEEKS: s__('OnCallSchedules|2 weeks'), WEEKS: s__('OnCallSchedules|2 weeks'),
...@@ -211,12 +213,14 @@ export default { ...@@ -211,12 +213,14 @@ export default {
data-testid="previous-timeframe-btn" data-testid="previous-timeframe-btn"
icon="chevron-left" icon="chevron-left"
:disabled="loading" :disabled="loading"
:aria-label="$options.i18n.viewPreviousTimeframe"
@click="updateToViewPreviousTimeframe" @click="updateToViewPreviousTimeframe"
/> />
<gl-button <gl-button
data-testid="next-timeframe-btn" data-testid="next-timeframe-btn"
icon="chevron-right" icon="chevron-right"
:disabled="loading" :disabled="loading"
:aria-label="$options.i18n.viewNextTimeframe"
@click="updateToViewNextTimeframe" @click="updateToViewNextTimeframe"
/> />
</gl-button-group> </gl-button-group>
......
<script> <script>
import { GlPopover, GlLink, GlAvatar, GlButton, GlTooltipDirective } from '@gitlab/ui'; import { GlPopover, GlLink, GlAvatar, GlButton, GlTooltipDirective } from '@gitlab/ui';
import { __ } from '~/locale';
import timeagoMixin from '~/vue_shared/mixins/timeago'; import timeagoMixin from '~/vue_shared/mixins/timeago';
import { FilterState } from '../constants'; import { FilterState } from '../constants';
...@@ -7,6 +8,10 @@ import RequirementMeta from '../mixins/requirement_meta'; ...@@ -7,6 +8,10 @@ import RequirementMeta from '../mixins/requirement_meta';
import RequirementStatusBadge from './requirement_status_badge.vue'; import RequirementStatusBadge from './requirement_status_badge.vue';
export default { export default {
i18n: {
archiveLabel: __('Archive'),
editLabel: __('Edit'),
},
components: { components: {
GlPopover, GlPopover,
GlLink, GlLink,
...@@ -130,7 +135,8 @@ export default { ...@@ -130,7 +135,8 @@ export default {
<gl-button <gl-button
v-gl-tooltip v-gl-tooltip
icon="pencil" icon="pencil"
:title="__('Edit')" :title="$options.i18n.editLabel"
:aria-label="$options.i18n.editLabel"
@click="$emit('edit-click', requirement)" @click="$emit('edit-click', requirement)"
/> />
</li> </li>
...@@ -140,7 +146,8 @@ export default { ...@@ -140,7 +146,8 @@ export default {
v-gl-tooltip v-gl-tooltip
icon="archive" icon="archive"
:loading="stateChangeRequestActive" :loading="stateChangeRequestActive"
:title="__('Archive')" :title="$options.i18n.archiveLabel"
:aria-label="$options.i18n.archiveLabel"
@click.stop="handleArchiveClick" @click.stop="handleArchiveClick"
/> />
</li> </li>
......
<script> <script>
import { GlBadge, GlButton, GlButtonGroup, GlTabs, GlTab, GlTooltipDirective } from '@gitlab/ui'; import { GlBadge, GlButton, GlButtonGroup, GlTabs, GlTab, GlTooltipDirective } from '@gitlab/ui';
import { __ } from '~/locale';
import { FilterState } from '../constants'; import { FilterState } from '../constants';
export default { export default {
i18n: {
exportAsCsvLabel: __('Export as CSV'),
importRequirementsLabel: __('Import requirements'),
},
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
...@@ -87,7 +91,8 @@ export default { ...@@ -87,7 +91,8 @@ export default {
<gl-button-group> <gl-button-group>
<gl-button <gl-button
v-gl-tooltip v-gl-tooltip
:title="__('Export as CSV')" :title="$options.i18n.exportAsCsvLabel"
:aria-label="$options.i18n.exportAsCsvLabel"
category="secondary" category="secondary"
:disabled="showCreateForm" :disabled="showCreateForm"
icon="export" icon="export"
...@@ -95,7 +100,8 @@ export default { ...@@ -95,7 +100,8 @@ export default {
/> />
<gl-button <gl-button
v-gl-tooltip v-gl-tooltip
:title="__('Import requirements')" :title="$options.i18n.importRequirementsLabel"
:aria-label="$options.i18n.importRequirementsLabel"
category="secondary" category="secondary"
class="js-import-requirements qa-import-requirements-button" class="js-import-requirements qa-import-requirements-button"
:disabled="showCreateForm" :disabled="showCreateForm"
......
...@@ -254,6 +254,7 @@ export default { ...@@ -254,6 +254,7 @@ export default {
data-testid="dast-profile-delete-button" data-testid="dast-profile-delete-button"
:disabled="isPolicyProfile(item)" :disabled="isPolicyProfile(item)"
:aria-disabled="isPolicyProfile(item)" :aria-disabled="isPolicyProfile(item)"
:aria-label="s__('DastProfiles|Delete profile')"
@click="prepareProfileDeletion(item.id)" @click="prepareProfileDeletion(item.id)"
/> />
</span> </span>
......
<script> <script>
import { GlBadge, GlButton, GlLoadingIcon, GlTooltipDirective } from '@gitlab/ui'; import { GlBadge, GlButton, GlLoadingIcon, GlTooltipDirective } from '@gitlab/ui';
import { s__ } from '~/locale';
import ProjectAvatar from '~/vue_shared/components/project_avatar/default.vue'; import ProjectAvatar from '~/vue_shared/components/project_avatar/default.vue';
export default { export default {
i18n: {
removeLabel: s__('SecurityReports|Remove project from dashboard'),
},
components: { components: {
GlBadge, GlBadge,
GlButton, GlButton,
...@@ -52,7 +56,8 @@ export default { ...@@ -52,7 +56,8 @@ export default {
v-gl-tooltip v-gl-tooltip
icon="remove" icon="remove"
class="gl-ml-auto js-projects-list-project-remove" class="gl-ml-auto js-projects-list-project-remove"
:title="s__('SecurityReports|Remove project from dashboard')" :title="$options.i18n.removeLabel"
:aria-label="$options.i18n.removeLabel"
@click="projectRemoved(project)" @click="projectRemoved(project)"
/> />
</li> </li>
......
...@@ -127,6 +127,7 @@ export default { ...@@ -127,6 +127,7 @@ export default {
data-testid="remove-alert" data-testid="remove-alert"
icon="remove" icon="remove"
category="tertiary" category="tertiary"
:aria-label="__('Remove')"
@click="$emit('update-alert', !policyAlert)" @click="$emit('update-alert', !policyAlert)"
/> />
</div> </div>
......
...@@ -241,6 +241,7 @@ export default { ...@@ -241,6 +241,7 @@ export default {
icon="remove" icon="remove"
category="tertiary" category="tertiary"
class="gl-absolute gl-top-3 gl-right-3" class="gl-absolute gl-top-3 gl-right-3"
:aria-label="__('Remove')"
data-testid="remove-rule" data-testid="remove-rule"
@click="$emit('remove')" @click="$emit('remove')"
/> />
......
...@@ -184,6 +184,7 @@ export default { ...@@ -184,6 +184,7 @@ export default {
<gl-button <gl-button
v-gl-tooltip:tooltipcontainer.left v-gl-tooltip:tooltipcontainer.left
:title="$options.i18n.discoverFeedbackLabel" :title="$options.i18n.discoverFeedbackLabel"
:aria-label="$options.i18n.discoverFeedbackLabel"
icon="slight-smile" icon="slight-smile"
size="medium" size="medium"
class="discover-feedback-icon" class="discover-feedback-icon"
......
...@@ -90,6 +90,7 @@ export default { ...@@ -90,6 +90,7 @@ export default {
category="tertiary" category="tertiary"
:icon="button.iconName" :icon="button.iconName"
:title="button.title" :title="button.title"
:aria-label="button.title"
@click="button.onClick" @click="button.onClick"
/> />
</div> </div>
......
---
title: Add aria labels to icon-only buttons
merge_request: 58460
author:
type: fixed
...@@ -291,6 +291,7 @@ exports[`OnDemandScansScannerProfileSelector renders properly with profiles 1`] ...@@ -291,6 +291,7 @@ exports[`OnDemandScansScannerProfileSelector renders properly with profiles 1`]
data-testid="selected-profile-summary" data-testid="selected-profile-summary"
> >
<a <a
aria-label="Edit profile"
class="btn gl-absolute gl-right-7 btn-default btn-md gl-button btn-icon" class="btn gl-absolute gl-right-7 btn-default btn-md gl-button btn-icon"
href="/scanner_profile/edit/1" href="/scanner_profile/edit/1"
title="Edit profile" title="Edit profile"
......
...@@ -291,6 +291,7 @@ exports[`OnDemandScansSiteProfileSelector renders properly with profiles 1`] = ` ...@@ -291,6 +291,7 @@ exports[`OnDemandScansSiteProfileSelector renders properly with profiles 1`] = `
data-testid="selected-profile-summary" data-testid="selected-profile-summary"
> >
<a <a
aria-label="Edit profile"
class="btn gl-absolute gl-right-7 btn-default btn-md gl-button btn-icon" class="btn gl-absolute gl-right-7 btn-default btn-md gl-button btn-icon"
href="/site_profiles/edit/1" href="/site_profiles/edit/1"
title="Edit profile" title="Edit profile"
......
...@@ -81,6 +81,7 @@ exports[`Event Item with action buttons renders the action buttons 1`] = ` ...@@ -81,6 +81,7 @@ exports[`Event Item with action buttons renders the action buttons 1`] = `
class="gl-flex-shrink-0 gl-align-self-start" class="gl-flex-shrink-0 gl-align-self-start"
> >
<button <button
aria-label="Foo Action"
class="btn btn-default btn-md gl-button btn-default-tertiary btn-icon" class="btn btn-default btn-md gl-button btn-default-tertiary btn-icon"
title="Foo Action" title="Foo Action"
type="button" type="button"
...@@ -100,6 +101,7 @@ exports[`Event Item with action buttons renders the action buttons 1`] = ` ...@@ -100,6 +101,7 @@ exports[`Event Item with action buttons renders the action buttons 1`] = `
<!----> <!---->
</button> </button>
<button <button
aria-label="Bar Action"
class="btn btn-default btn-md gl-button btn-default-tertiary btn-icon" class="btn btn-default btn-md gl-button btn-default-tertiary btn-icon"
title="Bar Action" title="Bar Action"
type="button" type="button"
......
...@@ -21675,6 +21675,12 @@ msgstr "" ...@@ -21675,6 +21675,12 @@ msgstr ""
msgid "OnCallSchedules|Try adding a rotation" msgid "OnCallSchedules|Try adding a rotation"
msgstr "" msgstr ""
msgid "OnCallSchedules|View next timeframe"
msgstr ""
msgid "OnCallSchedules|View previous timeframe"
msgstr ""
msgid "OnCallSchedules|Your schedule has been successfully created and all alerts from this project will now be routed to this schedule. Currently, only one schedule can be created per project. More coming soon! To add individual users to this schedule, use the add a rotation button." msgid "OnCallSchedules|Your schedule has been successfully created and all alerts from this project will now be routed to this schedule. Currently, only one schedule can be created per project. More coming soon! To add individual users to this schedule, use the add a rotation button."
msgstr "" msgstr ""
......
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