-
Notifications
You must be signed in to change notification settings - Fork 95
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: [FC-0070] rendering split test content in unit page #1492
base: master
Are you sure you want to change the base?
feat: [FC-0070] rendering split test content in unit page #1492
Conversation
Thanks for the pull request, @ihor-romaniuk! 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. 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. |
3b37da2
to
8e41ceb
Compare
15e0b50
to
d22e2e0
Compare
d22e2e0
to
d863730
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1492 +/- ##
==========================================
+ Coverage 93.35% 93.37% +0.01%
==========================================
Files 1109 1111 +2
Lines 22103 22305 +202
Branches 4765 4826 +61
==========================================
+ Hits 20635 20827 +192
- Misses 1397 1405 +8
- Partials 71 73 +2 ☔ View full report in Codecov by Sentry. |
Sandbox deployment successful 🚀 |
4e4eb4f
to
94889ce
Compare
Sandbox deployment successful 🚀 |
94889ce
to
beae096
Compare
Sandbox deployment successful 🚀 |
beae096
to
eddab6b
Compare
Sandbox deployment successful 🚀 |
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 haven't reviewed the code in depth, yet, but I noticed a few problems when testing in the sandbox:
-
It's not possible to add an HTML ("Text") block to a content group in the new split_test page. Clicking on it does nothing and throws no detectable error.
-
Adding a problem works, but the "Select" button when selecting a problem type initially is presented too far down the page, after a blank space. This initially led me to believe the button just wasn't showing.
-
An X-Frame-Options issue? After selecting a problem type and saving it, my browser refuses to display the contents with an "The loading of in a frame is denied by “X-Frame-Options“ directive set to “sameorigin“." Refreshing the page fixes it. This is reproducible in this PR's sandbox.
-
When copying a component with an empty clipboard, the "paste component" button does not show until after refreshing the page. (Pasting does work afterwards, though.)
-
If you click on the config link inside "This content experiment uses group configuration 'Group config 1' at the top of the page, the group config page is embedded in the split_test page instead of directing the user to the top-level route.
I'm not sure how many of the above issues stem from the new page. If they're pre-existing, or if the issues are meant to be solved in a subsequent PR, we can consider merging it as is. Let me know.
}); | ||
handleCreateNewCourseXBlock( | ||
{ type, boilerplate: moduleName, parentLocator: blockId }, | ||
({ courseKey, locator }) => navigate(`/course/${courseKey}/editor/html/${locator}`), |
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.
[inform]: This code section was covered by the test in the previous PR
@@ -5,7 +5,7 @@ import { logError } from '@edx/frontend-platform/logging'; | |||
|
|||
export interface IframeContextType { | |||
setIframeRef: (ref: MutableRefObject<HTMLIFrameElement | null>) => void; | |||
sendMessageToIframe: (messageType: string, payload: unknown) => void; | |||
sendMessageToIframe: (messageType: string, payload: unknown, consumerWindow?: any) => void; |
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.
[nit]: Let's try to get rid of any
and specify a type for consumerWindow
.
For example, it could be consumerWindow?: Window | null
.
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.
Changed
@@ -16,11 +16,12 @@ export const IframeProvider: React.FC = ({ children }: { children: ReactNode }) | |||
iframeRef.current = ref.current; | |||
}, []); | |||
|
|||
const sendMessageToIframe = useCallback((messageType: string, payload: any) => { | |||
const sendMessageToIframe = useCallback((messageType: string, payload: any, consumerWindow?: any) => { |
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.
[curious]: Since we have a full understanding of what's in the payload, should we type the payload structure (type: string
, payload: {}
, description?: string
)?
window.parent.postMessage(
{
type: '<TYPE_NAME>',
payload: { ... },
description: <SOME_TEXT>
}, document.referrer
);
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.
We don't pass description
to messages to iframe, so I think it's not necessary to add it here.
We pass this value from legacy to MFE but not the other way around.
@@ -0,0 +1,4 @@ | |||
.xblock-container-iframe { | |||
width: calc(100% + ($spacer * .3125)); | |||
margin: 0 (-($spacer * .3125)); |
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.
[optional]: Since this MFE will be moving to the use of Paragon Design tokens, it would be great to already envisage the use of CSS variables in such mathematical constructions.
margin: 0 (-($spacer * .3125)); | |
margin: 0 (($spacer * .3125) * -1); |
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.
Changed
Description
This PR introduces functionality to display Split Test Content within the new Unit page interface.
The feature enables opening a Split Test Content page within the Unit page’s new interface. This page displays the xBlocks from the specified groups and provides basic configuration options for the groups.
split_test.mov
Related Pull Requests
Testing instructions
Other information
Settings