Linting fixes to improve quality report

This commit is contained in:
Kshitij Sobti
2018-07-16 13:39:38 +05:30
parent bf6af13ed1
commit fcff921fdb
16 changed files with 32 additions and 35 deletions

View File

@@ -149,7 +149,7 @@ EntitlementForm.propTypes = {
EntitlementForm.defaultProps = {
entitlement: {
uuid:'',
uuid: '',
courseUuid: '',
created: '',
modified: '',
@@ -158,7 +158,7 @@ EntitlementForm.defaultProps = {
orderNumber: '',
supportDetails: [],
user: '',
}
},
};
export default EntitlementForm;

View File

@@ -1,5 +1,5 @@
import { formActions, entitlementActions } from '../constants/actionTypes';
import { formTypes } from '../constants/formTypes'
import { formTypes } from '../constants/formTypes';
const clearFormState = {
formType: '',
isOpen: false,

View File

@@ -83,9 +83,9 @@ function LoggedInUser({ userInformation, setErrorState, zendeskApiHost, submitFo
{/* TODO file uploading will be done after initial release */}
{/* <FileUpload */}
{/* setErrorState={setErrorState} */}
{/* zendeskApiHost={zendeskApiHost} */}
{/* accessToken={accessToken} */}
{/* setErrorState={setErrorState} */}
{/* zendeskApiHost={zendeskApiHost} */}
{/* accessToken={accessToken} */}
{/* /> */}
<div className="row">

View File

@@ -51,7 +51,7 @@ class RenderForm extends React.Component {
data.requester = {
email: $userInfo.data('email'),
name: $userInfo.data('username')
name: $userInfo.data('username'),
};
course = $course.find(':selected').val();

View File

@@ -60,7 +60,7 @@
this.clearSearch();
},
showErrorMessage: function (error) {
showErrorMessage: function(error) {
this.$message.text(gettext(error || 'There was an error, try searching again.'));
}

View File

@@ -52,7 +52,7 @@ describe('Program Progress View', () => {
model: programModel,
courseModel: courseData,
certificateCollection,
programRecordUrl: '/foo/bar'
programRecordUrl: '/foo/bar',
});
beforeEach(() => {

View File

@@ -101,7 +101,7 @@ class UnenrollView extends Backbone.View {
this.mainPageSelector = '#dashboard-main';
this.triggerSelector = '.action-unenroll';
$(this.triggerSelector).each(function attachTriggerHandler(index, element) {
$(this.triggerSelector).each((index, element) => {
$(element).on('click', view.handleTrigger.bind($(element)));
});

View File

@@ -4,18 +4,18 @@ function playVideo(src) {
document.querySelector('#program_video iframe').style = 'display:block;';
document.querySelector('#program_video iframe').src = src;
}
$(".instructor-image, .instructor-label").leanModal({closeButton: ".modal_close", top: '10%'});
$('.instructor-image, .instructor-label').leanModal({closeButton: '.modal_close', top: '10%'});
// Create MutationObserver which prevents the body of
// the page from scrolling when a modal window is displayed
var observer = new MutationObserver(function(mutations, obv){
mutations.forEach(function(mutation) {
if ($(mutation.target).css('display') === 'block') {
$('body').css('overflow','hidden');
} else {
$('body').css('overflow', 'auto');
}
});
var observer = new MutationObserver(function(mutations, obv) {
mutations.forEach(function(mutation) {
if ($(mutation.target).css('display') === 'block') {
$('body').css('overflow', 'hidden');
} else {
$('body').css('overflow', 'auto');
}
});
});
$('.modal').each(function(index, element) {
observer.observe(element, {attributes: true, attributeFilter: ['style']});
});
$('.modal').each(function(index, element){
observer.observe(element, {attributes: true, attributeFilter:['style']});
});

View File

@@ -156,7 +156,7 @@ define([
var requests = AjaxHelpers.requests(this);
$('.discovery-input').val('asdfasdf');
$('.discovery-submit').trigger('click');
AjaxHelpers.respondWithError(requests, 404, {'error': 'some-search-error'});
AjaxHelpers.respondWithError(requests, 404, {error: 'some-search-error'});
expect($('#discovery-message')).not.toBeEmpty();
expect($('#discovery-message')).toContainHtml('some-search-error');
expect($('.courses-listing')).toBeEmpty();

View File

@@ -45,11 +45,10 @@
// If we successfully enrolled, redirect the user
// to the next page (usually the student dashboard or payment flow)
if (response.redirect_destination) {
this.redirect(response.redirect_destination)
this.redirect(response.redirect_destination);
} else if (redirectUrl) {
this.redirect(redirectUrl);
}
});
},