diff --git a/.eslintrc.json b/.eslintrc.json
index 9cc8eb1a57..22dbc24aab 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -49,7 +49,6 @@
"import/no-dynamic-require": "off",
"import/no-unresolved": "off",
"max-len": "off",
- "newline-per-chained-call": "off",
"no-console": "off",
"no-lonely-if": "off",
"no-param-reassign": "off",
@@ -73,7 +72,6 @@
"radix": "off",
"react/jsx-indent-props": ["error", 4],
"react/prop-types": "off",
- "semi": "off",
"vars-on-top": "off"
}
}
diff --git a/cms/static/cms/js/spec/main_webpack.js b/cms/static/cms/js/spec/main_webpack.js
index 020b4d313f..f7440c3876 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';
@@ -12,11 +10,6 @@ import _ from 'underscore';
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';
@@ -31,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/certificates/spec/custom_matchers.js b/cms/static/js/certificates/spec/custom_matchers.js
index 18062476b8..32e19dec6a 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/cms/static/js/certificates/spec/views/certificate_preview_spec.js b/cms/static/js/certificates/spec/views/certificate_preview_spec.js
index 741c7c5996..ed7f078951 100644
--- a/cms/static/js/certificates/spec/views/certificate_preview_spec.js
+++ b/cms/static/js/certificates/spec/views/certificate_preview_spec.js
@@ -64,16 +64,16 @@ function(_, $, Course, CertificatePreview, TemplateHelpers, ViewHelpers, AjaxHel
it('course mode selection updating the link successfully', function() {
selectDropDownByText(this.view.$(SELECTORS.course_modes), 'test1');
- expect(this.view.$(SELECTORS.preview_certificate).attr('href')).
- toEqual('/users/1/courses/orgX/009/2016?preview=test1');
+ expect(this.view.$(SELECTORS.preview_certificate).attr('href'))
+ .toEqual('/users/1/courses/orgX/009/2016?preview=test1');
selectDropDownByText(this.view.$(SELECTORS.course_modes), 'test2');
- expect(this.view.$(SELECTORS.preview_certificate).attr('href')).
- toEqual('/users/1/courses/orgX/009/2016?preview=test2');
+ expect(this.view.$(SELECTORS.preview_certificate).attr('href'))
+ .toEqual('/users/1/courses/orgX/009/2016?preview=test2');
selectDropDownByText(this.view.$(SELECTORS.course_modes), 'test3');
- expect(this.view.$(SELECTORS.preview_certificate).attr('href')).
- toEqual('/users/1/courses/orgX/009/2016?preview=test3');
+ expect(this.view.$(SELECTORS.preview_certificate).attr('href'))
+ .toEqual('/users/1/courses/orgX/009/2016?preview=test3');
});
it('toggle certificate activation event works fine', function() {
diff --git a/cms/static/js/factories/container.js b/cms/static/js/factories/container.js
index cfca298851..b98e0f99f2 100644
--- a/cms/static/js/factories/container.js
+++ b/cms/static/js/factories/container.js
@@ -21,6 +21,6 @@ export default function ContainerFactory(componentTemplates, XBlockInfoJson, act
var view = new ContainerPage(_.extend(main_options, options));
view.render();
});
-};
+}
-export {ContainerFactory}
+export {ContainerFactory};
diff --git a/cms/static/js/factories/context_course.js b/cms/static/js/factories/context_course.js
index 475e5a6282..24745295ec 100644
--- a/cms/static/js/factories/context_course.js
+++ b/cms/static/js/factories/context_course.js
@@ -1,3 +1,3 @@
import * as ContextCourse from 'js/models/course';
-export {ContextCourse}
+export {ContextCourse};
diff --git a/cms/static/js/factories/edit_tabs.js b/cms/static/js/factories/edit_tabs.js
index 51688bf6a1..cd82fd2d91 100644
--- a/cms/static/js/factories/edit_tabs.js
+++ b/cms/static/js/factories/edit_tabs.js
@@ -21,6 +21,6 @@ export default function EditTabsFactory(courseLocation, explicitUrl) {
mast: $('.wrapper-mast')
});
});
-};
+}
-export {EditTabsFactory}
+export {EditTabsFactory};
diff --git a/cms/static/js/factories/library.js b/cms/static/js/factories/library.js
index 7f8d458502..c104b3b049 100644
--- a/cms/static/js/factories/library.js
+++ b/cms/static/js/factories/library.js
@@ -24,6 +24,6 @@ export default function LibraryFactory(componentTemplates, XBlockInfoJson, optio
var view = new PagedContainerPage(_.extend(main_options, options));
view.render();
});
-};
+}
-export {LibraryFactory}
+export {LibraryFactory};
diff --git a/cms/static/js/factories/settings.js b/cms/static/js/factories/settings.js
index b170731397..34faec2eb1 100644
--- a/cms/static/js/factories/settings.js
+++ b/cms/static/js/factories/settings.js
@@ -16,9 +16,9 @@ define([
// Toggle collapsibles when trigger is clicked
$('.collapsible .collapsible-trigger').click(function() {
- const contentId = this.id.replace('-trigger', '-content')
- $(`#${contentId}`).toggleClass('collapsed')
- })
+ const contentId = this.id.replace('-trigger', '-content');
+ $(`#${contentId}`).toggleClass('collapsed');
+ });
model = new CourseDetailsModel();
model.urlRoot = detailsUrl;
diff --git a/cms/static/js/factories/textbooks.js b/cms/static/js/factories/textbooks.js
index 01950f867f..4c2cec3130 100644
--- a/cms/static/js/factories/textbooks.js
+++ b/cms/static/js/factories/textbooks.js
@@ -19,6 +19,6 @@ export default function TextbooksFactory(textbooksJson) {
return gettext('You have unsaved changes. Do you really want to leave this page?');
}
});
-};
+}
-export {TextbooksFactory}
+export {TextbooksFactory};
diff --git a/cms/static/js/factories/xblock_validation.js b/cms/static/js/factories/xblock_validation.js
index 0411dc9150..9936208626 100644
--- a/cms/static/js/factories/xblock_validation.js
+++ b/cms/static/js/factories/xblock_validation.js
@@ -16,6 +16,6 @@ export default function XBlockValidationFactory(validationMessages, hasEditingUr
if (!model.get('empty')) {
new XBlockValidationView({el: validationEle, model: model, root: isRoot}).render();
}
-};
+}
-export {XBlockValidationFactory}
+export {XBlockValidationFactory};
diff --git a/cms/static/js/models/settings/course_grading_policy.js b/cms/static/js/models/settings/course_grading_policy.js
index 498815cf13..4ed105c7ee 100644
--- a/cms/static/js/models/settings/course_grading_policy.js
+++ b/cms/static/js/models/settings/course_grading_policy.js
@@ -10,7 +10,7 @@ define(['backbone', 'js/models/location', 'js/collections/course_grader', 'edx-u
grace_period: null, // either null or { hours: n, minutes: m, ...}
minimum_grade_credit: null, // either null or percentage
assignment_count_info: [], // Object with keys mapping assignment type names to a list of
- //assignment display names
+ // assignment display names
},
parse: function(attributes) {
if (attributes.graders) {
diff --git a/cms/static/js/sock.js b/cms/static/js/sock.js
index 43c41ba254..1512ec51bc 100644
--- a/cms/static/js/sock.js
+++ b/cms/static/js/sock.js
@@ -4,7 +4,7 @@ import 'jquery.smoothScroll';
'use strict';
-var toggleSock = function (e) {
+var toggleSock = function(e) {
e.preventDefault();
var $btnShowSockLabel = $(this).find('.copy-show');
@@ -33,9 +33,9 @@ var toggleSock = function (e) {
});
};
-domReady(function () {
+domReady(function() {
// toggling footer additional support
$('.cta-show-sock').bind('click', toggleSock);
});
-export {toggleSock}
+export {toggleSock};
diff --git a/cms/static/js/spec/views/license_spec.js b/cms/static/js/spec/views/license_spec.js
index 54eb5e2afb..193d267263 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/module_edit_spec.js b/cms/static/js/spec/views/module_edit_spec.js
index c46cb2b873..a96bbad995 100644
--- a/cms/static/js/spec/views/module_edit_spec.js
+++ b/cms/static/js/spec/views/module_edit_spec.js
@@ -64,7 +64,7 @@ describe('ModuleEdit', function() {
});
});
describe('render', function() {
- beforeEach(function () {
+ beforeEach(function() {
edit_helpers.installEditTemplates(true);
spyOn(this.moduleEdit, 'loadDisplay');
spyOn(this.moduleEdit, 'delegateEvents');
diff --git a/cms/static/js/spec/views/pages/container_subviews_spec.js b/cms/static/js/spec/views/pages/container_subviews_spec.js
index d3860e8530..cde0b42d81 100644
--- a/cms/static/js/spec/views/pages/container_subviews_spec.js
+++ b/cms/static/js/spec/views/pages/container_subviews_spec.js
@@ -343,15 +343,15 @@ describe('Container Subviews', function() {
it('renders the last published date and user when there are no changes', function() {
renderContainerPage(this, mockContainerXBlockHtml);
fetch({published_on: 'Jul 01, 2014 at 12:45 UTC', published_by: 'amako'});
- expect(containerPage.$(lastDraftCss).text()).
- toContain('Last published Jul 01, 2014 at 12:45 UTC by amako');
+ expect(containerPage.$(lastDraftCss).text())
+ .toContain('Last published Jul 01, 2014 at 12:45 UTC by amako');
});
it('renders the last saved date and user when there are changes', function() {
renderContainerPage(this, mockContainerXBlockHtml);
fetch({has_changes: true, edited_on: 'Jul 02, 2014 at 14:20 UTC', edited_by: 'joe'});
- expect(containerPage.$(lastDraftCss).text()).
- toContain('Draft saved on Jul 02, 2014 at 14:20 UTC by joe');
+ expect(containerPage.$(lastDraftCss).text())
+ .toContain('Draft saved on Jul 02, 2014 at 14:20 UTC by joe');
});
describe('Release Date', function() {
@@ -596,8 +596,8 @@ describe('Container Subviews', function() {
fetch({
published: true, published_on: 'Jul 01, 2014 at 12:45 UTC', published_by: 'amako'
});
- expect(containerPage.$(lastPublishCss).text()).
- toContain('Last published Jul 01, 2014 at 12:45 UTC by amako');
+ expect(containerPage.$(lastPublishCss).text())
+ .toContain('Last published Jul 01, 2014 at 12:45 UTC by amako');
});
it('renders correctly when the block is published without publish info', function() {
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 6f49ade213..195e5702d0 100644
--- a/cms/static/js/spec/views/pages/course_outline_spec.js
+++ b/cms/static/js/spec/views/pages/course_outline_spec.js
@@ -14,7 +14,7 @@ describe('CourseOutlinePage', function() {
selectVisibilitySettings, selectDiscussionSettings, selectAdvancedSettings, createMockCourseJSON, createMockSectionJSON,
createMockSubsectionJSON, verifyTypePublishable, mockCourseJSON, mockEmptyCourseJSON, setSelfPaced, setSelfPacedCustomPLS,
mockSingleSectionCourseJSON, createMockVerticalJSON, createMockIndexJSON, mockCourseEntranceExamJSON,
- selectOnboardingExam, createMockCourseJSONWithReviewRules,mockCourseJSONWithReviewRules,
+ selectOnboardingExam, createMockCourseJSONWithReviewRules, mockCourseJSONWithReviewRules,
mockOutlinePage = readFixtures('templates/mock/mock-course-outline-page.underscore'),
mockRerunNotification = readFixtures('templates/mock/mock-course-rerun-notification.underscore');
@@ -210,7 +210,7 @@ describe('CourseOutlinePage', function() {
setSelfPacedCustomPLS = function() {
setSelfPaced();
course.set('is_custom_relative_dates_active', true);
- }
+ };
createCourseOutlinePage = function(test, courseJSON, createOnly) {
requests = AjaxHelpers.requests(test);
@@ -1458,7 +1458,7 @@ describe('CourseOutlinePage', function() {
$('.wrapper-modal-window .action-save').click();
});
- it('can select the onboarding exam when a course supports onboarding', function () {
+ it('can select the onboarding exam when a course supports onboarding', function() {
var mockCourseWithSpecialExamJSON = createMockCourseJSON({}, [
createMockSectionJSON({
has_changes: true,
@@ -2191,7 +2191,7 @@ describe('CourseOutlinePage', function() {
expect($modalWindow.find('.outline-subsection')).not.toExist();
});
- describe('Self Paced with Custom Personalized Learner Schedules (PLS)', function () {
+ describe('Self Paced with Custom Personalized Learner Schedules (PLS)', function() {
beforeEach(function() {
var mockCourseJSON = createMockCourseJSON({}, [
createMockSectionJSON({}, [
@@ -2210,7 +2210,7 @@ describe('CourseOutlinePage', function() {
selectRelativeWeeksSubsection = function(weeks) {
$('#due_in').val(weeks).trigger('keyup');
- }
+ };
mockCustomPacingServerValuesJson = createMockSectionJSON({
release_date: 'Jan 01, 2970 at 05:00 UTC'
@@ -2235,7 +2235,7 @@ describe('CourseOutlinePage', function() {
])
]);
- it('can show correct editors for self_paced course with custom pacing', function (){
+ it('can show correct editors for self_paced course with custom pacing', function() {
outlinePage.$('.outline-subsection .configure-button').click();
expect($('.edit-settings-release').length).toBe(0);
// Due date input exists for custom pacing self paced courses
@@ -2295,7 +2295,7 @@ describe('CourseOutlinePage', function() {
expectShowCorrectness('never');
});
- it ('does not show relative date input when assignment is not graded', function() {
+ it('does not show relative date input when assignment is not graded', function() {
outlinePage.$('.outline-subsection .configure-button').click();
$('#grading_type').val('Lab').trigger('change');
$('#due_in').val('').trigger('change');
@@ -2304,7 +2304,7 @@ describe('CourseOutlinePage', function() {
$('#grading_type').val('notgraded').trigger('change');
$('#due_in').val('').trigger('change');
expect($('#relative_date_input').css('display')).toBe('none');
- })
+ });
it('shows validation error on relative date', function() {
outlinePage.$('.outline-subsection .configure-button').click();
@@ -2371,7 +2371,7 @@ describe('CourseOutlinePage', function() {
'Contains staff only content'
);
});
- })
+ });
});
// Note: most tests for units can be found in Bok Choy
@@ -2470,13 +2470,12 @@ describe('CourseOutlinePage', function() {
expect(messages).toContainText('Contains staff only content');
});
- describe('discussion settings', function () {
+ describe('discussion settings', function() {
it('hides discussion settings if unit level discussions are disabled', function() {
getUnitStatus({}, {unit_level_discussions: false});
outlinePage.$('.outline-unit .configure-button').click();
expect($('.modal-section .edit-discussion')).not.toExist();
});
-
});
verifyTypePublishable('unit', function(options) {
diff --git a/cms/static/js/spec/views/xblock_validation_spec.js b/cms/static/js/spec/views/xblock_validation_spec.js
index 577f16eeb6..16473b9deb 100644
--- a/cms/static/js/spec/views/xblock_validation_spec.js
+++ b/cms/static/js/spec/views/xblock_validation_spec.js
@@ -110,8 +110,8 @@ define(['jquery', 'js/models/xblock_validation', 'js/views/xblock_validation', '
it('renders action info', function() {
expect(view.$('a.edit-button .action-button-text').text()).toContain('Summary Action');
- expect(view.$('a.notification-action-button .action-button-text').text()).
- toContain('First Message Action');
+ expect(view.$('a.notification-action-button .action-button-text').text())
+ .toContain('First Message Action');
expect(view.$('a.notification-action-button').data('notification-action')).toBe('fix-up');
});
diff --git a/cms/static/js/spec_helpers/edit_helpers.js b/cms/static/js/spec_helpers/edit_helpers.js
index 217a067e87..0fa81b1e5a 100644
--- a/cms/static/js/spec_helpers/edit_helpers.js
+++ b/cms/static/js/spec_helpers/edit_helpers.js
@@ -138,4 +138,4 @@ export {
installEditTemplates,
showEditModal,
verifyXBlockRequest,
-}
+};
diff --git a/cms/static/js/views/course_video_sharing_enable.js b/cms/static/js/views/course_video_sharing_enable.js
index 8104141a1a..46bc7ba759 100644
--- a/cms/static/js/views/course_video_sharing_enable.js
+++ b/cms/static/js/views/course_video_sharing_enable.js
@@ -1,66 +1,67 @@
define([
- "jquery",
- "underscore",
- "backbone",
- "js/views/utils/xblock_utils",
- "js/utils/templates",
- "js/views/modals/course_outline_modals",
- "edx-ui-toolkit/js/utils/html-utils",
-], function ($, _, Backbone, XBlockViewUtils, TemplateUtils, CourseOutlineModalsFactory, HtmlUtils) {
- "use strict";
- var CourseVideoSharingEnableView = Backbone.View.extend({
- events: {
- "change #video-sharing-configuration-options": "handleVideoSharingConfigurationChange",
- },
+ 'jquery',
+ 'underscore',
+ 'backbone',
+ 'js/views/utils/xblock_utils',
+ 'js/utils/templates',
+ 'js/views/modals/course_outline_modals',
+ 'edx-ui-toolkit/js/utils/html-utils',
+], function($, _, Backbone, XBlockViewUtils, TemplateUtils, CourseOutlineModalsFactory, HtmlUtils) {
+ 'use strict';
- initialize: function () {
- this.template = TemplateUtils.loadTemplate("course-video-sharing-enable");
- },
-
- getRequestData: function (value) {
- return {
- metadata: {
- 'video_sharing_options': value,
+ var CourseVideoSharingEnableView = Backbone.View.extend({
+ events: {
+ 'change #video-sharing-configuration-options': 'handleVideoSharingConfigurationChange',
},
- };
- },
- handleVideoSharingConfigurationChange: function (event) {
- if (event.type === "change") {
- event.preventDefault();
- this.updateVideoSharingConfiguration(event.target.value);
- this.trackVideoSharingConfigurationChange(event.target.value);
- }
- },
+ initialize: function() {
+ this.template = TemplateUtils.loadTemplate('course-video-sharing-enable');
+ },
- updateVideoSharingConfiguration: function (value) {
- XBlockViewUtils.updateXBlockFields(this.model, this.getRequestData(value), {
- success: this.refresh.bind(this)
- });
- },
+ getRequestData: function(value) {
+ return {
+ metadata: {
+ video_sharing_options: value,
+ },
+ };
+ },
- trackVideoSharingConfigurationChange: function (value) {
- window.analytics.track(
- 'edx.social.video_sharing_options.changed',
- {
- course_id: this.model.id,
- video_sharing_options: value
- }
- );
- },
+ handleVideoSharingConfigurationChange: function(event) {
+ if (event.type === 'change') {
+ event.preventDefault();
+ this.updateVideoSharingConfiguration(event.target.value);
+ this.trackVideoSharingConfigurationChange(event.target.value);
+ }
+ },
- refresh: function () {
- this.model.fetch({
- success: this.render.bind(this),
- });
- },
+ updateVideoSharingConfiguration: function(value) {
+ XBlockViewUtils.updateXBlockFields(this.model, this.getRequestData(value), {
+ success: this.refresh.bind(this)
+ });
+ },
- render: function () {
- var html = this.template(this.model.attributes);
- HtmlUtils.setHtml(this.$el, HtmlUtils.HTML(html));
- return this;
- },
- });
+ trackVideoSharingConfigurationChange: function(value) {
+ window.analytics.track(
+ 'edx.social.video_sharing_options.changed',
+ {
+ course_id: this.model.id,
+ video_sharing_options: value
+ }
+ );
+ },
- return CourseVideoSharingEnableView;
+ refresh: function() {
+ this.model.fetch({
+ success: this.render.bind(this),
+ });
+ },
+
+ render: function() {
+ var html = this.template(this.model.attributes);
+ HtmlUtils.setHtml(this.$el, HtmlUtils.HTML(html));
+ return this;
+ },
+ });
+
+ return CourseVideoSharingEnableView;
});
diff --git a/cms/static/js/views/metadata.js b/cms/static/js/views/metadata.js
index c56363ef7c..3c5fa59811 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/cms/static/js/views/modals/course_outline_modals.js b/cms/static/js/views/modals/course_outline_modals.js
index aefb13d286..492bd4b7d0 100644
--- a/cms/static/js/views/modals/course_outline_modals.js
+++ b/cms/static/js/views/modals/course_outline_modals.js
@@ -408,11 +408,11 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
if (!this.getValue() || !course.get('start')) { return; }
var startDate = new Date(course.get('start'));
// The value returned by toUTCString() is a string in the form Www, dd Mmm yyyy hh:mm:ss GMT
- var startDateList = startDate.toUTCString().split(' ')
+ var startDateList = startDate.toUTCString().split(' ');
// This text will look like Mmm dd, yyyy (i.e. Jul 26, 2021)
this.$('#relative_weeks_due_start_date').text(startDateList[2] + ' ' + startDateList[1] + ', ' + startDateList[3]);
- var projectedDate = new Date(startDate)
- projectedDate.setDate(projectedDate.getDate() + this.getValue()*7);
+ var projectedDate = new Date(startDate);
+ projectedDate.setDate(projectedDate.getDate() + this.getValue() * 7);
var projectedDateList = projectedDate.toUTCString().split(' ');
this.$('#relative_weeks_due_projected_due_in').text(projectedDateList[2] + ' ' + projectedDateList[1] + ', ' + projectedDateList[3]);
this.$('#relative_weeks_due_projected').show();
@@ -433,9 +433,9 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
afterRender: function() {
AbstractEditor.prototype.afterRender.call(this);
if (this.model.get('graded')) {
- this.$('#relative_date_input').show()
+ this.$('#relative_date_input').show();
} else {
- this.$('#relative_date_input').hide()
+ this.$('#relative_date_input').hide();
}
this.$('.field-due-in input').val(this.model.get('relative_weeks_due'));
this.$('#relative_weeks_due_projected').hide();
@@ -444,12 +444,12 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
getRequestData: function() {
// Grab all the sections, map them to their block_ids, then return as an Array
- var sectionIds = $('.outline-section').map(function(){ return this.id; }).get()
+ var sectionIds = $('.outline-section').map(function() { return this.id; }).get();
// Grab all the subsections, map them to their block_ids, then return as an Array
- var subsectionIds = $('.outline-subsection').map(function(){ return this.id; }).get()
+ var subsectionIds = $('.outline-subsection').map(function() { return this.id; }).get();
var relative_weeks_due = null;
if (this.getValue() > 0 && $('#grading_type').val() !== 'notgraded') {
- relative_weeks_due = this.getValue()
+ relative_weeks_due = this.getValue();
}
window.analytics.track('edx.bi.studio.relative_date.saved', {
block_id: this.model.get('id'),
@@ -944,16 +944,16 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
showTipText: function() {
if (this.model.get('published')) {
- $('.un-published-tip').hide()
+ $('.un-published-tip').hide();
} else {
- $('.un-published-tip').show()
+ $('.un-published-tip').show();
}
- let enabledForGraded = course.get('discussions_settings').enable_graded_units
+ let enabledForGraded = course.get('discussions_settings').enable_graded_units;
if (this.model.get('graded') && !enabledForGraded) {
$('#discussion_enabled').prop('disabled', true);
- $('.graded-tip').show()
+ $('.graded-tip').show();
} else {
- $('.graded-tip').hide()
+ $('.graded-tip').hide();
}
},
diff --git a/cms/static/js/views/paged_container.js b/cms/static/js/views/paged_container.js
index 31c123ad12..87f8605c4b 100644
--- a/cms/static/js/views/paged_container.js
+++ b/cms/static/js/views/paged_container.js
@@ -109,7 +109,7 @@ function($, _, ViewUtils, ContainerView, ModuleUtils, gettext, NotificationView,
if (originalDone) {
originalDone();
}
- }
+ };
self.handleXBlockFragment(fragment, options);
}
});
diff --git a/cms/static/js/views/pages/container.js b/cms/static/js/views/pages/container.js
index 1793f28e75..b6afcd4b11 100644
--- a/cms/static/js/views/pages/container.js
+++ b/cms/static/js/views/pages/container.js
@@ -265,15 +265,15 @@ function($, _, Backbone, gettext, BasePage, ViewUtils, ContainerView, XBlockView
editXBlock: function(event, options) {
event.preventDefault();
- if(!options || options.view !== 'visibility_view' ){
- const primaryHeader = $(event.target).closest('.xblock-header-primary')
+ if (!options || options.view !== 'visibility_view') {
+ const primaryHeader = $(event.target).closest('.xblock-header-primary');
var useNewTextEditor = primaryHeader.attr('use-new-editor-text'),
useNewVideoEditor = primaryHeader.attr('use-new-editor-video'),
useNewProblemEditor = primaryHeader.attr('use-new-editor-problem'),
blockType = primaryHeader.attr('data-block-type');
- if( (useNewTextEditor === 'True' && blockType === 'html')
+ if((useNewTextEditor === 'True' && blockType === 'html')
|| (useNewVideoEditor === 'True' && blockType === 'video')
|| (useNewProblemEditor === 'True' && blockType === 'problem')
) {
@@ -476,13 +476,13 @@ function($, _, Backbone, gettext, BasePage, ViewUtils, ContainerView, XBlockView
useNewProblemEditor = this.$('.xblock-header-primary').attr('use-new-editor-problem');
// find the block type in the locator if availible
- if(data.hasOwnProperty('locator')){
+ if(data.hasOwnProperty('locator')) {
var matchBlockTypeFromLocator = /\@(.*?)\+/;
var blockType = data.locator.match(matchBlockTypeFromLocator);
}
if((useNewTextEditor === 'True' && blockType.includes('html'))
|| (useNewVideoEditor === 'True' && blockType.includes('video'))
- ||(useNewProblemEditor === 'True' && blockType.includes('problem'))
+ || (useNewProblemEditor === 'True' && blockType.includes('problem'))
){
var destinationUrl = this.$('.xblock-header-primary').attr('authoring_MFE_base_url') + '/' + blockType[1] + '/' + encodeURI(data.locator);
window.location.href = destinationUrl;
diff --git a/cms/static/js/views/pages/course_outline.js b/cms/static/js/views/pages/course_outline.js
index 78a69baa9a..31227f4aa1 100644
--- a/cms/static/js/views/pages/course_outline.js
+++ b/cms/static/js/views/pages/course_outline.js
@@ -125,7 +125,7 @@ function($, _, gettext, BasePage, XBlockViewUtils, CourseOutlineView, ViewUtils,
* at 100 millisecond intervals until element is found or
* Polling is reached
*/
- scrollToElement: function () {
+ scrollToElement: function() {
this.findElementPollingTimeout -= this.pollingDelay;
const elementID = window.location.hash.replace('#', '');
diff --git a/cms/static/js/views/settings/grading.js b/cms/static/js/views/settings/grading.js
index fea7dd78e0..2148466a0e 100644
--- a/cms/static/js/views/settings/grading.js
+++ b/cms/static/js/views/settings/grading.js
@@ -75,7 +75,7 @@ function(ValidatingView, _, $, ui, GraderView, StringUtils, HtmlUtils) {
this);
gradeCollection.each(function(gradeModel) {
var graderType = gradeModel.get('type');
- var graderTypeAssignmentList = self.courseAssignmentLists[graderType]
+ var graderTypeAssignmentList = self.courseAssignmentLists[graderType];
if (graderTypeAssignmentList === undefined) {
graderTypeAssignmentList = [];
}
diff --git a/cms/static/js/views/settings/main.js b/cms/static/js/views/settings/main.js
index 4f5b358cdc..ef728b616c 100644
--- a/cms/static/js/views/settings/main.js
+++ b/cms/static/js/views/settings/main.js
@@ -388,7 +388,7 @@ function(ValidatingView, CodeMirror, _, $, ui, DateUtils, FileUploadModel,
Hides and clears the certificate available date field if a display behavior that doesn't use it is
chosen. Because we are clearing it, toggling back to "end_with_date" will require re-entering the date
*/
- if (!this.useV2CertDisplaySettings){
+ if (!this.useV2CertDisplaySettings) {
return;
}
let showDatepicker = this.model.get('certificates_display_behavior') == 'end_with_date';
@@ -402,7 +402,7 @@ function(ValidatingView, CodeMirror, _, $, ui, DateUtils, FileUploadModel,
datepicker.prop('disabled', true);
datepicker.val(null);
this.clearValidationErrors();
- this.setAndValidate('certificate_available_date', null)
+ this.setAndValidate('certificate_available_date', null);
certificateAvailableDateField.addClass('hidden');
}
},
diff --git a/cms/static/karma_cms.conf.js b/cms/static/karma_cms.conf.js
index 16d2cc6f4c..6d6451ebd4 100644
--- a/cms/static/karma_cms.conf.js
+++ b/cms/static/karma_cms.conf.js
@@ -6,6 +6,7 @@
'use strict';
var path = require('path');
+
var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js'));
var options = {
diff --git a/cms/static/karma_cms_squire.conf.js b/cms/static/karma_cms_squire.conf.js
index f8c0260fde..9a83a189be 100644
--- a/cms/static/karma_cms_squire.conf.js
+++ b/cms/static/karma_cms_squire.conf.js
@@ -6,6 +6,7 @@
'use strict';
var path = require('path');
+
var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js'));
var options = {
diff --git a/cms/static/karma_cms_webpack.conf.js b/cms/static/karma_cms_webpack.conf.js
index 91650cc5b1..60c228e36c 100644
--- a/cms/static/karma_cms_webpack.conf.js
+++ b/cms/static/karma_cms_webpack.conf.js
@@ -6,6 +6,7 @@
'use strict';
var path = require('path');
+
var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js'));
var options = {
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 1a7d81f336..9012703ce8 100644
--- a/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowser.jsx
+++ b/common/static/common/js/components/BlockBrowser/components/BlockBrowser/BlockBrowser.jsx
@@ -34,7 +34,7 @@ const BlockType = PropTypes.shape({
});
export const BlockList = ({
- blocks, selectedBlock, onSelectBlock, onChangeRoot
+ blocks, selectedBlock, onSelectBlock, onChangeRoot,
}) => (
{blocks.map(block => (
@@ -48,11 +48,12 @@ export const BlockList = ({
label={block.display_name}
/>
{block.children
- && onChangeRoot(block.id)}
- label={RightIcon}
- />
- }
+ && (
+ onChangeRoot(block.id)}
+ label={RightIcon}
+ />
+ )}
))}
@@ -71,7 +72,7 @@ BlockList.defaultProps = {
};
export const BlockBrowser = ({
- blocks, selectedBlock, onSelectBlock, onChangeRoot, className
+ blocks, selectedBlock, onSelectBlock, onChangeRoot, className,
}) => !!blocks && (
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 fd96ef3d12..2f00eaa08c 100644
--- a/common/static/common/js/components/BlockBrowser/data/api/client.js
+++ b/common/static/common/js/components/BlockBrowser/data/api/client.js
@@ -29,4 +29,4 @@ export const getCourseBlocks = courseId => fetch(`${COURSE_BLOCKS_API}?${buildQu
credentials: 'same-origin',
method: 'get',
headers: HEADERS,
-},);
+});
diff --git a/common/static/common/js/components/ExperimentalCarousel.jsx b/common/static/common/js/components/ExperimentalCarousel.jsx
index 1f954d3206..6d99d6d468 100644
--- a/common/static/common/js/components/ExperimentalCarousel.jsx
+++ b/common/static/common/js/components/ExperimentalCarousel.jsx
@@ -11,7 +11,7 @@ function NextArrow(props) {
} = props;
const showArrow = slideCount - currentSlide > displayedSlides;
const opts = {
- className: classNames('js-carousel-nav', 'carousel-arrow', 'next', 'btn btn-secondary', {'active': showArrow}),
+ className: classNames('js-carousel-nav', 'carousel-arrow', 'next', 'btn btn-secondary', {active: showArrow}),
onClick
};
@@ -22,8 +22,8 @@ function NextArrow(props) {
return (
Next
-
- { 'Scroll carousel forwards' }
+
+ Scroll carousel forwards
);
}
@@ -32,7 +32,7 @@ function PrevArrow(props) {
const {currentSlide, onClick} = props;
const showArrow = currentSlide > 0;
const opts = {
- className: classNames('js-carousel-nav', 'carousel-arrow', 'prev', 'btn btn-secondary', {'active': showArrow}),
+ className: classNames('js-carousel-nav', 'carousel-arrow', 'prev', 'btn btn-secondary', {active: showArrow}),
onClick
};
@@ -41,10 +41,10 @@ function PrevArrow(props) {
}
return (
-
-
+
+
Prev
- { 'Scroll carousel backwards' }
+ Scroll carousel backwards
);
}
@@ -87,7 +87,7 @@ export default class ExperimentalCarousel extends React.Component {
},
tabIndex: tabIndex,
className: 'carousel-item'
- }
+ };
return (
@@ -113,7 +113,7 @@ export default class ExperimentalCarousel extends React.Component {
};
return (
-
+
{this.getCarouselContent()}
);
@@ -122,4 +122,4 @@ export default class ExperimentalCarousel extends React.Component {
ExperimentalCarousel.propTypes = {
slides: PropTypes.array.isRequired
-};
\ No newline at end of file
+};
diff --git a/common/static/common/js/discussion/content.js b/common/static/common/js/discussion/content.js
index 905271358f..71bc08f0db 100644
--- a/common/static/common/js/discussion/content.js
+++ b/common/static/common/js/discussion/content.js
@@ -208,7 +208,7 @@
Content.prototype.incrementVote = function(increment) {
var newVotes;
newVotes = _.clone(this.get('votes'));
- newVotes.up_count = newVotes.up_count + increment;
+ newVotes.up_count += increment;
return this.set('votes', newVotes);
};
diff --git a/common/static/common/js/discussion/utils.js b/common/static/common/js/discussion/utils.js
index bc9a99f14f..6be86b1462 100644
--- a/common/static/common/js/discussion/utils.js
+++ b/common/static/common/js/discussion/utils.js
@@ -32,8 +32,8 @@
if (_.isUndefined(userId)) {
userId = this.user ? this.user.id : void 0;
}
- if(_.isUndefined(this.roleIds)) {
- this.roleIds = {}
+ if (_.isUndefined(this.roleIds)) {
+ this.roleIds = {};
}
staff = _.union(this.roleIds.Moderator, this.roleIds.Administrator);
return _.include(staff, parseInt(userId));
@@ -77,7 +77,9 @@
DiscussionUtil.generateDiscussionLink = function(cls, txt, handler) {
return $('')
.addClass('discussion-link').attr('href', '#')
- .addClass(cls).text(txt).click(function() { return handler(this); });
+ .addClass(cls)
+ .text(txt)
+ .click(function() { return handler(this); });
};
DiscussionUtil.urlFor = function(name, param, param1, param2) {
@@ -484,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 c190bf94b3..d6d7f79773 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/common/js/jasmine_stack_trace.js b/common/static/common/js/jasmine_stack_trace.js
index 5cd73ff287..f61d591f0a 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/karma.common.conf.js b/common/static/common/js/karma.common.conf.js
index 41936aeb9b..6123b5a99d 100644
--- a/common/static/common/js/karma.common.conf.js
+++ b/common/static/common/js/karma.common.conf.js
@@ -40,9 +40,11 @@
var path = require('path');
var _ = require('underscore');
+
var appRoot = path.join(__dirname, '../../../../');
var webdriver = require('selenium-webdriver');
var firefox = require('selenium-webdriver/firefox');
+
var webpackConfig = require(path.join(appRoot, 'webpack.dev.config.js'));
// The following crazy bit is to work around the webpack.optimize.CommonsChunkPlugin
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 fa1079c747..70810dacbf 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
@@ -57,11 +57,11 @@
_ref >= 0 ? _i <= _ref : _i >= _ref;
i = _ref >= 0 ? ++_i : --_i
) {
- threadData.body = threadData.body + imageTag;
+ threadData.body += imageTag;
if (i === 0) {
- expectedHtml = expectedHtml + imageTag;
+ expectedHtml += imageTag;
} else {
- expectedHtml = expectedHtml + 'image omitted ';
+ expectedHtml += 'image omitted ';
}
}
}
diff --git a/common/static/js/capa/drag_and_drop/draggables.js b/common/static/js/capa/drag_and_drop/draggables.js
index bd2d312617..13e26c28de 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/common/static/js/spec/string_utils_spec.js b/common/static/js/spec/string_utils_spec.js
index 81b4d9fa3a..8d4e7c5181 100644
--- a/common/static/js/spec/string_utils_spec.js
+++ b/common/static/js/spec/string_utils_spec.js
@@ -1,15 +1,15 @@
describe('interpolate_ntext', function() {
it('replaces placeholder values', function() {
- expect(interpolate_ntext('contains {count} student', 'contains {count} students', 1, {count: 1})).
- toBe('contains 1 student');
- expect(interpolate_ntext('contains {count} student', 'contains {count} students', 5, {count: 2})).
- toBe('contains 2 students');
+ expect(interpolate_ntext('contains {count} student', 'contains {count} students', 1, {count: 1}))
+ .toBe('contains 1 student');
+ expect(interpolate_ntext('contains {count} student', 'contains {count} students', 5, {count: 2}))
+ .toBe('contains 2 students');
});
});
describe('interpolate_text', function() {
it('replaces placeholder values', function() {
- expect(interpolate_text('contains {adjective} students', {adjective: 'awesome'})).
- toBe('contains awesome students');
+ expect(interpolate_text('contains {adjective} students', {adjective: 'awesome'}))
+ .toBe('contains awesome students');
});
});
diff --git a/common/static/js/src/CookiePolicyBanner.jsx b/common/static/js/src/CookiePolicyBanner.jsx
index 7e6ec6ce71..a570e1cc95 100644
--- a/common/static/js/src/CookiePolicyBanner.jsx
+++ b/common/static/js/src/CookiePolicyBanner.jsx
@@ -1,4 +1,5 @@
import React from 'react';
import CookieBanner from '@edx/frontend-component-cookie-policy-banner';
-export function CookiePolicyBanner() { return ; };
+// eslint-disable-next-line import/prefer-default-export
+export function CookiePolicyBanner() { return ; }
diff --git a/common/static/js/src/accessibility_tools.js b/common/static/js/src/accessibility_tools.js
index 54f9997d19..5c2392c352 100644
--- a/common/static/js/src/accessibility_tools.js
+++ b/common/static/js/src/accessibility_tools.js
@@ -151,7 +151,7 @@ var accessible_modal = function(trigger, closeButtonId, modalId, mainPageId) {
// see http://accessibility.oit.ncsu.edu/blog/2013/09/13/the-incredible-accessible-modal-dialog/
// for more information on managing modals
//
- var initialFocus
+ var initialFocus;
$(trigger).click(function() {
$focusedElementBeforeModal = $(trigger);
diff --git a/common/static/karma_common.conf.js b/common/static/karma_common.conf.js
index ef8244ff78..93dbc183bd 100644
--- a/common/static/karma_common.conf.js
+++ b/common/static/karma_common.conf.js
@@ -6,6 +6,7 @@
'use strict';
var path = require('path');
+
var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js'));
var options = {
diff --git a/common/static/karma_common_requirejs.conf.js b/common/static/karma_common_requirejs.conf.js
index f407a548d0..4a0a18b785 100644
--- a/common/static/karma_common_requirejs.conf.js
+++ b/common/static/karma_common_requirejs.conf.js
@@ -6,6 +6,7 @@
'use strict';
var path = require('path');
+
var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js'));
var options = {
diff --git a/jest.config.js b/jest.config.js
index e9e014bd1d..a4e84c2350 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -1,17 +1,17 @@
module.exports = {
- 'globals': {
- 'gettext': (t) => { return t; },
+ globals: {
+ gettext: (t) => t,
},
- 'modulePaths': [
+ modulePaths: [
'common/static/common/js/components',
],
- 'setupFilesAfterEnv': ['/setupTests.js'],
- 'testMatch': [
+ setupFilesAfterEnv: ['/setupTests.js'],
+ testMatch: [
'/**/*.test.jsx',
'common/static/common/js/components/**/?(*.)+(spec|test).js?(x)',
],
- 'testEnvironment': 'jsdom',
- 'transform': {
+ testEnvironment: 'jsdom',
+ transform: {
'^.+\\.jsx$': 'babel-jest',
'^.+\\.js$': 'babel-jest',
},
diff --git a/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/Main.jsx b/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/Main.jsx
index e649c64dc2..d921f90441 100644
--- a/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/Main.jsx
+++ b/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/Main.jsx
@@ -29,7 +29,7 @@ export default class Main extends React.Component {
this.props.problemResponsesEndpoint,
this.props.taskStatusEndpoint,
this.props.reportDownloadEndpoint,
- this.props.selectedBlock
+ this.props.selectedBlock,
);
}
diff --git a/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/Main.test.jsx b/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/Main.test.jsx
index 00c6620dbc..4cdcf049ca 100644
--- a/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/Main.test.jsx
+++ b/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/Main.test.jsx
@@ -44,7 +44,7 @@ describe('ProblemBrowser Main component', () => {
fetchCourseBlocks={jest.fn()}
problemResponsesEndpoint={problemResponsesEndpoint}
onSelectBlock={jest.fn()}
- selectedBlock={'some-selected-block'}
+ selectedBlock="some-selected-block"
taskStatusEndpoint={taskStatusEndpoint}
/>
,
@@ -64,7 +64,7 @@ describe('ProblemBrowser Main component', () => {
fetchCourseBlocks={fetchCourseBlocksMock}
problemResponsesEndpoint={problemResponsesEndpoint}
onSelectBlock={jest.fn()}
- selectedBlock={'some-selected-block'}
+ selectedBlock="some-selected-block"
taskStatusEndpoint={taskStatusEndpoint}
/>
,
@@ -83,7 +83,7 @@ describe('ProblemBrowser Main component', () => {
fetchCourseBlocks={jest.fn()}
problemResponsesEndpoint={problemResponsesEndpoint}
onSelectBlock={jest.fn()}
- selectedBlock={'some-selected-block'}
+ selectedBlock="some-selected-block"
taskStatusEndpoint={taskStatusEndpoint}
/>,
);
diff --git a/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/MainContainer.jsx b/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/MainContainer.jsx
index e4affc695f..459588a447 100644
--- a/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/MainContainer.jsx
+++ b/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/Main/MainContainer.jsx
@@ -13,7 +13,7 @@ const mapDispatchToProps = dispatch => ({
(courseId, excludeBlockTypes) => dispatch(fetchCourseBlocks(courseId, excludeBlockTypes)),
createProblemResponsesReportTask:
(problemResponsesEndpoint, taskStatusEndpoint, reportDownloadEndpoint, problemLocation) => dispatch(
- createProblemResponsesReportTask(problemResponsesEndpoint, taskStatusEndpoint, reportDownloadEndpoint, problemLocation,),
+ createProblemResponsesReportTask(problemResponsesEndpoint, taskStatusEndpoint, reportDownloadEndpoint, problemLocation),
),
});
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 99db4d2984..49fbb3a034 100644
--- a/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/ReportStatus/ReportStatus.jsx
+++ b/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/ReportStatus/ReportStatus.jsx
@@ -5,7 +5,7 @@ import * as PropTypes from 'prop-types';
import * as React from 'react';
const ReportStatus = ({
- error, succeeded, inProgress, reportPath
+ error, succeeded, inProgress, reportPath,
}) => {
const progressMessage = (
diff --git a/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/ReportStatus/ReportStatus.test.jsx b/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/ReportStatus/ReportStatus.test.jsx
index fd5b247b92..a3d9e06356 100644
--- a/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/ReportStatus/ReportStatus.test.jsx
+++ b/lms/djangoapps/instructor/static/instructor/ProblemBrowser/components/ReportStatus/ReportStatus.test.jsx
@@ -23,8 +23,8 @@ describe('ReportStatus component', () => {
,
);
@@ -35,7 +35,7 @@ describe('ReportStatus component', () => {
test('render error status', () => {
const component = renderer.create(
fetch(`${endpoint}/?task_id=${taskId}`, {
credentials: 'same-origin',
method: 'get',
headers: HEADERS,
-},);
+});
const fetchDownloadsList = (endpoint, reportName) => {
const formData = new FormData();
@@ -33,7 +33,7 @@ const fetchDownloadsList = (endpoint, reportName) => {
method: 'POST',
headers: HEADERS,
body: formData,
- },);
+ });
};
export {
diff --git a/lms/djangoapps/support/static/support/jsx/entitlements/components/EntitlementForm/container.jsx b/lms/djangoapps/support/static/support/jsx/entitlements/components/EntitlementForm/container.jsx
index 905058b85a..f403be16b2 100644
--- a/lms/djangoapps/support/static/support/jsx/entitlements/components/EntitlementForm/container.jsx
+++ b/lms/djangoapps/support/static/support/jsx/entitlements/components/EntitlementForm/container.jsx
@@ -13,9 +13,9 @@ const mapStateToProps = state => ({
const mapDispatchToProps = dispatch => ({
createEntitlement: ({
- username, courseUuid, mode, comments
+ username, courseUuid, mode, comments,
}) => dispatch(createEntitlement({
- username, courseUuid, mode, comments
+ username, courseUuid, mode, comments,
})),
reissueEntitlement: ({ entitlement, comments }) => dispatch(reissueEntitlement({ entitlement, comments })),
closeForm: () => dispatch(closeForm()),
diff --git a/lms/djangoapps/support/static/support/jsx/entitlements/components/EntitlementForm/index.jsx b/lms/djangoapps/support/static/support/jsx/entitlements/components/EntitlementForm/index.jsx
index e06911c3ad..ceea7134df 100644
--- a/lms/djangoapps/support/static/support/jsx/entitlements/components/EntitlementForm/index.jsx
+++ b/lms/djangoapps/support/static/support/jsx/entitlements/components/EntitlementForm/index.jsx
@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import {
- Button, InputSelect, InputText, TextArea
+ Button, InputSelect, InputText, TextArea,
} from '@edx/paragon';
import { formTypes } from '../../data/constants/formTypes';
@@ -57,21 +57,21 @@ class EntitlementForm extends React.Component {
submitForm() {
const {
- courseUuid, username, mode, comments
+ courseUuid, username, mode, comments,
} = this.state;
const { formType, entitlement } = this.props;
if (formType === formTypes.REISSUE) { // if there is an active entitlement we are updating an entitlement
this.props.reissueEntitlement({ entitlement, comments });
} else { // if there is no active entitlement we are creating a new entitlement
this.props.createEntitlement({
- courseUuid, username, mode, comments
+ courseUuid, username, mode, comments,
});
}
}
render() {
const {
- courseUuid, username, mode, comments
+ courseUuid, username, mode, comments,
} = this.state;
const isReissue = this.props.formType === formTypes.REISSUE;
const title = isReissue ? 'Re-issue Entitlement' : 'Create Entitlement';
diff --git a/lms/djangoapps/support/static/support/jsx/entitlements/components/Table/EntitlementSupportTable.jsx b/lms/djangoapps/support/static/support/jsx/entitlements/components/Table/EntitlementSupportTable.jsx
index 5cf7bab59c..aec8c5896b 100644
--- a/lms/djangoapps/support/static/support/jsx/entitlements/components/Table/EntitlementSupportTable.jsx
+++ b/lms/djangoapps/support/static/support/jsx/entitlements/components/Table/EntitlementSupportTable.jsx
@@ -47,7 +47,7 @@ const entitlementColumns = [
const parseEntitlementData = (entitlements, ecommerceUrl, openReissueForm) => entitlements.map((entitlement) => {
const {
- expiredAt, created, modified, orderNumber, enrollmentCourseRun
+ expiredAt, created, modified, orderNumber, enrollmentCourseRun,
} = entitlement;
return Object.assign({}, entitlement, {
expiredAt: expiredAt ? moment(expiredAt).format('lll') : '',
diff --git a/lms/djangoapps/support/static/support/jsx/entitlements/data/actions/entitlement.js b/lms/djangoapps/support/static/support/jsx/entitlements/data/actions/entitlement.js
index 3173c85da3..d7aceb6328 100644
--- a/lms/djangoapps/support/static/support/jsx/entitlements/data/actions/entitlement.js
+++ b/lms/djangoapps/support/static/support/jsx/entitlements/data/actions/entitlement.js
@@ -67,7 +67,7 @@ const createEntitlementSuccess = entitlement => ({
const createEntitlementFailure = error => dispatch => dispatch(displayError('Error Creating Entitlement', error));
const createEntitlement = ({
- username, courseUuid, mode, comments
+ username, courseUuid, mode, comments,
}) => (dispatch) => {
postEntitlement({
username,
diff --git a/lms/djangoapps/support/static/support/jsx/entitlements/data/api/client.js b/lms/djangoapps/support/static/support/jsx/entitlements/data/api/client.js
index 747d71642f..0431298041 100644
--- a/lms/djangoapps/support/static/support/jsx/entitlements/data/api/client.js
+++ b/lms/djangoapps/support/static/support/jsx/entitlements/data/api/client.js
@@ -12,10 +12,10 @@ const HEADERS = {
const getEntitlements = username => fetch(`${entitlementApi}?user=${username}`, {
credentials: 'same-origin',
method: 'get',
-},);
+});
const postEntitlement = ({
- username, courseUuid, mode, action, comments = null
+ username, courseUuid, mode, action, comments = null,
}) => fetch(`${entitlementApi}`, {
credentials: 'same-origin',
method: 'post',
@@ -30,10 +30,10 @@ const postEntitlement = ({
comments,
}],
}),
-},);
+});
const patchEntitlement = ({
- uuid, action, unenrolledRun = null, comments = null
+ uuid, action, unenrolledRun = null, comments = null,
}) => fetch(`${entitlementApi}${uuid}`, {
credentials: 'same-origin',
method: 'patch',
@@ -46,7 +46,7 @@ const patchEntitlement = ({
comments,
}],
}),
-},);
+});
export {
getEntitlements,
diff --git a/lms/djangoapps/support/static/support/jsx/entitlements/data/reducers/form.js b/lms/djangoapps/support/static/support/jsx/entitlements/data/reducers/form.js
index b195b4ff02..11394eb0b8 100644
--- a/lms/djangoapps/support/static/support/jsx/entitlements/data/reducers/form.js
+++ b/lms/djangoapps/support/static/support/jsx/entitlements/data/reducers/form.js
@@ -1,5 +1,6 @@
import { formActions, entitlementActions } from '../constants/actionTypes';
import { formTypes } from '../constants/formTypes';
+
const clearFormState = {
formType: '',
isOpen: false,
@@ -10,11 +11,11 @@ const form = (state = {}, action) => {
switch (action.type) {
case formActions.OPEN_REISSUE_FORM:
return {
- ...state, formType: formTypes.REISSUE, isOpen: true, activeEntitlement: action.entitlement
+ ...state, formType: formTypes.REISSUE, isOpen: true, activeEntitlement: action.entitlement,
};
case formActions.OPEN_CREATION_FORM:
return {
- ...state, formType: formTypes.CREATE, isOpen: true, activeEntitlement: null
+ ...state, formType: formTypes.CREATE, isOpen: true, activeEntitlement: null,
};
case formActions.CLOSE_FORM:
case entitlementActions.reissue.SUCCESS:
diff --git a/lms/djangoapps/support/static/support/jsx/file_upload.jsx b/lms/djangoapps/support/static/support/jsx/file_upload.jsx
index 57ba417f80..ec9cb91b41 100644
--- a/lms/djangoapps/support/static/support/jsx/file_upload.jsx
+++ b/lms/djangoapps/support/static/support/jsx/file_upload.jsx
@@ -141,8 +141,7 @@ class FileUpload extends React.Component {
fileName={this.state.fileInProgress}
request={this.state.currentRequest}
/>
- )
- }
+ )}
{
diff --git a/lms/djangoapps/support/static/support/jsx/program_enrollments/index.jsx b/lms/djangoapps/support/static/support/jsx/program_enrollments/index.jsx
index aa137ac4b2..9d7ce4ec32 100644
--- a/lms/djangoapps/support/static/support/jsx/program_enrollments/index.jsx
+++ b/lms/djangoapps/support/static/support/jsx/program_enrollments/index.jsx
@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import Cookies from 'js-cookie';
import {
- Button, InputText, TextArea, StatusAlert
+ Button, InputText, TextArea, StatusAlert,
} from '@edx/paragon';
export const LinkProgramEnrollmentsSupportPage = props => (
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 3f8f6fda57..0996b12050 100644
--- a/lms/djangoapps/support/static/support/jsx/program_enrollments/inspector.jsx
+++ b/lms/djangoapps/support/static/support/jsx/program_enrollments/inspector.jsx
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
- Button, InputText, StatusAlert, InputSelect
+ Button, InputText, StatusAlert, InputSelect,
} from '@edx/paragon';
/*
@@ -112,7 +112,7 @@ const renderEnrollmentsSection = enrollments => (
)}
- )
+ ),
)}
))}
@@ -152,7 +152,7 @@ export const ProgramEnrollmentsInspectorPage = props => (
dialog={props.error}
/>
)}
-
+
Search either by edx username or email, or Institution user key, but not both
@@ -228,7 +228,7 @@ ProgramEnrollmentsInspectorPage.propTypes = {
is_active: PropTypes.bool,
mode: PropTypes.string,
}),
- })
+ }),
),
}),
),
diff --git a/lms/djangoapps/support/static/support/jsx/single_support_form.jsx b/lms/djangoapps/support/static/support/jsx/single_support_form.jsx
index 850301954a..6288777690 100644
--- a/lms/djangoapps/support/static/support/jsx/single_support_form.jsx
+++ b/lms/djangoapps/support/static/support/jsx/single_support_form.jsx
@@ -150,7 +150,7 @@ class RenderForm extends React.Component {
{
id: this.props.context.customFields.referrer,
value: document.referrer ? document.referrer : 'Direct Contact Us Page Request',
- }
+ },
],
tags: this.props.context.tags,
};
@@ -175,6 +175,7 @@ class RenderForm extends React.Component {
this.scrollToTop();
}.bind(this);
}
+
validateFormData(formData) {
const { course, subject, message } = formData;
@@ -273,21 +274,25 @@ class RenderForm extends React.Component {
let userElement,
suggestionsListComponent = null;
if (this.userInformation) {
- userElement = ( );
+ userElement = (
+
+ );
} else {
- userElement = ( );
+ userElement = (
+
+ );
}
if (suggestions !== null && suggestions.length) {
suggestionsListComponent = (
diff --git a/lms/djangoapps/support/static/support/jsx/success.jsx b/lms/djangoapps/support/static/support/jsx/success.jsx
index da72afb30b..22ca476506 100644
--- a/lms/djangoapps/support/static/support/jsx/success.jsx
+++ b/lms/djangoapps/support/static/support/jsx/success.jsx
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
import StringUtils from 'edx-ui-toolkit/js/utils/string-utils';
function Success({
- platformName, homepageUrl, dashboardUrl, isLoggedIn
+ platformName, homepageUrl, dashboardUrl, isLoggedIn,
}) {
let btnText,
btnUrl;
diff --git a/lms/static/completion/js/CompletionOnViewService.js b/lms/static/completion/js/CompletionOnViewService.js
index 016aaa7d1a..b705f5a6f4 100644
--- a/lms/static/completion/js/CompletionOnViewService.js
+++ b/lms/static/completion/js/CompletionOnViewService.js
@@ -11,7 +11,7 @@ export function markBlocksCompletedOnViewIfNeeded(runtime, containerElement) {
const tracker = new ViewedEventTracker();
blockElements.forEach((blockElement) => {
- const markCompletedOnViewAfterDelay = parseInt(blockElement.dataset.markCompletedOnViewAfterDelay, 10,);
+ const markCompletedOnViewAfterDelay = parseInt(blockElement.dataset.markCompletedOnViewAfterDelay, 10);
if (markCompletedOnViewAfterDelay >= 0) {
tracker.addElement(blockElement, markCompletedOnViewAfterDelay);
}
diff --git a/lms/static/js/Markdown.Editor.js b/lms/static/js/Markdown.Editor.js
index e61630bced..01df547de2 100644
--- a/lms/static/js/Markdown.Editor.js
+++ b/lms/static/js/Markdown.Editor.js
@@ -123,7 +123,7 @@
this.before = this.before.replace(regex,
function(match) {
- chunkObj.startTag = chunkObj.startTag + match;
+ chunkObj.startTag += match;
return '';
});
@@ -131,7 +131,7 @@
this.selection = this.selection.replace(regex,
function(match) {
- chunkObj.startTag = chunkObj.startTag + match;
+ chunkObj.startTag += match;
return '';
});
}
@@ -194,14 +194,14 @@
this.selection = this.selection.replace(/(^\n*)/, '');
- this.startTag = this.startTag + re.$1;
+ this.startTag += re.$1;
this.selection = this.selection.replace(/(\n*$)/, '');
- this.endTag = this.endTag + re.$1;
+ this.endTag += re.$1;
this.startTag = this.startTag.replace(/(^\n*)/, '');
- this.before = this.before + re.$1;
+ this.before += re.$1;
this.endTag = this.endTag.replace(/(\n*$)/, '');
- this.after = this.after + re.$1;
+ this.after += re.$1;
if (this.before) {
regexText = replacementText = '';
@@ -236,7 +236,7 @@
function findAnEmptyToolbar(toolbarClassName) {
var toolbars = doc.getElementsByClassName(toolbarClassName);
- for (var i=0; i < toolbars.length; ++i) {
+ for (var i = 0; i < toolbars.length; ++i) {
var aToolbar = toolbars[i];
if (aToolbar.children.length == 0) {
var anEmptyToolbar = aToolbar;
@@ -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;
}
};
@@ -737,7 +735,7 @@
// Sets the TextareaState properties given a chunk of markdown.
this.setChunks = function(chunk) {
- chunk.before = chunk.before + chunk.startTag;
+ chunk.before += chunk.startTag;
chunk.after = chunk.endTag + chunk.after;
this.start = chunk.before.length;
@@ -1572,11 +1570,9 @@
// Add the true markup.
var markup = nStars <= 1 ? '*' : '**'; // shouldn't the test be = ?
- chunk.before = chunk.before + markup;
+ chunk.before += markup;
chunk.after = markup + chunk.after;
}
-
- return;
};
commandProto.stripLinkDefs = function(text, defsToAdd) {
@@ -1663,7 +1659,9 @@
});
if (title) {
title = title.trim ? title.trim() : title.replace(/^\s*/, '').replace(/\s*$/, '');
- title = $.trim(title).replace(/"/g, 'quot;').replace(/\(/g, '(').replace(/\)/g, ')').replace(//g, '>');
+ title = $.trim(title).replace(/"/g, 'quot;').replace(/\(/g, '(').replace(/\)/g, ')')
+ .replace(//g, '>');
}
return title ? link + ' "' + title + '"' : link;
});
diff --git a/lms/static/js/accessible_components/StatusBarAlert.jsx b/lms/static/js/accessible_components/StatusBarAlert.jsx
index 362fb09186..cede69fe83 100644
--- a/lms/static/js/accessible_components/StatusBarAlert.jsx
+++ b/lms/static/js/accessible_components/StatusBarAlert.jsx
@@ -19,11 +19,11 @@ export class StatusAlertRenderer {
*/
ReactDOM.render(
this.shiftFocus(afterselector)}
/>,
document.querySelector(selector)
diff --git a/lms/static/js/course_survey.js b/lms/static/js/course_survey.js
index aca7048d83..c92d53e3cc 100644
--- a/lms/static/js/course_survey.js
+++ b/lms/static/js/course_survey.js
@@ -49,9 +49,9 @@ $(function() {
});
if (cancel_submit) {
- $('.status.message.submission-error').
- removeClass('is-hidden').
- focus();
+ $('.status.message.submission-error')
+ .removeClass('is-hidden')
+ .focus();
$('html, body').animate({scrollTop: 0}, 'fast');
return false;
}
@@ -72,10 +72,10 @@ $(function() {
toggleSubmitButton(true);
json = $.parseJSON(jqXHR.responseText);
$('.status.message.submission-error').addClass('is-shown').focus();
- $('.status.message.submission-error .message-copy').
- text(gettext('There has been an error processing your survey.')).
- stop().
- css('display', 'block');
+ $('.status.message.submission-error .message-copy')
+ .text(gettext('There has been an error processing your survey.'))
+ .stop()
+ .css('display', 'block');
});
});
@@ -83,14 +83,14 @@ function toggleSubmitButton(enable) {
var $submitButton = $('form .form-actions #submit');
if (enable) {
- $submitButton.
- removeClass('is-disabled').
- attr('aria-disabled', false).
- removeProp('disabled');
+ $submitButton
+ .removeClass('is-disabled')
+ .attr('aria-disabled', false)
+ .removeProp('disabled');
} else {
- $submitButton.
- addClass('is-disabled').
- attr('aria-disabled', true).
- prop('disabled', true);
+ $submitButton
+ .addClass('is-disabled')
+ .attr('aria-disabled', true)
+ .prop('disabled', true);
}
}
diff --git a/lms/static/js/dashboard/legacy.js b/lms/static/js/dashboard/legacy.js
index bd36849b25..7d0007a352 100644
--- a/lms/static/js/dashboard/legacy.js
+++ b/lms/static/js/dashboard/legacy.js
@@ -272,7 +272,7 @@ var edx = edx || {};
display: 'block',
'z-index': 0
});
- $('#activate-account-modal').focus()
+ $('#activate-account-modal').focus();
}
$('.action-email-settings').each(function(index) {
diff --git a/lms/static/js/demographics_collection/DemographicsCollectionBanner.jsx b/lms/static/js/demographics_collection/DemographicsCollectionBanner.jsx
index 71a221d081..d01ec4e285 100644
--- a/lms/static/js/demographics_collection/DemographicsCollectionBanner.jsx
+++ b/lms/static/js/demographics_collection/DemographicsCollectionBanner.jsx
@@ -4,13 +4,12 @@ import Cookies from 'js-cookie';
import {DemographicsCollectionModal} from './DemographicsCollectionModal';
export class DemographicsCollectionBanner extends React.Component {
-
constructor(props) {
super(props);
this.state = {
modalOpen: false,
hideBanner: false
- }
+ };
this.dismissBanner = this.dismissBanner.bind(this);
}
@@ -65,30 +64,31 @@ export class DemographicsCollectionBanner extends React.Component {
{gettext('Want to make edX better for everyone?')}
-
+
{gettext('Get started')}
-
+
{this.state.modalOpen
- && this.setState({modalOpen: false})}
- dismissBanner={this.dismissBanner}
- />
- }
+ && (
+ this.setState({modalOpen: false})}
+ dismissBanner={this.dismissBanner}
+ />
+ )}
- )
+ );
} else {
return null;
}
diff --git a/lms/static/js/demographics_collection/DemographicsCollectionModal.jsx b/lms/static/js/demographics_collection/DemographicsCollectionModal.jsx
index 065cdc7583..92ebeb80d9 100644
--- a/lms/static/js/demographics_collection/DemographicsCollectionModal.jsx
+++ b/lms/static/js/demographics_collection/DemographicsCollectionModal.jsx
@@ -1,14 +1,14 @@
/* global gettext */
import React from 'react';
import get from 'lodash/get';
-import Wizard from './Wizard';
import Cookies from 'js-cookie';
-import {SelectWithInput} from './SelectWithInput'
+import StringUtils from 'edx-ui-toolkit/js/utils/string-utils';
+import FocusLock from 'react-focus-lock';
+import Wizard from './Wizard';
+import {SelectWithInput} from './SelectWithInput';
import {MultiselectDropdown} from './MultiselectDropdown';
import AxiosJwtTokenService from '../jwt_auth/AxiosJwtTokenService';
-import StringUtils from 'edx-ui-toolkit/js/utils/string-utils';
import AxiosCsrfTokenService from '../jwt_auth/AxiosCsrfTokenService';
-import FocusLock from 'react-focus-lock';
const FIELD_NAMES = {
CURRENT_WORK: 'current_work_sector',
@@ -66,7 +66,7 @@ class DemographicsCollectionModal extends React.Component {
accessToken,
refreshUrl,
);
- this.csrfTokenService = new AxiosCsrfTokenService(this.props.csrfTokenPath)
+ this.csrfTokenService = new AxiosCsrfTokenService(this.props.csrfTokenPath);
}
async componentDidMount() {
@@ -108,7 +108,7 @@ class DemographicsCollectionModal extends React.Component {
};
try {
await this.jwtTokenService.getJwtToken();
- await fetch(url, options)
+ await fetch(url, options);
} catch (error) {
this.setState({loading: false, fieldError: true, errorMessage: error});
}
@@ -129,13 +129,13 @@ class DemographicsCollectionModal extends React.Component {
this.setState(({selected}) => {
// decline was previously selected
if (selected[FIELD_NAMES.ETHNICITY].find(i => i === 'declined')) {
- return {selected: {...selected, [FIELD_NAMES.ETHNICITY]: values.filter(value => value !== 'declined')}}
+ return {selected: {...selected, [FIELD_NAMES.ETHNICITY]: values.filter(value => value !== 'declined')}};
// decline was just selected
} else if (decline) {
- return {selected: {...selected, [FIELD_NAMES.ETHNICITY]: [decline]}}
+ return {selected: {...selected, [FIELD_NAMES.ETHNICITY]: [decline]}};
// anything else was selected
} else {
- return {selected: {...selected, [FIELD_NAMES.ETHNICITY]: values}}
+ return {selected: {...selected, [FIELD_NAMES.ETHNICITY]: values}};
}
});
}
@@ -174,7 +174,7 @@ class DemographicsCollectionModal extends React.Component {
// We gather the possible answers to any demographics questions from the OPTIONS of the api
async getDemographicsQuestionOptions() {
try {
- const optionsResponse = await fetch(`${this.props.demographicsBaseUrl}/demographics/api/v1/demographics/`, {method: 'OPTIONS'})
+ const optionsResponse = await fetch(`${this.props.demographicsBaseUrl}/demographics/api/v1/demographics/`, {method: 'OPTIONS'});
const demographicsOptions = await optionsResponse.json();
return demographicsOptions;
} catch (error) {
@@ -240,7 +240,7 @@ class DemographicsCollectionModal extends React.Component {
render() {
if (this.state.loading) {
- return
+ return
;
}
return (
@@ -261,8 +261,7 @@ class DemographicsCollectionModal extends React.Component {
currentPage: currentPage,
totalPages: totalPages
}
- )
- }
+ )}
{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 */}
+
+
+ {gettext('What was the total combined income, during the last 12 months, of all members of your family? ')}
+
+
+ {gettext('Select income')}
+ {
+ this.loadOptions(FIELD_NAMES.INCOME)
}
- }
- this.handleSelectChange(e);
- }}
- />
- {/* Family Income */}
-
-
- {gettext('What was the total combined income, during the last 12 months, of all members of your family? ')}
-
-
- {gettext('Select income')}
- {
- this.loadOptions(FIELD_NAMES.INCOME)
- }
-
+
+
-
- }
+ )}
- {({wizardConsumer}) =>
- {/* Military History */}
-
-
- {gettext('Have you ever served on active duty in the U.S. Armed Forces, Reserves, or National Guard?')}
-
-
- {gettext('Select military status')}
- {
- this.loadOptions(FIELD_NAMES.MILITARY)
- }
-
+ {({wizardConsumer}) => (
+
+ {/* Military History */}
+
+
+ {gettext('Have you ever served on active duty in the U.S. Armed Forces, Reserves, or National Guard?')}
+
+
+ {gettext('Select military status')}
+ {
+ this.loadOptions(FIELD_NAMES.MILITARY)
+ }
+
+
-
- }
+ )}
- {({wizardConsumer}) =>
- {/* Learner Education Level */}
-
-
- {gettext('What is the highest level of education that you have achieved so far?')}
-
-
- {gettext('Select level of education')}
- {
- this.loadOptions(FIELD_NAMES.EDUCATION_LEVEL)
- }
-
+ {({wizardConsumer}) => (
+
+ {/* Learner Education Level */}
+
+
+ {gettext('What is the highest level of education that you have achieved so far?')}
+
+
+ {gettext('Select level of education')}
+ {
+ this.loadOptions(FIELD_NAMES.EDUCATION_LEVEL)
+ }
+
+
+ {/* Parent/Guardian Education Level */}
+
+
+ {gettext('What is the highest level of education that any of your parents or guardians have achieved?')}
+
+
+ {gettext('Select guardian education')}
+ {
+ this.loadOptions(FIELD_NAMES.PARENT_EDUCATION)
+ }
+
+
- {/* Parent/Guardian Education Level */}
-
-
- {gettext('What is the highest level of education that any of your parents or guardians have achieved?')}
-
-
- {gettext('Select guardian education')}
- {
- 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 */}
-
-
- {gettext('What industry do you currently work in?')}
-
-
(
+
+ {/* 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}
- >
- {gettext('Select current industry')}
- {
- this.loadOptions(FIELD_NAMES.CURRENT_WORK)
- }
-
+ />
+ {/* Current Work Industry */}
+
+
+ {gettext('What industry do you currently work in?')}
+
+
+ {gettext('Select current industry')}
+ {
+ this.loadOptions(FIELD_NAMES.CURRENT_WORK)
+ }
+
+
+ {/* Future Work Industry */}
+
+
+ {gettext('What industry do you want to work in?')}
+
+
+ {gettext('Select prospective industry')}
+ {
+ this.loadOptions(FIELD_NAMES.FUTURE_WORK)
+ }
+
+
- {/* Future Work Industry */}
-
-
- {gettext('What industry do you want to work in?')}
-
-
- {gettext('Select prospective industry')}
- {
- this.loadOptions(FIELD_NAMES.FUTURE_WORK)
- }
-
-
-
- }
+ )}
-
+
{gettext('Thank you! You’re helping make edX better for everyone.')}
@@ -493,7 +497,7 @@ class DemographicsCollectionModal extends React.Component {
- )
+ );
}
}
diff --git a/lms/static/js/demographics_collection/MultiselectDropdown.jsx b/lms/static/js/demographics_collection/MultiselectDropdown.jsx
index 780ed91929..83316047d6 100644
--- a/lms/static/js/demographics_collection/MultiselectDropdown.jsx
+++ b/lms/static/js/demographics_collection/MultiselectDropdown.jsx
@@ -13,7 +13,7 @@ class MultiselectDropdown extends React.Component {
this.buttonRef = null;
this.setButtonRef = (element) => {
this.buttonRef = element;
- }
+ };
this.focusButton = this.focusButton.bind(this);
this.handleKeydown = this.handleKeydown.bind(this);
@@ -27,7 +27,6 @@ class MultiselectDropdown extends React.Component {
}
componentWillUnmount() {
-
document.removeEventListener('keydown', this.handleKeydown, false);
}
@@ -87,7 +86,7 @@ class MultiselectDropdown extends React.Component {
.map(selected => this.findOption(selected).display_name)
.join(', ');
if (selectedList.length > 60) {
- return selectedList.substring(0, 55) + '...'
+ return selectedList.substring(0, 55) + '...';
}
return selectedList;
}
@@ -95,7 +94,7 @@ class MultiselectDropdown extends React.Component {
renderUnselect() {
return this.props.selected.length > 0 && (
{gettext('Clear all')}
- )
+ );
}
renderMenu() {
@@ -112,15 +111,15 @@ class MultiselectDropdown extends React.Component {
{option.display_name}
- )
- })
+ );
+ });
return (
{this.props.label}
{options}
- )
+ );
}
render() {
@@ -136,7 +135,7 @@ class MultiselectDropdown extends React.Component {
// and close the dropdown.
if (!e.currentTarget.contains(e.relatedTarget)) {
this.props.onBlur(e);
- this.setState({open: false})
+ this.setState({open: false});
}
}}
>
@@ -151,7 +150,7 @@ class MultiselectDropdown extends React.Component {
{this.renderMenu()}
- )
+ );
}
}
diff --git a/lms/static/js/demographics_collection/SelectWithInput.jsx b/lms/static/js/demographics_collection/SelectWithInput.jsx
index 794c87e450..6f6d9cba26 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/demographics_collection/Wizard.jsx b/lms/static/js/demographics_collection/Wizard.jsx
index 42f57d3574..759cc8c2d1 100644
--- a/lms/static/js/demographics_collection/Wizard.jsx
+++ b/lms/static/js/demographics_collection/Wizard.jsx
@@ -16,7 +16,7 @@ export default class Wizard extends React.Component {
totalPages: 0,
pages: [],
wizardContext: {},
- }
+ };
this.wizardComplete = this.wizardComplete.bind(this);
}
@@ -32,18 +32,18 @@ export default class Wizard extends React.Component {
handleNext() {
if (this.state.currentPage < this.props.children.length) {
- this.setState(prevState => ({currentPage: prevState.currentPage + 1}))
+ this.setState(prevState => ({currentPage: prevState.currentPage + 1}));
}
}
findSubComponentByType(type) {
- return React.Children.toArray(this.props.children).filter(child => child.type.name === type)
+ return React.Children.toArray(this.props.children).filter(child => child.type.name === type);
}
// this needs to handle the case of no provided header
renderHeader() {
const header = this.findSubComponentByType(Wizard.Header.name)[0];
- return header.props.children({currentPage: this.state.currentPage, totalPages: this.state.totalPages})
+ return header.props.children({currentPage: this.state.currentPage, totalPages: this.state.totalPages});
}
renderPage() {
@@ -74,7 +74,7 @@ export default class Wizard extends React.Component {
{gettext('Close')}
- )
+ );
}
/**
diff --git a/lms/static/js/groups/views/cohort_editor.js b/lms/static/js/groups/views/cohort_editor.js
index 02878ab765..8421ced67b 100644
--- a/lms/static/js/groups/views/cohort_editor.js
+++ b/lms/static/js/groups/views/cohort_editor.js
@@ -181,7 +181,7 @@
_.each(modifiedUsers.changed, function(changedInfo) {
oldCohort = changedInfo.previous_cohort;
if (oldCohort in movedByCohort) {
- movedByCohort[oldCohort] = movedByCohort[oldCohort] + 1;
+ movedByCohort[oldCohort] += 1;
} else {
movedByCohort[oldCohort] = 1;
}
diff --git a/lms/static/js/header/header.js b/lms/static/js/header/header.js
index 6907a9f825..8231de9050 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/instructor_dashboard/certificates.js b/lms/static/js/instructor_dashboard/certificates.js
index fcc714d910..6fae4573de 100644
--- a/lms/static/js/instructor_dashboard/certificates.js
+++ b/lms/static/js/instructor_dashboard/certificates.js
@@ -91,9 +91,9 @@ var onCertificatesReady = null;
var response = JSON.parse(jqXHR.responseText);
$certificate_regeneration_status.text(gettext(response.message)).addClass('message');
} catch (error) {
- $certificate_regeneration_status.
- text(gettext('Error while regenerating certificates. Please try again.')).
- addClass('message');
+ $certificate_regeneration_status
+ .text(gettext('Error while regenerating certificates. Please try again.'))
+ .addClass('message');
}
}
});
diff --git a/lms/static/js/leanModal.js b/lms/static/js/leanModal.js
index cd7f490e9d..dce0212449 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_analytics_dashboard/CircleChart.jsx b/lms/static/js/learner_analytics_dashboard/CircleChart.jsx
index 29291836fa..e092aea0fc 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/CircleChartLegend.jsx b/lms/static/js/learner_analytics_dashboard/CircleChartLegend.jsx
index 7034875197..adf9246073 100644
--- a/lms/static/js/learner_analytics_dashboard/CircleChartLegend.jsx
+++ b/lms/static/js/learner_analytics_dashboard/CircleChartLegend.jsx
@@ -50,6 +50,6 @@ class CircleChartLegend extends React.Component {
CircleChartLegend.propTypes = {
data: PropTypes.array.isRequired
-}
+};
export default CircleChartLegend;
diff --git a/lms/static/js/learner_analytics_dashboard/Discussions.jsx b/lms/static/js/learner_analytics_dashboard/Discussions.jsx
index d5b48c915a..d0dd2b4d45 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
@@ -85,6 +85,6 @@ class Discussions extends React.Component {
Discussions.propTypes = {
content_authored: PropTypes.number.isRequired,
thread_votes: PropTypes.number.isRequired
-}
+};
export default Discussions;
diff --git a/lms/static/js/learner_analytics_dashboard/DueDates.jsx b/lms/static/js/learner_analytics_dashboard/DueDates.jsx
index 86be589d0a..52a2914e1f 100644
--- a/lms/static/js/learner_analytics_dashboard/DueDates.jsx
+++ b/lms/static/js/learner_analytics_dashboard/DueDates.jsx
@@ -22,7 +22,7 @@ class DueDates extends React.Component {
getLabel(type) {
const {assignmentCounts} = this.props;
- if (assignmentCounts[type] < 2 ) {
+ if (assignmentCounts[type] < 2) {
return type;
} else {
this.renderLabels[type] += 1;
@@ -35,14 +35,12 @@ class DueDates extends React.Component {
this.renderLabels = this.initLabelTracker(assignmentCounts);
return dates.sort((a, b) => new Date(a.due) > new Date(b.due))
- .map(({format, due}, index) => {
- return (
-
- {this.getLabel(format)}
- {this.getDate(due)}
-
- );
- });
+ .map(({format, due}, index) => (
+
+ {this.getLabel(format)}
+ {this.getDate(due)}
+
+ ));
}
initLabelTracker(list) {
@@ -51,7 +49,7 @@ class DueDates extends React.Component {
return labels.reduce((accumulator, key) => {
accumulator[key] = 0;
return accumulator;
- }, {})
+ }, {});
}
renderList() {
@@ -73,6 +71,6 @@ class DueDates extends React.Component {
DueDates.propTypes = {
dates: PropTypes.array.isRequired
-}
+};
export default DueDates;
diff --git a/lms/static/js/learner_analytics_dashboard/GradeTable.jsx b/lms/static/js/learner_analytics_dashboard/GradeTable.jsx
index 6d5019c27f..628b9bf9e7 100644
--- a/lms/static/js/learner_analytics_dashboard/GradeTable.jsx
+++ b/lms/static/js/learner_analytics_dashboard/GradeTable.jsx
@@ -1,20 +1,21 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
+
const exGrades = [
{
- 'assignment_type':'Exam',
- 'total_possible':6.0,
- 'total_earned':3.0
+ assignment_type: 'Exam',
+ total_possible: 6.0,
+ total_earned: 3.0
},
{
- 'assignment_type':'Homework',
- 'total_possible':5.0,
+ assignment_type: 'Homework',
+ total_possible: 5.0,
},
{
- 'assignment_type':'Homework',
- 'total_possible':11.0,
- 'total_earned':0.0
+ assignment_type: 'Homework',
+ total_possible: 11.0,
+ total_earned: 0.0
}
];
@@ -26,7 +27,7 @@ class GradeTable extends React.Component {
getTableGroup(type, groupIndex) {
const {grades} = this.props;
const groupData = grades.filter(value => {
- if (value['assignment_type'] === type) {
+ if (value.assignment_type === type) {
return value;
}
});
@@ -68,15 +69,15 @@ class GradeTable extends React.Component {
- )
+ );
}
-};
+}
GradeTable.propTypes = {
assignmentTypes: PropTypes.array.isRequired,
grades: PropTypes.array.isRequired,
passingGrade: PropTypes.number.isRequired,
percentGrade: PropTypes.number.isRequired
-}
+};
export default GradeTable;
diff --git a/lms/static/js/learner_analytics_dashboard/LearnerAnalyticsDashboard.jsx b/lms/static/js/learner_analytics_dashboard/LearnerAnalyticsDashboard.jsx
index 24f0593350..912433e0a8 100644
--- a/lms/static/js/learner_analytics_dashboard/LearnerAnalyticsDashboard.jsx
+++ b/lms/static/js/learner_analytics_dashboard/LearnerAnalyticsDashboard.jsx
@@ -15,7 +15,7 @@ function arrayToObject(array) {
const key = Object.keys(obj)[0];
accumulator[key] = obj[key];
return accumulator;
- }, {})
+ }, {});
}
function countByType(type, assignments) {
@@ -24,7 +24,7 @@ function countByType(type, assignments) {
if (format === type) {
count += 1;
}
- })
+ });
return count;
}
@@ -34,18 +34,16 @@ function getActiveUserString(count) {
}
function getAssignmentCounts(types, assignments) {
- const countsArray = types.map((type) => {
- return {
- [type]: countByType(type, assignments)
- }
- });
+ const countsArray = types.map((type) => ({
+ [type]: countByType(type, assignments)
+ }));
return arrayToObject(countsArray);
}
function getStreakIcons(count) {
return Array.apply(null, {length: count}).map((e, i) => (
-
+
));
}
@@ -56,7 +54,7 @@ function getStreakEncouragement(count) {
}
function getStreakString(count) {
- const unit = (count ===1) ? 'week' : 'weeks';
+ const unit = (count === 1) ? 'week' : 'weeks';
return (count > 0) ? `Active ${count} ${unit} in a row` : false;
}
@@ -64,16 +62,14 @@ export function LearnerAnalyticsDashboard(props) {
const {
grading_policy, grades, schedule, schedule_raw, week_streak, weekly_active_users, discussion_info, profile_images, passing_grade, percent_grade
} = props;
- const gradeBreakdown = grading_policy.GRADER.map(({type, weight}, index) => {
- return {
- value: weight,
- label: type,
- sliceIndex: index + 1
- }
- });
+ const gradeBreakdown = grading_policy.GRADER.map(({type, weight}, index) => ({
+ value: weight,
+ label: type,
+ sliceIndex: index + 1
+ }));
// Get a list of assignment types minus duplicates
- const assignments = gradeBreakdown.map(value => value['label']);
+ const assignments = gradeBreakdown.map(value => value.label);
const assignmentTypes = [...new Set(assignments)];
const assignmentCounts = getAssignmentCounts(assignmentTypes, schedule);
@@ -86,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. */}
@@ -125,8 +121,7 @@ export function LearnerAnalyticsDashboard(props) {
Week streak
{week_streak > 0
- &&
{getStreakIcons(week_streak)}
- }
+ &&
{getStreakIcons(week_streak)}
}
{getStreakString(week_streak)}
{getStreakEncouragement(week_streak)}
@@ -136,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/learner_dashboard/EnterpriseLearnerPortalModal.jsx b/lms/static/js/learner_dashboard/EnterpriseLearnerPortalModal.jsx
index 2f0adcb772..c80e669a28 100644
--- a/lms/static/js/learner_dashboard/EnterpriseLearnerPortalModal.jsx
+++ b/lms/static/js/learner_dashboard/EnterpriseLearnerPortalModal.jsx
@@ -117,7 +117,7 @@ class EnterpriseLearnerPortalModal extends React.Component {
gettext('You have access to the {enterpriseName} dashboard'),
{
enterpriseName: this.props.enterpriseCustomerName,
- }
+ },
)}
@@ -125,7 +125,7 @@ class EnterpriseLearnerPortalModal extends React.Component {
gettext('To access the courses available to you through {enterpriseName}, visit the {enterpriseName} dashboard.'),
{
enterpriseName: this.props.enterpriseCustomerName,
- }
+ },
)}
diff --git a/lms/static/js/learner_dashboard/spec/course_enroll_view_spec.js b/lms/static/js/learner_dashboard/spec/course_enroll_view_spec.js
index f29bb08dc1..375d747d99 100644
--- a/lms/static/js/learner_dashboard/spec/course_enroll_view_spec.js
+++ b/lms/static/js/learner_dashboard/spec/course_enroll_view_spec.js
@@ -217,7 +217,7 @@ describe('Course Enroll View', () => {
view.enrollSuccess();
expect(CourseEnrollView.redirect).toHaveBeenCalledWith(
- view.trackSelectionUrl + courseCardModel.get('course_run_key')
+ view.trackSelectionUrl + courseCardModel.get('course_run_key'),
);
});
diff --git a/lms/static/js/learner_dashboard/spec/course_entitlement_view_spec.js b/lms/static/js/learner_dashboard/spec/course_entitlement_view_spec.js
index 9fb26f5290..7469c8281a 100644
--- a/lms/static/js/learner_dashboard/spec/course_entitlement_view_spec.js
+++ b/lms/static/js/learner_dashboard/spec/course_entitlement_view_spec.js
@@ -83,7 +83,7 @@ describe('Course Entitlement View', () => {
it('Courses with an an enroll by date should indicate so on the selection option.', () => {
const enrollEndSetOptionIndex = entitlementAvailableSessions.findIndex(
- session => session.enrollment_end !== null
+ session => session.enrollment_end !== null,
);
const enrollEndSetOption = selectOptions[enrollEndSetOptionIndex];
expect(enrollEndSetOption && enrollEndSetOption.text.includes('Open until')).toBe(true);
@@ -123,7 +123,7 @@ describe('Course Entitlement View', () => {
it('Currently selected session should be specified in the dropdown options.', () => {
const selectedSessionIndex = entitlementAvailableSessions.findIndex(
- session => initialSessionId === session.session_id
+ session => initialSessionId === session.session_id,
);
expect(selectOptions[selectedSessionIndex].text.includes('Currently Selected')).toBe(true);
});
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 2c05d6bc7e..f889a7e0a2 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 b3f40de14c..e8c24edd09 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
@@ -524,7 +524,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({
@@ -580,9 +580,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', () => {
@@ -598,8 +598,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', () => {
@@ -695,7 +695,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.',
);
});
@@ -704,7 +704,7 @@ describe('Program Details View', () => {
'active',
'Manage my subscription',
'Active trial ends',
- true
+ true,
);
});
@@ -712,7 +712,7 @@ describe('Program Details View', () => {
testSubscriptionState(
'active',
'Manage my subscription',
- 'Your next billing date is'
+ 'Your next billing date is',
);
});
@@ -720,7 +720,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/collection_list_view.js b/lms/static/js/learner_dashboard/views/collection_list_view.js
index bbc92b315e..efe444e192 100644
--- a/lms/static/js/learner_dashboard/views/collection_list_view.js
+++ b/lms/static/js/learner_dashboard/views/collection_list_view.js
@@ -45,7 +45,7 @@ class CollectionListView extends Backbone.View {
StringUtils.interpolate(this.titleContext.title),
HtmlUtils.HTML(''),
this.titleContext.el,
- HtmlUtils.HTML('>')
+ HtmlUtils.HTML('>'),
);
return titleHtml;
}
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 b672b9ebaf..ba2a77a975 100644
--- a/lms/static/js/learner_dashboard/views/program_details_view.js
+++ b/lms/static/js/learner_dashboard/views/program_details_view.js
@@ -45,7 +45,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,
@@ -92,7 +92,7 @@ class ProgramDetailsView extends Backbone.View {
const totalCount = completedCount + inProgressCount + remainingCount;
const buyButtonUrl = ProgramDetailsView.getUrl(
this.options.urls.buy_button_url,
- this.options.programData
+ this.options.programData,
);
let data = {
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 37127f3e05..daab8ccfa9 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 bf4ad7ac71..c260d8e49d 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 a0ae5c7fb4..0a1e75f9c4 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) {
@@ -262,8 +261,8 @@ function(Backbone, $, AjaxHelpers, TemplateHelpers, CohortsView, CohortCollectio
// But upload form should not be visible until toggle is clicked.
expect(cohortsView.$(fileUploadFormCss).length).toBe(0);
uploadCsvToggle = cohortsView.$('.toggle-cohort-management-secondary');
- expect(uploadCsvToggle.text()).
- toContain('Assign learners to cohorts by uploading a CSV file');
+ expect(uploadCsvToggle.text())
+ .toContain('Assign learners to cohorts by uploading a CSV file');
uploadCsvToggle.click();
// After toggle is clicked, it should be hidden.
expect(uploadCsvToggle).toHaveClass('hidden');
diff --git a/lms/static/js/spec/groups/views/discussions_spec.js b/lms/static/js/spec/groups/views/discussions_spec.js
index 378a3c7913..ca87291142 100644
--- a/lms/static/js/spec/groups/views/discussions_spec.js
+++ b/lms/static/js/spec/groups/views/discussions_spec.js
@@ -133,17 +133,17 @@ function(Backbone, $, AjaxHelpers, TemplateHelpers, DiscussionsView, CourseDiscu
expect($inlineDiscussionsForm.length).toBe(1);
expect($courseWideDiscussionsForm.length).toBe(1);
- expect($courseWideDiscussionsForm.text()).
- toContain('Course-Wide Discussion Topics');
- expect($courseWideDiscussionsForm.text()).
- toContain('Select the course-wide discussion topics that you want to divide.');
+ expect($courseWideDiscussionsForm.text())
+ .toContain('Course-Wide Discussion Topics');
+ expect($courseWideDiscussionsForm.text())
+ .toContain('Select the course-wide discussion topics that you want to divide.');
// Should see the inline discussions form and its content
expect($inlineDiscussionsForm.length).toBe(1);
- expect($inlineDiscussionsForm.text()).
- toContain('Content-Specific Discussion Topics');
- expect($inlineDiscussionsForm.text()).
- toContain('Specify whether content-specific discussion topics are divided.');
+ expect($inlineDiscussionsForm.text())
+ .toContain('Content-Specific Discussion Topics');
+ expect($inlineDiscussionsForm.text())
+ .toContain('Specify whether content-specific discussion topics are divided.');
};
beforeEach(function() {
diff --git a/lms/static/js/spec/instructor_dashboard/certificates_invalidation_spec.js b/lms/static/js/spec/instructor_dashboard/certificates_invalidation_spec.js
index edd73a4c1a..bedb7c970a 100644
--- a/lms/static/js/spec/instructor_dashboard/certificates_invalidation_spec.js
+++ b/lms/static/js/spec/instructor_dashboard/certificates_invalidation_spec.js
@@ -182,10 +182,10 @@ function($, AjaxHelpers, CertificateInvalidationModel, CertificateInvalidationVi
view.collection.add(model);
expect(view.$el.find('table tbody tr').length).toBe(3);
- expect(view.$el.find('table tbody tr td:contains("' + user + '")').parent().html()).
- toMatch(notes);
- expect(view.$el.find('table tbody tr td:contains("' + user + '")').parent().html()).
- toMatch(user);
+ expect(view.$el.find('table tbody tr td:contains("' + user + '")').parent().html())
+ .toMatch(notes);
+ expect(view.$el.find('table tbody tr td:contains("' + user + '")').parent().html())
+ .toMatch(user);
// Remove a model from collection
var collection_model = view.collection.get({id: 2});
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 75b81ac82d..3f0daacf84 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/spec/instructor_dashboard/student_admin_spec.js b/lms/static/js/spec/instructor_dashboard/student_admin_spec.js
index 97d5cd0407..a4314228e0 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/lms/static/js/spec/student_account/account_settings_factory_spec.js b/lms/static/js/spec/student_account/account_settings_factory_spec.js
index c855c9fe8e..e1c9627f60 100644
--- a/lms/static/js/spec/student_account/account_settings_factory_spec.js
+++ b/lms/static/js/spec/student_account/account_settings_factory_spec.js
@@ -53,7 +53,6 @@ function(Backbone, $, _, AjaxHelpers, TemplateHelpers, FieldViewsSpecHelpers, He
Helpers.expectLoadingErrorIsVisible(accountSettingsView, true);
});
-
it('shows loading error when UserPreferencesModel fails to load', function() {
requests = AjaxHelpers.requests(this);
@@ -108,7 +107,7 @@ function(Backbone, $, _, AjaxHelpers, TemplateHelpers, FieldViewsSpecHelpers, He
AjaxHelpers.respondWithJson(requests, Helpers.createAccountSettingsData());
AjaxHelpers.respondWithJson(requests, Helpers.TIME_ZONE_RESPONSE);
AjaxHelpers.respondWithJson(requests, Helpers.createUserPreferencesData());
- AjaxHelpers.respondWithJson(requests, {}); // Page viewed analytics event
+ AjaxHelpers.respondWithJson(requests, {}); // Page viewed analytics event
var sectionsData = accountSettingsView.options.tabSections.aboutTabSections;
@@ -272,7 +271,7 @@ function(Backbone, $, _, AjaxHelpers, TemplateHelpers, FieldViewsSpecHelpers, He
AjaxHelpers.respondWithJson(requests, Helpers.createAccountSettingsData());
AjaxHelpers.respondWithJson(requests, Helpers.TIME_ZONE_RESPONSE);
AjaxHelpers.respondWithJson(requests, Helpers.createUserPreferencesData());
- AjaxHelpers.respondWithJson(requests, {}); // Page viewed analytics event
+ AjaxHelpers.respondWithJson(requests, {}); // Page viewed analytics event
sectionsData = accountSettingsView.options.tabSections.aboutTabSections;
@@ -322,7 +321,7 @@ function(Backbone, $, _, AjaxHelpers, TemplateHelpers, FieldViewsSpecHelpers, He
title: view.options.title,
valueAttribute: view.options.valueAttribute,
helpMessage: '',
- validValue: Helpers.FIELD_OPTIONS[1][0], // dummy option for dropdown field
+ validValue: Helpers.FIELD_OPTIONS[1][0], // dummy option for dropdown field
invalidValue1: Helpers.FIELD_OPTIONS[2][0], // dummy option for dropdown field
invalidValue2: Helpers.FIELD_OPTIONS[3][0], // dummy option for dropdown field
validationError: 'Nope, this will not do!',
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 6171a59002..76ea7c512b 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
@@ -45,8 +45,8 @@ function(Backbone, $, _, AjaxHelpers, TemplateHelpers, UserAccountModel, FieldVi
AjaxHelpers.respondWithJson(requests, {success: 'true'});
FieldViewsSpecHelpers.expectMessageContains(
view,
- "We've sent a message to legolas@woodland.middlearth. " +
- 'Click the link in the message to reset your password.'
+ "We've sent a message to legolas@woodland.middlearth. "
+ + 'Click the link in the message to reset your password.'
);
});
diff --git a/lms/static/js/spec/student_account/account_settings_view_spec.js b/lms/static/js/spec/student_account/account_settings_view_spec.js
index e8e14387ca..c0c213cf3c 100644
--- a/lms/static/js/spec/student_account/account_settings_view_spec.js
+++ b/lms/static/js/spec/student_account/account_settings_view_spec.js
@@ -21,8 +21,8 @@ function(Backbone, $, _, AjaxHelpers, TemplateHelpers, Helpers, FieldViews, User
{
title: 'Basic Account Information',
messageType: 'info',
- message: 'Your profile settings are managed by Test Enterprise. ' +
- 'Contact your administrator or
edX Support for help.',
+ message: 'Your profile settings are managed by Test Enterprise. '
+ + 'Contact your administrator or
edX Support for help.',
fields: [
{
view: new FieldViews.ReadonlyFieldView({
diff --git a/lms/static/js/spec/student_account/register_spec.js b/lms/static/js/spec/student_account/register_spec.js
index 8b3fcce0e0..17d82e2b13 100644
--- a/lms/static/js/spec/student_account/register_spec.js
+++ b/lms/static/js/spec/student_account/register_spec.js
@@ -514,7 +514,7 @@
});
it('shows optional exposed fields', function() {
- var formFields = FORM_DESCRIPTION.fields
+ var formFields = FORM_DESCRIPTION.fields;
formFields.push({
placeholder: '',
name: 'exposed_custom_optional_field',
@@ -525,15 +525,15 @@
exposed: true,
instructions: 'Check this field if you would like to.',
restrictions: {}
- })
+ });
createRegisterView(this, formFields);
var elementClasses = view.$('.exposed-optional-fields').attr('class');
- var elementChildren = view.$('.exposed-optional-fields .form-field')
+ var elementChildren = view.$('.exposed-optional-fields .form-field');
// Expect the exposed optional fields container does not have other
// classes assigned, like .hidden
expect(elementClasses).toEqual('exposed-optional-fields');
- expect(elementChildren.length).toEqual(1)
+ expect(elementChildren.length).toEqual(1);
});
it('hides optional fields by default', function() {
diff --git a/lms/static/js/staff_debug_actions.js b/lms/static/js/staff_debug_actions.js
index ae2f38e02a..18dab75b7c 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/components/StudentAccountDeletion.jsx b/lms/static/js/student_account/components/StudentAccountDeletion.jsx
index 0bd09bf023..141d0c5557 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 d1491354e2..a3ca08538e 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
+ />
+ )}
= minimumAllowedAge;
return isBirthDefined && isOlderThanMinimum && !(this.get('requires_parental_consent'));
diff --git a/lms/static/js/student_account/views/AccessView.js b/lms/static/js/student_account/views/AccessView.js
index 3886a8272b..0ecf40e464 100644
--- a/lms/static/js/student_account/views/AccessView.js
+++ b/lms/static/js/student_account/views/AccessView.js
@@ -117,7 +117,7 @@
mode: this.activeForm
})
)
- )
+ );
this.postRender();
return this;
@@ -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/lms/static/js/student_account/views/FormView.js b/lms/static/js/student_account/views/FormView.js
index b04427df7d..c015a61842 100644
--- a/lms/static/js/student_account/views/FormView.js
+++ b/lms/static/js/student_account/views/FormView.js
@@ -65,7 +65,7 @@
HtmlUtils: HtmlUtils
})
)
- )
+ );
this.postRender();
return this;
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 5480e1511f..e205ffa01a 100644
--- a/lms/static/js/student_account/views/account_section_view.js
+++ b/lms/static/js/student_account/views/account_section_view.js
@@ -1,5 +1,6 @@
(function(define, undefined) {
'use strict';
+
define([
'gettext',
'jquery',
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 7f74199a54..15d5774acf 100644
--- a/lms/static/js/student_account/views/account_settings_factory.js
+++ b/lms/static/js/student_account/views/account_settings_factory.js
@@ -1,5 +1,6 @@
(function(define, undefined) {
'use strict';
+
define([
'gettext', 'jquery', 'underscore', 'backbone', 'logger',
'js/student_account/models/user_account_model',
@@ -53,7 +54,7 @@
if (syncLearnerProfileData && enterpriseName) {
aboutSectionMessageType = 'info';
aboutSectionMessage = HtmlUtils.interpolateHtml(
- gettext('Your profile settings are managed by {enterprise_name}. Contact your administrator or {link_start}edX Support{link_end} for help.'), // eslint-disable-line max-len
+ gettext('Your profile settings are managed by {enterprise_name}. Contact your administrator or {link_start}edX Support{link_end} for help.'), // eslint-disable-line max-len
{
enterprise_name: enterpriseName,
link_start: HtmlUtils.HTML(
@@ -73,12 +74,12 @@
title: gettext('Email Address (Sign In)'),
valueAttribute: 'email',
helpMessage: StringUtils.interpolate(
- gettext('You receive messages from {platform_name} and course teams at this address.'), // eslint-disable-line max-len
+ gettext('You receive messages from {platform_name} and course teams at this address.'), // eslint-disable-line max-len
{platform_name: platformName}
),
persistChanges: true
};
- if (!allowEmailChange || (syncLearnerProfileData && enterpriseReadonlyAccountFields.fields.indexOf('email') !== -1)) { // eslint-disable-line max-len
+ if (!allowEmailChange || (syncLearnerProfileData && enterpriseReadonlyAccountFields.fields.indexOf('email') !== -1)) { // eslint-disable-line max-len
emailFieldView = {
view: new AccountSettingsFieldViews.ReadonlyFieldView(emailFieldData)
};
@@ -92,7 +93,7 @@
model: userAccountModel,
title: gettext('Recovery Email Address'),
valueAttribute: 'secondary_email',
- helpMessage: gettext('You may access your account with this address if single-sign on or access to your primary email is not available.'), // eslint-disable-line max-len
+ helpMessage: gettext('You may access your account with this address if single-sign on or access to your primary email is not available.'), // eslint-disable-line max-len
persistChanges: true
};
@@ -100,7 +101,7 @@
model: userAccountModel,
title: gettext('Full Name'),
valueAttribute: 'name',
- helpMessage: gettext('The name that is used for ID verification and that appears on your certificates.'), // eslint-disable-line max-len,
+ helpMessage: gettext('The name that is used for ID verification and that appears on your certificates.'), // eslint-disable-line max-len,
persistChanges: true
};
if (syncLearnerProfileData && enterpriseReadonlyAccountFields.fields.indexOf('name') !== -1) {
@@ -155,7 +156,7 @@
title: gettext('Username'),
valueAttribute: 'username',
helpMessage: StringUtils.interpolate(
- gettext('The name that identifies you on {platform_name}. You cannot change your username.'), // eslint-disable-line max-len
+ gettext('The name that identifies you on {platform_name}. You cannot change your username.'), // eslint-disable-line max-len
{platform_name: platformName}
)
})
@@ -172,7 +173,7 @@
passwordResetSupportUrl: passwordResetSupportUrl,
linkTitle: gettext('Reset Your Password'),
linkHref: fieldsData.password.url,
- helpMessage: gettext('Check your email account for instructions to reset your password.') // eslint-disable-line max-len
+ helpMessage: gettext('Check your email account for instructions to reset your password.') // eslint-disable-line max-len
})
},
{
@@ -183,7 +184,7 @@
required: true,
refreshPageOnSave: true,
helpMessage: StringUtils.interpolate(
- gettext('The language used throughout this site. This site is currently available in a limited number of languages. Changing the value of this field will cause the page to refresh.'), // eslint-disable-line max-len
+ gettext('The language used throughout this site. This site is currently available in a limited number of languages. Changing the value of this field will cause the page to refresh.'), // eslint-disable-line max-len
{platform_name: platformName}
),
options: fieldsData.language.options,
@@ -252,11 +253,11 @@
}
];
- if (enableCoppaCompliance){
- yearOfBirthViewIndex = aboutSectionsData[1]['fields'].findIndex(function (field) {
- return field['view']['options']['valueAttribute']=== 'year_of_birth';
+ if (enableCoppaCompliance) {
+ yearOfBirthViewIndex = aboutSectionsData[1].fields.findIndex(function(field) {
+ return field.view.options.valueAttribute === 'year_of_birth';
});
- aboutSectionsData[1]['fields'].splice(yearOfBirthViewIndex,1)
+ aboutSectionsData[1].fields.splice(yearOfBirthViewIndex, 1);
}
// Secondary email address
@@ -267,24 +268,25 @@
return HtmlUtils.joinHtml(
this.indicators.success,
StringUtils.interpolate(
- gettext('We\'ve sent a confirmation message to {new_secondary_email_address}. Click the link in the message to update your secondary email address.'), // eslint-disable-line max-len
+ gettext('We\'ve sent a confirmation message to {new_secondary_email_address}. Click the link in the message to update your secondary email address.'), // eslint-disable-line max-len
{
new_secondary_email_address: this.fieldValue()
}
)
- );}
+ );
+ }
};
emailFieldViewIndex = aboutSectionsData[0].fields.indexOf(emailFieldView);
// Insert secondary email address after email address field.
aboutSectionsData[0].fields.splice(
emailFieldViewIndex + 1, 0, secondaryEmailFieldView
- )
+ );
}
// Add the extended profile fields
additionalFields = aboutSectionsData[1];
- for (var field in extendedProfileFields) { // eslint-disable-line guard-for-in, no-restricted-syntax, vars-on-top, max-len
+ for (var field in extendedProfileFields) { // eslint-disable-line guard-for-in, no-restricted-syntax, vars-on-top, max-len
fieldItem = extendedProfileFields[field];
if (fieldItem.field_type === 'TextField') {
additionalFields.fields.push({
@@ -312,15 +314,14 @@
}
}
-
// Add the social link fields
socialFields = {
title: gettext('Social Media Links'),
- subtitle: gettext('Optionally, link your personal accounts to the social media icons on your edX profile.'), // eslint-disable-line max-len
+ subtitle: gettext('Optionally, link your personal accounts to the social media icons on your edX profile.'), // eslint-disable-line max-len
fields: []
};
- for (var socialPlatform in socialPlatforms) { // eslint-disable-line guard-for-in, no-restricted-syntax, vars-on-top, max-len
+ for (var socialPlatform in socialPlatforms) { // eslint-disable-line guard-for-in, no-restricted-syntax, vars-on-top, max-len
platformData = socialPlatforms[socialPlatform];
socialFields.fields.push(
{
@@ -332,7 +333,7 @@
),
valueAttribute: 'social_links',
helpMessage: StringUtils.interpolate(
- gettext('Enter your {platform_display_name} username or the URL to your {platform_display_name} page. Delete the URL to remove the link.'), // eslint-disable-line max-len
+ gettext('Enter your {platform_display_name} username or the URL to your {platform_display_name} page. Delete the URL to remove the link.'), // eslint-disable-line max-len
{platform_display_name: platformData.display_name}
),
platform: socialPlatform,
@@ -406,7 +407,7 @@
{
title: gettext('My Orders'),
subtitle: StringUtils.interpolate(
- gettext('This page contains information about orders that you have placed with {platform_name}.'), // eslint-disable-line max-len
+ gettext('This page contains information about orders that you have placed with {platform_name}.'), // eslint-disable-line max-len
{platform_name: platformName}
),
fields: _.map(ordersHistoryData, function(order) {
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 ff1223844f..fbb5816ca8 100644
--- a/lms/static/js/student_account/views/account_settings_fields.js
+++ b/lms/static/js/student_account/views/account_settings_fields.js
@@ -1,5 +1,6 @@
(function(define, undefined) {
'use strict';
+
define([
'gettext',
'jquery',
@@ -42,7 +43,7 @@
return HtmlUtils.joinHtml(
this.indicators.success,
StringUtils.interpolate(
- gettext('We\'ve sent a confirmation message to {new_email_address}. Click the link in the message to update your email address.'), // eslint-disable-line max-len
+ gettext('We\'ve sent a confirmation message to {new_email_address}. Click the link in the message to update your email address.'), // eslint-disable-line max-len
{new_email_address: this.fieldValue()}
)
);
@@ -52,7 +53,7 @@
fieldTemplate: field_dropdown_account_template,
initialize: function(options) {
- this._super(options); // eslint-disable-line no-underscore-dangle
+ this._super(options); // eslint-disable-line no-underscore-dangle
this.listenTo(this.model, 'revertValue', this.revertValue);
},
@@ -85,7 +86,7 @@
view.showNotificationMessage(
HtmlUtils.joinHtml(
view.indicators.error,
- gettext('You must sign out and sign back in before your language changes take effect.') // eslint-disable-line max-len
+ gettext('You must sign out and sign back in before your language changes take effect.') // eslint-disable-line max-len
)
);
}
@@ -99,7 +100,7 @@
initialize: function(options) {
this.options = _.extend({}, options);
_.bindAll(this, 'listenToCountryView', 'updateCountrySubheader', 'replaceOrAddGroupOption');
- this._super(options); // eslint-disable-line no-underscore-dangle
+ this._super(options); // eslint-disable-line no-underscore-dangle
},
listenToCountryView: function(view) {
@@ -206,7 +207,7 @@
return HtmlUtils.joinHtml(
this.indicators.success,
HtmlUtils.interpolateHtml(
- gettext('We\'ve sent a message to {email}. Click the link in the message to reset your password. Didn\'t receive the message? Contact {anchorStart}technical support{anchorEnd}.'), // eslint-disable-line max-len
+ gettext('We\'ve sent a message to {email}. Click the link in the message to reset your password. Didn\'t receive the message? Contact {anchorStart}technical support{anchorEnd}.'), // eslint-disable-line max-len
{
email: this.model.get(this.options.emailAttribute),
anchorStart: HtmlUtils.HTML(
@@ -268,8 +269,10 @@
var attributes, value;
if (this.persistChanges === true) {
attributes = {};
- value = this.fieldValue() != null ? [{platform: this.options.platform,
- social_link: this.fieldValue()}] : [];
+ value = this.fieldValue() != null ? [{
+ platform: this.options.platform,
+ social_link: this.fieldValue()
+ }] : [];
attributes[this.options.valueAttribute] = value;
this.saveAttributes(attributes);
}
@@ -301,8 +304,10 @@
var attributes, value;
if (this.persistChanges === true) {
attributes = {};
- value = this.fieldValue() != null ? [{field_name: this.options.fieldName,
- field_value: this.fieldValue()}] : [];
+ value = this.fieldValue() != null ? [{
+ field_name: this.options.fieldName,
+ field_value: this.fieldValue()
+ }] : [];
attributes[this.options.valueAttribute] = value;
this.saveAttributes(attributes);
}
@@ -323,8 +328,10 @@
var attributes = {},
value;
if (this.persistChanges === true) {
- value = this.fieldValue() ? [{field_name: this.options.fieldName,
- field_value: this.fieldValue()}] : [];
+ value = this.fieldValue() ? [{
+ field_name: this.options.fieldName,
+ field_value: this.fieldValue()
+ }] : [];
attributes[this.options.valueAttribute] = value;
this.saveAttributes(attributes);
}
@@ -352,7 +359,7 @@
linkTitle = gettext('Unlink This Account');
linkClass = 'social-field-linked';
subTitle = StringUtils.interpolate(
- gettext('You can use your {accountName} account to sign in to your {platformName} account.'), // eslint-disable-line max-len
+ gettext('You can use your {accountName} account to sign in to your {platformName} account.'), // eslint-disable-line max-len
{accountName: this.options.title, platformName: this.options.platformName}
);
screenReaderTitle = StringUtils.interpolate(
@@ -363,7 +370,7 @@
linkTitle = gettext('Link Your Account');
linkClass = 'social-field-unlinked';
subTitle = StringUtils.interpolate(
- gettext('Link your {accountName} account to your {platformName} account and use {accountName} to sign in to {platformName}.'), // eslint-disable-line max-len
+ gettext('Link your {accountName} account to your {platformName} account and use {accountName} to sign in to {platformName}.'), // eslint-disable-line max-len
{accountName: this.options.title, platformName: this.options.platformName}
);
}
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 fa50a03167..bead8da99f 100644
--- a/lms/static/js/student_account/views/account_settings_view.js
+++ b/lms/static/js/student_account/views/account_settings_view.js
@@ -1,5 +1,6 @@
(function(define, undefined) {
'use strict';
+
define([
'gettext',
'jquery',
@@ -59,7 +60,7 @@
if (!_.isEmpty(view.options.betaLanguage) && $.cookie('old-pref-lang')) {
betaLangMessage = HtmlUtils.interpolateHtml(
- gettext('You have set your language to {beta_language}, which is currently not fully translated. You can help us translate this language fully by joining the Transifex community and adding translations from English for learners that speak {beta_language}.'), // eslint-disable-line max-len
+ gettext('You have set your language to {beta_language}, which is currently not fully translated. You can help us translate this language fully by joining the Transifex community and adding translations from English for learners that speak {beta_language}.'), // eslint-disable-line max-len
{
beta_language: view.options.betaLanguage.name
}
diff --git a/lms/static/karma_lms.conf.js b/lms/static/karma_lms.conf.js
index a9827dbd80..0119d4d18c 100644
--- a/lms/static/karma_lms.conf.js
+++ b/lms/static/karma_lms.conf.js
@@ -6,6 +6,7 @@
'use strict';
var path = require('path');
+
var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js'));
var options = {
diff --git a/openedx/features/announcements/static/announcements/jsx/Announcements.jsx b/openedx/features/announcements/static/announcements/jsx/Announcements.jsx
index 162a09aec8..eff152146e 100644
--- a/openedx/features/announcements/static/announcements/jsx/Announcements.jsx
+++ b/openedx/features/announcements/static/announcements/jsx/Announcements.jsx
@@ -15,11 +15,11 @@ class AnnouncementSkipLink extends React.Component {
this.setState({
count: data.count
});
- })
+ });
}
render() {
- return ({'Skip to list of ' + this.state.count + ' announcements'}
)
+ return ({'Skip to list of ' + this.state.count + ' announcements'}
);
}
}
@@ -29,8 +29,7 @@ class Announcement extends React.Component {
-
+ />
);
}
}
@@ -66,7 +65,7 @@ class AnnouncementList extends React.Component {
end_index: data.end_index,
page: page
});
- })
+ });
}
renderPrevPage() {
@@ -132,4 +131,4 @@ export default class AnnouncementsView {
}
}
-export {AnnouncementsView, AnnouncementList, AnnouncementSkipLink}
+export {AnnouncementsView, AnnouncementList, AnnouncementSkipLink};
diff --git a/openedx/features/announcements/static/announcements/jsx/Announcements.test.jsx b/openedx/features/announcements/static/announcements/jsx/Announcements.test.jsx
index 4b3b6a251e..3ec55f3928 100644
--- a/openedx/features/announcements/static/announcements/jsx/Announcements.test.jsx
+++ b/openedx/features/announcements/static/announcements/jsx/Announcements.test.jsx
@@ -1,15 +1,15 @@
import React from 'react';
import renderer from 'react-test-renderer';
-import testAnnouncements from './test-announcements.json'
+import testAnnouncements from './test-announcements.json';
-import {AnnouncementSkipLink, AnnouncementList} from './Announcements'
+import {AnnouncementSkipLink, AnnouncementList} from './Announcements';
describe('Announcements component', () => {
test('render skip link', () => {
const component = renderer.create(
,
);
- component.root.instance.setState({'count': 10})
+ component.root.instance.setState({count: 10});
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
@@ -22,5 +22,4 @@ describe('Announcements component', () => {
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
-
});
diff --git a/openedx/features/course_bookmarks/static/course_bookmarks/js/spec_helpers/bookmark_helpers.js b/openedx/features/course_bookmarks/static/course_bookmarks/js/spec_helpers/bookmark_helpers.js
index 094bd1ee9f..ac31730fbc 100644
--- a/openedx/features/course_bookmarks/static/course_bookmarks/js/spec_helpers/bookmark_helpers.js
+++ b/openedx/features/course_bookmarks/static/course_bookmarks/js/spec_helpers/bookmark_helpers.js
@@ -43,9 +43,9 @@ define(
};
var breadcrumbTrail = function(path, unitDisplayName) {
- return _.pluck(path, 'display_name').
- concat([unitDisplayName]).
- join(' - ');
+ return _.pluck(path, 'display_name')
+ .concat([unitDisplayName])
+ .join(' - ');
};
var verifyBookmarkedData = function(view, expectedData) {
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 c5f7111a27..c2019b8e5a 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 510915971d..4defec6ad8 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
@@ -1,7 +1,7 @@
/* globals loadFixtures */
import $ from 'jquery'; // eslint-disable-line import/extensions
-import {Currency} from '../currency';
+import { Currency } from '../currency';
describe('Currency factory', () => {
let currency;
@@ -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/openedx/features/learner_profile/static/learner_profile/js/learner_profile_factory.js b/openedx/features/learner_profile/static/learner_profile/js/learner_profile_factory.js
index 3921027734..6419dd1770 100644
--- a/openedx/features/learner_profile/static/learner_profile/js/learner_profile_factory.js
+++ b/openedx/features/learner_profile/static/learner_profile/js/learner_profile_factory.js
@@ -1,4 +1,4 @@
-(function (define){
+(function(define) {
'use strict';
define([
@@ -19,10 +19,10 @@
'js/student_account/views/account_settings_fields',
'js/views/message_banner',
'string_utils'
- ], function (gettext, $, _, Backbone, Logger, StringUtils, PagingCollection, AccountSettingsModel,
+ ], function(gettext, $, _, Backbone, Logger, StringUtils, PagingCollection, AccountSettingsModel,
AccountPreferencesModel, FieldsView, LearnerProfileFieldsView, LearnerProfileView, BadgeModel,
- BadgeListContainer, AccountSettingsFieldViews, MessageBannerView){
- return function (options) {
+ BadgeListContainer, AccountSettingsFieldViews, MessageBannerView) {
+ return function(options) {
var $learnerProfileElement = $('.wrapper-profile');
var accountSettingsModel = new AccountSettingsModel(
@@ -122,7 +122,7 @@
helpMessage: '',
userLanguage: accountSettingsModel.get('language'),
userTimezone: accountPreferencesModel.get('time_zone'),
- dateFormat: 'MMMM YYYY' // not localized, but hopefully ok.
+ dateFormat: 'MMMM YYYY' // not localized, but hopefully ok.
}),
new FieldsView.DropdownFieldView({
@@ -208,7 +208,7 @@
platformName: options.platform_name
});
- getProfileVisibility = function (){
+ getProfileVisibility = function() {
if (options.has_preferences_access) {
return accountPreferencesModel.get('account_privacy');
} else {
@@ -216,7 +216,7 @@
}
};
- showLearnerProfileView = function (){
+ showLearnerProfileView = function() {
// Record that the profile page was viewed
Logger.log('edx.user.settings.viewed', {
page: 'profile',
diff --git a/openedx/features/learner_profile/static/learner_profile/js/spec/learner_profile_factory_spec.js b/openedx/features/learner_profile/static/learner_profile/js/spec/learner_profile_factory_spec.js
index 48351d171a..f5b8f4bec6 100644
--- a/openedx/features/learner_profile/static/learner_profile/js/spec/learner_profile_factory_spec.js
+++ b/openedx/features/learner_profile/static/learner_profile/js/spec/learner_profile_factory_spec.js
@@ -210,7 +210,6 @@ define(
LearnerProfileHelpers.expectPage(learnerProfileView, LearnerProfileHelpers.firstPageBadges);
});
-
it('renders the limited profile for under 13 users', function() {
var context = createProfilePage(
true,
diff --git a/openedx/features/learner_profile/static/learner_profile/js/spec/views/badge_list_view_spec.js b/openedx/features/learner_profile/static/learner_profile/js/spec/views/badge_list_view_spec.js
index 468d130f72..e8cfd32d4c 100644
--- a/openedx/features/learner_profile/static/learner_profile/js/spec/views/badge_list_view_spec.js
+++ b/openedx/features/learner_profile/static/learner_profile/js/spec/views/badge_list_view_spec.js
@@ -79,4 +79,3 @@ function(Backbone, $, _, PagingCollection, LearnerProfileHelpers, BadgeListView)
});
}
);
-
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 4e5e2d2106..49b3dbc630 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
@@ -138,10 +138,12 @@ define(
// Upon successful image upload, account settings model will be fetched to
// 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,
- has_image: true
- }};
+ data = {
+ profile_image: {
+ image_url_large: '/media/profile-images/' + imageName,
+ has_image: true
+ }
+ };
AjaxHelpers.respondWithJson(requests, data);
// Verify uploaded image name
@@ -160,7 +162,6 @@ define(
var data;
imageView.render();
-
// Verify image remove title
verifyImageRemoveButtonMessage(imageView, false);
@@ -177,10 +178,12 @@ define(
// Upon successful image removal, account settings model will be fetched to get default image url
// So we need to send the response for that GET
- data = {profile_image: {
- image_url_large: '/media/profile-images/default.jpg',
- has_image: false
- }};
+ data = {
+ profile_image: {
+ image_url_large: '/media/profile-images/default.jpg',
+ has_image: false
+ }
+ };
AjaxHelpers.respondWithJson(requests, data);
// Remove button should not be present for default image
diff --git a/openedx/features/learner_profile/static/learner_profile/js/spec/views/learner_profile_view_spec.js b/openedx/features/learner_profile/static/learner_profile/js/spec/views/learner_profile_view_spec.js
index 4baa867cc1..1797b0de05 100644
--- a/openedx/features/learner_profile/static/learner_profile/js/spec/views/learner_profile_view_spec.js
+++ b/openedx/features/learner_profile/static/learner_profile/js/spec/views/learner_profile_view_spec.js
@@ -124,8 +124,8 @@ define(
editable: editable,
showMessages: false,
title: 'About me',
- placeholderValue: 'Tell other edX learners a little about yourself: where you live, ' +
- "what your interests are, why you're taking courses on edX, or what you hope to learn.",
+ placeholderValue: 'Tell other edX learners a little about yourself: where you live, '
+ + "what your interests are, why you're taking courses on edX, or what you hope to learn.",
valueAttribute: 'bio',
helpMessage: '',
messagePosition: 'header'
diff --git a/openedx/features/learner_profile/static/learner_profile/js/spec/views/section_two_tab_spec.js b/openedx/features/learner_profile/static/learner_profile/js/spec/views/section_two_tab_spec.js
index 9e4909ffa0..d0e22d670b 100644
--- a/openedx/features/learner_profile/static/learner_profile/js/spec/views/section_two_tab_spec.js
+++ b/openedx/features/learner_profile/static/learner_profile/js/spec/views/section_two_tab_spec.js
@@ -25,8 +25,8 @@ define(
editable: editable,
showMessages: false,
title: 'About me',
- placeholderValue: 'Tell other edX learners a little about yourself: where you live, ' +
- "what your interests are, why you're taking courses on edX, or what you hope to learn.",
+ placeholderValue: 'Tell other edX learners a little about yourself: where you live, '
+ + "what your interests are, why you're taking courses on edX, or what you hope to learn.",
valueAttribute: 'bio',
helpMessage: '',
messagePosition: 'header'
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 d0ecf09dbe..5d4a278907 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
@@ -150,8 +150,8 @@ 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(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);
@@ -161,8 +161,8 @@ define(['underscore', 'URI', 'edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers'
var expectBadgeLoadingErrorIsRendered = function() {
var errorMessage = $('.badge-set-display').text();
expect(errorMessage).toBe(
- 'Your request could not be completed. Reload the page and try again. If the issue persists, click the ' +
- 'Help tab to report the problem.'
+ 'Your request could not be completed. Reload the page and try again. If the issue persists, click the '
+ + 'Help tab to report the problem.'
);
};
diff --git a/openedx/features/learner_profile/static/learner_profile/js/views/learner_profile_fields.js b/openedx/features/learner_profile/static/learner_profile/js/views/learner_profile_fields.js
index 28c24ab37b..807e3e4c5b 100644
--- a/openedx/features/learner_profile/static/learner_profile/js/views/learner_profile_fields.js
+++ b/openedx/features/learner_profile/static/learner_profile/js/views/learner_profile_fields.js
@@ -41,14 +41,14 @@
if (this.profileIsPrivate) {
this._super(
HtmlUtils.interpolateHtml(
- gettext('You must specify your birth year before you can share your full profile. To specify your birth year, go to the {account_settings_page_link}'), // eslint-disable-line max-len
+ gettext('You must specify your birth year before you can share your full profile. To specify your birth year, go to the {account_settings_page_link}'), // eslint-disable-line max-len
{account_settings_page_link: accountSettingsLink}
)
);
} else if (this.requiresParentalConsent) {
this._super(
HtmlUtils.interpolateHtml(
- gettext('You must be over 13 to share a full profile. If you are over 13, make sure that you have specified a birth year on the {account_settings_page_link}'), // eslint-disable-line max-len
+ gettext('You must be over 13 to share a full profile. If you are over 13, make sure that you have specified a birth year on the {account_settings_page_link}'), // eslint-disable-line max-len
{account_settings_page_link: accountSettingsLink}
)
);
diff --git a/openedx/features/learner_profile/static/learner_profile/js/views/learner_profile_view.js b/openedx/features/learner_profile/static/learner_profile/js/views/learner_profile_view.js
index 9c9e8704da..c75a22db14 100644
--- a/openedx/features/learner_profile/static/learner_profile/js/views/learner_profile_view.js
+++ b/openedx/features/learner_profile/static/learner_profile/js/views/learner_profile_view.js
@@ -1,4 +1,4 @@
-(function (define){
+(function(define) {
'use strict';
define(
@@ -7,10 +7,10 @@
'common/js/components/views/tabbed_view',
'learner_profile/js/views/section_two_tab'
],
- function (gettext, $, _, Backbone, HtmlUtils, TabbedView, SectionTwoTab){
+ function(gettext, $, _, Backbone, HtmlUtils, TabbedView, SectionTwoTab) {
var LearnerProfileView = Backbone.View.extend({
- initialize: function (options){
+ initialize: function(options) {
var Router;
this.options = _.extend({}, options);
_.bindAll(this, 'showFullProfile', 'render', 'renderFields', 'showLoadingError');
@@ -23,7 +23,7 @@
this.firstRender = true;
},
- showFullProfile: function () {
+ showFullProfile: function() {
var isAboveMinimumAge = this.options.accountSettingsModel.isAboveMinimumAge();
if (this.options.ownProfile) {
return isAboveMinimumAge
@@ -33,14 +33,14 @@
}
},
- setActiveTab: function (tab){
+ setActiveTab: function(tab) {
// This tab may not actually exist.
if (this.tabbedView.getTabMeta(tab).tab) {
this.tabbedView.setActiveTab(tab);
}
},
- render: function (){
+ render: function() {
var tabs,
$tabbedViewElement,
$wrapperProfileBioElement = this.$el.find('.wrapper-profile-bio'),
@@ -77,9 +77,9 @@
];
// Build the accomplishments Tab and fill with data
- this.options.badgeListContainer.collection.fetch().done(function (){
+ this.options.badgeListContainer.collection.fetch().done(function() {
self.options.badgeListContainer.render();
- }).error(function (){
+ }).error(function() {
self.options.badgeListContainer.renderError();
});
@@ -115,13 +115,13 @@
return this;
},
- isCoppaCompliant: function (){
+ isCoppaCompliant: function() {
var enableCoppaCompliance = this.options.accountSettingsModel.get('enable_coppa_compliance'),
isAboveAge = this.options.accountSettingsModel.isAboveMinimumAge();
return !enableCoppaCompliance || (enableCoppaCompliance && isAboveAge);
},
- renderFields: function (){
+ renderFields: function() {
var view = this,
fieldView,
imageView,
@@ -150,14 +150,14 @@
imageView = this.options.profileImageFieldView;
this.$('.profile-image-field').append(imageView.render().el);
- if (this.showFullProfile()){
- _.each(this.options.sectionOneFieldViews, function (childFieldView) {
+ if (this.showFullProfile()) {
+ _.each(this.options.sectionOneFieldViews, function(childFieldView) {
view.$('.profile-section-one-fields').append(childFieldView.render().el);
});
}
},
- showLoadingError: function (){
+ showLoadingError: function() {
this.$('.ui-loading-indicator').addClass('is-hidden');
this.$('.ui-loading-error').removeClass('is-hidden');
}
diff --git a/xmodule/assets/library_source_block/LibrarySourcedBlockPicker.jsx b/xmodule/assets/library_source_block/LibrarySourcedBlockPicker.jsx
index d491939c94..d3ad6c42e4 100644
--- a/xmodule/assets/library_source_block/LibrarySourcedBlockPicker.jsx
+++ b/xmodule/assets/library_source_block/LibrarySourcedBlockPicker.jsx
@@ -29,7 +29,7 @@ class LibrarySourcedBlockPicker extends React.Component {
this.fetchLibraries();
}
- fetchLibraries(textSearch='', page=1, append=false) {
+ fetchLibraries(textSearch = '', page = 1, append = false) {
this.setState({
libraries: append ? this.state.libraries : [],
libraryLoading: true,
@@ -42,7 +42,7 @@ class LibrarySourcedBlockPicker extends React.Component {
libraryLoading: false,
}, () => {
if (res.next) {
- this.fetchLibraries(textSearch, page+1, true);
+ this.fetchLibraries(textSearch, page + 1, true);
}
});
} catch (error) {
@@ -58,7 +58,7 @@ class LibrarySourcedBlockPicker extends React.Component {
});
}
- fetchXblocks(library, textSearch='', page=1, append=false) {
+ fetchXblocks(library, textSearch = '', page = 1, append = false) {
this.setState({
xblocks: append ? this.state.xblocks : [],
xblocksLoading: true,
@@ -71,7 +71,7 @@ class LibrarySourcedBlockPicker extends React.Component {
xblocksLoading: false,
}, () => {
if (res.next) {
- this.fetchXblocks(library, textSearch, page+1, true);
+ this.fetchXblocks(library, textSearch, page + 1, true);
}
});
} catch (error) {
@@ -88,7 +88,7 @@ class LibrarySourcedBlockPicker extends React.Component {
}
onLibrarySearchInput(event) {
- event.persist()
+ event.persist();
this.setState({
searchedLibrary: event.target.value,
});
@@ -101,7 +101,7 @@ class LibrarySourcedBlockPicker extends React.Component {
}
onXBlockSearchInput(event) {
- event.persist()
+ event.persist();
if (!this.debouncedFetchXblocks) {
this.debouncedFetchXblocks = _.debounce(value => {
this.fetchXblocks(this.state.selectedLibrary, value);
@@ -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 => (
-
+
{block.display_name} ({block.id})
))
@@ -199,7 +199,7 @@ class LibrarySourcedBlockPicker extends React.Component {
{block}
-
+
))
diff --git a/xmodule/js/karma_runner_webpack.js b/xmodule/js/karma_runner_webpack.js
index c5c4290d60..64cd930666 100644
--- a/xmodule/js/karma_runner_webpack.js
+++ b/xmodule/js/karma_runner_webpack.js
@@ -32,9 +32,9 @@ import '../../common/static/common/js/vendor/sinon.js';
import 'jquery.ui';
// These
-import './src/video/10_main.js'
-import './spec/helper.js'
-import './spec/video_helper.js'
+import './src/video/10_main.js';
+import './spec/helper.js';
+import './spec/video_helper.js';
// These are the tests that will be run
import './spec/video/async_process_spec.js';
@@ -74,8 +74,8 @@ import './spec/video/social_share_spec.js';
// Somehow the code initialized in jQuery's onready doesn't get called before karma auto starts
'use strict';
-window.__karma__.loaded = function () {
- setTimeout(function () {
+window.__karma__.loaded = function() {
+ setTimeout(function() {
window.__karma__.start();
}, 1000);
};
diff --git a/xmodule/js/karma_xmodule.conf.js b/xmodule/js/karma_xmodule.conf.js
index 7d62917118..185e1e6688 100644
--- a/xmodule/js/karma_xmodule.conf.js
+++ b/xmodule/js/karma_xmodule.conf.js
@@ -6,6 +6,7 @@
'use strict';
var path = require('path');
+
var configModule = require(path.join(__dirname, 'common_static/common/js/karma.common.conf.js'));
var options = {
diff --git a/xmodule/js/karma_xmodule_webpack.conf.js b/xmodule/js/karma_xmodule_webpack.conf.js
index c1a1e63830..e0abad75a8 100644
--- a/xmodule/js/karma_xmodule_webpack.conf.js
+++ b/xmodule/js/karma_xmodule_webpack.conf.js
@@ -6,6 +6,7 @@
'use strict';
var path = require('path');
+
var configModule = require(path.join(__dirname, 'common_static/common/js/karma.common.conf.js'));
var options = {
diff --git a/xmodule/js/spec/video/social_share_spec.js b/xmodule/js/spec/video/social_share_spec.js
index 69d01717ae..f0c3006a1b 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/spec/video/video_events_plugin_spec.js b/xmodule/js/spec/video/video_events_plugin_spec.js
index 54ed189207..d6840e3941 100644
--- a/xmodule/js/spec/video/video_events_plugin_spec.js
+++ b/xmodule/js/spec/video/video_events_plugin_spec.js
@@ -1,4 +1,4 @@
-import '../helper.js'
+import '../helper.js';
(function(undefined) {
'use strict';
diff --git a/xmodule/js/spec/video/video_save_state_plugin_spec.js b/xmodule/js/spec/video/video_save_state_plugin_spec.js
index 556a6c6a1d..04206ae9ad 100644
--- a/xmodule/js/spec/video/video_save_state_plugin_spec.js
+++ b/xmodule/js/spec/video/video_save_state_plugin_spec.js
@@ -183,7 +183,7 @@ import * as Time from 'time.js';
state.videoSaveStatePlugin.onUnload();
expect($.ajax).not.toHaveBeenCalledWith({
url: state.config.saveStateUrl
- })
+ });
state.config.saveStateEnabled = true;
$.ajax.calls.reset();
state.videoSaveStatePlugin.onUnload();
@@ -200,7 +200,7 @@ import * as Time from 'time.js';
state.el.trigger('pause');
expect($.ajax).not.toHaveBeenCalledWith({
url: state.config.saveStateUrl
- })
+ });
state.config.saveStateEnabled = true;
state.el.trigger('pause');
expect($.ajax).toHaveBeenCalledWith({
@@ -233,7 +233,7 @@ import * as Time from 'time.js';
state.config.saveStateEnabled = false;
state.config.recordedYoutubeIsAvailable = false;
state.el.trigger('youtube_availability', [true]);
- expect($.ajax).not.toHaveBeenCalled()
+ expect($.ajax).not.toHaveBeenCalled();
state.config.saveStateEnabled = true;
state.config.recordedYoutubeIsAvailable = false;
state.el.trigger('youtube_availability', [true]);
diff --git a/xmodule/js/src/capa/display.js b/xmodule/js/src/capa/display.js
index 8afe368d42..cce976255b 100644
--- a/xmodule/js/src/capa/display.js
+++ b/xmodule/js/src/capa/display.js
@@ -907,8 +907,8 @@
this.el.find('.choicegroup').each(function(i, choicegroupBlock) {
var checked;
checked = false;
- $(choicegroupBlock).find('input[type=checkbox], input[type=radio]').
- each(function(j, checkboxOrRadio) {
+ $(choicegroupBlock).find('input[type=checkbox], input[type=radio]')
+ .each(function(j, checkboxOrRadio) {
if ($(checkboxOrRadio).is(':checked')) {
checked = true;
}
diff --git a/xmodule/js/src/poll/poll_main.js b/xmodule/js/src/poll/poll_main.js
index dd1e91c607..48195fab79 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 () {
diff --git a/xmodule/js/src/time.js b/xmodule/js/src/time.js
index 7fecbebc9a..b4faec3ea0 100644
--- a/xmodule/js/src/time.js
+++ b/xmodule/js/src/time.js
@@ -8,8 +8,8 @@ function format(time, formatFull) {
seconds = Math.floor(time);
minutes = Math.floor(seconds / 60);
hours = Math.floor(minutes / 60);
- seconds = seconds % 60;
- minutes = minutes % 60;
+ seconds %= 60;
+ minutes %= 60;
if (formatFull) {
return '' + _pad(hours) + ':' + _pad(minutes) + ':' + _pad(seconds % 60);
@@ -38,4 +38,4 @@ function _pad(number) {
}
}
-export {format, formatFull, convert}
+export {format, formatFull, convert};
diff --git a/xmodule/js/src/video/036_video_social_sharing.js b/xmodule/js/src/video/036_video_social_sharing.js
index 3658438161..6ab363eaec 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 ad19aa3132..aa97119d3a 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/06_video_progress_slider.js b/xmodule/js/src/video/06_video_progress_slider.js
index aba6a89bcb..c6e7228e30 100644
--- a/xmodule/js/src/video/06_video_progress_slider.js
+++ b/xmodule/js/src/video/06_video_progress_slider.js
@@ -332,8 +332,8 @@ mind, or whether to act, and in acting, to live."
return interpolate(msg, {value: value}, true);
};
- seconds = seconds % 60;
- minutes = minutes % 60;
+ seconds %= 60;
+ minutes %= 60;
if (hours) {
return i18n(hours, 'hour') + ' '
diff --git a/xmodule/js/src/video/09_video_caption.js b/xmodule/js/src/video/09_video_caption.js
index 1d602bb933..f7a3cda18d 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',