From 148ca9bcfd5240cac9da3d6fe6eee5c0dca2eede Mon Sep 17 00:00:00 2001
From: Syed Ali Abbas Zaidi
Date: Tue, 7 Mar 2023 12:42:50 +0500
Subject: [PATCH 01/30] fix: eslint operator-linebreak issue
---
lms/static/js/dashboard/legacy.js | 16 ++++++++--------
xmodule/js/src/capa/display.js | 1 -
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/lms/static/js/dashboard/legacy.js b/lms/static/js/dashboard/legacy.js
index bd36849b25b7..33b27d194877 100644
--- a/lms/static/js/dashboard/legacy.js
+++ b/lms/static/js/dashboard/legacy.js
@@ -239,12 +239,12 @@ var edx = edx || {};
// xss-lint: disable=javascript-jquery-append
$('#activate-account-modal p').append(
// xss-lint: disable=javascript-concat-html
- ''
+ + '\n'
+ + ''
);
}, 500); // adding timeout to make spinner animation longer
}
@@ -254,12 +254,12 @@ var edx = edx || {};
// xss-lint: disable=javascript-jquery-append
$('#activate-account-modal p').append(
// xss-lint: disable=javascript-concat-html
- ''
+ + '\n'
+ + ''
);
});
diff --git a/xmodule/js/src/capa/display.js b/xmodule/js/src/capa/display.js
index 8afe368d4239..c2578b4f9f4e 100644
--- a/xmodule/js/src/capa/display.js
+++ b/xmodule/js/src/capa/display.js
@@ -7,7 +7,6 @@
(function() {
'use strict';
-
var indexOfHelper = [].indexOf
|| function(item) {
var i, len;
From 3cecf212245c40d17d0fe7e7c7f219c66883a7cf Mon Sep 17 00:00:00 2001
From: Syed Ali Abbas Zaidi
Date: Tue, 7 Mar 2023 14:21:54 +0500
Subject: [PATCH 02/30] fix: eslint quotes issue
---
lms/static/js/dashboard/legacy.js | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/lms/static/js/dashboard/legacy.js b/lms/static/js/dashboard/legacy.js
index 33b27d194877..bd36849b25b7 100644
--- a/lms/static/js/dashboard/legacy.js
+++ b/lms/static/js/dashboard/legacy.js
@@ -239,12 +239,12 @@ var edx = edx || {};
// xss-lint: disable=javascript-jquery-append
$('#activate-account-modal p').append(
// xss-lint: disable=javascript-concat-html
- ''
+ '\n' +
+ ''
);
}, 500); // adding timeout to make spinner animation longer
}
@@ -254,12 +254,12 @@ var edx = edx || {};
// xss-lint: disable=javascript-jquery-append
$('#activate-account-modal p').append(
// xss-lint: disable=javascript-concat-html
- ''
+ '\n' +
+ ''
);
});
From b2fb0e182f2e2fb31b736aafa3b0e8b5358742d3 Mon Sep 17 00:00:00 2001
From: Syed Ali Abbas Zaidi
Date: Tue, 7 Mar 2023 22:07:13 +0500
Subject: [PATCH 03/30] fix: react jsx indent and props issues
---
.../support/static/support/jsx/program_enrollments/inspector.jsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/lms/djangoapps/support/static/support/jsx/program_enrollments/inspector.jsx b/lms/djangoapps/support/static/support/jsx/program_enrollments/inspector.jsx
index 3f8f6fda57c4..3947f5f8e7f1 100644
--- a/lms/djangoapps/support/static/support/jsx/program_enrollments/inspector.jsx
+++ b/lms/djangoapps/support/static/support/jsx/program_enrollments/inspector.jsx
@@ -66,6 +66,7 @@ const renderEnrollmentsSection = enrollments => (
{gettext('Help make edX better for everyone!')}
@@ -282,204 +281,209 @@ class DemographicsCollectionModal extends React.Component {
)}
- {({wizardConsumer}) =>
- {/* Gender Identity */}
-
{gettext('Select gender')},
- this.loadOptions(FIELD_NAMES.GENDER)
- ]}
- showInput={wizardConsumer[FIELD_NAMES.GENDER] == 'self-describe'}
- inputName={FIELD_NAMES.GENDER_DESCRIPTION}
- inputId={FIELD_NAMES.GENDER_DESCRIPTION}
- inputType="text"
- inputValue={wizardConsumer[FIELD_NAMES.GENDER_DESCRIPTION]}
- inputOnChange={this.handleInputChange}
- inputOnBlur={this.handleSelectChange}
- disabled={this.state.fieldError}
- />
- {/* Ethnicity */}
- {
+ {({wizardConsumer}) => (
+
+ {/* Gender Identity */}
+
{gettext('Select gender')},
+ this.loadOptions(FIELD_NAMES.GENDER)
+ ]}
+ showInput={wizardConsumer[FIELD_NAMES.GENDER] == 'self-describe'}
+ inputName={FIELD_NAMES.GENDER_DESCRIPTION}
+ inputId={FIELD_NAMES.GENDER_DESCRIPTION}
+ inputType="text"
+ inputValue={wizardConsumer[FIELD_NAMES.GENDER_DESCRIPTION]}
+ inputOnChange={this.handleInputChange}
+ inputOnBlur={this.handleSelectChange}
+ disabled={this.state.fieldError}
+ />
+ {/* Ethnicity */}
+ {
// we create a fake "event", and then use it to call our normal selection handler function that
// is used by the other dropdowns.
- const e = {
- target: {
- name: FIELD_NAMES.ETHNICITY,
- value: wizardConsumer[FIELD_NAMES.ETHNICITY].map(ethnicity => ({ethnicity, value: ethnicity})),
+ const e = {
+ target: {
+ name: FIELD_NAMES.ETHNICITY,
+ value: wizardConsumer[FIELD_NAMES.ETHNICITY].map(ethnicity => ({ethnicity, value: ethnicity})),
+ }
+ };
+ this.handleSelectChange(e);
+ }}
+ />
+ {/* Family Income */}
+
+
+
-
- }
+ )}
- {({wizardConsumer}) =>
- {/* Military History */}
-
-
-
-
- {
- this.loadOptions(FIELD_NAMES.MILITARY)
- }
-
+ {({wizardConsumer}) => (
+
+ {/* Military History */}
+
+
+
+
+ {
+ this.loadOptions(FIELD_NAMES.MILITARY)
+ }
+
+
-
- }
+ )}
- {({wizardConsumer}) =>
- {/* Learner Education Level */}
-
-
-
-
- {
- this.loadOptions(FIELD_NAMES.EDUCATION_LEVEL)
- }
-
-
- {/* Parent/Guardian Education Level */}
-
-
-
-
- {
- this.loadOptions(FIELD_NAMES.PARENT_EDUCATION)
- }
-
+ {({wizardConsumer}) => (
+
+ {/* Learner Education Level */}
+
+
+
+
+ {
+ this.loadOptions(FIELD_NAMES.EDUCATION_LEVEL)
+ }
+
+
+ {/* Parent/Guardian Education Level */}
+
+
+
+
+ {
+ this.loadOptions(FIELD_NAMES.PARENT_EDUCATION)
+ }
+
+
-
- }
+ )}
- {({wizardConsumer}) =>
- {/* Employment Status */}
-
{gettext('Select employment status')},
- this.loadOptions(FIELD_NAMES.WORK_STATUS)
- ]}
- showInput={wizardConsumer[FIELD_NAMES.WORK_STATUS] == 'other'}
- inputName={FIELD_NAMES.WORK_STATUS_DESCRIPTION}
- inputId={FIELD_NAMES.WORK_STATUS_DESCRIPTION}
- inputType="text"
- inputValue={wizardConsumer[FIELD_NAMES.WORK_STATUS_DESCRIPTION]}
- inputOnChange={this.handleInputChange}
- inputOnBlur={this.handleSelectChange}
- disabled={this.state.fieldError}
- />
- {/* Current Work Industry */}
-
-
-
-
- {
- this.loadOptions(FIELD_NAMES.CURRENT_WORK)
- }
-
-
- {/* Future Work Industry */}
-
-
-
(
+
+ {/* Employment Status */}
+
{gettext('Select employment status')},
+ this.loadOptions(FIELD_NAMES.WORK_STATUS)
+ ]}
+ showInput={wizardConsumer[FIELD_NAMES.WORK_STATUS] == 'other'}
+ inputName={FIELD_NAMES.WORK_STATUS_DESCRIPTION}
+ inputId={FIELD_NAMES.WORK_STATUS_DESCRIPTION}
+ inputType="text"
+ inputValue={wizardConsumer[FIELD_NAMES.WORK_STATUS_DESCRIPTION]}
+ inputOnChange={this.handleInputChange}
+ inputOnBlur={this.handleSelectChange}
disabled={this.state.fieldError}
- >
-
- {
- this.loadOptions(FIELD_NAMES.FUTURE_WORK)
- }
-
+ />
+ {/* Current Work Industry */}
+
+
+
+
+ {
+ this.loadOptions(FIELD_NAMES.CURRENT_WORK)
+ }
+
+
+ {/* Future Work Industry */}
+
+
+
+
+ {
+ this.loadOptions(FIELD_NAMES.FUTURE_WORK)
+ }
+
+
-
- }
+ )}
-
+
{gettext('Thank you! You’re helping make edX better for everyone.')}
diff --git a/lms/static/js/demographics_collection/SelectWithInput.jsx b/lms/static/js/demographics_collection/SelectWithInput.jsx
index 237b514ae3bb..6f6d9cba262c 100644
--- a/lms/static/js/demographics_collection/SelectWithInput.jsx
+++ b/lms/static/js/demographics_collection/SelectWithInput.jsx
@@ -32,19 +32,20 @@ export const SelectWithInput = (props) => {
{options}
{showInput
- &&
- }
+ && (
+
+ )}
);
};
diff --git a/lms/static/js/learner_analytics_dashboard/CircleChart.jsx b/lms/static/js/learner_analytics_dashboard/CircleChart.jsx
index 29291836fadf..e092aea0fc3b 100644
--- a/lms/static/js/learner_analytics_dashboard/CircleChart.jsx
+++ b/lms/static/js/learner_analytics_dashboard/CircleChart.jsx
@@ -81,13 +81,15 @@ class CircleChart extends React.Component {
lastY = nextY;
// eslint-disable-next-line react/jsx-indent
- return ;
+ return (
+
+ );
});
}
diff --git a/lms/static/js/learner_analytics_dashboard/Discussions.jsx b/lms/static/js/learner_analytics_dashboard/Discussions.jsx
index 8075d6269bbe..d0dd2b4d451f 100644
--- a/lms/static/js/learner_analytics_dashboard/Discussions.jsx
+++ b/lms/static/js/learner_analytics_dashboard/Discussions.jsx
@@ -72,7 +72,7 @@ class Discussions extends React.Component {
-
+
{thread_votes}
Votes on your posts, comments, and replies
diff --git a/lms/static/js/learner_analytics_dashboard/LearnerAnalyticsDashboard.jsx b/lms/static/js/learner_analytics_dashboard/LearnerAnalyticsDashboard.jsx
index 65a5af8e7047..912433e0a8e2 100644
--- a/lms/static/js/learner_analytics_dashboard/LearnerAnalyticsDashboard.jsx
+++ b/lms/static/js/learner_analytics_dashboard/LearnerAnalyticsDashboard.jsx
@@ -43,7 +43,7 @@ function getAssignmentCounts(types, assignments) {
function getStreakIcons(count) {
return Array.apply(null, {length: count}).map((e, i) => (
-
+
));
}
@@ -82,23 +82,23 @@ export function LearnerAnalyticsDashboard(props) {
Grading
{gradeBreakdown
- &&
Weight
- }
+ &&
Weight
}
{gradeBreakdown
- &&
-
- }
+ )}
Graded Assignments
{/* TODO: LEARNER-3854: If implementing Learner Analytics, rename to graded-assignments-wrapper. */}
@@ -121,8 +121,7 @@ export function LearnerAnalyticsDashboard(props) {
Week streak
{week_streak > 0
- &&
{getStreakIcons(week_streak)}
- }
+ &&
{getStreakIcons(week_streak)}
}
{getStreakString(week_streak)}
{getStreakEncouragement(week_streak)}
@@ -132,8 +131,8 @@ export function LearnerAnalyticsDashboard(props) {
-
-
{weekly_active_users.toLocaleString('en', {useGrouping:true})}
+
+
{weekly_active_users.toLocaleString('en', {useGrouping: true})}
{getActiveUserString(weekly_active_users)}
diff --git a/lms/static/js/student_account/components/StudentAccountDeletion.jsx b/lms/static/js/student_account/components/StudentAccountDeletion.jsx
index 0bd09bf02330..141d0c555742 100644
--- a/lms/static/js/student_account/components/StudentAccountDeletion.jsx
+++ b/lms/static/js/student_account/components/StudentAccountDeletion.jsx
@@ -134,32 +134,34 @@ export class StudentAccountDeletion extends React.Component {
onClick={this.loadDeletionModal}
/>
{showError
- &&
-
-
+ && (
+
+
+
+
+
+ {socialAuthConnected && isActive
+ &&
}
+ {!isActive &&
}
+
-
- {socialAuthConnected && isActive
- &&
- }
- {!isActive &&
}
-
-
- )}
- alertType="danger"
- dismissible={false}
- open
- />
- }
- {deletionModalOpen &&
}
+ )}
+ alertType="danger"
+ dismissible={false}
+ open
+ />
+ )}
+ {deletionModalOpen && (
+
+ )}
);
}
diff --git a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx
index d1491354e217..a3ca08538ead 100644
--- a/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx
+++ b/lms/static/js/student_account/components/StudentAccountDeletionModal.jsx
@@ -136,23 +136,24 @@ class StudentAccountDeletionConfirmationModal extends React.Component {
body={(
{responseError
- &&
-
-
+ && (
+
+
+
+
+
+
{ validationMessage }
+
{ validationErrorDetails }
+
-
-
{ validationMessage }
-
{ validationErrorDetails }
-
-
- )}
- alertType="danger"
- dismissible={false}
- open
- />
- }
+ )}
+ alertType="danger"
+ dismissible={false}
+ open
+ />
+ )}
-
+ />
);
}
}
diff --git a/xmodule/assets/library_source_block/LibrarySourcedBlockPicker.jsx b/xmodule/assets/library_source_block/LibrarySourcedBlockPicker.jsx
index b1cd8e39067c..d3ad6c42e4b5 100644
--- a/xmodule/assets/library_source_block/LibrarySourcedBlockPicker.jsx
+++ b/xmodule/assets/library_source_block/LibrarySourcedBlockPicker.jsx
@@ -155,19 +155,19 @@ class LibrarySourcedBlockPicker extends React.Component {
-
+
Hitting 'Save and Import' will import the latest versions of the selected blocks, overwriting any changes done to this block post-import.
-
+
{
this.state.xblocks.map(block => (
-
+
))
@@ -199,7 +199,7 @@ class LibrarySourcedBlockPicker extends React.Component {
{block}
))
From 0d00d2d8afdfb4888bb907886105960351aebd1a Mon Sep 17 00:00:00 2001
From: Syed Ali Abbas Zaidi
Date: Fri, 5 May 2023 12:10:12 +0500
Subject: [PATCH 22/30] fix: autofixable eslint issues
---
cms/static/cms/js/spec/main_webpack.js | 16 ++++++++--------
cms/static/js/spec/views/license_spec.js | 2 +-
.../js/spec/views/pages/course_outline_spec.js | 1 -
cms/static/js/views/metadata.js | 2 +-
common/static/common/js/discussion/utils.js | 3 +--
common/static/common/js/jasmine.common.conf.js | 2 +-
.../static/js/capa/drag_and_drop/draggables.js | 4 ----
.../components/ReportStatus/ReportStatus.jsx | 2 +-
lms/static/js/Markdown.Editor.js | 4 ----
.../MultiselectDropdown.jsx | 1 -
.../views/progress_circle_view.js | 2 +-
.../js/learner_dashboard/views/unenroll_view.js | 1 -
lms/static/js/spec/groups/views/cohorts_spec.js | 1 -
.../instructor_dashboard/data_download_spec.js | 1 -
lms/static/js/staff_debug_actions.js | 1 -
.../js/student_account/views/AccessView.js | 1 -
.../announcements/jsx/Announcements.test.jsx | 1 -
.../static/course_experience/js/currency.js | 1 -
.../course_experience/js/spec/Currency_spec.js | 10 +++++-----
xmodule/js/src/poll/poll_main.js | 2 --
20 files changed, 19 insertions(+), 39 deletions(-)
diff --git a/cms/static/cms/js/spec/main_webpack.js b/cms/static/cms/js/spec/main_webpack.js
index 801fb68b504c..f7440c3876b7 100644
--- a/cms/static/cms/js/spec/main_webpack.js
+++ b/cms/static/cms/js/spec/main_webpack.js
@@ -1,5 +1,3 @@
-jasmine.getFixtures().fixturesPath = '/base/templates';
-
import 'common/js/spec_helpers/jasmine-extensions';
import 'common/js/spec_helpers/jasmine-stealth';
import 'common/js/spec_helpers/jasmine-waituntil';
@@ -13,12 +11,6 @@ import str from 'underscore.string';
import HtmlUtils from 'edx-ui-toolkit/js/utils/html-utils';
import StringUtils from 'edx-ui-toolkit/js/utils/string-utils';
-window._ = _;
-window._.str = str;
-window.edx = window.edx || {};
-window.edx.HtmlUtils = HtmlUtils;
-window.edx.StringUtils = StringUtils;
-
// These are the tests that will be run
import './xblock/cms.runtime.v1_spec.js';
import '../../../js/spec/factories/xblock_validation_spec.js';
@@ -32,4 +24,12 @@ import '../../../js/spec/views/pages/course_outline_spec.js';
import '../../../js/spec/views/xblock_editor_spec.js';
import '../../../js/spec/views/xblock_string_field_editor_spec.js';
+jasmine.getFixtures().fixturesPath = '/base/templates';
+
+window._ = _;
+window._.str = str;
+window.edx = window.edx || {};
+window.edx.HtmlUtils = HtmlUtils;
+window.edx.StringUtils = StringUtils;
+
window.__karma__.start(); // eslint-disable-line no-underscore-dangle
diff --git a/cms/static/js/spec/views/license_spec.js b/cms/static/js/spec/views/license_spec.js
index 54eb5e2afb5b..193d26726365 100644
--- a/cms/static/js/spec/views/license_spec.js
+++ b/cms/static/js/spec/views/license_spec.js
@@ -147,7 +147,7 @@ define(['js/views/license', 'js/models/license', 'common/js/spec_helpers/templat
this.view = new LicenseView({model: this.model, showPreview: true});
this.view.render();
expect(this.view.$('.license-preview').length).toEqual(1);
- // Expect default text to be "All Rights Reserved"
+ // Expect default text to be "All Rights Reserved"
expect(this.view.$('.license-preview')).toContainText('All Rights Reserved');
this.view.$('li[data-license=creative-commons] button').click();
expect(this.view.$('.license-preview').length).toEqual(1);
diff --git a/cms/static/js/spec/views/pages/course_outline_spec.js b/cms/static/js/spec/views/pages/course_outline_spec.js
index b32ab69dcd29..195e5702d093 100644
--- a/cms/static/js/spec/views/pages/course_outline_spec.js
+++ b/cms/static/js/spec/views/pages/course_outline_spec.js
@@ -2476,7 +2476,6 @@ describe('CourseOutlinePage', function() {
outlinePage.$('.outline-unit .configure-button').click();
expect($('.modal-section .edit-discussion')).not.toExist();
});
-
});
verifyTypePublishable('unit', function(options) {
diff --git a/cms/static/js/views/metadata.js b/cms/static/js/views/metadata.js
index c56363ef7c26..3c5fa598117d 100644
--- a/cms/static/js/views/metadata.js
+++ b/cms/static/js/views/metadata.js
@@ -313,7 +313,7 @@ define(
updateUrlFieldVisibility: function() {
const urlContainer = this.$el.find('.public-access-block-url-container');
- if(this.getValueFromEditor()) {
+ if (this.getValueFromEditor()) {
urlContainer.removeClass('is-hidden');
} else {
urlContainer.addClass('is-hidden');
diff --git a/common/static/common/js/discussion/utils.js b/common/static/common/js/discussion/utils.js
index f489ab2e8843..6be86b146237 100644
--- a/common/static/common/js/discussion/utils.js
+++ b/common/static/common/js/discussion/utils.js
@@ -32,7 +32,7 @@
if (_.isUndefined(userId)) {
userId = this.user ? this.user.id : void 0;
}
- if(_.isUndefined(this.roleIds)) {
+ if (_.isUndefined(this.roleIds)) {
this.roleIds = {};
}
staff = _.union(this.roleIds.Moderator, this.roleIds.Administrator);
@@ -486,7 +486,6 @@
element,
this.postMathJaxProcessor(this.markdownWithHighlight(element.text()))
);
-
};
DiscussionUtil.typesetMathJax = function(element) {
diff --git a/common/static/common/js/jasmine.common.conf.js b/common/static/common/js/jasmine.common.conf.js
index c190bf94b3fb..d6d7f7977380 100644
--- a/common/static/common/js/jasmine.common.conf.js
+++ b/common/static/common/js/jasmine.common.conf.js
@@ -9,4 +9,4 @@ jasmine.getFixtures().fixturesPath = '/base/';
// Stub out modal dialog alerts, which will prevent
// us from accessing the test results in the DOM
window.confirm = function() { return true; };
-window.alert = function() { return; };
+window.alert = function() { };
diff --git a/common/static/js/capa/drag_and_drop/draggables.js b/common/static/js/capa/drag_and_drop/draggables.js
index bd2d3126171a..13e26c28de49 100644
--- a/common/static/js/capa/drag_and_drop/draggables.js
+++ b/common/static/js/capa/drag_and_drop/draggables.js
@@ -80,8 +80,6 @@
callbackFunc(draggableObj);
}, 0);
});
-
- return;
} else {
if (draggableObj.originalConfigObj.label.length > 0) {
draggableObj.iconEl = $(HtmlUtils.joinHtml(
@@ -101,8 +99,6 @@
setTimeout(function() {
callbackFunc(draggableObj);
}, 0);
-
- return;
}
}
}
diff --git a/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/ReportStatus/ReportStatus.jsx b/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/ReportStatus/ReportStatus.jsx
index 2fd77939d191..49fbb3a034b3 100644
--- a/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/ReportStatus/ReportStatus.jsx
+++ b/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/ReportStatus/ReportStatus.jsx
@@ -41,7 +41,7 @@ const ReportStatus = ({
{succeeded && successMessage}
);
-}
+};
ReportStatus.propTypes = {
error: PropTypes.string,
diff --git a/lms/static/js/Markdown.Editor.js b/lms/static/js/Markdown.Editor.js
index 2d8da0c5f51e..01df547de203 100644
--- a/lms/static/js/Markdown.Editor.js
+++ b/lms/static/js/Markdown.Editor.js
@@ -524,7 +524,6 @@
var keyCodeChar = String.fromCharCode(keyCode);
switch (keyCodeChar) {
-
case 'y':
undoObj.redo();
handled = true;
@@ -548,7 +547,6 @@
if (window.event) {
window.event.returnValue = false;
}
- return;
}
};
@@ -1575,8 +1573,6 @@
chunk.before += markup;
chunk.after = markup + chunk.after;
}
-
- return;
};
commandProto.stripLinkDefs = function(text, defsToAdd) {
diff --git a/lms/static/js/demographics_collection/MultiselectDropdown.jsx b/lms/static/js/demographics_collection/MultiselectDropdown.jsx
index b5e9d78fd08f..83316047d609 100644
--- a/lms/static/js/demographics_collection/MultiselectDropdown.jsx
+++ b/lms/static/js/demographics_collection/MultiselectDropdown.jsx
@@ -27,7 +27,6 @@ class MultiselectDropdown extends React.Component {
}
componentWillUnmount() {
-
document.removeEventListener('keydown', this.handleKeydown, false);
}
diff --git a/lms/static/js/learner_dashboard/views/progress_circle_view.js b/lms/static/js/learner_dashboard/views/progress_circle_view.js
index 37127f3e05f6..daab8ccfa9af 100644
--- a/lms/static/js/learner_dashboard/views/progress_circle_view.js
+++ b/lms/static/js/learner_dashboard/views/progress_circle_view.js
@@ -2,7 +2,7 @@ import Backbone from 'backbone';
import HtmlUtils from 'edx-ui-toolkit/js/utils/html-utils';
-import progressViewTpl from '../../../templates/learner_dashboard//progress_circle_view.underscore';
+import progressViewTpl from '../../../templates/learner_dashboard/progress_circle_view.underscore';
import progressSegmentTpl from '../../../templates/learner_dashboard/progress_circle_segment.underscore';
class ProgressCircleView extends Backbone.View {
diff --git a/lms/static/js/learner_dashboard/views/unenroll_view.js b/lms/static/js/learner_dashboard/views/unenroll_view.js
index bf4ad7ac717e..c260d8e49dc9 100644
--- a/lms/static/js/learner_dashboard/views/unenroll_view.js
+++ b/lms/static/js/learner_dashboard/views/unenroll_view.js
@@ -3,7 +3,6 @@
import Backbone from 'backbone';
class UnenrollView extends Backbone.View {
-
constructor(options) {
const defaults = {
el: '.unenroll-modal',
diff --git a/lms/static/js/spec/groups/views/cohorts_spec.js b/lms/static/js/spec/groups/views/cohorts_spec.js
index 5038750a066e..0a1e75f9c447 100644
--- a/lms/static/js/spec/groups/views/cohorts_spec.js
+++ b/lms/static/js/spec/groups/views/cohorts_spec.js
@@ -101,7 +101,6 @@ function(Backbone, $, AjaxHelpers, TemplateHelpers, CohortsView, CohortCollectio
if (options && options.selectCohort) {
cohortsView.$('.cohort-select').val(options.selectCohort.toString()).change();
}
-
};
respondToRefresh = function(catCount, dogCount) {
diff --git a/lms/static/js/spec/instructor_dashboard/data_download_spec.js b/lms/static/js/spec/instructor_dashboard/data_download_spec.js
index 75b81ac82d40..3f0daacf8465 100644
--- a/lms/static/js/spec/instructor_dashboard/data_download_spec.js
+++ b/lms/static/js/spec/instructor_dashboard/data_download_spec.js
@@ -17,7 +17,6 @@ function($, id, AjaxHelper) {
dataDownload = window.InstructorDashboard.sections;
dataDownload.DataDownloadV2($('#data_download_2'));
window.InstructorDashboard.util.PendingInstructorTasks = function() {
- return;
};
requests = AjaxHelper.requests(this);
$selected = $('
');
diff --git a/lms/static/js/staff_debug_actions.js b/lms/static/js/staff_debug_actions.js
index ae2f38e02a14..18dab75b7c3e 100644
--- a/lms/static/js/staff_debug_actions.js
+++ b/lms/static/js/staff_debug_actions.js
@@ -158,7 +158,6 @@ var StaffDebug = (function() {
// Register click handlers
$(document).ready(function() {
-
var $mainContainer = $('#main');
$mainContainer.on('click', '.staff-debug-reset', function() {
StaffDebug.reset(
diff --git a/lms/static/js/student_account/views/AccessView.js b/lms/static/js/student_account/views/AccessView.js
index f31a6f3abc6e..0ecf40e4647f 100644
--- a/lms/static/js/student_account/views/AccessView.js
+++ b/lms/static/js/student_account/views/AccessView.js
@@ -272,7 +272,6 @@
// Load the form. Institution login is always refreshed since it changes based on the previous form.
if (!this.form.isLoaded($form) || type == 'institution_login') {
-
// We need a special case for loading reset form as there is mismatch of form id
// value ie 'password-reset' vs load function name ie 'reset'
if (type === 'password-reset') {
diff --git a/openedx/features/announcements/static/announcements/jsx/Announcements.test.jsx b/openedx/features/announcements/static/announcements/jsx/Announcements.test.jsx
index afcec6882b44..3ec55f392889 100644
--- a/openedx/features/announcements/static/announcements/jsx/Announcements.test.jsx
+++ b/openedx/features/announcements/static/announcements/jsx/Announcements.test.jsx
@@ -22,5 +22,4 @@ describe('Announcements component', () => {
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
-
});
diff --git a/openedx/features/course_experience/static/course_experience/js/currency.js b/openedx/features/course_experience/static/course_experience/js/currency.js
index c5f7111a279a..c2019b8e5ab8 100644
--- a/openedx/features/course_experience/static/course_experience/js/currency.js
+++ b/openedx/features/course_experience/static/course_experience/js/currency.js
@@ -2,7 +2,6 @@ import 'jquery.cookie';
import $ from 'jquery'; // eslint-disable-line import/extensions
export class Currency { // eslint-disable-line import/prefer-default-export
-
editText(price) {
const l10nCookie = this.countryL10nData;
const lmsregex = /(\$)([\d|.]*)( USD)/g;
diff --git a/openedx/features/course_experience/static/course_experience/js/spec/Currency_spec.js b/openedx/features/course_experience/static/course_experience/js/spec/Currency_spec.js
index 4defec6ad84c..e2be162498a3 100644
--- a/openedx/features/course_experience/static/course_experience/js/spec/Currency_spec.js
+++ b/openedx/features/course_experience/static/course_experience/js/spec/Currency_spec.js
@@ -31,27 +31,27 @@ describe('Currency factory', () => {
longitude: 137.737495,
},
};
- $.cookie('edx-price-l10n', null, { path: '/' });
+ $.cookie('edx-price-l10n', null, {path: '/'});
});
describe('converts price to local currency', () => {
it('when location is the default (US)', () => {
- $.cookie('edx-price-l10n', '{"rate":1,"code":"USD","symbol":"$","countryCode":"US"}', { path: '/' });
+ $.cookie('edx-price-l10n', '{"rate":1,"code":"USD","symbol":"$","countryCode":"US"}', {path: '/'});
currency = new Currency();
expect($('[name="verified_mode"].no-discount').filter(':visible').text()).toEqual('Pursue a Verified Certificate($100 USD)');
});
it('when cookie is set to a different country', () => {
- $.cookie('edx-price-l10n', '{"rate":2.2,"code":"CAD","symbol":"$","countryCode":"CAN"}', { expires: 1 });
+ $.cookie('edx-price-l10n', '{"rate":2.2,"code":"CAD","symbol":"$","countryCode":"CAN"}', {expires: 1});
currency = new Currency();
expect($('[name="verified_mode"].no-discount').filter(':visible').text()).toEqual('Pursue a Verified Certificate($220 CAD)');
});
it('when cookie is set to a different country with a discount', () => {
- $.cookie('edx-price-l10n', '{"rate":2.2,"code":"CAD","symbol":"$","countryCode":"CAN"}', { expires: 1 });
+ $.cookie('edx-price-l10n', '{"rate":2.2,"code":"CAD","symbol":"$","countryCode":"CAN"}', {expires: 1});
currency = new Currency();
expect($('[name="verified_mode"].discount').filter(':visible').text()).toEqual('Pursue a Verified Certificate($198 CAD $220 CAD)');
});
it('should send event on initial load', () => {
- $.cookie('edx-price-l10n', '{"rate":1,"code":"USD","symbol":"$","countryCode":"US"}', { path: '/' });
+ $.cookie('edx-price-l10n', '{"rate":1,"code":"USD","symbol":"$","countryCode":"US"}', {path: '/'});
currency = new Currency();
expect(window.analytics.track).toHaveBeenCalledWith('edx.bi.user.track_selection.local_currency_cookie_set');
});
diff --git a/xmodule/js/src/poll/poll_main.js b/xmodule/js/src/poll/poll_main.js
index dd1e91c6072d..48195fab7915 100644
--- a/xmodule/js/src/poll/poll_main.js
+++ b/xmodule/js/src/poll/poll_main.js
@@ -315,8 +315,6 @@
'ERROR: Invalid JSON config for poll ID "' + this.id + '".',
'Error messsage: "' + err.message + '".'
);
-
- return;
}
} // End-of: function PollMain(el) {
}); // End-of: define('PollMain', [], function () {
From 0f5078ed26396c2d8d3ce253503f26bb87e164fd Mon Sep 17 00:00:00 2001
From: Syed Ali Abbas Zaidi
Date: Wed, 10 May 2023 10:21:59 +0500
Subject: [PATCH 23/30] chore: remove all template literals
---
.../account_settings_fields_helpers.js | 2 +-
.../account_settings_fields_spec.js | 4 ++--
.../student_account/views/account_section_view.js | 2 +-
.../views/account_settings_factory.js | 4 ++--
.../views/account_settings_fields.js | 8 ++++----
.../student_account/views/account_settings_view.js | 8 ++++----
.../js/spec/views/learner_profile_fields_spec.js | 8 ++++----
.../learner_profile/js/spec_helpers/helpers.js | 14 +++++++-------
8 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/lms/static/js/spec/student_account/account_settings_fields_helpers.js b/lms/static/js/spec/student_account/account_settings_fields_helpers.js
index 210470e9f616..4aea86b235a3 100644
--- a/lms/static/js/spec/student_account/account_settings_fields_helpers.js
+++ b/lms/static/js/spec/student_account/account_settings_fields_helpers.js
@@ -9,7 +9,7 @@ function(Backbone, $, _, AjaxHelpers, TemplateHelpers, FieldViewsSpecHelpers) {
'use strict';
var verifyAuthField = function(view, data, requests) {
- var selector = `.u-field-value .u-field-link-title-${view.options.valueAttribute}`;
+ var selector = '.u-field-value .u-field-link-title-' + view.options.valueAttribute;
spyOn(view, 'redirect_to');
diff --git a/lms/static/js/spec/student_account/account_settings_fields_spec.js b/lms/static/js/spec/student_account/account_settings_fields_spec.js
index 0976fde79b76..76ea7c512b7f 100644
--- a/lms/static/js/spec/student_account/account_settings_fields_spec.js
+++ b/lms/static/js/spec/student_account/account_settings_fields_spec.js
@@ -52,8 +52,8 @@ function(Backbone, $, _, AjaxHelpers, TemplateHelpers, UserAccountModel, FieldVi
it('update time zone dropdown after country dropdown changes', function() {
var baseSelector = '.u-field-value > select';
- var groupsSelector = `${baseSelector}> optgroup`;
- var groupOptionsSelector = `${groupsSelector}> option`;
+ var groupsSelector = baseSelector + '> optgroup';
+ var groupOptionsSelector = groupsSelector + '> option';
var timeZoneData = FieldViewsSpecHelpers.createFieldData(AccountSettingsFieldViews.TimeZoneFieldView, {
valueAttribute: 'time_zone',
diff --git a/lms/static/js/student_account/views/account_section_view.js b/lms/static/js/student_account/views/account_section_view.js
index b94a4c9ea1b3..e205ffa01acd 100644
--- a/lms/static/js/student_account/views/account_section_view.js
+++ b/lms/static/js/student_account/views/account_section_view.js
@@ -33,7 +33,7 @@
renderFields: function() {
var view = this;
- _.each(view.$(`.${view.options.tabName}-section-body`), function(sectionEl, index) {
+ _.each(view.$('.' + view.options.tabName + '-section-body'), function(sectionEl, index) {
_.each(view.options.sections[index].fields, function(field) {
$(sectionEl).append(field.view.render().el);
});
diff --git a/lms/static/js/student_account/views/account_settings_factory.js b/lms/static/js/student_account/views/account_settings_factory.js
index a8e3cf4d711d..15d5774acf2a 100644
--- a/lms/static/js/student_account/views/account_settings_factory.js
+++ b/lms/static/js/student_account/views/account_settings_factory.js
@@ -381,7 +381,7 @@
return {
view: new AccountSettingsFieldViews.AuthFieldView({
title: provider.name,
- valueAttribute: `auth-${provider.id}`,
+ valueAttribute: 'auth-' + provider.id,
helpMessage: '',
connected: provider.connected,
connectUrl: provider.connect_url,
@@ -421,7 +421,7 @@
orderId: order.number,
orderDate: order.order_date,
receiptUrl: order.receipt_url,
- valueAttribute: `order-${orderNumber}`,
+ valueAttribute: 'order-' + orderNumber,
lines: order.lines
})
};
diff --git a/lms/static/js/student_account/views/account_settings_fields.js b/lms/static/js/student_account/views/account_settings_fields.js
index 613420e7b298..fbb5816ca808 100644
--- a/lms/static/js/student_account/views/account_settings_fields.js
+++ b/lms/static/js/student_account/views/account_settings_fields.js
@@ -192,7 +192,7 @@
});
},
toggleDisableButton: function(disabled) {
- var button = this.$(`#u-field-link-${this.options.valueAttribute}`);
+ var button = this.$('#u-field-link-' + this.options.valueAttribute);
if (button) {
button.prop('disabled', disabled);
}
@@ -246,7 +246,7 @@
SocialLinkTextFieldView: FieldViews.TextFieldView.extend({
render: function() {
HtmlUtils.setHtml(this.$el, HtmlUtils.template(field_text_account_template)({
- id: `${this.options.valueAttribute}_${this.options.platform}`,
+ id: this.options.valueAttribute + '_' + this.options.platform,
title: this.options.title,
value: this.modelValue(),
message: this.options.helpMessage,
@@ -281,7 +281,7 @@
ExtendedFieldTextFieldView: FieldViews.TextFieldView.extend({
render: function() {
HtmlUtils.setHtml(this.$el, HtmlUtils.template(field_text_account_template)({
- id: `${this.options.valueAttribute}_${this.options.field_name}`,
+ id: this.options.valueAttribute + '_' + this.options.field_name,
title: this.options.title,
value: this.modelValue(),
message: this.options.helpMessage,
@@ -340,7 +340,7 @@
AuthFieldView: FieldViews.LinkFieldView.extend({
fieldTemplate: field_social_link_template,
className: function() {
- return `u-field u-field-social u-field-${this.options.valueAttribute}`;
+ return 'u-field u-field-social u-field-' + this.options.valueAttribute;
},
initialize: function(options) {
this.options = _.extend({}, options);
diff --git a/lms/static/js/student_account/views/account_settings_view.js b/lms/static/js/student_account/views/account_settings_view.js
index c92ac3c0cd29..bead8da99f56 100644
--- a/lms/static/js/student_account/views/account_settings_view.js
+++ b/lms/static/js/student_account/views/account_settings_view.js
@@ -73,11 +73,11 @@
);
betaLangCode = this.options.betaLanguage.code.split('-');
if (betaLangCode.length > 1) {
- betaLangCode = `${betaLangCode[0]}_${betaLangCode[1].toUpperCase()}`;
+ betaLangCode = betaLangCode[0] + '_' + betaLangCode[1].toUpperCase();
} else {
betaLangCode = betaLangCode[0];
}
- helpTranslateLink = `https://www.transifex.com/open-edx/edx-platform/translate/#${betaLangCode}`;
+ helpTranslateLink = 'https://www.transifex.com/open-edx/edx-platform/translate/#' + betaLangCode;
oldLangCode = $.cookie('old-pref-lang');
// Deleting the cookie
document.cookie = 'old-pref-lang=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/account;';
@@ -112,7 +112,7 @@
$(tabPanel).addClass('hidden');
});
- $(`#${this.activeTab}-tabpanel`).removeClass('hidden');
+ $('#' + this.activeTab + '-tabpanel').removeClass('hidden');
$accountNavLink.attr('tabindex', -1);
$accountNavLink.attr('aria-selected', false);
@@ -136,7 +136,7 @@
tabName: tabName,
tabLabel: tabLabel,
sections: tabSections,
- el: `#${tabName}-tabpanel`
+ el: '#' + tabName + '-tabpanel'
});
accountSectionView.render();
diff --git a/openedx/features/learner_profile/static/learner_profile/js/spec/views/learner_profile_fields_spec.js b/openedx/features/learner_profile/static/learner_profile/js/spec/views/learner_profile_fields_spec.js
index 0ef69919d6c4..49b3dbc630df 100644
--- a/openedx/features/learner_profile/static/learner_profile/js/spec/views/learner_profile_fields_spec.js
+++ b/openedx/features/learner_profile/static/learner_profile/js/spec/views/learner_profile_fields_spec.js
@@ -140,7 +140,7 @@ define(
// get the url for newly uploaded image, So we need to send the response for that GET
data = {
profile_image: {
- image_url_large: `/media/profile-images/${imageName}`,
+ image_url_large: '/media/profile-images/' + imageName,
has_image: true
}
};
@@ -338,12 +338,12 @@ define(
socialLinkData = socialPlatformLinks[socialPlatform];
if (socialLinkData.social_link) {
// Icons with a social_link value should be displayed with a surrounding link
- $icon = socialLinksView.$(`span.fa-${socialPlatform}-square`);
+ $icon = socialLinksView.$('span.fa-' + socialPlatform + '-square');
expect($icon).toExist();
expect($icon.parent().is('a'));
} else {
// Icons without a social_link value should be displayed without a surrounding link
- $icon = socialLinksView.$(`span.fa-${socialPlatform}-square`);
+ $icon = socialLinksView.$('span.fa-' + socialPlatform + '-square');
expect($icon).toExist();
expect(!$icon.parent().is('a'));
}
@@ -372,7 +372,7 @@ define(
for (var i = 0; i < Object.keys(socialPlatformLinks); i++) { // eslint-disable-line vars-on-top
socialPlatform = Object.keys(socialPlatformLinks)[i];
socialLinkData = socialPlatformLinks[socialPlatform];
- $icon = socialLinksView.$(`span.fa-${socialPlatform}-square`);
+ $icon = socialLinksView.$('span.fa-' + socialPlatform + '-square');
expect($icon).toBe(null);
}
});
diff --git a/openedx/features/learner_profile/static/learner_profile/js/spec_helpers/helpers.js b/openedx/features/learner_profile/static/learner_profile/js/spec_helpers/helpers.js
index a675cfaf65fd..5d4a278907ca 100644
--- a/openedx/features/learner_profile/static/learner_profile/js/spec_helpers/helpers.js
+++ b/openedx/features/learner_profile/static/learner_profile/js/spec_helpers/helpers.js
@@ -31,7 +31,7 @@ define(['underscore', 'URI', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
expect($($element.find('.u-field-value .u-field-value-readonly')[0]).text()).toBe(view.modelValue());
}
} else {
- throw new Error(`Unexpected field type: ${view.fieldType}`);
+ throw new Error('Unexpected field type: ' + view.fieldType);
}
};
@@ -150,11 +150,11 @@ define(['underscore', 'URI', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
var expectPage = function(learnerProfileView, pageData) {
var $badgeListContainer = $('#tabpanel-accomplishments');
var index = $badgeListContainer.find('span.search-count').text().trim();
- expect(index).toBe(`Showing ${pageData.start + 1}-${pageData.start + pageData.results.length
- } out of ${pageData.count} total`);
- expect($badgeListContainer.find('.current-page').text()).toBe(`${pageData.current_page}`);
+ expect(index).toBe('Showing ' + (pageData.start + 1) + '-' + (pageData.start + pageData.results.length)
+ + ' out of ' + pageData.count + ' total');
+ expect($badgeListContainer.find('.current-page').text()).toBe('' + pageData.current_page);
_.each(pageData.results, function(badge) {
- expect($(`.badge-display:contains(${badge.badge_class.display_name})`).length).toBe(1);
+ expect($('.badge-display:contains(' + badge.badge_class.display_name + ')').length).toBe(1);
});
};
@@ -213,9 +213,9 @@ define(['underscore', 'URI', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
function makeBadge(num) {
return {
badge_class: {
- slug: `test_slug_${num}`,
+ slug: 'test_slug_' + num,
issuing_component: 'test_component',
- display_name: `Test Badge ${num}`,
+ display_name: 'Test Badge ' + num,
course_id: null,
description: "Yay! It's a test badge.",
criteria: 'https://example.com/syllabus',
From adc46215d409e387bbc4dd997c0e8e05fdfa202f Mon Sep 17 00:00:00 2001
From: Syed Ali Abbas Zaidi
Date: Wed, 10 May 2023 11:25:06 +0500
Subject: [PATCH 24/30] fix: remaining autofixable issues
---
.../js/certificates/spec/custom_matchers.js | 4 +--
.../static/common/js/jasmine_stack_trace.js | 4 +--
.../discussion_thread_profile_view_spec.js | 2 +-
lms/static/js/header/header.js | 4 +--
lms/static/js/leanModal.js | 4 +--
.../spec/program_details_sidebar_view_spec.js | 20 +++++++--------
.../spec/program_details_view_spec.js | 18 ++++++-------
.../views/program_details_view.js | 2 +-
.../student_admin_spec.js | 4 +--
.../announcements/jsx/Announcements.jsx | 2 +-
.../js/spec/Currency_spec.js | 10 ++++----
xmodule/js/spec/video/social_share_spec.js | 25 ++++++++++---------
.../js/src/video/036_video_social_sharing.js | 5 ++--
.../js/src/video/05_video_quality_control.js | 4 +--
xmodule/js/src/video/09_video_caption.js | 4 +--
15 files changed, 57 insertions(+), 55 deletions(-)
diff --git a/cms/static/js/certificates/spec/custom_matchers.js b/cms/static/js/certificates/spec/custom_matchers.js
index 18062476b895..32e19dec6a27 100644
--- a/cms/static/js/certificates/spec/custom_matchers.js
+++ b/cms/static/js/certificates/spec/custom_matchers.js
@@ -2,8 +2,8 @@
// http://tobyho.com/2012/01/30/write-a-jasmine-matcher/
define(['jquery'], function($) { // eslint-disable-line no-unused-vars
-
-'use strict';
+
+ 'use strict';
return function() {
jasmine.addMatchers({
diff --git a/common/static/common/js/jasmine_stack_trace.js b/common/static/common/js/jasmine_stack_trace.js
index 5cd73ff287ae..f61d591f0a43 100644
--- a/common/static/common/js/jasmine_stack_trace.js
+++ b/common/static/common/js/jasmine_stack_trace.js
@@ -3,8 +3,8 @@
initialized we can't override the ExceptionFormatter as Jasmine then uses the stored reference to the function */
(function() {
/* globals jasmineRequire */
-
-'use strict';
+
+ 'use strict';
var OldExceptionFormatter = jasmineRequire.ExceptionFormatter(),
oldExceptionFormatter = new OldExceptionFormatter(),
diff --git a/common/static/common/js/spec/discussion/view/discussion_thread_profile_view_spec.js b/common/static/common/js/spec/discussion/view/discussion_thread_profile_view_spec.js
index c18e86df39b8..70810dacbf20 100644
--- a/common/static/common/js/spec/discussion/view/discussion_thread_profile_view_spec.js
+++ b/common/static/common/js/spec/discussion/view/discussion_thread_profile_view_spec.js
@@ -61,7 +61,7 @@
if (i === 0) {
expectedHtml += imageTag;
} else {
- expectedHtml = expectedHtml + 'image omitted';
+ expectedHtml += 'image omitted';
}
}
}
diff --git a/lms/static/js/header/header.js b/lms/static/js/header/header.js
index 6907a9f8254c..8231de90500c 100644
--- a/lms/static/js/header/header.js
+++ b/lms/static/js/header/header.js
@@ -8,8 +8,8 @@ function createMobileMenu() {
* Dynamically create a mobile menu from all specified mobile links
* on the page.
*/
-
-'use strict';
+
+ 'use strict';
$('.mobile-nav-item').each(function() {
var mobileNavItem = $(this).clone().addClass('mobile-nav-link');
diff --git a/lms/static/js/leanModal.js b/lms/static/js/leanModal.js
index cd7f490e9d0d..dce0212449cd 100644
--- a/lms/static/js/leanModal.js
+++ b/lms/static/js/leanModal.js
@@ -1,6 +1,6 @@
(function($) { // eslint-disable-line wrap-iife
-
-'use strict';
+
+ 'use strict';
$.fn.extend({
/*
diff --git a/lms/static/js/learner_dashboard/spec/program_details_sidebar_view_spec.js b/lms/static/js/learner_dashboard/spec/program_details_sidebar_view_spec.js
index ea902fc8d099..cc94132cce84 100644
--- a/lms/static/js/learner_dashboard/spec/program_details_sidebar_view_spec.js
+++ b/lms/static/js/learner_dashboard/spec/program_details_sidebar_view_spec.js
@@ -61,18 +61,18 @@ describe('Program Progress View', () => {
expect(view.$('.js-subscription-info')[0]).toBeInDOM();
expect(
- view.$('.js-subscription-info .divider-heading').text().trim()
+ view.$('.js-subscription-info .divider-heading').text().trim(),
).toEqual(heading);
expect(
- view.$('.js-subscription-info .subscription-section p:nth-child(1)')
+ view.$('.js-subscription-info .subscription-section p:nth-child(1)'),
).toContainHtml(body);
expect(
- view.$('.js-subscription-info .subscription-section p:nth-child(2)')
+ view.$('.js-subscription-info .subscription-section p:nth-child(2)'),
).toContainText(
- /Need help\? Check out the.*Learner Help Center.*to troubleshoot issues or contact support/
+ /Need help\? Check out the.*Learner Help Center.*to troubleshoot issues or contact support/,
);
expect(
- view.$('.js-subscription-info .subscription-section p:nth-child(2) .subscription-link').attr('href')
+ view.$('.js-subscription-info .subscription-section p:nth-child(2) .subscription-link').attr('href'),
).toEqual('/learner');
};
@@ -235,18 +235,18 @@ describe('Program Progress View', () => {
testSubscriptionState(
'pre',
'Inactive subscription',
- 'If you had a subscription previously, your payment history is still available'
+ 'If you had a subscription previously, your payment history is still available',
);
});
it('should render active trial subscription info if subscription is active with trial', () => {
subscriptionData.trial_end = moment().add(3, 'days').utc().format(
- 'YYYY-MM-DDTHH:mm:ss[Z]'
+ 'YYYY-MM-DDTHH:mm:ss[Z]',
);
testSubscriptionState(
'active',
'Trial subscription',
- 'View your receipts or modify your subscription'
+ 'View your receipts or modify your subscription',
);
});
@@ -254,7 +254,7 @@ describe('Program Progress View', () => {
testSubscriptionState(
'active',
'Active subscription',
- 'View your receipts or modify your subscription'
+ 'View your receipts or modify your subscription',
);
});
@@ -262,7 +262,7 @@ describe('Program Progress View', () => {
testSubscriptionState(
'inactive',
'Inactive subscription',
- 'Restart your subscription for $100/month. Your payment history is still available'
+ 'Restart your subscription for $100/month. Your payment history is still available',
);
});
});
diff --git a/lms/static/js/learner_dashboard/spec/program_details_view_spec.js b/lms/static/js/learner_dashboard/spec/program_details_view_spec.js
index 60ac335830ae..5b65d219f583 100644
--- a/lms/static/js/learner_dashboard/spec/program_details_view_spec.js
+++ b/lms/static/js/learner_dashboard/spec/program_details_view_spec.js
@@ -523,7 +523,7 @@ describe('Program Details View', () => {
};
if (trial) {
subscriptionData.trial_end = moment().add(3, 'days').utc().format(
- 'YYYY-MM-DDTHH:mm:ss[Z]'
+ 'YYYY-MM-DDTHH:mm:ss[Z]',
);
}
view = initView({
@@ -579,9 +579,9 @@ describe('Program Details View', () => {
expect(view.$('.program-heading-title').text()).toEqual('Your Program Journey');
expect(view.$('.program-heading-message').text().trim()
.replace(/\s+/g, ' ')).toEqual(
- 'Track and plan your progress through the 3 courses in this program. '
+ 'Track and plan your progress through the 3 courses in this program. '
+ 'To complete the program, you must earn a verified certificate for each course.',
- );
+ );
});
it('should render the program heading congratulations message if all courses completed', () => {
@@ -597,8 +597,8 @@ describe('Program Details View', () => {
expect(view.$('.program-heading-title').text()).toEqual('Congratulations!');
expect(view.$('.program-heading-message').text().trim()
.replace(/\s+/g, ' ')).toEqual(
- 'You have successfully completed all the requirements for the Test Course Title Test.',
- );
+ 'You have successfully completed all the requirements for the Test Course Title Test.',
+ );
});
it('should render the course list headings', () => {
@@ -694,7 +694,7 @@ describe('Program Details View', () => {
testSubscriptionState(
'pre',
'Start 7-Day free trial',
- '$100/month subscription after trial ends. Cancel anytime.'
+ '$100/month subscription after trial ends. Cancel anytime.',
);
});
@@ -703,7 +703,7 @@ describe('Program Details View', () => {
'active',
'Manage my subscription',
'Active trial ends',
- true
+ true,
);
});
@@ -711,7 +711,7 @@ describe('Program Details View', () => {
testSubscriptionState(
'active',
'Manage my subscription',
- 'Your next billing date is'
+ 'Your next billing date is',
);
});
@@ -719,7 +719,7 @@ describe('Program Details View', () => {
testSubscriptionState(
'inactive',
'Restart my subscription',
- 'Unlock verified access to all courses for $100/month. Cancel anytime.'
+ 'Unlock verified access to all courses for $100/month. Cancel anytime.',
);
});
});
diff --git a/lms/static/js/learner_dashboard/views/program_details_view.js b/lms/static/js/learner_dashboard/views/program_details_view.js
index d55c1bd8c4a9..fdd29ac69213 100644
--- a/lms/static/js/learner_dashboard/views/program_details_view.js
+++ b/lms/static/js/learner_dashboard/views/program_details_view.js
@@ -42,7 +42,7 @@ class ProgramDetailsView extends Backbone.View {
this.programModel = new Backbone.Model(this.options.programData);
this.courseData = new Backbone.Model(this.options.courseData);
this.certificateCollection = new Backbone.Collection(
- this.options.certificateData
+ this.options.certificateData,
);
this.subscriptionModel = new SubscriptionModel({
context: this.options,
diff --git a/lms/static/js/spec/instructor_dashboard/student_admin_spec.js b/lms/static/js/spec/instructor_dashboard/student_admin_spec.js
index 97d5cd0407bc..a4314228e006 100644
--- a/lms/static/js/spec/instructor_dashboard/student_admin_spec.js
+++ b/lms/static/js/spec/instructor_dashboard/student_admin_spec.js
@@ -2,8 +2,8 @@
define(['jquery', 'js/instructor_dashboard/student_admin', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'],
function($, StudentAdmin, AjaxHelpers) {
// 'js/instructor_dashboard/student_admin'
-
-'use strict';
+
+ 'use strict';
describe('edx.instructor_dashboard.student_admin.StudentAdmin', function() {
var studentadmin, dashboardApiUrl, uniqStudentIdentifier, alertMsg;
diff --git a/openedx/features/announcements/static/announcements/jsx/Announcements.jsx b/openedx/features/announcements/static/announcements/jsx/Announcements.jsx
index 5945c245b0f4..eff152146ef1 100644
--- a/openedx/features/announcements/static/announcements/jsx/Announcements.jsx
+++ b/openedx/features/announcements/static/announcements/jsx/Announcements.jsx
@@ -19,7 +19,7 @@ class AnnouncementSkipLink extends React.Component {
}
render() {
- return ({'Skip to list of ' + this.state.count + ' announcements'}
)
+ return ({'Skip to list of ' + this.state.count + ' announcements'}
);
}
}
diff --git a/openedx/features/course_experience/static/course_experience/js/spec/Currency_spec.js b/openedx/features/course_experience/static/course_experience/js/spec/Currency_spec.js
index e2be162498a3..4defec6ad84c 100644
--- a/openedx/features/course_experience/static/course_experience/js/spec/Currency_spec.js
+++ b/openedx/features/course_experience/static/course_experience/js/spec/Currency_spec.js
@@ -31,27 +31,27 @@ describe('Currency factory', () => {
longitude: 137.737495,
},
};
- $.cookie('edx-price-l10n', null, {path: '/'});
+ $.cookie('edx-price-l10n', null, { path: '/' });
});
describe('converts price to local currency', () => {
it('when location is the default (US)', () => {
- $.cookie('edx-price-l10n', '{"rate":1,"code":"USD","symbol":"$","countryCode":"US"}', {path: '/'});
+ $.cookie('edx-price-l10n', '{"rate":1,"code":"USD","symbol":"$","countryCode":"US"}', { path: '/' });
currency = new Currency();
expect($('[name="verified_mode"].no-discount').filter(':visible').text()).toEqual('Pursue a Verified Certificate($100 USD)');
});
it('when cookie is set to a different country', () => {
- $.cookie('edx-price-l10n', '{"rate":2.2,"code":"CAD","symbol":"$","countryCode":"CAN"}', {expires: 1});
+ $.cookie('edx-price-l10n', '{"rate":2.2,"code":"CAD","symbol":"$","countryCode":"CAN"}', { expires: 1 });
currency = new Currency();
expect($('[name="verified_mode"].no-discount').filter(':visible').text()).toEqual('Pursue a Verified Certificate($220 CAD)');
});
it('when cookie is set to a different country with a discount', () => {
- $.cookie('edx-price-l10n', '{"rate":2.2,"code":"CAD","symbol":"$","countryCode":"CAN"}', {expires: 1});
+ $.cookie('edx-price-l10n', '{"rate":2.2,"code":"CAD","symbol":"$","countryCode":"CAN"}', { expires: 1 });
currency = new Currency();
expect($('[name="verified_mode"].discount').filter(':visible').text()).toEqual('Pursue a Verified Certificate($198 CAD $220 CAD)');
});
it('should send event on initial load', () => {
- $.cookie('edx-price-l10n', '{"rate":1,"code":"USD","symbol":"$","countryCode":"US"}', {path: '/'});
+ $.cookie('edx-price-l10n', '{"rate":1,"code":"USD","symbol":"$","countryCode":"US"}', { path: '/' });
currency = new Currency();
expect(window.analytics.track).toHaveBeenCalledWith('edx.bi.user.track_selection.local_currency_cookie_set');
});
diff --git a/xmodule/js/spec/video/social_share_spec.js b/xmodule/js/spec/video/social_share_spec.js
index 69d01717ae00..f0c3006a1bf7 100644
--- a/xmodule/js/spec/video/social_share_spec.js
+++ b/xmodule/js/spec/video/social_share_spec.js
@@ -1,38 +1,39 @@
(function() {
'use strict';
+
describe('VideoSocialSharingHandler', function() {
var state;
beforeEach(function() {
state = jasmine.initializePlayer('video_all.html');
- window.analytics = jasmine.createSpyObj('analytics', ['track'])
+ window.analytics = jasmine.createSpyObj('analytics', ['track']);
});
afterAll(() => delete window.analytics);
describe('clicking social share fires an analytics event', function() {
const testCases = [
- { source: 'twitter' },
- { source: 'facebook' },
- { source: 'linkedin' },
+ {source: 'twitter'},
+ {source: 'facebook'},
+ {source: 'linkedin'},
];
- _.each(testCases, ({ source }) => {
+ _.each(testCases, ({source}) => {
it(source, () => {
var siteShareButton = $(`.social-share-link[data-source="${source}"]`);
expect(siteShareButton.length).toEqual(1);
-
+
siteShareButton.trigger('click');
expect(window.analytics.track).toHaveBeenCalledWith(
'edx.social.video.share_button.clicked',
- {
- source: source,
- video_block_id: 'block-v1:coursekey+type@video+block@000000000000000000',
- course_id: 'course-v1:someOrg+thisCOurse+runAway',
- }
+ {
+ source: source,
+ video_block_id: 'block-v1:coursekey+type@video+block@000000000000000000',
+ course_id: 'course-v1:someOrg+thisCOurse+runAway',
+ }
);
});
});
});
});
-}).call(this);
\ No newline at end of file
+}).call(this);
diff --git a/xmodule/js/src/video/036_video_social_sharing.js b/xmodule/js/src/video/036_video_social_sharing.js
index 3658438161e7..6ab363eaece9 100644
--- a/xmodule/js/src/video/036_video_social_sharing.js
+++ b/xmodule/js/src/video/036_video_social_sharing.js
@@ -1,5 +1,6 @@
(function(define) {
'use strict';
+
// VideoSocialSharingHandler module.
define(
'video/036_video_social_sharing.js', ['underscore'],
@@ -37,13 +38,13 @@
this.el.on('click', '.btn-link', this.clickHandler);
this.baseVideoUrl = this.el.data('url');
this.course_id = this.container.data('courseId');
- this.block_id = this.container.data('blockId')
+ this.block_id = this.container.data('blockId');
},
// Fire an analytics event on share button click.
clickHandler: function(event) {
var self = this;
- var source = $(event.currentTarget).data('source')
+ var source = $(event.currentTarget).data('source');
self.sendAnalyticsEvent(source);
},
diff --git a/xmodule/js/src/video/05_video_quality_control.js b/xmodule/js/src/video/05_video_quality_control.js
index ad19aa3132f9..aa97119d3a7c 100644
--- a/xmodule/js/src/video/05_video_quality_control.js
+++ b/xmodule/js/src/video/05_video_quality_control.js
@@ -1,7 +1,7 @@
(function(requirejs, require, define) {
// VideoQualityControl module.
-
-'use strict';
+
+ 'use strict';
define(
'video/05_video_quality_control.js',
diff --git a/xmodule/js/src/video/09_video_caption.js b/xmodule/js/src/video/09_video_caption.js
index 1d602bb93337..f7a3cda18dad 100644
--- a/xmodule/js/src/video/09_video_caption.js
+++ b/xmodule/js/src/video/09_video_caption.js
@@ -1,7 +1,7 @@
(function(define) {
// VideoCaption module.
-
-'use strict';
+
+ 'use strict';
define('video/09_video_caption.js', [
'video/00_sjson.js',
From 4d051815662017a2d06d18de429e2ea087b7ce82 Mon Sep 17 00:00:00 2001
From: Syed Ali Abbas Zaidi
Date: Fri, 5 May 2023 12:52:50 +0500
Subject: [PATCH 25/30] chore: apply amnesty on all existing issues
---
cms/static/cms/js/spec/main_spec.js | 1 +
.../js/certificates/spec/custom_matchers.js | 1 +
cms/static/js/factories/container.js | 1 +
cms/static/js/factories/context_course.js | 1 +
cms/static/js/factories/edit_tabs.js | 1 +
cms/static/js/factories/library.js | 1 +
cms/static/js/factories/settings.js | 1 +
cms/static/js/factories/textbooks.js | 1 +
cms/static/js/factories/xblock_validation.js | 1 +
.../js/features/import/factories/import.js | 1 +
.../studio/CourseOrLibraryListing.jsx | 6 ++++
cms/static/js/models/location.js | 1 +
cms/static/js/sock.js | 3 ++
.../spec/models/group_configuration_spec.js | 6 ++++
.../spec/utils/handle_iframe_binding_spec.js | 1 +
.../video/transcripts/message_manager_spec.js | 4 +++
.../js/spec/video/transcripts/utils_spec.js | 2 ++
.../spec/video/transcripts/videolist_spec.js | 1 +
cms/static/js/spec/views/module_edit_spec.js | 2 ++
cms/static/js/spec/views/move_xblock_spec.js | 2 ++
.../js/spec/views/pages/container_spec.js | 3 ++
.../spec/views/pages/course_outline_spec.js | 13 ++++++++
.../js/spec/views/xblock_editor_spec.js | 1 +
cms/static/js/spec_helpers/edit_helpers.js | 2 ++
cms/static/js/utils/drag_and_drop.js | 1 +
cms/static/js/utils/handle_iframe_binding.js | 1 +
cms/static/js/views/assets.js | 4 +++
cms/static/js/views/baseview.js | 2 ++
cms/static/js/views/course_info_edit.js | 2 ++
cms/static/js/views/course_outline.js | 1 +
cms/static/js/views/course_video_settings.js | 3 ++
cms/static/js/views/list.js | 1 +
cms/static/js/views/manage_users_and_roles.js | 3 ++
cms/static/js/views/metadata.js | 5 ++++
.../js/views/modals/course_outline_modals.js | 4 +++
cms/static/js/views/module_edit.js | 1 +
cms/static/js/views/pages/course_outline.js | 1 +
cms/static/js/views/settings/advanced.js | 1 +
cms/static/js/views/settings/grading.js | 5 ++++
cms/static/js/views/settings/main.js | 4 +++
cms/static/js/views/tabs.js | 1 +
.../js/views/utils/create_library_utils.js | 1 +
cms/static/js/views/validation.js | 1 +
.../views/video/transcripts/file_uploader.js | 1 +
.../video/transcripts/metadata_videolist.js | 2 ++
.../js/views/video/transcripts/utils.js | 4 +++
.../js/views/video/translations_editor.js | 1 +
.../components/BlockBrowser/BlockBrowser.jsx | 9 ++++++
.../BlockBrowser/BlockBrowser.test.jsx | 6 ++++
.../BlockBrowser/BlockBrowserContainer.jsx | 5 ++++
.../BlockBrowser/data/actions/courseBlocks.js | 5 ++++
.../BlockBrowser/data/api/client.js | 4 +++
.../BlockBrowser/data/reducers/index.js | 9 ++++++
.../js/components/BlockBrowser/data/store.js | 5 ++++
.../js/components/BlockBrowser/index.jsx | 6 ++++
.../js/components/ExperimentalCarousel.jsx | 4 +++
common/static/common/js/discussion/content.js | 1 +
.../static/common/js/discussion/discussion.js | 2 ++
common/static/common/js/discussion/utils.js | 4 +++
.../views/discussion_content_view.js | 2 ++
.../views/discussion_thread_list_view.js | 2 ++
.../views/discussion_thread_show_view.js | 1 +
.../views/discussion_thread_view.js | 3 ++
.../js/discussion/views/new_post_view.js | 2 ++
.../discussion/views/response_comment_view.js | 1 +
.../discussion/views/thread_response_view.js | 2 ++
common/static/common/js/karma.common.conf.js | 2 ++
.../js/spec/components/feedback_spec.js | 2 ++
.../view/discussion_thread_list_view_spec.js | 1 +
.../discussion_thread_profile_view_spec.js | 2 ++
.../view/discussion_thread_view_spec.js | 1 +
.../view/discussion_topic_menu_view_spec.js | 1 +
.../static/common/js/spec/xblock/core_spec.js | 2 ++
.../js/spec_helpers/jasmine-extensions.js | 1 +
.../common/js/spec_helpers/jasmine-stealth.js | 2 ++
.../common/js/utils/edx.utils.validate.js | 1 +
.../static/common/js/utils/require-serial.js | 1 +
common/static/js/capa/design-protein-2d.js | 2 +-
.../js/capa/drag_and_drop/draggable_logic.js | 3 ++
common/static/js/capa/drag_and_drop/main.js | 2 ++
.../static/js/capa/drag_and_drop/scroller.js | 1 +
.../js/capa/drag_and_drop/update_input.js | 10 +++++++
common/static/js/capa/schematicinput.js | 1 +
.../spec/formula_equation_preview_spec.js | 3 ++
common/static/js/capa/src/jschannel.js | 9 ++++++
common/static/js/capa/src/jsinput.js | 3 ++
.../js/capa/symbolic_mathjax_preprocessor.js | 2 +-
common/static/js/src/ReactRenderer.jsx | 2 ++
common/static/js/src/accessibility_tools.js | 1 +
.../ProblemBrowser/components/Main/Main.jsx | 10 +++++++
.../components/Main/Main.test.jsx | 7 +++++
.../components/Main/MainContainer.jsx | 6 ++++
.../components/ReportStatus/ReportStatus.jsx | 8 +++++
.../ReportStatus/ReportStatus.test.jsx | 6 ++++
.../ReportStatus/ReportStatusContainer.jsx | 5 ++++
.../data/actions/problemResponses.js | 6 ++++
.../ProblemBrowser/data/api/client.js | 5 ++++
.../ProblemBrowser/data/reducers/index.js | 1 +
.../instructor/ProblemBrowser/data/store.js | 5 ++++
.../instructor/ProblemBrowser/index.jsx | 6 ++++
.../static/support/js/views/certificates.js | 1 +
.../components/EntitlementForm/container.jsx | 5 ++++
.../components/EntitlementForm/index.jsx | 6 ++++
.../jsx/entitlements/components/Main/Main.jsx | 7 +++++
.../components/Main/MainContainer.jsx | 5 ++++
.../entitlements/components/Search/Search.jsx | 5 ++++
.../components/Search/SearchContainer.jsx | 5 ++++
.../Table/EntitlementSupportTable.jsx | 7 +++++
.../EntitlementSupportTableContainer.jsx | 5 ++++
.../entitlements/data/actions/entitlement.js | 5 ++++
.../jsx/entitlements/data/actions/error.js | 5 ++++
.../jsx/entitlements/data/actions/form.js | 5 ++++
.../jsx/entitlements/data/api/client.js | 5 ++++
.../data/reducers/entitlements.js | 6 ++++
.../jsx/entitlements/data/reducers/error.js | 6 ++++
.../jsx/entitlements/data/reducers/form.js | 6 ++++
.../jsx/entitlements/data/reducers/index.js | 5 ++++
.../support/jsx/entitlements/data/store.js | 5 ++++
.../static/support/jsx/entitlements/index.jsx | 6 ++++
.../static/support/jsx/errors_list.jsx | 6 ++++
.../static/support/jsx/file_upload.jsx | 8 +++++
.../static/support/jsx/logged_in_user.jsx | 6 ++++
.../static/support/jsx/logged_out_user.jsx | 6 ++++
.../support/jsx/program_enrollments/index.jsx | 6 ++++
.../jsx/program_enrollments/inspector.jsx | 14 +++++++++
.../support/jsx/single_support_form.jsx | 26 ++++++++++++++++
.../support/static/support/jsx/success.jsx | 5 ++++
.../static/support/jsx/upload_progress.jsx | 7 +++++
.../teams/js/spec/views/team_profile_spec.js | 1 +
.../teams/static/teams/js/views/teams_tab.js | 8 +++++
.../completion/js/CompletionOnViewService.js | 4 +++
lms/static/completion/js/ViewedEvent.js | 1 +
.../completion/js/spec/ViewedEvent_spec.js | 12 ++++++++
lms/static/js/Markdown.Editor.js | 20 +++++++++++--
lms/static/js/Markdown.Sanitizer.js | 4 ++-
.../accessible_components/StatusBarAlert.jsx | 1 +
lms/static/js/ajax-error.js | 1 +
lms/static/js/ccx/schedule.js | 7 +++++
.../views/certificate_invalidation_view.js | 1 +
lms/static/js/dashboard/donation.js | 2 ++
lms/static/js/dashboard/dropdown.js | 1 +
.../DemographicsCollectionBanner.jsx | 3 ++
.../DemographicsCollectionModal.jsx | 13 ++++++++
.../MultiselectDropdown.jsx | 11 +++++++
.../SelectWithInput.jsx | 2 ++
.../js/demographics_collection/Wizard.jsx | 10 +++++++
lms/static/js/discovery/collection.js | 2 ++
.../js/discovery/models/search_state.js | 1 +
.../js/discovery/views/refine_sidebar.js | 2 ++
lms/static/js/edxnotes/collections/tabs.js | 1 +
lms/static/js/edxnotes/models/tab.js | 1 +
.../js/edxnotes/plugins/caret_navigation.js | 1 +
lms/static/js/edxnotes/plugins/events.js | 1 +
lms/static/js/edxnotes/plugins/scroller.js | 1 +
.../edxnotes/plugins/store_error_handler.js | 1 +
lms/static/js/edxnotes/utils/logger.js | 3 ++
lms/static/js/edxnotes/utils/template.js | 1 +
lms/static/js/edxnotes/utils/utils.js | 1 +
lms/static/js/edxnotes/views/note_group.js | 1 +
lms/static/js/edxnotes/views/note_item.js | 1 +
lms/static/js/edxnotes/views/notes_factory.js | 2 ++
lms/static/js/edxnotes/views/notes_page.js | 1 +
.../views/notes_visibility_factory.js | 1 +
lms/static/js/edxnotes/views/page_factory.js | 1 +
lms/static/js/edxnotes/views/search_box.js | 2 ++
lms/static/js/edxnotes/views/shim.js | 1 +
lms/static/js/edxnotes/views/tab_item.js | 1 +
lms/static/js/edxnotes/views/tab_panel.js | 1 +
lms/static/js/edxnotes/views/tab_view.js | 1 +
.../edxnotes/views/tabs/course_structure.js | 2 ++
.../js/edxnotes/views/tabs/recent_activity.js | 1 +
.../js/edxnotes/views/tabs/search_results.js | 1 +
lms/static/js/edxnotes/views/tabs/tags.js | 2 ++
lms/static/js/edxnotes/views/tabs_list.js | 1 +
.../js/edxnotes/views/visibility_decorator.js | 1 +
lms/static/js/form.ext.js | 3 ++
lms/static/js/groups/views/cohorts.js | 1 +
.../groups/views/cohorts_dashboard_factory.js | 1 +
lms/static/js/header/header.js | 1 +
lms/static/js/ie11_find_array.js | 1 +
.../js/instructor_dashboard/certificates.js | 4 +++
.../instructor_dashboard/cohort_management.js | 1 +
.../instructor_dashboard.js | 2 ++
.../js/instructor_dashboard/membership.js | 4 +++
.../js/instructor_dashboard/student_admin.js | 1 +
.../js/jwt_auth/AxiosCsrfTokenService.js | 5 ++++
.../js/jwt_auth/AxiosJwtTokenService.js | 7 +++++
.../interceptors/createRetryInterceptor.js | 6 ++++
lms/static/js/leanModal.js | 1 +
.../CircleChart.jsx | 6 ++++
.../CircleChartLegend.jsx | 3 ++
.../Discussions.jsx | 2 ++
.../learner_analytics_dashboard/DueDates.jsx | 4 +++
.../GradeTable.jsx | 5 ++++
.../LearnerAnalyticsDashboard.jsx | 4 +++
.../EnterpriseLearnerPortalModal.jsx | 16 ++++++++++
.../js/learner_dashboard/certificate_api.js | 6 ++++
.../collections/course_card_collection.js | 6 ++++
.../collections/program_collection.js | 6 ++++
.../program_progress_collection.js | 5 ++++
.../course_entitlement_factory.js | 5 ++++
.../entitlement_unenrollment_factory.js | 5 ++++
.../models/course_card_model.js | 9 ++++++
.../models/course_enroll_model.js | 6 ++++
.../models/course_entitlement_model.js | 6 ++++
.../learner_dashboard/models/program_model.js | 5 ++++
.../program_details_factory.js | 5 ++++
.../learner_dashboard/program_list_factory.js | 5 ++++
.../spec/collection_list_view_spec.js | 7 ++++-
.../spec/course_card_view_spec.js | 7 +++++
.../spec/course_enroll_view_spec.js | 15 ++++++++++
.../spec/course_entitlement_view_spec.js | 5 ++++
.../entitlement_unenrollment_view_spec.js | 30 +++++++++++++++++++
.../spec/program_card_view_spec.js | 7 +++++
.../spec/program_details_header_spec.js | 5 ++++
.../spec/program_details_sidebar_view_spec.js | 6 ++++
.../spec/program_details_view_spec.js | 21 +++++++++++++
.../spec/progress_circle_view_spec.js | 6 ++++
.../spec/sidebar_view_spec.js | 5 ++++
.../spec/unenroll_view_spec.js | 9 ++++++
.../learner_dashboard/unenrollment_factory.js | 5 ++++
.../views/certificate_list_view.js | 5 ++++
.../views/certificate_status_view.js | 6 ++++
.../views/collection_list_view.js | 5 ++++
.../views/course_card_view.js | 7 +++++
.../views/course_enroll_view.js | 8 +++++
.../views/course_entitlement_view.js | 21 +++++++++++++
.../views/entitlement_unenrollment_view.js | 15 ++++++++++
.../views/expired_notification_view.js | 5 ++++
.../views/explore_new_programs_view.js | 7 +++++
.../views/program_card_view.js | 7 +++++
.../views/program_details_sidebar_view.js | 8 +++++
.../views/program_details_view.js | 12 ++++++++
.../views/program_header_view.js | 8 +++++
.../views/progress_circle_view.js | 7 +++++
.../learner_dashboard/views/sidebar_view.js | 6 ++++
.../learner_dashboard/views/unenroll_view.js | 16 ++++++++++
.../views/upgrade_message_view.js | 5 ++++
lms/static/js/pdf-analytics.js | 1 +
lms/static/js/pending_tasks.js | 2 ++
lms/static/js/shoppingcart/shoppingcart.js | 1 +
lms/static/js/spec/ccx/schedule_spec.js | 1 +
.../js/spec/components/card/card_spec.js | 1 +
.../spec/discovery/views/search_form_spec.js | 1 +
lms/static/js/spec/edxnotes/helpers.js | 5 ++++
.../edxnotes/plugins/accessibility_spec.js | 1 +
.../views/tabs/course_structure_spec.js | 1 +
.../views/tabs/recent_activity_spec.js | 3 ++
.../views/tabs/search_results_spec.js | 2 ++
.../instructor_dashboard/send_email_spec.js | 3 ++
.../account_settings_factory_spec.js | 1 +
lms/static/js/spec/views/fields_helpers.js | 2 ++
lms/static/js/split.js | 5 ++++
.../js/student_account/AccountsClient.js | 1 +
.../components/PasswordResetConfirmation.jsx | 5 ++++
.../components/PasswordResetInput.jsx | 5 ++++
.../components/StudentAccountDeletion.jsx | 7 ++++-
.../StudentAccountDeletionModal.jsx | 7 ++++-
.../components/removeLoggedInCookies.js | 6 ++++
.../spec/PasswordResetConfirmation_spec.js | 12 ++++++++
.../student_account/logistration_factory.js | 1 +
.../models/user_account_model.js | 1 +
.../models/user_preferences_model.js | 1 +
.../js/student_account/multiple_enterprise.js | 2 ++
.../student_account/views/FinishAuthView.js | 1 +
.../js/student_account/views/RegisterView.js | 2 ++
.../views/account_section_view.js | 1 +
.../views/account_settings_factory.js | 3 ++
.../views/account_settings_fields.js | 1 +
.../views/account_settings_view.js | 1 +
lms/static/js/toggle_login_modal.js | 4 +++
lms/static/js/views/file_uploader.js | 2 ++
lms/static/js/wiki/accessible.js | 1 +
lms/static/lms/js/preview/preview_factory.js | 2 ++
.../lms/js/spec/main_requirejs_coffee.js | 1 +
.../announcements/jsx/Announcements.jsx | 7 +++++
.../static/course_experience/js/CourseSock.js | 7 +++++
.../static/course_experience/js/currency.js | 7 +++++
.../js/spec/Currency_spec.js | 11 +++++++
scripts/delete-mongo-test-dbs.js | 1 +
scripts/xsslint/tests/templates/test.js | 2 ++
setupTests.js | 2 ++
webpack.common.config.js | 1 +
.../LibrarySourcedBlockPicker.jsx | 13 ++++++++
.../word_cloud/src/js/word_cloud_main.js | 14 +++++++++
xmodule/assets/word_cloud/webpack.config.js | 1 +
xmodule/js/karma_runner_webpack.js | 1 +
xmodule/js/spec/capa/imageinput_spec.js | 1 +
xmodule/js/spec/collapsible_spec.js | 1 +
xmodule/js/spec/main_requirejs.js | 1 +
xmodule/js/spec/sequence/display_spec.js | 1 +
xmodule/js/spec/time_spec.js | 1 +
xmodule/js/spec/video/events_spec.js | 1 +
xmodule/js/spec/video/general_spec.js | 2 ++
xmodule/js/spec/video/html5_video_spec.js | 3 ++
xmodule/js/spec/video/resizer_spec.js | 1 +
xmodule/js/spec/video/social_share_spec.js | 13 +++++---
xmodule/js/spec/video/video_bumper_spec.js | 1 +
xmodule/js/spec/video/video_caption_spec.js | 1 +
.../js/spec/video/video_context_menu_spec.js | 4 +++
.../video/video_events_bumper_plugin_spec.js | 1 +
.../js/spec/video/video_events_plugin_spec.js | 1 +
.../js/spec/video/video_focus_grabber_spec.js | 1 +
xmodule/js/spec/video/video_player_spec.js | 2 ++
.../spec/video/video_progress_slider_spec.js | 1 +
.../spec/video/video_quality_control_spec.js | 1 +
.../video/video_save_state_plugin_spec.js | 1 +
.../js/spec/video/video_speed_control_spec.js | 1 +
xmodule/js/spec/video/video_storage_spec.js | 3 ++
xmodule/js/src/capa/display.js | 6 ++++
xmodule/js/src/capa/imageinput.js | 1 +
xmodule/js/src/collapsible.js | 2 ++
xmodule/js/src/lti/lti.js | 3 ++
xmodule/js/src/poll/poll_main.js | 1 +
xmodule/js/src/problem/edit.js | 3 ++
xmodule/js/src/time.js | 2 ++
xmodule/js/src/video/00_component.js | 2 ++
xmodule/js/src/video/00_resizer.js | 2 ++
xmodule/js/src/video/01_initialize.js | 2 ++
.../js/src/video/036_video_social_sharing.js | 1 +
xmodule/js/src/video/03_video_player.js | 9 ++++++
xmodule/js/src/video/04_video_full_screen.js | 2 ++
.../js/src/video/05_video_quality_control.js | 1 +
.../js/src/video/06_video_progress_slider.js | 1 +
.../js/src/video/07_video_volume_control.js | 3 ++
.../js/src/video/08_video_speed_control.js | 3 ++
.../js/src/video/095_video_context_menu.js | 7 +++++
xmodule/js/src/video/09_video_caption.js | 3 ++
328 files changed, 1295 insertions(+), 12 deletions(-)
diff --git a/cms/static/cms/js/spec/main_spec.js b/cms/static/cms/js/spec/main_spec.js
index 5b59db83315f..8b9f27d0bd73 100644
--- a/cms/static/cms/js/spec/main_spec.js
+++ b/cms/static/cms/js/spec/main_spec.js
@@ -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() {
diff --git a/cms/static/js/certificates/spec/custom_matchers.js b/cms/static/js/certificates/spec/custom_matchers.js
index 32e19dec6a27..00ac8ca6b954 100644
--- a/cms/static/js/certificates/spec/custom_matchers.js
+++ b/cms/static/js/certificates/spec/custom_matchers.js
@@ -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';
diff --git a/cms/static/js/factories/container.js b/cms/static/js/factories/container.js
index b98e0f99f286..4ad252708a67 100644
--- a/cms/static/js/factories/container.js
+++ b/cms/static/js/factories/container.js
@@ -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 = {
diff --git a/cms/static/js/factories/context_course.js b/cms/static/js/factories/context_course.js
index 24745295ec04..db9d5f6cd459 100644
--- a/cms/static/js/factories/context_course.js
+++ b/cms/static/js/factories/context_course.js
@@ -1,3 +1,4 @@
import * as ContextCourse from 'js/models/course';
+// eslint-disable-next-line import/prefer-default-export
export {ContextCourse};
diff --git a/cms/static/js/factories/edit_tabs.js b/cms/static/js/factories/edit_tabs.js
index cd82fd2d913e..68bbba27bd73 100644
--- a/cms/static/js/factories/edit_tabs.js
+++ b/cms/static/js/factories/edit_tabs.js
@@ -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() {
diff --git a/cms/static/js/factories/library.js b/cms/static/js/factories/library.js
index c104b3b049d9..a444f81e8eca 100644
--- a/cms/static/js/factories/library.js
+++ b/cms/static/js/factories/library.js
@@ -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 = {
diff --git a/cms/static/js/factories/settings.js b/cms/static/js/factories/settings.js
index 34faec2eb11e..f8f927287c64 100644
--- a/cms/static/js/factories/settings.js
+++ b/cms/static/js/factories/settings.js
@@ -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'),
diff --git a/cms/static/js/factories/textbooks.js b/cms/static/js/factories/textbooks.js
index 4c2cec3130d1..c3ba710ebfda 100644
--- a/cms/static/js/factories/textbooks.js
+++ b/cms/static/js/factories/textbooks.js
@@ -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}),
diff --git a/cms/static/js/factories/xblock_validation.js b/cms/static/js/factories/xblock_validation.js
index 9936208626d0..2fac53f463ca 100644
--- a/cms/static/js/factories/xblock_validation.js
+++ b/cms/static/js/factories/xblock_validation.js
@@ -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;
diff --git a/cms/static/js/features/import/factories/import.js b/cms/static/js/features/import/factories/import.js
index 6b81540dbe2b..5ec2ff09415f 100644
--- a/cms/static/js/features/import/factories/import.js
+++ b/cms/static/js/features/import/factories/import.js
@@ -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;
diff --git a/cms/static/js/features_jsx/studio/CourseOrLibraryListing.jsx b/cms/static/js/features_jsx/studio/CourseOrLibraryListing.jsx
index 767287d149f1..d9b4493e0c7e 100644
--- a/cms/static/js/features_jsx/studio/CourseOrLibraryListing.jsx
+++ b/cms/static/js/features_jsx/studio/CourseOrLibraryListing.jsx
@@ -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) => (
@@ -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,
};
diff --git a/cms/static/js/models/location.js b/cms/static/js/models/location.js
index 75b4ecb633e6..b2ee1711d722 100644
--- a/cms/static/js/models/location.js
+++ b/cms/static/js/models/location.js
@@ -16,6 +16,7 @@ define(['backbone', 'underscore'], function(Backbone, _) {
+ (overrides && overrides.name ? overrides.name : this.get('name')) + '/';
},
_tagPattern: /[^:]+/g,
+ // eslint-disable-next-line prefer-regex-literals
_fieldPattern: new RegExp('[^/]+', 'g'),
parse: function(payload) {
diff --git a/cms/static/js/sock.js b/cms/static/js/sock.js
index 1512ec51bc76..c932e1aa2bb1 100644
--- a/cms/static/js/sock.js
+++ b/cms/static/js/sock.js
@@ -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();
@@ -38,4 +40,5 @@ domReady(function() {
$('.cta-show-sock').bind('click', toggleSock);
});
+// eslint-disable-next-line import/prefer-default-export
export {toggleSock};
diff --git a/cms/static/js/spec/models/group_configuration_spec.js b/cms/static/js/spec/models/group_configuration_spec.js
index be1de362d262..2206904bfa81 100644
--- a/cms/static/js/spec/models/group_configuration_spec.js
+++ b/cms/static/js/spec/models/group_configuration_spec.js
@@ -242,6 +242,7 @@ define([
var collection, injector, mockGettext, initializeGroupModel, cleanUp;
mockGettext = function(returnedValue) {
+ // eslint-disable-next-line no-shadow
var injector = new Squire();
injector.mock('gettext', function() {
@@ -258,6 +259,7 @@ define([
injector = mockGettext(dict);
injector.require(['js/collections/group'],
+ // eslint-disable-next-line no-shadow
function(GroupCollection) {
collection = new GroupCollection();
deferred.resolve(collection);
@@ -273,6 +275,7 @@ define([
};
it('returns correct ids', function() {
+ // eslint-disable-next-line no-shadow
var collection = new GroupCollection();
expect(collection.getGroupId(0)).toBe('A');
@@ -287,6 +290,7 @@ define([
it('just 1 character in the dictionary', function(done) {
initializeGroupModel('1')
+ // eslint-disable-next-line no-shadow
.then(function(collection) {
expect(collection.getGroupId(0)).toBe('1');
expect(collection.getGroupId(1)).toBe('11');
@@ -300,6 +304,7 @@ define([
it('allow to use unicode characters in the dict', function(done) {
initializeGroupModel('ö诶úeœ')
+ // eslint-disable-next-line no-shadow
.then(function(collection) {
expect(collection.getGroupId(0)).toBe('ö');
expect(collection.getGroupId(1)).toBe('诶');
@@ -316,6 +321,7 @@ define([
it('return initial value if dictionary is empty', function(done) {
initializeGroupModel('')
+ // eslint-disable-next-line no-shadow
.then(function(collection) {
expect(collection.getGroupId(0)).toBe('0');
expect(collection.getGroupId(5)).toBe('5');
diff --git a/cms/static/js/spec/utils/handle_iframe_binding_spec.js b/cms/static/js/spec/utils/handle_iframe_binding_spec.js
index 9cf632161af9..ada1844e8248 100644
--- a/cms/static/js/spec/utils/handle_iframe_binding_spec.js
+++ b/cms/static/js/spec/utils/handle_iframe_binding_spec.js
@@ -48,6 +48,7 @@ define(
});
it('does nothing on tinymce iframe', function() {
+ // eslint-disable-next-line no-script-url
verify_no_modification('javascript:');
});
});
diff --git a/cms/static/js/spec/video/transcripts/message_manager_spec.js b/cms/static/js/spec/video/transcripts/message_manager_spec.js
index aa09ebf4000e..9306cdfe81a6 100644
--- a/cms/static/js/spec/video/transcripts/message_manager_spec.js
+++ b/cms/static/js/spec/video/transcripts/message_manager_spec.js
@@ -154,6 +154,7 @@ define(
describe('processCommand', function() {
var action = 'replace',
errorMessage = 'errorMessage',
+ // eslint-disable-next-line no-void
videoList = void 0,
extraParamas = 'video_id';
@@ -175,6 +176,7 @@ define(
var defaults = {
action: 'replace',
errorMessage: 'errorMessage',
+ // eslint-disable-next-line no-void
extraParamas: void 0
};
var args = $.extend({}, defaults, config);
@@ -201,6 +203,7 @@ define(
action,
view.component_locator,
videoList,
+ // eslint-disable-next-line no-void
void 0
);
expect(view.showError).not.toHaveBeenCalled();
@@ -251,6 +254,7 @@ define(
action,
view.component_locator,
videoList,
+ // eslint-disable-next-line no-void
void 0
);
expect(view.showError).toHaveBeenCalled();
diff --git a/cms/static/js/spec/video/transcripts/utils_spec.js b/cms/static/js/spec/video/transcripts/utils_spec.js
index 13f948bbbd2a..1423c7c875c5 100644
--- a/cms/static/js/spec/video/transcripts/utils_spec.js
+++ b/cms/static/js/spec/video/transcripts/utils_spec.js
@@ -219,6 +219,7 @@ define(
});
it('Method: getYoutubeLink', function() {
+ // eslint-disable-next-line no-shadow
var videoId = 'video_id',
result = Utils.getYoutubeLink(videoId),
expectedResult = 'http://youtu.be/' + videoId;
@@ -262,6 +263,7 @@ define(
describe('Wrong arguments ', function() {
it('youtube videoId is wrong', function() {
+ // eslint-disable-next-line no-shadow
var videoId = 'wrong_id',
link = 'http://youtu.be/' + videoId,
result = Utils.parseLink(link);
diff --git a/cms/static/js/spec/video/transcripts/videolist_spec.js b/cms/static/js/spec/video/transcripts/videolist_spec.js
index 908d519d8921..e142174cd3d5 100644
--- a/cms/static/js/spec/video/transcripts/videolist_spec.js
+++ b/cms/static/js/spec/video/transcripts/videolist_spec.js
@@ -313,6 +313,7 @@ define(
it('is rendered without opened extra videos bar', function(done) {
var view = createVideoListView(this.mockServer),
+ // eslint-disable-next-line no-shadow
videoList = [
{
mode: 'youtube',
diff --git a/cms/static/js/spec/views/module_edit_spec.js b/cms/static/js/spec/views/module_edit_spec.js
index a96bbad99594..301d31441880 100644
--- a/cms/static/js/spec/views/module_edit_spec.js
+++ b/cms/static/js/spec/views/module_edit_spec.js
@@ -14,6 +14,7 @@ describe('ModuleEdit', function() {
+ '\n'
+ ' \n'
+ '
\n'
+ // eslint-disable-next-line no-template-curly-in-string
+ ' ${editor}\n'
+ '
\n'
+ '
Save\n'
@@ -73,6 +74,7 @@ describe('ModuleEdit', function() {
window.MockXBlock = function() {
return {};
};
+ // eslint-disable-next-line no-void
window.loadedXBlockResources = void 0;
this.moduleEdit.render();
return $.ajax.calls.mostRecent().args[0].success({
diff --git a/cms/static/js/spec/views/move_xblock_spec.js b/cms/static/js/spec/views/move_xblock_spec.js
index fa1eaba99b43..e32f8a043fc2 100644
--- a/cms/static/js/spec/views/move_xblock_spec.js
+++ b/cms/static/js/spec/views/move_xblock_spec.js
@@ -12,6 +12,7 @@ import XBlockInfo from 'js/models/xblock_info';
import Course from 'js/models/course';
import 'mock-ajax';
+// eslint-disable-next-line padded-blocks
describe('MoveXBlock', function() {
'use strict';
@@ -396,6 +397,7 @@ describe('MoveXBlock', function() {
expectedData,
sourceIndex = sourceIndex || 0; // eslint-disable-line no-redeclare
+ // eslint-disable-next-line no-multi-assign
responseData = expectedData = {
move_source_locator: xblockLocator,
parent_locator: modal.targetParentXBlockInfo.id
diff --git a/cms/static/js/spec/views/pages/container_spec.js b/cms/static/js/spec/views/pages/container_spec.js
index 642d092de455..f84efdca89b6 100644
--- a/cms/static/js/spec/views/pages/container_spec.js
+++ b/cms/static/js/spec/views/pages/container_spec.js
@@ -97,6 +97,7 @@ function parameterized_suite(label, globalPageOptions) {
AjaxHelpers.respondWithJson(requests, options || {});
};
+ // eslint-disable-next-line no-shadow
handleContainerPageRefresh = function(requests) {
var request = AjaxHelpers.currentRequest(requests);
expect(str.startsWith(request.url,
@@ -551,10 +552,12 @@ function parameterized_suite(label, globalPageOptions) {
describe('Previews', function() {
var getButtonIcon, getButtonText;
+ // eslint-disable-next-line no-shadow
getButtonIcon = function(containerPage) {
return containerPage.$('.action-toggle-preview .fa');
};
+ // eslint-disable-next-line no-shadow
getButtonText = function(containerPage) {
return containerPage.$('.action-toggle-preview .preview-text').text().trim();
};
diff --git a/cms/static/js/spec/views/pages/course_outline_spec.js b/cms/static/js/spec/views/pages/course_outline_spec.js
index 195e5702d093..ed1124d46589 100644
--- a/cms/static/js/spec/views/pages/course_outline_spec.js
+++ b/cms/static/js/spec/views/pages/course_outline_spec.js
@@ -241,6 +241,7 @@ describe('CourseOutlinePage', function() {
};
it('can be published', function() {
+ // eslint-disable-next-line no-shadow
var mockCourseJSON = getMockCourseJSON({
has_changes: true
});
@@ -256,6 +257,7 @@ describe('CourseOutlinePage', function() {
});
it('should show publish button if it is not published and not changed', function() {
+ // eslint-disable-next-line no-shadow
var mockCourseJSON = getMockCourseJSON({
has_changes: false,
published: false
@@ -264,6 +266,7 @@ describe('CourseOutlinePage', function() {
});
it('should show publish button if it is published and changed', function() {
+ // eslint-disable-next-line no-shadow
var mockCourseJSON = getMockCourseJSON({
has_changes: true,
published: true
@@ -272,6 +275,7 @@ describe('CourseOutlinePage', function() {
});
it('should show publish button if it is not published, but changed', function() {
+ // eslint-disable-next-line no-shadow
var mockCourseJSON = getMockCourseJSON({
has_changes: true,
published: false
@@ -280,6 +284,7 @@ describe('CourseOutlinePage', function() {
});
it('should hide publish button if it is not changed, but published', function() {
+ // eslint-disable-next-line no-shadow
var mockCourseJSON = getMockCourseJSON({
has_changes: false,
published: true
@@ -589,6 +594,7 @@ describe('CourseOutlinePage', function() {
setSelfPaced();
});
+ // eslint-disable-next-line prefer-const
createCourse = function(sectionOptions, courseOptions) {
createCourseOutlinePage(this,
createMockCourseJSON(courseOptions, [
@@ -597,14 +603,17 @@ describe('CourseOutlinePage', function() {
);
};
+ // eslint-disable-next-line prefer-const
createCourseWithHighlights = function(highlights) {
createCourse({highlights: highlights});
};
+ // eslint-disable-next-line prefer-const
clickSaveOnModal = function() {
$('.wrapper-modal-window .action-save').click();
};
+ // eslint-disable-next-line prefer-const
clickCancelOnModal = function() {
$('.wrapper-modal-window .action-cancel').click();
};
@@ -1043,6 +1052,7 @@ describe('CourseOutlinePage', function() {
});
it('can display a publish modal with a list of unpublished subsections and units', function() {
+ // eslint-disable-next-line no-shadow
var mockCourseJSON = createMockCourseJSON({}, [
createMockSectionJSON({has_changes: true}, [
createMockSubsectionJSON({has_changes: true}, [
@@ -1319,6 +1329,7 @@ describe('CourseOutlinePage', function() {
});
it('can show correct editors for self_paced course', function() {
+ // eslint-disable-next-line no-shadow
var mockCourseJSON = createMockCourseJSON({}, [
createMockSectionJSON({}, [
createMockSubsectionJSON({}, [])
@@ -2166,6 +2177,7 @@ describe('CourseOutlinePage', function() {
});
it('can display a publish modal with a list of unpublished units', function() {
+ // eslint-disable-next-line no-shadow
var mockCourseJSON = createMockCourseJSON({}, [
createMockSectionJSON({has_changes: true}, [
createMockSubsectionJSON({has_changes: true}, [
@@ -2193,6 +2205,7 @@ describe('CourseOutlinePage', function() {
describe('Self Paced with Custom Personalized Learner Schedules (PLS)', function() {
beforeEach(function() {
+ // eslint-disable-next-line no-shadow
var mockCourseJSON = createMockCourseJSON({}, [
createMockSectionJSON({}, [
createMockSubsectionJSON({}, [])
diff --git a/cms/static/js/spec/views/xblock_editor_spec.js b/cms/static/js/spec/views/xblock_editor_spec.js
index 00ed6c985443..5791572ddde0 100644
--- a/cms/static/js/spec/views/xblock_editor_spec.js
+++ b/cms/static/js/spec/views/xblock_editor_spec.js
@@ -98,6 +98,7 @@ describe('XBlockEditorView', function() {
it('can render a module with only settings', function() {
var requests = AjaxHelpers.requests(this),
+ // eslint-disable-next-line no-shadow
mockXModuleEditorHtml;
mockXModuleEditorHtml = readFixtures('templates/mock/mock-xmodule-settings-only-editor.underscore');
diff --git a/cms/static/js/spec_helpers/edit_helpers.js b/cms/static/js/spec_helpers/edit_helpers.js
index 0fa81b1e5a0b..acfdeff32344 100644
--- a/cms/static/js/spec_helpers/edit_helpers.js
+++ b/cms/static/js/spec_helpers/edit_helpers.js
@@ -12,6 +12,7 @@ import XModule from 'xmodule/js/src/xmodule';
import 'cms/js/main';
import 'xblock/cms.runtime.v1';
+// eslint-disable-next-line import/no-mutable-exports
var installMockXBlock, uninstallMockXBlock, installMockXModule, uninstallMockXModule,
mockComponentTemplates, installEditTemplates, showEditModal, verifyXBlockRequest;
@@ -116,6 +117,7 @@ verifyXBlockRequest = function(requests, expectedJson) {
expect(actualJson).toEqual(expectedJson);
};
+// eslint-disable-next-line import/no-mutable-exports
var editHelpers = $.extend(modal_helpers, {
installMockXBlock: installMockXBlock,
uninstallMockXBlock: uninstallMockXBlock,
diff --git a/cms/static/js/utils/drag_and_drop.js b/cms/static/js/utils/drag_and_drop.js
index 88c1301999c0..900523d37099 100644
--- a/cms/static/js/utils/drag_and_drop.js
+++ b/cms/static/js/utils/drag_and_drop.js
@@ -287,6 +287,7 @@ function($, ui, _, gettext, Draggabilly, ModuleUtils, NotificationView) {
oldParentLocator = element.data('parent'),
oldParentEle, saving, refreshParent;
+ // eslint-disable-next-line no-shadow
refreshParent = function(element) {
var refresh = element.data('refresh');
// If drop was into a collapsed parent, the parent will have been
diff --git a/cms/static/js/utils/handle_iframe_binding.js b/cms/static/js/utils/handle_iframe_binding.js
index b4527afd85d4..b7e904c47db0 100644
--- a/cms/static/js/utils/handle_iframe_binding.js
+++ b/cms/static/js/utils/handle_iframe_binding.js
@@ -33,6 +33,7 @@ define(['jquery'], function($) {
// The TinyMCE editor is hosted in an iframe, and before the iframe is
// removed we execute this code. To avoid throwing an error when setting the
// attr, check that the source doesn't start with the value specified by TinyMCE ('javascript:""').
+ // eslint-disable-next-line no-script-url
else if (ifr_source.lastIndexOf('javascript:', 0) !== 0) {
$(this).attr('src', ifr_source + '?' + wmode);
}
diff --git a/cms/static/js/views/assets.js b/cms/static/js/views/assets.js
index 5aaccda82f9e..6d4806418797 100644
--- a/cms/static/js/views/assets.js
+++ b/cms/static/js/views/assets.js
@@ -183,15 +183,18 @@ function($, _, gettext, HtmlUtils, BaseView, AssetModel, PagingView, AssetView,
type: 'POST',
maxChunkSize: self.uploadChunkSizeInBytes,
autoUpload: true,
+ // eslint-disable-next-line no-shadow
progressall: function(event, data) {
var percentComplete = parseInt((100 * data.loaded) / data.total, 10);
self.showUploadFeedback(event, percentComplete);
},
maxFileSize: self.maxFileSizeInBytes,
maxNumberofFiles: 100,
+ // eslint-disable-next-line no-shadow
done: function(event, data) {
self.displayFinishedUpload(data.result);
},
+ // eslint-disable-next-line no-shadow
processfail: function(event, data) {
var filename = data.files[data.index].name;
var error = gettext('File {filename} exceeds maximum size of {maxFileSizeInMBs} MB')
@@ -216,6 +219,7 @@ function($, _, gettext, HtmlUtils, BaseView, AssetModel, PagingView, AssetView,
msg: gettext('Max file size exceeded')
});
},
+ // eslint-disable-next-line no-shadow
processdone: function(event, data) {
self.largeFileErrorMsg = null;
}
diff --git a/cms/static/js/views/baseview.js b/cms/static/js/views/baseview.js
index c7da2bac6603..266264bb6c8d 100644
--- a/cms/static/js/views/baseview.js
+++ b/cms/static/js/views/baseview.js
@@ -38,6 +38,7 @@ function($, _, Backbone, gettext, IframeUtils, TemplateUtils, ViewUtils) {
if (!Math.trunc) {
Math.trunc = function(v) {
v = +v; // eslint-disable-line no-param-reassign
+ // eslint-disable-next-line no-mixed-operators, no-nested-ternary
return (v - v % 1) || (!isFinite(v) || v === 0 ? v : v < 0 ? -0 : 0);
};
}
@@ -45,6 +46,7 @@ function($, _, Backbone, gettext, IframeUtils, TemplateUtils, ViewUtils) {
var _this = this;
// xss-lint: disable=javascript-jquery-insertion
+ // eslint-disable-next-line no-shadow
this.render = _.wrap(this.render, function(render, options) {
_this.beforeRender();
render(options);
diff --git a/cms/static/js/views/course_info_edit.js b/cms/static/js/views/course_info_edit.js
index aab15d4f91f9..840ebf8939b0 100644
--- a/cms/static/js/views/course_info_edit.js
+++ b/cms/static/js/views/course_info_edit.js
@@ -12,12 +12,14 @@ define(['js/views/baseview', 'js/views/course_info_update', 'js/views/course_inf
render: function() {
// instantiate the ClassInfoUpdateView and delegate the proper dom to it
+ // eslint-disable-next-line no-new
new CourseInfoUpdateView({
el: $('body.updates'),
collection: this.model.get('updates'),
base_asset_url: this.model.get('base_asset_url')
});
+ // eslint-disable-next-line no-new
new CourseInfoHandoutView({
el: this.$('#course-handouts-view'),
model: this.model.get('handouts'),
diff --git a/cms/static/js/views/course_outline.js b/cms/static/js/views/course_outline.js
index 3eeeff5b1e07..72647d3edb5b 100644
--- a/cms/static/js/views/course_outline.js
+++ b/cms/static/js/views/course_outline.js
@@ -48,6 +48,7 @@ function(
refresh: function(viewState) {
var getViewToRefresh, view, expandedLocators;
+ // eslint-disable-next-line no-shadow
getViewToRefresh = function(view) {
if (view.model.isChapter() || !view.parentView) {
return view;
diff --git a/cms/static/js/views/course_video_settings.js b/cms/static/js/views/course_video_settings.js
index 4fe5586e120a..265efa45cf8b 100644
--- a/cms/static/js/views/course_video_settings.js
+++ b/cms/static/js/views/course_video_settings.js
@@ -153,6 +153,7 @@ function($, Backbone, _, gettext, moment, ViewUtils, HtmlUtils, StringUtils, Tra
this.clearPreferenceErrorState($fidelityContainer);
// Clear active and selected languages.
+ // eslint-disable-next-line no-multi-assign
this.selectedLanguages = this.activeLanguages = [];
// Also clear selected language.
this.selectedVideoSourceLanguage = '';
@@ -167,6 +168,7 @@ function($, Backbone, _, gettext, moment, ViewUtils, HtmlUtils, StringUtils, Tra
this.clearPreferenceErrorState($videoSourceLanguageContainer);
// Clear active and selected languages.
+ // eslint-disable-next-line no-multi-assign
this.selectedLanguages = this.activeLanguages = [];
this.renderTargetLanguages();
},
@@ -236,6 +238,7 @@ function($, Backbone, _, gettext, moment, ViewUtils, HtmlUtils, StringUtils, Tra
$(event.target.parentElement).parent().remove();
// Remove language from selected languages.
+ // eslint-disable-next-line no-multi-assign
this.selectedLanguages = this.activeLanguages = _.without(this.selectedLanguages, selectedLanguage);
// Populate menu again to reflect latest changes.
diff --git a/cms/static/js/views/list.js b/cms/static/js/views/list.js
index 714eb5f10a19..4d411845242d 100644
--- a/cms/static/js/views/list.js
+++ b/cms/static/js/views/list.js
@@ -50,6 +50,7 @@ define([
});
edx.HtmlUtils.setHtml(this.$el, edx.HtmlUtils.HTML(template));
+ // eslint-disable-next-line no-shadow
this.collection.each(function(model) {
this.$(this.listContainerCss).append(
this.createItemView({model: model, restrictEditing: this.restrictEditing}).render().el
diff --git a/cms/static/js/views/manage_users_and_roles.js b/cms/static/js/views/manage_users_and_roles.js
index fd34945c67b2..e83453a62b05 100644
--- a/cms/static/js/views/manage_users_and_roles.js
+++ b/cms/static/js/views/manage_users_and_roles.js
@@ -105,6 +105,7 @@ function($, _, gettext, BaseView, PromptView, ViewUtils, HtmlUtils) {
var role_name = self.options.roles[i].key;
var role_selector = 'click .user-actions .make-' + role_name;
+ // eslint-disable-next-line no-loop-func
(function(role) {
roleEvents[role_selector] = function(event) { self.handleRoleButtonClick(event.target, role); };
}(role_name));
@@ -169,6 +170,7 @@ function($, _, gettext, BaseView, PromptView, ViewUtils, HtmlUtils) {
getPossibleRoleChangesForRole: function(role, adminRoleCount) {
var result = [],
+ // eslint-disable-next-line no-shadow
role_names = _.map(this.roles, function(role) { return role.key; });
if (role === this.admin_role.key && adminRoleCount === 1) {
result.push({notoggle: true});
@@ -177,6 +179,7 @@ function($, _, gettext, BaseView, PromptView, ViewUtils, HtmlUtils) {
// in reverse order to show "Add" buttons to the left, "Remove" to the right
for (var i = this.roles.length - 1; i >= 0; i--) {
var other_role = this.roles[i];
+ // eslint-disable-next-line no-continue
if (Math.abs(currentRoleIdx - i) !== 1) { continue; } // allows moving only to adjacent roles
result.push({
to_role: other_role.key,
diff --git a/cms/static/js/views/metadata.js b/cms/static/js/views/metadata.js
index 3c5fa598117d..1dda68b30947 100644
--- a/cms/static/js/views/metadata.js
+++ b/cms/static/js/views/metadata.js
@@ -189,6 +189,7 @@ define(
this.max = Number(options[max]);
this.$el.find('input').attr(max, numToString(this.max));
}
+ // eslint-disable-next-line no-undef-init
var stepValue = undefined;
if (options.hasOwnProperty(step)) {
// Parse step and convert to String. Polyfill doesn't like float values like ".1" (expects "0.1").
@@ -234,7 +235,9 @@ define(
// This first filtering if statement is take from polyfill to prevent
// non-numeric input (for browsers that don't use polyfill because they DO have a number input type).
var _ref, _ref1;
+ // eslint-disable-next-line no-cond-assign
if (((_ref = e.keyCode) !== 8 && _ref !== 9 && _ref !== 35 && _ref !== 36 && _ref !== 37 && _ref !== 39)
+ // eslint-disable-next-line no-cond-assign
&& ((_ref1 = e.which) !== 45 && _ref1 !== 46 && _ref1 !== 48 && _ref1 !== 49 && _ref1 !== 50 && _ref1 !== 51
&& _ref1 !== 52 && _ref1 !== 53 && _ref1 !== 54 && _ref1 !== 55 && _ref1 !== 56 && _ref1 !== 57)) {
e.preventDefault();
@@ -444,6 +447,7 @@ define(
}).reverse();
seconds = _.reduce(list, function(memo, num, index) {
+ // eslint-disable-next-line prefer-exponentiation-operator, no-restricted-properties
return memo + num * Math.pow(60, index);
}, 0);
@@ -515,6 +519,7 @@ define(
var list = this.$el.find('ol'),
frag = document.createDocumentFragment();
+ // eslint-disable-next-line no-shadow
_.each(value, function(value, key) {
var template = _.template(
HtmlUtils.joinHtml(
diff --git a/cms/static/js/views/modals/course_outline_modals.js b/cms/static/js/views/modals/course_outline_modals.js
index 492bd4b7d0bd..d00af0a537f2 100644
--- a/cms/static/js/views/modals/course_outline_modals.js
+++ b/cms/static/js/views/modals/course_outline_modals.js
@@ -133,6 +133,7 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
tabsTemplate = this.loadTemplate('settings-modal-tabs');
HtmlUtils.setHtml(this.$('.modal-section'), HtmlUtils.HTML(tabsTemplate({tabs: tabs})));
_.each(this.options.tabs, function(tab) {
+ // eslint-disable-next-line prefer-spread
this.options.editors.push.apply(
this.options.editors,
_.map(tab.editors, function(Editor) {
@@ -606,6 +607,7 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
this.$('.field-exam-review-rules textarea').val(value);
},
isValidTimeLimit: function(timeLimit) {
+ // eslint-disable-next-line prefer-regex-literals
var pattern = new RegExp('^\\d{1,2}:[0-5][0-9]$');
return pattern.test(timeLimit) && timeLimit !== '00:00';
},
@@ -948,6 +950,7 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
} else {
$('.un-published-tip').show();
}
+ // eslint-disable-next-line prefer-const
let enabledForGraded = course.get('discussions_settings').enable_graded_units;
if (this.model.get('graded') && !enabledForGraded) {
$('#discussion_enabled').prop('disabled', true);
@@ -1032,6 +1035,7 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
} else {
display = 'none';
}
+ // eslint-disable-next-line no-shadow
$.each(warning, function(_, element) {
element.style.display = display;
});
diff --git a/cms/static/js/views/module_edit.js b/cms/static/js/views/module_edit.js
index fe3bba582127..f58f02a9c94f 100644
--- a/cms/static/js/views/module_edit.js
+++ b/cms/static/js/views/module_edit.js
@@ -23,6 +23,7 @@
var ModuleEdit = (function(_super) {
__extends(ModuleEdit, _super);
+ // eslint-disable-next-line no-shadow
function ModuleEdit() {
return ModuleEdit.__super__.constructor.apply(this, arguments);
}
diff --git a/cms/static/js/views/pages/course_outline.js b/cms/static/js/views/pages/course_outline.js
index 31227f4aa1d9..1d10fb63752a 100644
--- a/cms/static/js/views/pages/course_outline.js
+++ b/cms/static/js/views/pages/course_outline.js
@@ -66,6 +66,7 @@ function($, _, gettext, BasePage, XBlockViewUtils, CourseOutlineView, ViewUtils,
},
renderPage: function() {
+ // eslint-disable-next-line no-shadow
var setInitialExpandState = function(xblockInfo, expandedLocators) {
if (xblockInfo.isCourse() || xblockInfo.isChapter()) {
expandedLocators.add(xblockInfo.get('id'));
diff --git a/cms/static/js/views/settings/advanced.js b/cms/static/js/views/settings/advanced.js
index 0a3eaf82ae36..14f054bb37c8 100644
--- a/cms/static/js/views/settings/advanced.js
+++ b/cms/static/js/views/settings/advanced.js
@@ -82,6 +82,7 @@ function(ValidatingView, $, _, gettext, CodeMirror, ValidationErrorModal, HtmlUt
var stringValue = $.trim(mirror.getValue());
// update CodeMirror to show the trimmed value.
mirror.setValue(stringValue);
+ // eslint-disable-next-line no-undef-init
var JSONValue = undefined;
try {
JSONValue = JSON.parse(stringValue);
diff --git a/cms/static/js/views/settings/grading.js b/cms/static/js/views/settings/grading.js
index 2148466a0ed6..ac4d170352a2 100644
--- a/cms/static/js/views/settings/grading.js
+++ b/cms/static/js/views/settings/grading.js
@@ -229,6 +229,7 @@ function(ValidatingView, _, $, ui, GraderView, StringUtils, HtmlUtils) {
// set min/max widths
var cachethis = this;
var widthPerPoint = cachethis.gradeBarWidth / 100;
+ // eslint-disable-next-line no-shadow
return function(event, ui) {
var barIndex = ui.element.index();
var offset = 1;
@@ -245,6 +246,7 @@ function(ValidatingView, _, $, ui, GraderView, StringUtils, HtmlUtils) {
moveBarClosure: function() {
// 0th ele doesn't have a bar; so, will never invoke this
var cachethis = this;
+ // eslint-disable-next-line no-shadow
return function(event, ui) {
var barIndex = ui.element.index();
var offset = 1;
@@ -254,6 +256,7 @@ function(ValidatingView, _, $, ui, GraderView, StringUtils, HtmlUtils) {
: offset);
// minus 2 b/c minus 1 is the element we're effecting. It's max is just shy of the next one above it
var max = (barIndex >= 2 ? cachethis.descendingCutoffs[barIndex - 2].cutoff - offset : 100);
+ // eslint-disable-next-line no-mixed-operators
var percentage = Math.min(Math.max(ui.size.width / cachethis.gradeBarWidth * 100, min), max);
cachethis.descendingCutoffs[barIndex - 1].cutoff = Math.round(percentage);
cachethis.renderGradeRanges();
@@ -272,6 +275,7 @@ function(ValidatingView, _, $, ui, GraderView, StringUtils, HtmlUtils) {
stopDragClosure: function() {
var cachethis = this;
+ // eslint-disable-next-line no-shadow
return function(event, ui) {
// for some reason the resize is setting height to 0
cachethis.saveCutoffs();
@@ -388,6 +392,7 @@ function(ValidatingView, _, $, ui, GraderView, StringUtils, HtmlUtils) {
// Instrument grading scale
// convert cutoffs to inversely ordered list
var modelCutoffs = this.model.get('grade_cutoffs');
+ // eslint-disable-next-line guard-for-in
for (var cutoff in modelCutoffs) {
this.descendingCutoffs.push({designation: cutoff, cutoff: Math.round(modelCutoffs[cutoff] * 100)});
}
diff --git a/cms/static/js/views/settings/main.js b/cms/static/js/views/settings/main.js
index ef728b616c81..4f3bf0bb2733 100644
--- a/cms/static/js/views/settings/main.js
+++ b/cms/static/js/views/settings/main.js
@@ -391,8 +391,11 @@ function(ValidatingView, CodeMirror, _, $, ui, DateUtils, FileUploadModel,
if (!this.useV2CertDisplaySettings) {
return;
}
+ // eslint-disable-next-line prefer-const
let showDatepicker = this.model.get('certificates_display_behavior') == 'end_with_date';
+ // eslint-disable-next-line prefer-const
let datepicker = this.$el.find('#certificate-available-date');
+ // eslint-disable-next-line prefer-const
let certificateAvailableDateField = this.$el.find('#field-certificate-available-date');
if (showDatepicker) {
@@ -451,6 +454,7 @@ function(ValidatingView, CodeMirror, _, $, ui, DateUtils, FileUploadModel,
selector = '',
image_key = '',
image_path_key = '';
+ // eslint-disable-next-line default-case
switch (event.currentTarget.id) {
case 'upload-course-image':
title = gettext('Upload your course image.');
diff --git a/cms/static/js/views/tabs.js b/cms/static/js/views/tabs.js
index 70be63f9257c..129bec4d2b4b 100644
--- a/cms/static/js/views/tabs.js
+++ b/cms/static/js/views/tabs.js
@@ -28,6 +28,7 @@
TabsEdit = (function(_super) {
__extends(TabsEdit, _super);
+ // eslint-disable-next-line no-shadow
function TabsEdit() {
var self = this;
this.deleteTab = function() {
diff --git a/cms/static/js/views/utils/create_library_utils.js b/cms/static/js/views/utils/create_library_utils.js
index 3b8782f152cb..ad32a9e0afdc 100644
--- a/cms/static/js/views/utils/create_library_utils.js
+++ b/cms/static/js/views/utils/create_library_utils.js
@@ -27,6 +27,7 @@ define(['jquery', 'gettext', 'common/js/components/utils/view_utils', 'js/views/
if (detailedReason) {
reason = detailedReason;
}
+ // eslint-disable-next-line no-empty
} catch (e) {}
}
errorHandler(reason);
diff --git a/cms/static/js/views/validation.js b/cms/static/js/views/validation.js
index 1cc8635ffb36..e193294ddd29 100644
--- a/cms/static/js/views/validation.js
+++ b/cms/static/js/views/validation.js
@@ -37,6 +37,7 @@ function(HtmlUtils, BaseView, _, $, gettext, NotificationView, AlertView) {
handleValidationError: function(model, error) {
this.clearValidationErrors();
// error is object w/ fields and error strings
+ // eslint-disable-next-line guard-for-in
for (var field in error) {
var ele = this.$el.find('#' + this.fieldToSelectorMap[field]);
this._cacheValidationErrors.push(ele);
diff --git a/cms/static/js/views/video/transcripts/file_uploader.js b/cms/static/js/views/video/transcripts/file_uploader.js
index 5c635fdc4db1..e1fba9a9a8d3 100644
--- a/cms/static/js/views/video/transcripts/file_uploader.js
+++ b/cms/static/js/views/video/transcripts/file_uploader.js
@@ -130,6 +130,7 @@ define(
checkExtValidity: function(file) {
var fileExtension;
if (!file.name) {
+ // eslint-disable-next-line no-void
return void 0;
}
diff --git a/cms/static/js/views/video/transcripts/metadata_videolist.js b/cms/static/js/views/video/transcripts/metadata_videolist.js
index 1cbf37467db6..961e9fd25906 100644
--- a/cms/static/js/views/video/transcripts/metadata_videolist.js
+++ b/cms/static/js/views/video/transcripts/metadata_videolist.js
@@ -223,8 +223,10 @@ define(
}
if (this.$extraVideosBar.hasClass('is-visible')) {
+ // eslint-disable-next-line prefer-spread
this.closeExtraVideosBar.apply(this, arguments);
} else {
+ // eslint-disable-next-line prefer-spread
this.openExtraVideosBar.apply(this, arguments);
}
},
diff --git a/cms/static/js/views/video/transcripts/utils.js b/cms/static/js/views/video/transcripts/utils.js
index fae39400bd65..e339626eb91f 100644
--- a/cms/static/js/views/video/transcripts/utils.js
+++ b/cms/static/js/views/video/transcripts/utils.js
@@ -84,6 +84,7 @@ define(['jquery', 'underscore', 'jquery.ajaxQueue'], function($) {
return function(url) {
if (typeof url !== 'string') {
+ // eslint-disable-next-line no-void
return void 0;
}
@@ -92,6 +93,7 @@ define(['jquery', 'underscore', 'jquery.ajaxQueue'], function($) {
}
var match = url.match(regExp);
+ // eslint-disable-next-line no-void
cache[url] = (match) ? match[1] : void 0;
return cache[url];
@@ -114,6 +116,7 @@ define(['jquery', 'underscore', 'jquery.ajaxQueue'], function($) {
return function(url) {
if (typeof url !== 'string') {
+ // eslint-disable-next-line no-void
return void 0;
}
@@ -169,6 +172,7 @@ define(['jquery', 'underscore', 'jquery.ajaxQueue'], function($) {
result;
if (typeof url !== 'string') {
+ // eslint-disable-next-line no-void
return void 0;
}
diff --git a/cms/static/js/views/video/translations_editor.js b/cms/static/js/views/video/translations_editor.js
index 89df139e7b92..26d0ee239090 100644
--- a/cms/static/js/views/video/translations_editor.js
+++ b/cms/static/js/views/video/translations_editor.js
@@ -56,6 +56,7 @@ define(
getDropdown: (function() {
var dropdown,
disableOptions = function(element, values) {
+ // eslint-disable-next-line no-shadow
var dropdown = $(element).clone();
_.each(values, function(value, key) {
diff --git a/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowser.jsx b/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowser.jsx
index 9012703ce8ad..f355df9f9411 100644
--- a/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowser.jsx
+++ b/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowser.jsx
@@ -1,3 +1,8 @@
+/*
+eslint-disable import/no-extraneous-dependencies, import/no-duplicates, import/order, import/no-self-import,
+import/no-cycle, import/no-relative-packages, import/no-named-as-default, import/no-named-as-default-member,
+import/named, import/no-useless-path-segments
+*/
/* global gettext */
import { Button, Icon } from '@edx/paragon';
import classNames from 'classnames';
@@ -26,6 +31,7 @@ const BLOCK_TYPE_NAME = {
};
const BlockType = PropTypes.shape({
+ // eslint-disable-next-line react/forbid-prop-types
children: PropTypes.array,
display_name: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
@@ -33,6 +39,7 @@ const BlockType = PropTypes.shape({
type: PropTypes.string.isRequired,
});
+// eslint-disable-next-line react/function-component-definition
export const BlockList = ({
blocks, selectedBlock, onSelectBlock, onChangeRoot,
}) => (
@@ -71,7 +78,9 @@ BlockList.defaultProps = {
selectedBlock: null,
};
+// eslint-disable-next-line react/function-component-definition
export const BlockBrowser = ({
+ // eslint-disable-next-line react/prop-types
blocks, selectedBlock, onSelectBlock, onChangeRoot, className,
}) => !!blocks && (
diff --git a/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowser.test.jsx b/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowser.test.jsx
index db4f47d65647..df65f3acfc8d 100644
--- a/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowser.test.jsx
+++ b/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowser.test.jsx
@@ -1,3 +1,9 @@
+/*
+eslint-disable import/no-extraneous-dependencies, import/no-duplicates, import/order, import/no-self-import,
+import/no-cycle, import/no-relative-packages, import/no-named-as-default, import/no-named-as-default-member,
+import/named, import/no-useless-path-segments
+*/
+// eslint-disable-next-line no-redeclare
/* global jest,test,describe,expect */
import React from 'react';
import renderer from 'react-test-renderer';
diff --git a/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowserContainer.jsx b/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowserContainer.jsx
index e58b260d02b8..06a20053e109 100644
--- a/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowserContainer.jsx
+++ b/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowserContainer.jsx
@@ -1,3 +1,8 @@
+/*
+eslint-disable import/no-extraneous-dependencies, import/no-duplicates, import/order, import/no-self-import,
+import/no-cycle, import/no-relative-packages, import/no-named-as-default, import/no-named-as-default-member,
+import/named, import/no-useless-path-segments
+*/
import { connect } from 'react-redux';
import { changeRoot } from '../../data/actions/courseBlocks';
import { getActiveBlockTree } from '../../data/selectors/index';
diff --git a/common/static/common/js/components/BlockBrowser/data/actions/courseBlocks.js b/common/static/common/js/components/BlockBrowser/data/actions/courseBlocks.js
index dffea458449e..209774d4a130 100644
--- a/common/static/common/js/components/BlockBrowser/data/actions/courseBlocks.js
+++ b/common/static/common/js/components/BlockBrowser/data/actions/courseBlocks.js
@@ -1,3 +1,8 @@
+/*
+eslint-disable import/no-extraneous-dependencies, import/no-duplicates, import/order, import/no-self-import,
+import/no-cycle, import/no-relative-packages, import/no-named-as-default, import/no-named-as-default-member,
+import/named, import/no-useless-path-segments
+*/
import { getCourseBlocks } from '../api/client';
import courseBlocksActions from './constants';
diff --git a/common/static/common/js/components/BlockBrowser/data/api/client.js b/common/static/common/js/components/BlockBrowser/data/api/client.js
index 2f00eaa08c55..c39509091754 100644
--- a/common/static/common/js/components/BlockBrowser/data/api/client.js
+++ b/common/static/common/js/components/BlockBrowser/data/api/client.js
@@ -1,3 +1,7 @@
+/*
+eslint-disable import/no-extraneous-dependencies, import/no-duplicates, import/order, import/no-self-import,
+import/no-cycle, import/no-relative-packages, import/no-named-as-default, import/no-named-as-default-member
+*/
import Cookies from 'js-cookie';
import 'whatwg-fetch';
diff --git a/common/static/common/js/components/BlockBrowser/data/reducers/index.js b/common/static/common/js/components/BlockBrowser/data/reducers/index.js
index 64e0bdca88ae..783f68eb1a6e 100644
--- a/common/static/common/js/components/BlockBrowser/data/reducers/index.js
+++ b/common/static/common/js/components/BlockBrowser/data/reducers/index.js
@@ -1,9 +1,15 @@
+/*
+eslint-disable import/no-extraneous-dependencies, import/no-duplicates, import/order, import/no-self-import,
+import/no-cycle, import/no-relative-packages, import/no-named-as-default, import/no-named-as-default-member,
+import/named, import/no-useless-path-segments
+*/
import { combineReducers } from 'redux';
import courseBlocksActions from '../actions/constants';
export const buildBlockTree = (blocks, excludeBlockTypes) => {
if (!(blocks && blocks.root)) { return null; }
const blockTree = (root, parent) => {
+ // eslint-disable-next-line prefer-object-spread
const tree = Object.assign({ parent }, blocks.blocks[root]);
if (tree.children) {
tree.children = tree.children.map(block => blockTree(block, root));
@@ -18,6 +24,7 @@ export const buildBlockTree = (blocks, excludeBlockTypes) => {
return blockTree(blocks.root, null);
};
+// eslint-disable-next-line default-param-last
export const blocks = (state = {}, action) => {
switch (action.type) {
case courseBlocksActions.fetch.SUCCESS:
@@ -27,6 +34,7 @@ export const blocks = (state = {}, action) => {
}
};
+// eslint-disable-next-line default-param-last
export const selectedBlock = (state = '', action) => {
switch (action.type) {
case courseBlocksActions.SELECT_BLOCK:
@@ -36,6 +44,7 @@ export const selectedBlock = (state = '', action) => {
}
};
+// eslint-disable-next-line default-param-last
export const rootBlock = (state = null, action) => {
switch (action.type) {
case courseBlocksActions.fetch.SUCCESS:
diff --git a/common/static/common/js/components/BlockBrowser/data/store.js b/common/static/common/js/components/BlockBrowser/data/store.js
index c5bacaf72981..883b99f3f272 100644
--- a/common/static/common/js/components/BlockBrowser/data/store.js
+++ b/common/static/common/js/components/BlockBrowser/data/store.js
@@ -1,3 +1,8 @@
+/*
+eslint-disable import/no-extraneous-dependencies, import/no-duplicates, import/order, import/no-self-import,
+import/no-cycle, import/no-relative-packages, import/no-named-as-default, import/no-named-as-default-member,
+import/named, import/no-useless-path-segments
+*/
import { applyMiddleware, createStore } from 'redux';
import thunkMiddleware from 'redux-thunk';
diff --git a/common/static/common/js/components/BlockBrowser/index.jsx b/common/static/common/js/components/BlockBrowser/index.jsx
index 0ac85c289bbd..60ab10019294 100644
--- a/common/static/common/js/components/BlockBrowser/index.jsx
+++ b/common/static/common/js/components/BlockBrowser/index.jsx
@@ -1,8 +1,14 @@
+/*
+eslint-disable import/no-extraneous-dependencies, import/no-duplicates, import/order, import/no-self-import,
+import/no-cycle, import/no-relative-packages, import/no-named-as-default, import/no-named-as-default-member,
+import/named, import/no-useless-path-segments
+*/
import React from 'react';
import { Provider } from 'react-redux';
import BlockBrowserContainer from './components/BlockBrowser/BlockBrowserContainer';
import store from './data/store';
+// eslint-disable-next-line react/function-component-definition
export const BlockBrowser = props => (
diff --git a/common/static/common/js/components/ExperimentalCarousel.jsx b/common/static/common/js/components/ExperimentalCarousel.jsx
index 6d99d6d468c1..ba239ae63e6f 100644
--- a/common/static/common/js/components/ExperimentalCarousel.jsx
+++ b/common/static/common/js/components/ExperimentalCarousel.jsx
@@ -20,6 +20,7 @@ function NextArrow(props) {
}
return (
+ // eslint-disable-next-line react/button-has-type