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

Convert masquerade UI widgets to Function Components + TypeScript #1513

Merged
merged 5 commits into from
Dec 4, 2024

Conversation

bradenmacdonald
Copy link
Contributor

The masquerade UI widget:

Screenshot of the masquerade UI

... is using old-fashioned class-based components and JavaScript. In this PR I have modernized it, converting it to TypeScript and Function Components.

There should be no changes to the functionality, but the code should be much easier to understand.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 6, 2024
@openedx-webhooks
Copy link

Thanks for the pull request, @bradenmacdonald!

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/committers-frontend-app-learning. 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.

@bradenmacdonald
Copy link
Contributor Author

@farhaanbukhsh could you please review this?

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 10 lines in your changes missing coverage. Please review.

Project coverage is 89.76%. Comparing base (98c670a) to head (c6dd302).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...tor-toolbar/masquerade-widget/MasqueradeWidget.tsx 88.63% 5 Missing ⚠️
...olbar/masquerade-widget/MasqueradeWidgetOption.tsx 83.87% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1513      +/-   ##
==========================================
+ Coverage   89.25%   89.76%   +0.51%     
==========================================
  Files         318      319       +1     
  Lines        5565     5559       -6     
  Branches     1377     1388      +11     
==========================================
+ Hits         4967     4990      +23     
+ Misses        582      553      -29     
  Partials       16       16              

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

@farhaanbukhsh
Copy link
Member

farhaanbukhsh commented Nov 13, 2024

@bradenmacdonald will do and I am willing to make these changes in Gradebook MFE but I am wondering who can review these?

@bradenmacdonald
Copy link
Contributor Author

@farhaanbukhsh I'm not sure who maintains the gradebook MFE, but I'm always happy to review TypeScript conversion PRs and I'm a Core Contributor on any frontend repos including all MFEs.

@farhaanbukhsh
Copy link
Member

I'm not sure who maintains the gradebook MFE, but I'm always happy to review TypeScript conversion PRs and I'm a Core Contributor on any frontend repos including all MFEs.

I am the one maintaining it but I need someone who can review those changes :) thanks a lot for the help.

@itsjeyd itsjeyd added the core contributor PR author is a Core Contributor (who may or may not have write access to this repo). label Nov 21, 2024
@itsjeyd itsjeyd added the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label Nov 21, 2024
Copy link
Member

@farhaanbukhsh farhaanbukhsh left a comment

Choose a reason for hiding this comment

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

@bradenmacdonald would it be possible to pass patch coverage, there are a few conditionals that can be tested, and it will be good to have, otherwise it looks good.

@bradenmacdonald
Copy link
Contributor Author

@farhaanbukhsh Ah, right. I was planning to come back and improve the coverage but kept procrastinating. Now I've added some more tests and got the patch coverage up. I had to make some unrelated cleanups in a few other places/tests at the same time. Please check it out and let me know if this is good to merge!

@farhaanbukhsh
Copy link
Member

@bradenmacdonald The other thing here which is looking a little off to me is the use of .then here, this can be handled very differently in the API layer but I think we can do that later. I can take a stab at this. :)

Thanks for the work here. 😄

Copy link
Member

@farhaanbukhsh farhaanbukhsh left a comment

Choose a reason for hiding this comment

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

👍

  • ✅ I tested this on Tutor devstack
  • ✅ I read through the code
  • ❌ I checked for accessibility issues
  • ❌ Includes documentation
  • ❌ I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.

@farhaanbukhsh farhaanbukhsh merged commit 4a925f9 into openedx:master Dec 4, 2024
7 checks passed
@bradenmacdonald bradenmacdonald deleted the ts-masquerade branch December 4, 2024 17:09
@itsjeyd itsjeyd removed the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants