Skip to content

Commit

Permalink
Merge branch 'master' into golle/ACADEMIC-16209
Browse files Browse the repository at this point in the history
  • Loading branch information
germanolleunlp authored Aug 7, 2023
2 parents 8d49f7d + 2732934 commit 57578d5
Show file tree
Hide file tree
Showing 352 changed files with 5,480 additions and 4,558 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"func-names": "off",
"indent": ["error", 4],
"react/jsx-indent": ["error", 4],
"react/jsx-indent-props": ["error", 4],
"new-cap": "off",
"no-else-return": "off",
"no-shadow": "error",
Expand Down Expand Up @@ -70,7 +71,6 @@
"prefer-rest-params": "off",
"prefer-template": "off",
"radix": "off",
"react/jsx-indent-props": ["error", 4],
"react/prop-types": "off",
"vars-on-top": "off"
}
Expand Down
35 changes: 18 additions & 17 deletions cms/djangoapps/pipeline_js/js/xmodule.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ define(
function() {
window.MathJax.Hub.Config({
styles: {
'.MathJax_SVG>svg': { 'max-width': '100%' },
'.MathJax_SVG>svg': {'max-width': '100%'},
// This is to resolve for people who use center mathjax with tables
'table>tbody>tr>td>.MathJax_SVG>svg': { 'max-width': 'inherit'},
'table>tbody>tr>td>.MathJax_SVG>svg': {'max-width': 'inherit'},
},
tex2jax: {
inlineMath: [
Expand All @@ -38,9 +38,9 @@ define(
['[mathjax]', '[/mathjax]']
]
},
CommonHTML: { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } },
"HTML-CSS": { linebreaks: { automatic: true } },
CommonHTML: {linebreaks: {automatic: true}},
SVG: {linebreaks: {automatic: true}},
'HTML-CSS': {linebreaks: {automatic: true}},
});

// In order to eliminate all flashing during interactive
Expand All @@ -54,28 +54,29 @@ define(
window.addEventListener('resize', MJrenderer);

let t = -1;
// eslint-disable-next-line prefer-const
let delay = 1000;
let oldWidth = document.documentElement.scrollWidth;
function MJrenderer() {
// don't rerender if the window is the same size as before
if (t >= 0) {
window.clearTimeout(t);
window.clearTimeout(t);
}
if (oldWidth !== document.documentElement.scrollWidth) {
t = window.setTimeout(function() {
oldWidth = document.documentElement.scrollWidth;
MathJax.Hub.Queue(
["Rerender", MathJax.Hub],
[() => $('.MathJax_SVG>svg').toArray().forEach(el => {
if ($(el).width() === 0) {
$(el).css('max-width', 'inherit');
}
})]
);
t = -1;
oldWidth = document.documentElement.scrollWidth;
MathJax.Hub.Queue(
['Rerender', MathJax.Hub],
[() => $('.MathJax_SVG>svg').toArray().forEach(el => {
if ($(el).width() === 0) {
$(el).css('max-width', 'inherit');
}
})]
);
t = -1;
}, delay);
}
};
}
}
);
window.CodeMirror = CodeMirror;
Expand Down
2 changes: 0 additions & 2 deletions cms/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ filterwarnings =
default
ignore:No request passed to the backend, unable to rate-limit:UserWarning
ignore::xblock.exceptions.FieldDataDeprecationWarning
ignore::django.utils.deprecation.RemovedInDjango40Warning
ignore::django.utils.deprecation.RemovedInDjango41Warning
norecursedirs = envs
python_classes =
python_files = test.py tests.py test_*.py *_tests.py
1 change: 1 addition & 0 deletions cms/static/cms/js/spec/main_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(function(sandbox) {
'use strict';

// eslint-disable-next-line global-require
require(['jquery', 'backbone', 'cms/js/main', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers', 'jquery.cookie'],
function($, Backbone, main, AjaxHelpers) {
describe('CMS', function() {
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/certificates/spec/custom_matchers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Custom matcher library for Jasmine test assertions
// http://tobyho.com/2012/01/30/write-a-jasmine-matcher/

// eslint-disable-next-line padded-blocks
define(['jquery'], function($) { // eslint-disable-line no-unused-vars

'use strict';
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/factories/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import './base';
import 'cms/js/main';
import 'xblock/cms.runtime.v1';

// eslint-disable-next-line no-unused-expressions
'use strict';
export default function ContainerFactory(componentTemplates, XBlockInfoJson, action, options) {
var main_options = {
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/factories/context_course.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as ContextCourse from 'js/models/course';

// eslint-disable-next-line import/prefer-default-export
export {ContextCourse};
1 change: 1 addition & 0 deletions cms/static/js/factories/edit_tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'cms/js/main';
import 'xblock/cms.runtime.v1';
import 'xmodule/js/src/xmodule'; // Force the XBlockToXModuleShim to load for Static Tabs

// eslint-disable-next-line no-unused-expressions
'use strict';
export default function EditTabsFactory(courseLocation, explicitUrl) {
xmoduleLoader.done(function() {
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/factories/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import './base';
import 'cms/js/main';
import 'xblock/cms.runtime.v1';

// eslint-disable-next-line no-unused-expressions
'use strict';
export default function LibraryFactory(componentTemplates, XBlockInfoJson, options) {
var main_options = {
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/factories/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ define([
model.useV2CertDisplaySettings = useV2CertDisplaySettings;
model.set('upgrade_deadline', upgradeDeadline);
model.fetch({
// eslint-disable-next-line no-shadow
success: function(model) {
var editor = new MainView({
el: $('.settings-details'),
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/factories/textbooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as TextbookCollection from 'js/collections/textbook';
import * as ListTextbooksView from 'js/views/list_textbooks';
import './base';

// eslint-disable-next-line no-unused-expressions
'use strict';
export default function TextbooksFactory(textbooksJson) {
var textbooks = new TextbookCollection(textbooksJson, {parse: true}),
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/factories/xblock_validation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as XBlockValidationView from 'js/views/xblock_validation';
import * as XBlockValidationModel from 'js/models/xblock_validation';

// eslint-disable-next-line no-unused-expressions
'use strict';
export default function XBlockValidationFactory(validationMessages, hasEditingUrl, isRoot, isUnit, validationEle) {
var model, response;
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/features/import/factories/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ define([
},

progressall: function(e, data) {
// eslint-disable-next-line no-mixed-operators
var percentInt = data.loaded / data.total * 100,
percentVal = parseInt(percentInt, 10) + '%',
doneAt;
Expand Down
6 changes: 6 additions & 0 deletions cms/static/js/features_jsx/studio/CourseOrLibraryListing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@

import PropTypes from 'prop-types';
import React from 'react';
// eslint-disable-next-line no-unused-vars
import ReactDOM from 'react-dom';

// eslint-disable-next-line import/prefer-default-export
export function CourseOrLibraryListing(props) {
// eslint-disable-next-line prefer-destructuring
const allowReruns = props.allowReruns;
// eslint-disable-next-line prefer-destructuring
const linkClass = props.linkClass;
// eslint-disable-next-line prefer-destructuring
const idBase = props.idBase;

const renderCourseMetadata = (item, i) => (
Expand Down Expand Up @@ -84,6 +89,7 @@ export function CourseOrLibraryListing(props) {
CourseOrLibraryListing.propTypes = {
allowReruns: PropTypes.bool.isRequired,
idBase: PropTypes.string.isRequired,
// eslint-disable-next-line react/forbid-prop-types
items: PropTypes.arrayOf(PropTypes.object).isRequired,
linkClass: PropTypes.string.isRequired,
};
1 change: 1 addition & 0 deletions cms/static/js/i18n/eo/djangojs.js

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

1 change: 1 addition & 0 deletions cms/static/js/i18n/rtl/djangojs.js

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

2 changes: 2 additions & 0 deletions cms/static/js/models/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ define(['backbone', 'underscore'], function(Backbone, _) {
},
toUrl: function(overrides) {
return;
/* eslint-disable-next-line no-unused-expressions, no-unreachable */
(overrides && overrides.tag ? overrides.tag : this.get('tag')) + '://'
+ (overrides && overrides.org ? overrides.org : this.get('org')) + '/'
+ (overrides && overrides.course ? overrides.course : this.get('course')) + '/'
+ (overrides && overrides.category ? overrides.category : this.get('category')) + '/'
+ (overrides && overrides.name ? overrides.name : this.get('name')) + '/';
},
_tagPattern: /[^:]+/g,
// eslint-disable-next-line prefer-regex-literals
_fieldPattern: new RegExp('[^/]+', 'g'),

parse: function(payload) {
Expand Down
3 changes: 3 additions & 0 deletions cms/static/js/sock.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import * as domReady from 'domReady';
import * as $ from 'jquery';
import 'jquery.smoothScroll';

// eslint-disable-next-line no-unused-expressions
'use strict';

// eslint-disable-next-line import/no-mutable-exports
var toggleSock = function(e) {
e.preventDefault();

Expand Down Expand Up @@ -38,4 +40,5 @@ domReady(function() {
$('.cta-show-sock').bind('click', toggleSock);
});

// eslint-disable-next-line import/prefer-default-export
export {toggleSock};
Loading

0 comments on commit 57578d5

Please sign in to comment.