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: handle navigation and resize events from discussions MFE [BD-38] [TNL-9585] #30164

Merged

Conversation

xitij2000
Copy link
Contributor

@xitij2000 xitij2000 commented Apr 1, 2022

Description

The discussions MFE sends resize and navigation events via the postMessage API, we can use these events to resize the iframe and make sure that the iframe loads the correct page on refresh.

Supporting information

Testing instructions

@openedx-webhooks openedx-webhooks added blended PR is managed through 2U's blended developmnt program needs triage labels Apr 1, 2022
@openedx-webhooks
Copy link

Thanks for the pull request, @xitij2000! I've created BLENDED-1179 to keep track of it in Jira. More details are on the BD-38 project page.

When this pull request is ready, tag your edX technical lead.

The discussions MFE sends resize and navigation events via the postMessage API, we can use these events to resize the iframe and make sure that the iframe loads the correct page on refresh.

Co-authored-by: Hamza Khchine <hamza.Khchine@opencraft.com>
@xitij2000 xitij2000 force-pushed the kshitij/tnl-9685/navigation-hints branch from bdfa993 to 6f87a74 Compare April 1, 2022 12:22
@asadazam93
Copy link
Contributor

@xitij2000 This will update the iframe src url? Or will it update the url that loads this iframe?

@xitij2000
Copy link
Contributor Author

@xitij2000 This will update the iframe src url? Or will it update the url that loads this iframe?

It works both ways. When there is navigation inside the iframe, it sends a message, the platform puts that in the URL hash. If you then reload the page, it will take the URL hash and append it to the correct MFE URL inside the frame.

@asadazam93 asadazam93 merged commit 73c7d71 into openedx:master Apr 4, 2022
@openedx-webhooks
Copy link

@xitij2000 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

@xitij2000 xitij2000 deleted the kshitij/tnl-9685/navigation-hints branch April 5, 2022 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blended PR is managed through 2U's blended developmnt program merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants