Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix: use aria attribute correctly resolves wg-translations/issue… #1162

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ghassanmas
Copy link
Member

@ghassanmas ghassanmas commented Jul 16, 2024

…s/33

This change correct the usage of aria-* attributes resolves

Description

Before in part of code, aria-describedby and aria-labelledby attributes were treated as having translatable text, which is not correct, since these attributes suppose to link/refer to ids.

This PR resolve the issue by using aria-label, and aria-description instead, which can include raw text.

Note: the eslint role for aria is switched off since, aria-description is a new attribute that is not recgnoized until react>=18 hence this issue in react.

Lastly, aria-descripedby and aria-labelledby could have been used, but that would have require some extensive code change, so that id is passed on the childern of Alret paragon component.

This ready for review

…s/33

  This change correct the usage of aria-* attributes
@ghassanmas ghassanmas requested a review from a team as a code owner July 16, 2024 18:18
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 16, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Jul 16, 2024

Thanks for the pull request, @ghassanmas!

What's next?

Please work through the following steps to get your changes ready for engineering review:

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/2u-tnl. Tag them in a comment and let them know that your changes are ready for review.

Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

Copy link

codecov bot commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.68%. Comparing base (e087001) to head (fadcc6a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1162   +/-   ##
=======================================
  Coverage   92.68%   92.68%           
=======================================
  Files         693      693           
  Lines       12346    12346           
  Branches     2699     2699           
=======================================
  Hits        11443    11443           
  Misses        872      872           
  Partials       31       31           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines -154 to +153
aria-labelledby={intl.formatMessage(messages.alertSuccessAriaLabelledby)}
aria-describedby={intl.formatMessage(messages.alertSuccessAriaDescribedby)}
aria-label={intl.formatMessage(messages.alertSuccess)}
aria-description={intl.formatMessage(messages.alertSuccessDescriptions)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still want to have aria-labelledby here, but just use the element id directly instead of using intl.formatMessage for it

Copy link
Member Author

@ghassanmas ghassanmas Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's one option, the thing is that two ids would need to pass from parent down to Alert componenet, I have an example here 3c5541a , if you think it's okay then I guess we do the same for all other usage?

@bradenmacdonald
Copy link
Contributor

Wow, thanks for cleaning this up @ghassanmas :)

@@ -244,8 +242,8 @@ const AdvancedSettings = ({ intl, courseId }) => {
<AlertMessage
show={saveSettingsPrompt}
aria-hidden={saveSettingsPrompt}
aria-labelledby={intl.formatMessage(messages.alertWarningAriaLabelledby)}
aria-describedby={intl.formatMessage(messages.alertWarningAriaDescribedby)}
aria-labelledby="advancedSettingsAlertWarningTitle"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
aria-labelledby="advancedSettingsAlertWarningTitle"
aria-labelledby="notification-warning-title"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we used have

  alertWarningAriaLabelledby: {
    id: 'course-authoring.advanced-settings.alert.warning.aria.labelledby',
    defaultMessage: 'notification-warning-title',
  },

and then we used that message in

aria-labelledby={intl.formatMessage(messages.alertWarningAriaLabelledby)}

which means this evaluates to

aria-labelledby="notification-warning-title"

@mphilbrick211
Copy link

Hi @ghassanmas! Just checking to see if you're still planning to pursue this pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: In Eng Review
Development

Successfully merging this pull request may close these issues.

5 participants