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

Enable capa problem editor for components in libraries [FC-0062] #1290

Merged

Conversation

bradenmacdonald
Copy link
Contributor

@bradenmacdonald bradenmacdonald commented Sep 17, 2024

Description

Implements #1086

Builds on #1280 and can't merge until after that one is merged.

Private ref: FAL-382

Testing instructions

  1. Use the problem editor in a course, both to edit an existing problem and create a new problem.
  2. Use the problem editor in a v2 library, both to edit an existing problem and create a new problem.

TODO

  • Solve the problem that components in search results aren't updated synchronously after changes are saved. done separate in edx-platform PR
  • Remember to change the target branch to master before merging.

@bradenmacdonald bradenmacdonald requested a review from a team as a code owner September 17, 2024 02:18
@openedx-webhooks
Copy link

openedx-webhooks commented Sep 17, 2024

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.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Sep 17, 2024
@bradenmacdonald bradenmacdonald added the FC Relates to an Axim Funded Contribution project label Sep 17, 2024
interface AssetResponse {
assets: Record<string, string>[]; // In the raw response here, these are NOT camel-cased yet.
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of the functions below are unchanged other than adding types - I just had to move them higher up in the file.

};

export default Object.keys(apiMethods).reduce(
(obj, key) => ({ ...obj, [key]: checkMockApi(key) }),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This mock API was for the preview server that existed in frontend-lib-content-components. Last time I tried it, it wasn't working at all, and now that we've moved the code to frontend-app-authoring, it doesn't even exist. So I deleted the unused mockApi code.


export default {
videoDataProps,
problemDataProps,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These weren't used anymore (?), but they look like they'll be useful if/when we add more types to these APIs / to the redux state, so I kept the info here, just commented out.

@bradenmacdonald bradenmacdonald marked this pull request as draft September 17, 2024 02:23
@bradenmacdonald bradenmacdonald force-pushed the braden/edit-problems-in-library branch 3 times, most recently from 3b6947e to 4e6f3bd Compare September 17, 2024 20:35
@bradenmacdonald bradenmacdonald marked this pull request as ready for review September 17, 2024 20:36
@bradenmacdonald bradenmacdonald requested review from pomegranited and removed request for a team September 17, 2024 20:36
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 99.14530% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.47%. Comparing base (b010909) to head (d7e185b).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/library-authoring/LibraryLayout.tsx 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1290      +/-   ##
==========================================
+ Coverage   92.38%   92.47%   +0.08%     
==========================================
  Files        1023     1025       +2     
  Lines       18930    18977      +47     
  Branches     3967     4036      +69     
==========================================
+ Hits        17489    17549      +60     
+ Misses       1376     1363      -13     
  Partials       65       65              

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

Copy link
Contributor

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

👍 Working perfectly @bradenmacdonald .

There's some code comments in the tests that need updating, and I have one suggestion around parsing opaque keys, but it shouldn't block merging.

  • I tested this using the PR test instructions.
  • I read through the code
  • I checked for accessibility issues by using my keyboard only to navigate the screens.
  • Includes documentation -- code comments mark out TODOs and odd behaviours.
  • User-facing strings are extracted for translation N/A

Comment on lines +92 to +94
// Though first we need to fake the request or else the problem type selection UI won't display:
dispatch(actions.requests.completeRequest({ requestKey: RequestKeys.fetchAdvancedSettings, response: {} }));
Copy link
Contributor

Choose a reason for hiding this comment

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

😮

src/editors/data/services/cms/api.ts Outdated Show resolved Hide resolved
src/library-authoring/components/utils.test.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@ChrisChV ChrisChV left a comment

Choose a reason for hiding this comment

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

@bradenmacdonald Looks good 👍

@bradenmacdonald bradenmacdonald changed the base branch from braden/problem-editor-warnings to master September 18, 2024 17:09
@bradenmacdonald bradenmacdonald enabled auto-merge (squash) September 18, 2024 17:39
@bradenmacdonald bradenmacdonald merged commit 314dfa6 into openedx:master Sep 18, 2024
5 checks passed
@bradenmacdonald bradenmacdonald deleted the braden/edit-problems-in-library branch September 18, 2024 18:10
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.

4 participants