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

chore: add support for ora mfe url #2126

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openassessment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Initialization Information for Open Assessment Module
"""

__version__ = '6.0.7'
__version__ = '6.0.8'
1 change: 1 addition & 0 deletions openassessment/xblock/openassessmentblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ def student_view(self, context=None): # pylint: disable=unused-argument
initialize_js_func='OpenAssessmentBlock',
additional_js_context={
"MFE_VIEW_ENABLED": self.mfe_views_enabled and self.mfe_views_supported,
"ORA_MICROFRONTEND_URL": getattr(settings, 'ORA_MICROFRONTEND_URL', ''),
}
)

Expand Down
8 changes: 4 additions & 4 deletions openassessment/xblock/static/dist/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"openassessment-editor-textarea.js.map": "/openassessment-editor-textarea.b8f866ba96a1d2ad92a4.js.map",
"openassessment-editor-tinymce.js": "/openassessment-editor-tinymce.2cc0cab55c3be729265e.js",
"openassessment-editor-tinymce.js.map": "/openassessment-editor-tinymce.2cc0cab55c3be729265e.js.map",
"openassessment-lms.css": "/openassessment-lms.be9ec21845f2d141d3d4.css",
"openassessment-lms.js": "/openassessment-lms.be9ec21845f2d141d3d4.js",
"openassessment-lms.css.map": "/openassessment-lms.be9ec21845f2d141d3d4.css.map",
"openassessment-lms.js.map": "/openassessment-lms.be9ec21845f2d141d3d4.js.map",
"openassessment-lms.css": "/openassessment-lms.f4cf2dc4a6bd64c339d3.css",
"openassessment-lms.js": "/openassessment-lms.f4cf2dc4a6bd64c339d3.js",
"openassessment-lms.css.map": "/openassessment-lms.f4cf2dc4a6bd64c339d3.css.map",
"openassessment-lms.js.map": "/openassessment-lms.f4cf2dc4a6bd64c339d3.js.map",
"openassessment-ltr.css": "/openassessment-ltr.5e4380a9281df732ca84.css",
"openassessment-ltr.js": "/openassessment-ltr.5e4380a9281df732ca84.js",
"openassessment-ltr.css.map": "/openassessment-ltr.5e4380a9281df732ca84.css.map",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
/******/
/******/ var hotApplyOnUpdate = true;
/******/ // eslint-disable-next-line no-unused-vars
/******/ var hotCurrentHash = "1f4cf48400e88d37ff73";
/******/ var hotCurrentHash = "7c5fa44084cb9c1b2b1e";
/******/ var hotRequestTimeout = 10000;
/******/ var hotCurrentModuleData = {};
/******/ var hotCurrentChildModule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
/******/
/******/ var hotApplyOnUpdate = true;
/******/ // eslint-disable-next-line no-unused-vars
/******/ var hotCurrentHash = "1f4cf48400e88d37ff73";
/******/ var hotCurrentHash = "7c5fa44084cb9c1b2b1e";
/******/ var hotRequestTimeout = 10000;
/******/ var hotCurrentModuleData = {};
/******/ var hotCurrentChildModule;
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions openassessment/xblock/static/dist/openassessment-lms.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion openassessment/xblock/static/dist/openassessment-ltr.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
/******/
/******/ var hotApplyOnUpdate = true;
/******/ // eslint-disable-next-line no-unused-vars
/******/ var hotCurrentHash = "1f4cf48400e88d37ff73";
/******/ var hotCurrentHash = "7c5fa44084cb9c1b2b1e";
/******/ var hotRequestTimeout = 10000;
/******/ var hotCurrentModuleData = {};
/******/ var hotCurrentChildModule;
Expand Down
2 changes: 1 addition & 1 deletion openassessment/xblock/static/dist/openassessment-rtl.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
/******/
/******/ var hotApplyOnUpdate = true;
/******/ // eslint-disable-next-line no-unused-vars
/******/ var hotCurrentHash = "1f4cf48400e88d37ff73";
/******/ var hotCurrentHash = "7c5fa44084cb9c1b2b1e";
/******/ var hotRequestTimeout = 10000;
/******/ var hotCurrentModuleData = {};
/******/ var hotCurrentChildModule;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions openassessment/xblock/static/js/src/lms/oa_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export class BaseView {
this.element = element;
this.server = server;

this.show_mfe_views = data.CONTEXT?.MFE_VIEW_ENABLED && !window.navigator.userAgent.includes('org.edx.mobile');
const { ORA_MICROFRONTEND_URL, MFE_VIEW_ENABLED } = data.CONTEXT || {};

this.ORA_MICROFRONTEND_URL = ORA_MICROFRONTEND_URL;
this.show_mfe_views = ORA_MICROFRONTEND_URL && MFE_VIEW_ENABLED && !window.navigator.userAgent.includes('org.edx.mobile');

const oraMfeView = $('#ora-mfe-view', this.element);
const oraLegacyView = $('#ora-legacy-view', this.element);
Expand Down Expand Up @@ -281,9 +284,10 @@ export class BaseView {

const oraMfeIframe = $('#ora-mfe-view>iframe', this.element);
// TODO: put the ORA MFE URL in a config file
oraMfeIframe.attr('src', `http://localhost:1992/xblock/${courseId}/${xblockId}`);
oraMfeIframe.attr('src', `${this.ORA_MICROFRONTEND_URL}/xblock/${courseId}/${xblockId}`);
/* eslint-disable-next-line prefer-arrow-callback */
oraMfeIframe.on('load', function () {
/* eslint-disable-next-line prefer-arrow-callback */
window.addEventListener('message', function (event) {
if (event.data.type === 'plugin.resize') {
const { height } = event.data.payload;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edx-ora2",
"version": "6.0.7",
"version": "6.0.8",
"repository": "https://github.com/openedx/edx-ora2.git",
"dependencies": {
"@edx/frontend-build": "^6.1.1",
Expand Down
Loading