Skip to content
Closed
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
1 change: 0 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
- "3.11"
django-version:
- "pinned"
- "5.2"
# When updating the shards, remember to make the same changes in
# .github/workflows/unit-tests-gh-hosted.yml
shard_name:
Expand Down
6 changes: 5 additions & 1 deletion common/static/common/js/karma.common.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ function getBaseConfig(config, useRequireJs) {
base: 'Firefox',
prefs: {
'app.update.auto': false,
'app.update.enabled': false
'app.update.enabled': false,
'media.autoplay.default': 0, // allow autoplay
'media.autoplay.blocking_policy': 0, // disable autoplay blocking
'media.autoplay.allow-extension-background-pages': true,
'media.autoplay.enabled.user-gestures-needed': false,
}
},
ChromeDocker: {
Expand Down
2 changes: 1 addition & 1 deletion lms/templates/header/user_dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<div class="mobile-nav-item dropdown-item dropdown-nav-item"><a href="${settings.ENTERPRISE_LEARNER_PORTAL_BASE_URL}/${enterprise_customer_portal.get('slug')}" role="menuitem">${_("Dashboard")}</a></div>
% endif

<div class="mobile-nav-item dropdown-item dropdown-nav-item"><a href="${urljoin(settings.PROFILE_MICROFRONTEND_URL, f'/u/{user.username}')}" role="menuitem">${_("Profile")}</a></div>
<div class="mobile-nav-item dropdown-item dropdown-nav-item"><a href="${urljoin(settings.PROFILE_MICROFRONTEND_URL, f'{user.username}')}" role="menuitem">${_("Profile")}</a></div>
<div class="mobile-nav-item dropdown-item dropdown-nav-item"><a href="${settings.ACCOUNT_MICROFRONTEND_URL}" role="menuitem">${_("Account")}</a></div>
% if should_show_order_history:
<div class="mobile-nav-item dropdown-item dropdown-nav-item"><a href="${settings.ORDER_HISTORY_MICROFRONTEND_URL}" role="menuitem">${_("Order History")}</a></div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"watch-sass": "scripts/watch_sass.sh",
"test": "npm run test-jest && npm run test-karma",
"test-jest": "jest",
"test-karma": "npm run test-karma-vanilla && npm run test-karma-require && echo 'WARNING: Skipped broken webpack tests. For details, see: https://github.com/openedx/edx-platform/issues/35956'",
"test-karma": "npm run test-karma-vanilla && npm run test-karma-require && npm run test-xmodule-webpack && echo 'WARNING: Skipped broken lms-webpack and cms-webpack tests. For details, see: https://github.com/openedx/edx-platform/issues/35956'",
"test-karma-vanilla": "npm run test-cms-vanilla && npm run test-xmodule-vanilla && npm run test-common-vanilla",
"test-karma-require": "npm run test-cms-require && npm run test-common-require",
"test-karma-webpack": "npm run test-cms-webpack && npm run test-lms-webpack && npm run test-xmodule-webpack",
Expand Down
8 changes: 4 additions & 4 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
# This file contains all common constraints for edx-repos
-c common_constraints.txt

# Date: 2025-10-07
# Stay on LTS version, remove once this is added to common constraint
Django<6.0

# Date: 2020-02-26
# As it is not clarified what exact breaking changes will be introduced as per
# the next major release, ensure the installed version is within boundaries.
# Issue for unpinning: https://github.com/openedx/edx-platform/issues/35280
celery>=5.2.2,<6.0.0

# Date: 2024-02-02
# Stay on LTS version, remove once this is added to common constraint
Django<5.0

# Date: 2020-02-10
# django-oauth-toolkit version >=2.0.0 has breaking changes. More details
# mentioned on this issue https://github.com/openedx/edx-platform/issues/32884
Expand Down
6 changes: 3 additions & 3 deletions requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ defusedxml==0.7.1
# ora2
# python3-openid
# social-auth-core
django==4.2.25
django==5.2.7
# via
# -c requirements/constraints.txt
# -r requirements/edx/kernel.in
Expand Down Expand Up @@ -277,7 +277,7 @@ django-fernet-fields-v2==0.9
# via
# edx-enterprise
# enterprise-integrated-channels
django-filter==25.1
django-filter==25.2
# via
# -r requirements/edx/kernel.in
# edx-enterprise
Expand Down Expand Up @@ -781,7 +781,7 @@ mysqlclient==2.2.7
# via
# -r requirements/edx/kernel.in
# openedx-forum
nh3==0.3.0
nh3==0.3.1
# via
# -r requirements/edx/kernel.in
# xblocks-contrib
Expand Down
6 changes: 3 additions & 3 deletions requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ distlib==0.4.0
# via
# -r requirements/edx/testing.txt
# virtualenv
django==4.2.25
django==5.2.7
# via
# -c requirements/constraints.txt
# -r requirements/edx/doc.txt
Expand Down Expand Up @@ -469,7 +469,7 @@ django-fernet-fields-v2==0.9
# -r requirements/edx/testing.txt
# edx-enterprise
# enterprise-integrated-channels
django-filter==25.1
django-filter==25.2
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
Expand Down Expand Up @@ -1307,7 +1307,7 @@ mysqlclient==2.2.7
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
# openedx-forum
nh3==0.3.0
nh3==0.3.1
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
Expand Down
6 changes: 3 additions & 3 deletions requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ defusedxml==0.7.1
# ora2
# python3-openid
# social-auth-core
django==4.2.25
django==5.2.7
# via
# -c requirements/constraints.txt
# -r requirements/edx/base.txt
Expand Down Expand Up @@ -342,7 +342,7 @@ django-fernet-fields-v2==0.9
# -r requirements/edx/base.txt
# edx-enterprise
# enterprise-integrated-channels
django-filter==25.1
django-filter==25.2
# via
# -r requirements/edx/base.txt
# edx-enterprise
Expand Down Expand Up @@ -950,7 +950,7 @@ mysqlclient==2.2.7
# via
# -r requirements/edx/base.txt
# openedx-forum
nh3==0.3.0
nh3==0.3.1
# via
# -r requirements/edx/base.txt
# xblocks-contrib
Expand Down
6 changes: 3 additions & 3 deletions requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ dill==0.4.0
# via pylint
distlib==0.4.0
# via virtualenv
django==4.2.25
django==5.2.7
# via
# -c requirements/constraints.txt
# -r requirements/edx/base.txt
Expand Down Expand Up @@ -368,7 +368,7 @@ django-fernet-fields-v2==0.9
# -r requirements/edx/base.txt
# edx-enterprise
# enterprise-integrated-channels
django-filter==25.1
django-filter==25.2
# via
# -r requirements/edx/base.txt
# edx-enterprise
Expand Down Expand Up @@ -995,7 +995,7 @@ mysqlclient==2.2.7
# via
# -r requirements/edx/base.txt
# openedx-forum
nh3==0.3.0
nh3==0.3.1
# via
# -r requirements/edx/base.txt
# xblocks-contrib
Expand Down
2 changes: 1 addition & 1 deletion scripts/user_retirement/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cryptography==45.0.7
# via
# -c requirements/constraints.txt
# pyjwt
django==4.2.25
django==5.2.7
# via
# -c requirements/constraints.txt
# django-crum
Expand Down
2 changes: 1 addition & 1 deletion scripts/user_retirement/requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ cryptography==45.0.7
# pyjwt
ddt==1.7.2
# via -r scripts/user_retirement/requirements/testing.in
django==4.2.25
django==5.2.7
# via
# -r scripts/user_retirement/requirements/base.txt
# django-crum
Expand Down
7 changes: 3 additions & 4 deletions webpack.builtinblocks.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,13 @@ module.exports = {
'./xmodule/js/src/xmodule.js',
'./xmodule/js/src/sequence/edit.js'
],
VideoBlockDisplay: [
'./xmodule/js/src/xmodule.js',
'./xmodule/js/src/video/10_main.js'
],
VideoBlockEditor: [
'./xmodule/js/src/xmodule.js',
'./xmodule/js/src/tabs/tabs-aggregator.js'
],
VideoBlockDisplay: [
'./xmodule/assets/video/public/js/10_main.js'
],
WordCloudBlockDisplay: [
'./xmodule/js/src/xmodule.js',
'./xmodule/assets/word_cloud/src/js/word_cloud.js'
Expand Down
11 changes: 2 additions & 9 deletions webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,15 +505,6 @@ module.exports = Merge.merge({
}
]
},
{
test: /xmodule\/js\/src\/video\/10_main.js/,
use: [
{
loader: 'imports-loader',
options: 'this=>window'
}
]
},
/*
* END BUILT-IN XBLOCK ASSETS WITH GLOBAL DEFINITIONS
***************************************************************************************************** */
Expand Down Expand Up @@ -680,9 +671,11 @@ module.exports = Merge.merge({
$: 'jQuery',
backbone: 'Backbone',
canvas: 'canvas',
fs: 'fs',
gettext: 'gettext',
jquery: 'jQuery',
logger: 'Logger',
path: 'path',
underscore: '_',
URI: 'URI',
XBlockToXModuleShim: 'XBlockToXModuleShim',
Expand Down
52 changes: 52 additions & 0 deletions xmodule/assets/video/public/js/00_async_process.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
'use strict';

/**
* Provides convenient way to process big amount of data without UI blocking.
*
* @param {array} list Array to process.
* @param {function} process Calls this function on each item in the list.
* @return {array} Returns a Promise object to observe when all actions of a
* certain type bound to the collection, queued or not, have finished.
*/
let AsyncProcess = {
array: function(list, process) {
if (!_.isArray(list)) {
return $.Deferred().reject().promise();
}

if (!_.isFunction(process) || !list.length) {
return $.Deferred().resolve(list).promise();
}

let MAX_DELAY = 50, // maximum amount of time that js code should be allowed to run continuously
dfd = $.Deferred();
let result = [];
let index = 0;
let len = list.length;

let getCurrentTime = function() {
return (new Date()).getTime();
};

let handler = function() {
let start = getCurrentTime();

do {
result[index] = process(list[index], index);
index++;
} while (index < len && getCurrentTime() - start < MAX_DELAY);

if (index < len) {
setTimeout(handler, 25);
} else {
dfd.resolve(result);
}
};

setTimeout(handler, 25);

return dfd.promise();
}
};

export default AsyncProcess;
81 changes: 81 additions & 0 deletions xmodule/assets/video/public/js/00_component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
'use strict';

import _ from 'underscore';


/**
* Creates a new object with the specified prototype object and properties.
* @param {Object} o The object which should be the prototype of the
* newly-created object.
* @private
* @throws {TypeError, Error}
* @return {Object}
*/
let inherit = Object.create || (function() {
let F = function() {};

return function(o) {
if (arguments.length > 1) {
throw Error('Second argument not supported');
}
if (_.isNull(o) || _.isUndefined(o)) {
throw Error('Cannot set a null [[Prototype]]');
}
if (!_.isObject(o)) {
throw TypeError('Argument must be an object');
}

F.prototype = o;

return new F();
};
}());

/**
* Component module.
* @exports video/00_component.js
* @constructor
* @return {jquery Promise}
*/
let Component = function() {
if ($.isFunction(this.initialize)) {
// eslint-disable-next-line prefer-spread
return this.initialize.apply(this, arguments);
}
};

/**
* Returns new constructor that inherits form the current constructor.
* @static
* @param {Object} protoProps The object containing which will be added to
* the prototype.
* @return {Object}
*/
Component.extend = function(protoProps, staticProps) {
let Parent = this;
let Child = function() {
if ($.isFunction(this.initialize)) {
// eslint-disable-next-line prefer-spread
return this.initialize.apply(this, arguments);
}
};

// Inherit methods and properties from the Parent prototype.
Child.prototype = inherit(Parent.prototype);
Child.constructor = Parent;
// Provide access to parent's methods and properties
Child.__super__ = Parent.prototype;

// Extends inherited methods and properties by methods/properties
// passed as argument.
if (protoProps) {
$.extend(Child.prototype, protoProps);
}

// Inherit static methods and properties
$.extend(Child, Parent, staticProps);

return Child;
};

export default Component;
Loading
Loading