Content Libraries: Advanced Component Info & OLX Editor [FC-0062] - #1346
Conversation
|
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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf 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 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1346 +/- ##
==========================================
- Coverage 92.97% 92.94% -0.04%
==========================================
Files 1036 1037 +1
Lines 19427 19509 +82
Branches 4131 4084 -47
==========================================
+ Hits 18063 18133 +70
- Misses 1299 1313 +14
+ Partials 65 63 -2 ☔ View full report in Codecov by Sentry. |
bc07fcb to
581189a
Compare
d729d02 to
15a681e
Compare
15a681e to
b342efd
Compare
8312613 to
f2b5ef7
Compare
f2b5ef7 to
413259e
Compare
rpenido
left a comment
There was a problem hiding this comment.
Hi @bradenmacdonald, this is looking good!
I found a small bug and added one possible solution. Let me know what you think!
| */} | ||
| </Alert> | ||
| )} | ||
| <CodeEditor readOnly={!isEditingOLX} editorRef={editorRef}>{olx}</CodeEditor> |
There was a problem hiding this comment.
Small bug: If you click on another component, the CodeEditor is not updating.
We can fix that making the CodeEditor rerender when we change the usageKey.
| <CodeEditor readOnly={!isEditingOLX} editorRef={editorRef}>{olx}</CodeEditor> | |
| <CodeEditor key={usageKey} readOnly={!isEditingOLX} editorRef={editorRef}>{olx}</CodeEditor> |
| @@ -0,0 +1,55 @@ | |||
| /* eslint-disable import/prefer-default-export */ | |||
There was a problem hiding this comment.
I think this can go as we are also exporting the type here.
| /* eslint-disable import/prefer-default-export */ |
| @@ -0,0 +1,122 @@ | |||
| /* eslint-disable no-nested-ternary */ | |||
| /* eslint-disable import/prefer-default-export */ | |||
There was a problem hiding this comment.
It's not directly related here, but is there a reason why we don't remove this lint rule upstream?
Personally, I also prefer named exports.
There was a problem hiding this comment.
Good point. I guess I've just been lazy, but it's time to do that. openedx/eslint-config#164
| title={intl.formatMessage(messages.advancedDetailsTitle)} | ||
| > | ||
| <dl> | ||
| <dt><FormattedMessage {...messages.advancedDetailsUsageKey} /></dt> |
There was a problem hiding this comment.
Not sure if this matters for the MVP, but we are using a different style across the sidebar
| <dt><FormattedMessage {...messages.advancedDetailsUsageKey} /></dt> | |
| <h3 className="h5"><FormattedMessage {...messages.advancedDetailsUsageKey} /></h3> |
|
@rpenido Thanks! I addressed your comments. |
There was a problem hiding this comment.
LGTM 👍
Thank you for your work, @bradenmacdonald!
- I tested this using the instructions from the PR
- I read through the code
- I checked for accessibility issues
- Includes documentation
CC @ChrisChV
Description
This PR adds a new "Advanced details" section to the "Details" tab of library components in the Authoring MFE. This replaces the previous "developer info" panel that was only visible in development builds. This one is visible to everyone, but hidden behind a collapsible widget.
It includes the OLX editor, with a warning that you need to be very careful using it:
If you make a mistake in the OLX and it's invalid, you'll get an error message like this:
I also added a list of assets, though it depends on this WIP:
TODO before merging
Private ref: FAL-3880