Skip to content

Commit

Permalink
chore: apply amnesty on all existing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Syed-Ali-Abbas-Zaidi committed May 11, 2023
1 parent adc4621 commit 4d05181
Show file tree
Hide file tree
Showing 328 changed files with 1,295 additions and 12 deletions.
1 change: 1 addition & 0 deletions cms/static/cms/js/spec/main_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(function(sandbox) {
'use strict';

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

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

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

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

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

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

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

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

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

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

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

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

const renderCourseMetadata = (item, i) => (
Expand Down Expand Up @@ -84,6 +89,7 @@ export function CourseOrLibraryListing(props) {
CourseOrLibraryListing.propTypes = {
allowReruns: PropTypes.bool.isRequired,
idBase: PropTypes.string.isRequired,
// eslint-disable-next-line react/forbid-prop-types
items: PropTypes.arrayOf(PropTypes.object).isRequired,
linkClass: PropTypes.string.isRequired,
};
1 change: 1 addition & 0 deletions cms/static/js/models/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ define(['backbone', 'underscore'], function(Backbone, _) {
+ (overrides && overrides.name ? overrides.name : this.get('name')) + '/';
},
_tagPattern: /[^:]+/g,
// eslint-disable-next-line prefer-regex-literals
_fieldPattern: new RegExp('[^/]+', 'g'),

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

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

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

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

// eslint-disable-next-line import/prefer-default-export
export {toggleSock};
6 changes: 6 additions & 0 deletions cms/static/js/spec/models/group_configuration_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ define([
var collection, injector, mockGettext, initializeGroupModel, cleanUp;

mockGettext = function(returnedValue) {
// eslint-disable-next-line no-shadow
var injector = new Squire();

injector.mock('gettext', function() {
Expand All @@ -258,6 +259,7 @@ define([

injector = mockGettext(dict);
injector.require(['js/collections/group'],
// eslint-disable-next-line no-shadow
function(GroupCollection) {
collection = new GroupCollection();
deferred.resolve(collection);
Expand All @@ -273,6 +275,7 @@ define([
};

it('returns correct ids', function() {
// eslint-disable-next-line no-shadow
var collection = new GroupCollection();

expect(collection.getGroupId(0)).toBe('A');
Expand All @@ -287,6 +290,7 @@ define([

it('just 1 character in the dictionary', function(done) {
initializeGroupModel('1')
// eslint-disable-next-line no-shadow
.then(function(collection) {
expect(collection.getGroupId(0)).toBe('1');
expect(collection.getGroupId(1)).toBe('11');
Expand All @@ -300,6 +304,7 @@ define([

it('allow to use unicode characters in the dict', function(done) {
initializeGroupModel('ö诶úeœ')
// eslint-disable-next-line no-shadow
.then(function(collection) {
expect(collection.getGroupId(0)).toBe('ö');
expect(collection.getGroupId(1)).toBe('诶');
Expand All @@ -316,6 +321,7 @@ define([

it('return initial value if dictionary is empty', function(done) {
initializeGroupModel('')
// eslint-disable-next-line no-shadow
.then(function(collection) {
expect(collection.getGroupId(0)).toBe('0');
expect(collection.getGroupId(5)).toBe('5');
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/spec/utils/handle_iframe_binding_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ define(
});

it('does nothing on tinymce iframe', function() {
// eslint-disable-next-line no-script-url
verify_no_modification('javascript:');
});
});
Expand Down
4 changes: 4 additions & 0 deletions cms/static/js/spec/video/transcripts/message_manager_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ define(
describe('processCommand', function() {
var action = 'replace',
errorMessage = 'errorMessage',
// eslint-disable-next-line no-void
videoList = void 0,
extraParamas = 'video_id';

Expand All @@ -175,6 +176,7 @@ define(
var defaults = {
action: 'replace',
errorMessage: 'errorMessage',
// eslint-disable-next-line no-void
extraParamas: void 0
};
var args = $.extend({}, defaults, config);
Expand All @@ -201,6 +203,7 @@ define(
action,
view.component_locator,
videoList,
// eslint-disable-next-line no-void
void 0
);
expect(view.showError).not.toHaveBeenCalled();
Expand Down Expand Up @@ -251,6 +254,7 @@ define(
action,
view.component_locator,
videoList,
// eslint-disable-next-line no-void
void 0
);
expect(view.showError).toHaveBeenCalled();
Expand Down
2 changes: 2 additions & 0 deletions cms/static/js/spec/video/transcripts/utils_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ define(
});

it('Method: getYoutubeLink', function() {
// eslint-disable-next-line no-shadow
var videoId = 'video_id',
result = Utils.getYoutubeLink(videoId),
expectedResult = 'http://youtu.be/' + videoId;
Expand Down Expand Up @@ -262,6 +263,7 @@ define(

describe('Wrong arguments ', function() {
it('youtube videoId is wrong', function() {
// eslint-disable-next-line no-shadow
var videoId = 'wrong_id',
link = 'http://youtu.be/' + videoId,
result = Utils.parseLink(link);
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/spec/video/transcripts/videolist_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ define(

it('is rendered without opened extra videos bar', function(done) {
var view = createVideoListView(this.mockServer),
// eslint-disable-next-line no-shadow
videoList = [
{
mode: 'youtube',
Expand Down
2 changes: 2 additions & 0 deletions cms/static/js/spec/views/module_edit_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe('ModuleEdit', function() {
+ '<li class="component" id="stub-id" data-locator="stub-id">\n'
+ ' <div class="component-editor">\n'
+ ' <div class="module-editor">\n'
// eslint-disable-next-line no-template-curly-in-string
+ ' ${editor}\n'
+ ' </div>\n'
+ ' <a href="#" class="save-button">Save</a>\n'
Expand Down Expand Up @@ -73,6 +74,7 @@ describe('ModuleEdit', function() {
window.MockXBlock = function() {
return {};
};
// eslint-disable-next-line no-void
window.loadedXBlockResources = void 0;
this.moduleEdit.render();
return $.ajax.calls.mostRecent().args[0].success({
Expand Down
2 changes: 2 additions & 0 deletions cms/static/js/spec/views/move_xblock_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import XBlockInfo from 'js/models/xblock_info';
import Course from 'js/models/course';
import 'mock-ajax';

// eslint-disable-next-line padded-blocks
describe('MoveXBlock', function() {

'use strict';
Expand Down Expand Up @@ -396,6 +397,7 @@ describe('MoveXBlock', function() {
expectedData,
sourceIndex = sourceIndex || 0; // eslint-disable-line no-redeclare

// eslint-disable-next-line no-multi-assign
responseData = expectedData = {
move_source_locator: xblockLocator,
parent_locator: modal.targetParentXBlockInfo.id
Expand Down
3 changes: 3 additions & 0 deletions cms/static/js/spec/views/pages/container_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function parameterized_suite(label, globalPageOptions) {
AjaxHelpers.respondWithJson(requests, options || {});
};

// eslint-disable-next-line no-shadow
handleContainerPageRefresh = function(requests) {
var request = AjaxHelpers.currentRequest(requests);
expect(str.startsWith(request.url,
Expand Down Expand Up @@ -551,10 +552,12 @@ function parameterized_suite(label, globalPageOptions) {
describe('Previews', function() {
var getButtonIcon, getButtonText;

// eslint-disable-next-line no-shadow
getButtonIcon = function(containerPage) {
return containerPage.$('.action-toggle-preview .fa');
};

// eslint-disable-next-line no-shadow
getButtonText = function(containerPage) {
return containerPage.$('.action-toggle-preview .preview-text').text().trim();
};
Expand Down
13 changes: 13 additions & 0 deletions cms/static/js/spec/views/pages/course_outline_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ describe('CourseOutlinePage', function() {
};

it('can be published', function() {
// eslint-disable-next-line no-shadow
var mockCourseJSON = getMockCourseJSON({
has_changes: true
});
Expand All @@ -256,6 +257,7 @@ describe('CourseOutlinePage', function() {
});

it('should show publish button if it is not published and not changed', function() {
// eslint-disable-next-line no-shadow
var mockCourseJSON = getMockCourseJSON({
has_changes: false,
published: false
Expand All @@ -264,6 +266,7 @@ describe('CourseOutlinePage', function() {
});

it('should show publish button if it is published and changed', function() {
// eslint-disable-next-line no-shadow
var mockCourseJSON = getMockCourseJSON({
has_changes: true,
published: true
Expand All @@ -272,6 +275,7 @@ describe('CourseOutlinePage', function() {
});

it('should show publish button if it is not published, but changed', function() {
// eslint-disable-next-line no-shadow
var mockCourseJSON = getMockCourseJSON({
has_changes: true,
published: false
Expand All @@ -280,6 +284,7 @@ describe('CourseOutlinePage', function() {
});

it('should hide publish button if it is not changed, but published', function() {
// eslint-disable-next-line no-shadow
var mockCourseJSON = getMockCourseJSON({
has_changes: false,
published: true
Expand Down Expand Up @@ -589,6 +594,7 @@ describe('CourseOutlinePage', function() {
setSelfPaced();
});

// eslint-disable-next-line prefer-const
createCourse = function(sectionOptions, courseOptions) {
createCourseOutlinePage(this,
createMockCourseJSON(courseOptions, [
Expand All @@ -597,14 +603,17 @@ describe('CourseOutlinePage', function() {
);
};

// eslint-disable-next-line prefer-const
createCourseWithHighlights = function(highlights) {
createCourse({highlights: highlights});
};

// eslint-disable-next-line prefer-const
clickSaveOnModal = function() {
$('.wrapper-modal-window .action-save').click();
};

// eslint-disable-next-line prefer-const
clickCancelOnModal = function() {
$('.wrapper-modal-window .action-cancel').click();
};
Expand Down Expand Up @@ -1043,6 +1052,7 @@ describe('CourseOutlinePage', function() {
});

it('can display a publish modal with a list of unpublished subsections and units', function() {
// eslint-disable-next-line no-shadow
var mockCourseJSON = createMockCourseJSON({}, [
createMockSectionJSON({has_changes: true}, [
createMockSubsectionJSON({has_changes: true}, [
Expand Down Expand Up @@ -1319,6 +1329,7 @@ describe('CourseOutlinePage', function() {
});

it('can show correct editors for self_paced course', function() {
// eslint-disable-next-line no-shadow
var mockCourseJSON = createMockCourseJSON({}, [
createMockSectionJSON({}, [
createMockSubsectionJSON({}, [])
Expand Down Expand Up @@ -2166,6 +2177,7 @@ describe('CourseOutlinePage', function() {
});

it('can display a publish modal with a list of unpublished units', function() {
// eslint-disable-next-line no-shadow
var mockCourseJSON = createMockCourseJSON({}, [
createMockSectionJSON({has_changes: true}, [
createMockSubsectionJSON({has_changes: true}, [
Expand Down Expand Up @@ -2193,6 +2205,7 @@ describe('CourseOutlinePage', function() {

describe('Self Paced with Custom Personalized Learner Schedules (PLS)', function() {
beforeEach(function() {
// eslint-disable-next-line no-shadow
var mockCourseJSON = createMockCourseJSON({}, [
createMockSectionJSON({}, [
createMockSubsectionJSON({}, [])
Expand Down
1 change: 1 addition & 0 deletions cms/static/js/spec/views/xblock_editor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe('XBlockEditorView', function() {

it('can render a module with only settings', function() {
var requests = AjaxHelpers.requests(this),
// eslint-disable-next-line no-shadow
mockXModuleEditorHtml;
mockXModuleEditorHtml = readFixtures('templates/mock/mock-xmodule-settings-only-editor.underscore');

Expand Down
Loading

0 comments on commit 4d05181

Please sign in to comment.