mirror of
https://github.com/discourse/discourse.git
synced 2025-04-19 06:59:06 +08:00
A11Y: do not default to label for aria-label (#14258)
This commit is contained in:
parent
f513266bcb
commit
d51d94f771
@ -85,15 +85,14 @@ export default Component.extend({
|
||||
return translatedLabel;
|
||||
},
|
||||
|
||||
@discourseComputed("ariaLabel", "translatedAriaLabel", "computedLabel")
|
||||
computedAriaLabel(ariaLabel, translatedAriaLabel, computedLabel) {
|
||||
@discourseComputed("ariaLabel", "translatedAriaLabel")
|
||||
computedAriaLabel(ariaLabel, translatedAriaLabel) {
|
||||
if (ariaLabel) {
|
||||
return I18n.t(ariaLabel);
|
||||
}
|
||||
if (translatedAriaLabel) {
|
||||
return translatedAriaLabel;
|
||||
}
|
||||
return computedLabel;
|
||||
},
|
||||
|
||||
@discourseComputed("ariaExpanded")
|
||||
|
@ -99,7 +99,7 @@ addBulkButton("removeTags", "remove_tags", {
|
||||
});
|
||||
addBulkButton("deleteTopics", "delete", {
|
||||
icon: "trash-alt",
|
||||
class: "btn-danger",
|
||||
class: "btn-danger delete-topics",
|
||||
buttonVisible: function () {
|
||||
return this.currentUser.staff;
|
||||
},
|
||||
|
@ -61,6 +61,9 @@ export default Controller.extend(CanCheckEmails, {
|
||||
isExpanded: !this.collapsedInfo,
|
||||
icon: this.collapsedInfo ? "angle-double-down" : "angle-double-up",
|
||||
label: this.collapsedInfo ? "expand_profile" : "collapse_profile",
|
||||
ariaLabel: this.collapsedInfo
|
||||
? "user.sr_expand_profile"
|
||||
: "user.sr_collapse_profile",
|
||||
action: this.collapsedInfo ? "expandProfile" : "collapseProfile",
|
||||
};
|
||||
}),
|
||||
|
@ -13,5 +13,5 @@
|
||||
|
||||
<div class="modal-footer">
|
||||
{{d-button icon="trash-alt" class="btn-danger" action=(action "perform") label="admin.user.delete"}}
|
||||
{{d-button action=(route-action "closeModal") label="cancel"}}
|
||||
{{d-button action=(route-action "closeModal") label="cancel" class="cancel"}}
|
||||
</div>
|
||||
|
@ -19,7 +19,7 @@
|
||||
{{/each}}
|
||||
|
||||
{{d-button
|
||||
class="btn-default"
|
||||
class="btn-default notify"
|
||||
label="topic.share.notify_users.title"
|
||||
icon="hand-point-right"
|
||||
action=(action "toggleNotifyUsers")
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
{{#if allowInvites}}
|
||||
{{d-button
|
||||
class="btn-default"
|
||||
class="btn-default invite"
|
||||
label="topic.share.invite_users"
|
||||
icon="user-plus"
|
||||
action=(action "inviteUsers")
|
||||
|
@ -82,6 +82,7 @@
|
||||
<li>
|
||||
{{d-button
|
||||
ariaExpanded=collapsedInfoState.isExpanded
|
||||
ariaLabel=collapsedInfoState.ariaLabel
|
||||
ariaControls="collapsed-info-panel"
|
||||
class="btn-default"
|
||||
label=(concat "user." collapsedInfoState.label)
|
||||
|
@ -59,7 +59,7 @@ acceptance("Review", function (needs) {
|
||||
"it opens reject reason modal when user is rejected"
|
||||
);
|
||||
|
||||
await click(".modal-footer button[aria-label='cancel']");
|
||||
await click(".modal-footer .cancel");
|
||||
await reviewableActionDropdown.expand();
|
||||
await reviewableActionDropdown.selectRowByValue("reject_user_block");
|
||||
|
||||
|
@ -31,14 +31,13 @@ acceptance("Share and Invite modal", function (needs) {
|
||||
);
|
||||
|
||||
assert.ok(count("button[class*='share-']") > 1, "it shows social sources");
|
||||
|
||||
assert.ok(
|
||||
exists(".btn[aria-label='Notify']"),
|
||||
exists(".link-share-actions .notify"),
|
||||
"it shows the notify button"
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
exists(".btn[aria-label='Invite']"),
|
||||
exists(".link-share-actions .invite"),
|
||||
"it shows the invite button"
|
||||
);
|
||||
});
|
||||
|
@ -114,7 +114,7 @@ acceptance("Topic - Bulk Actions", function (needs) {
|
||||
await click(queryAll("input.bulk-select")[1]);
|
||||
|
||||
await click(".bulk-select-btn");
|
||||
await click(".modal-body button[aria-label='Delete Topics']");
|
||||
await click(".modal-body .delete-topics");
|
||||
|
||||
assert.ok(
|
||||
invisible(".topic-bulk-actions-modal"),
|
||||
|
@ -1040,7 +1040,9 @@ en:
|
||||
use_current_timezone: "Use Current Timezone"
|
||||
profile_hidden: "This user's public profile is hidden."
|
||||
expand_profile: "Expand"
|
||||
sr_expand_profile: "Expand profile details"
|
||||
collapse_profile: "Collapse"
|
||||
sr_collapse_profile: "Collapse profile details"
|
||||
bookmarks: "Bookmarks"
|
||||
bio: "About me"
|
||||
timezone: "Timezone"
|
||||
|
Loading…
x
Reference in New Issue
Block a user