-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Use html block base for About, StaticTab, CourseInfo #37757
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for the pull request, @salman2013! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are 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. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. 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. |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment failed 💥 |
|
Sandbox deployment failed 💥 |
|
Sandbox deployment failed 💥 |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment failed 💥 |
|
Sandbox deployment successful 🚀 |
feanil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in html_block.py make sense but I need some more explanations of the other changes.
|
|
||
| # Convert None or empty string to empty dict for consistency | ||
| # empty string means no template data was found | ||
| return overview_value or {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a change to the course detail serializer, can you explain why you're making this change? This would impact what people expect as output from an LMS REST API endpoint which could break 3rd party integrations that rely on this API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Background thoughts on this change:
In LMS multiple tests were failing after using extracted html xblock for AboutBlock.
It failed to find get_template here in this line
overview_template = about_block.get_template('overview.yaml')
As for extracted blocks we have added ResourceTemplates into XBLOCK_MIXINS
Ref: #37184
but it is not available for lms.
To fix the tests i put the check here and pass the empty dictionary in case template do not find. I thought its safe to pass empty dictionary in case template not found. but after reading your comment i believe i need to look it again if it could break 3rd party integrations.
Thanks for updating on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted this code and figured out the way to resolve test case failure.
As per discussion i found out that during extraction of HTML block we have solved all platform test with the addition of Resource template in XBLOCK_MIXINS and now we can remove ResourceTemplates safely from _BuiltinHtmlBlockMixin and i add it in AboutBlock where it is needed.
xmodule/modulestore/__init__.py
Outdated
|
|
||
| about_block = XBlock.load_class('about') | ||
| overview_template = about_block.get_template('overview.yaml') | ||
| about_block_dynamic = self.mixologist.mix(about_block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why instantiating this block is necessary here when it wasn't before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While fixing the above comment, this code was also removed.
dc90e03 to
f3c823c
Compare
|
Sandbox deployment successful 🚀 |
Ticket: #37718 (comment)
AboutBlock Testing Scenarios
CourseInfoBlock Testing Scenarios
Scenario # 1
Scenario # 2
StaticTabBlock Testing Scenarios
Open CMS
Navigate to Content -> Pages & Resources
Scroll to the Custom Page section
Add a new custom page and save the changes
Open LMS
Open same course
Verify that a new tab appears in the course navigation.
Verify the staticTab content by clicking on tab.