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

feat: edit Text components within content libraries [FC-0062] #1240

Merged
merged 20 commits into from
Sep 13, 2024

Conversation

bradenmacdonald
Copy link
Contributor

@bradenmacdonald bradenmacdonald commented Aug 29, 2024

Description

This implements #1090 so that Text (html) components can be edited within v2 content libraries.

Supporting information

Testing instructions

  1. Create a Text component in a library
  2. Edit it.

Other information

Private ref: FAL-3819

TODOs before merge:

  • update tests
  • add new tests
  • when creating a new Text component, open the editor right away

@bradenmacdonald bradenmacdonald requested a review from a team as a code owner August 29, 2024 19:36
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 29, 2024
@bradenmacdonald bradenmacdonald changed the title feat: edit Text components within content libraries feat: edit Text components within content libraries [FC-0062] Aug 29, 2024
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Aug 29, 2024
@bradenmacdonald bradenmacdonald force-pushed the braden/library-text-editor branch from 0720d11 to ac85a40 Compare August 29, 2024 21:38
@bradenmacdonald bradenmacdonald force-pushed the braden/library-text-editor branch 3 times, most recently from 7147905 to 27232b7 Compare September 6, 2024 20:36
Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 97.16981% with 3 lines in your changes missing coverage. Please review.

Project coverage is 92.31%. Comparing base (9b61037) to head (0ed2c2a).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/library-authoring/data/api.ts 60.00% 2 Missing ⚠️
src/library-authoring/data/apiHooks.ts 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1240      +/-   ##
==========================================
+ Coverage   92.25%   92.31%   +0.05%     
==========================================
  Files        1011     1013       +2     
  Lines       18654    18733      +79     
  Branches     3931     4008      +77     
==========================================
+ Hits        17210    17293      +83     
+ Misses       1378     1374       -4     
  Partials       66       66              

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

@openedx openedx deleted a comment from openedx-webhooks Sep 9, 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/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.

@bradenmacdonald bradenmacdonald force-pushed the braden/library-text-editor branch 2 times, most recently from 0972265 to cc90757 Compare September 10, 2024 18:22
Copy link
Contributor

@rpenido rpenido left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Thank you for your work, @bradenmacdonald!
Great work here! I left some non-blocking comments. Feel free to push back if you don't agree.

  • I tested this using the instructions from the PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

I found some warnings in the console while opening the editor, not directly related to this code:

  • The learningContextId inside the TextEditor is null in the first render (it is injected from the redux store)
Warning: Failed prop type: The prop `learningContextId` is marked as required in `TextEditor`, but its value is `null`.
  • Missing alt in the IconButton at src/editors/containers/EditorContainer/index.jsx:65
Warning: Failed prop type: The prop `alt` is marked as required in `ForwardRef(_c)`, but its value is `undefined`.
Warning: Failed prop type: Invalid prop `children` of type `object` supplied to `Toast`, expected `string`.

src/editors/EditorContainer.tsx Outdated Show resolved Hide resolved
src/library-authoring/components/utils.ts Show resolved Hide resolved
src/library-authoring/components/utils.ts Show resolved Hide resolved
src/library-authoring/data/apiHooks.ts Outdated Show resolved Hide resolved
src/library-authoring/LibraryLayout.tsx Outdated Show resolved Hide resolved
src/library-authoring/component-info/ComponentInfo.tsx Outdated Show resolved Hide resolved
/** Course ID or Library ID */
learningContextId: string;
/** Event handler for when user cancels out of the editor page */
onClose?: () => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

This issue is with the underlying editor, but passing onClose={undefined} here actually crashes the TextEditor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried to address this with 9e62bc0

src/editors/EditorContainer.tsx Outdated Show resolved Hide resolved
src/library-authoring/components/ComponentCard.tsx Outdated Show resolved Hide resolved
@bradenmacdonald bradenmacdonald force-pushed the braden/library-text-editor branch from cc90757 to 7c7dee3 Compare September 11, 2024 16:51
@bradenmacdonald bradenmacdonald force-pushed the braden/library-text-editor branch from f2351be to f5796ac Compare September 11, 2024 18:12
@bradenmacdonald
Copy link
Contributor Author

@ChrisChV Can you please give this a review as CC ?

@bradenmacdonald
Copy link
Contributor Author

@rpenido Thank you for the very nice review! I addressed all your comments.

@bradenmacdonald bradenmacdonald force-pushed the braden/library-text-editor branch from d7bdd91 to f4cbca8 Compare September 11, 2024 20:55
@bradenmacdonald bradenmacdonald force-pushed the braden/library-text-editor branch from f4cbca8 to ff05d2d Compare September 11, 2024 21:07
@bradenmacdonald bradenmacdonald force-pushed the braden/library-text-editor branch from ff05d2d to be9d01b Compare September 11, 2024 21:26
@bradenmacdonald bradenmacdonald merged commit fd48fef into openedx:master Sep 13, 2024
7 checks passed
@bradenmacdonald bradenmacdonald deleted the braden/library-text-editor branch September 13, 2024 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants