FIX: Update aria-labels on mobile / dropdown (#254)

- Update aria labels on mobile and for re-assign dropdown
- Fixes: https://dev.discourse.org/t/quicker-assign-to-self-when-group-is-assigned/54647/33?u=isaacjanzen
This commit is contained in:
janzenisaac 2021-11-19 11:55:14 -06:00 committed by GitHub
parent cb0a65b844
commit 09d254b369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 7 deletions

View File

@ -129,7 +129,12 @@ function registerTopicFooterButtons(api) {
const content = [
{
id: "unassign",
name: htmlSafe(
name: I18n.t("discourse_assign.unassign.help", {
username:
this.topic.assigned_to_user?.username ||
this.topic.assigned_to_group?.name,
}),
label: htmlSafe(
`${iconHTML("user-times")} ${I18n.t(
"discourse_assign.unassign.title"
)}`
@ -143,7 +148,8 @@ function registerTopicFooterButtons(api) {
) {
content.push({
id: "reassign-self",
name: htmlSafe(
name: I18n.t("discourse_assign.reassign.to_self_help"),
label: htmlSafe(
`${iconHTML("user-plus")} ${I18n.t(
"discourse_assign.reassign.to_self"
)}`
@ -152,7 +158,8 @@ function registerTopicFooterButtons(api) {
}
content.push({
id: "reassign",
name: htmlSafe(
name: I18n.t("discourse_assign.reassign.help"),
label: htmlSafe(
`${iconHTML("group-plus")} ${I18n.t(
"discourse_assign.reassign.title_w_ellipsis"
)}`
@ -311,10 +318,10 @@ function registerTopicFooterButtons(api) {
return "user-plus";
},
translatedTitle() {
return defaultTitle(this);
return I18n.t("discourse_assign.reassign.to_self_help");
},
translatedAriaLabel() {
return defaultTitle(this);
return I18n.t("discourse_assign.reassign.to_self_help");
},
translatedLabel() {
const label = I18n.t("discourse_assign.reassign.to_self");
@ -361,10 +368,10 @@ function registerTopicFooterButtons(api) {
return "group-plus";
},
translatedTitle() {
return defaultTitle(this);
return I18n.t("discourse_assign.reassign.help");
},
translatedAriaLabel() {
return defaultTitle(this);
return I18n.t("discourse_assign.reassign.help");
},
translatedLabel() {
const label = I18n.t("discourse_assign.reassign.title_w_ellipsis");

View File

@ -43,6 +43,7 @@ en:
title: "Re-assign"
title_w_ellipsis: "Re-assign to..."
to_self: "Re-assign to me"
to_self_help: "Re-assign Topic to me"
help: "Re-assign Topic to a different user"
reassign_modal:
title: "Re-assign Topic"