Skip to content
代码片段 群组 项目
未验证 提交 3f412a04 编辑于 作者: Deepika Guliani's avatar Deepika Guliani 提交者: GitLab
浏览文件

Merge branch 'justin_ho-fix-a11y-issues-with-duo-workflow' into 'master'

Duo Workflow: Update aria-label of buttons in VSA form

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181417



Merged-by: default avatarDeepika Guliani <dguliani@gitlab.com>
Approved-by: default avatarDeepika Guliani <dguliani@gitlab.com>
Reviewed-by: default avatarJustin Ho Tuan Duong <hduong@gitlab.com>
Co-authored-by: default avatarJustin Ho Tuan Duong <hduong@gitlab.com>
No related branches found
No related tags found
2 合并请求!3031Merge per-main-jh to main-jh by luzhiyuan,!3030Merge per-main-jh to main-jh
<script> <script>
import { GlButton, GlTooltipDirective } from '@gitlab/ui'; import { GlButton, GlTooltipDirective } from '@gitlab/ui';
import { __ } from '~/locale'; import { __, s__, sprintf } from '~/locale';
export default { export default {
name: 'StageFieldActions', name: 'StageFieldActions',
...@@ -28,6 +28,12 @@ export default { ...@@ -28,6 +28,12 @@ export default {
hideActionTooltip() { hideActionTooltip() {
return this.canRemove ? __('Remove') : __('Hide'); return this.canRemove ? __('Remove') : __('Hide');
}, },
hideActionAriaLabel() {
return sprintf(s__('CreateValueStreamForm|%{action} stage %{index}'), {
action: this.hideActionTooltip,
index: this.index + 1,
});
},
hideActionIcon() { hideActionIcon() {
return this.canRemove ? 'remove' : 'eye-slash'; return this.canRemove ? 'remove' : 'eye-slash';
}, },
...@@ -43,7 +49,7 @@ export default { ...@@ -43,7 +49,7 @@ export default {
v-gl-tooltip v-gl-tooltip
category="tertiary" category="tertiary"
:title="hideActionTooltip" :title="hideActionTooltip"
:aria-label="hideActionTooltip" :aria-label="hideActionAriaLabel"
:data-testid="hideActionTestId" :data-testid="hideActionTestId"
:icon="hideActionIcon" :icon="hideActionIcon"
@click="$emit(hideActionEvent, index)" @click="$emit(hideActionEvent, index)"
......
<script> <script>
import { GlButton, GlButtonGroup } from '@gitlab/ui'; import { GlButton, GlButtonGroup } from '@gitlab/ui';
import { __ } from '~/locale'; import { __, s__, sprintf } from '~/locale';
import { STAGE_SORT_DIRECTION } from '../constants'; import { STAGE_SORT_DIRECTION } from '../constants';
export default { export default {
...@@ -33,6 +33,18 @@ export default { ...@@ -33,6 +33,18 @@ export default {
isLastActiveStage() { isLastActiveStage() {
return this.index === this.lastStageIndex; return this.index === this.lastStageIndex;
}, },
moveDownAriaLabel() {
return sprintf(s__('CreateValueStreamForm|%{action} stage %{index}'), {
action: this.$options.i18n.moveDownLabel,
index: this.index + 1,
});
},
moveUpAriaLabel() {
return sprintf(s__('CreateValueStreamForm|%{action} stage %{index}'), {
action: this.$options.i18n.moveUpLabel,
index: this.index + 1,
});
},
}, },
STAGE_SORT_DIRECTION, STAGE_SORT_DIRECTION,
}; };
...@@ -46,7 +58,7 @@ export default { ...@@ -46,7 +58,7 @@ export default {
:disabled="isFirstActiveStage" :disabled="isFirstActiveStage"
icon="chevron-up" icon="chevron-up"
:title="$options.i18n.moveUpLabel" :title="$options.i18n.moveUpLabel"
:aria-label="$options.i18n.moveUpLabel" :aria-label="moveUpAriaLabel"
@click="$emit('move', { index, direction: $options.STAGE_SORT_DIRECTION.UP })" @click="$emit('move', { index, direction: $options.STAGE_SORT_DIRECTION.UP })"
/> />
<gl-button <gl-button
...@@ -55,7 +67,7 @@ export default { ...@@ -55,7 +67,7 @@ export default {
:disabled="isLastActiveStage" :disabled="isLastActiveStage"
icon="chevron-down" icon="chevron-down"
:title="$options.i18n.moveDownLabel" :title="$options.i18n.moveDownLabel"
:aria-label="$options.i18n.moveDownLabel" :aria-label="moveDownAriaLabel"
@click="$emit('move', { index, direction: $options.STAGE_SORT_DIRECTION.DOWN })" @click="$emit('move', { index, direction: $options.STAGE_SORT_DIRECTION.DOWN })"
/> />
</gl-button-group> </gl-button-group>
......
...@@ -17418,6 +17418,9 @@ msgstr "" ...@@ -17418,6 +17418,9 @@ msgstr ""
msgid "CreateTimelogForm|Time spent" msgid "CreateTimelogForm|Time spent"
msgstr "" msgstr ""
   
msgid "CreateValueStreamForm|%{action} stage %{index}"
msgstr ""
msgid "CreateValueStreamForm|%{name} (default)" msgid "CreateValueStreamForm|%{name} (default)"
msgstr "" msgstr ""
   
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册