From 2e1615f2c0d0f0a215ef414a78b2a978caf0e5d4 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Tue, 4 Jul 2017 13:25:16 +0800 Subject: [PATCH] MDL-59365 eslint: Noop changes for eslint --- .../manual/amd/build/form-potential-user-selector.min.js | 2 +- enrol/manual/amd/src/form-potential-user-selector.js | 3 ++- enrol/manual/amd/src/quickenrolment.js | 9 ++++++--- lib/amd/src/form-cohort-selector.js | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/enrol/manual/amd/build/form-potential-user-selector.min.js b/enrol/manual/amd/build/form-potential-user-selector.min.js index 1ae8096143e..d697a8b4036 100644 --- a/enrol/manual/amd/build/form-potential-user-selector.min.js +++ b/enrol/manual/amd/build/form-potential-user-selector.min.js @@ -1 +1 @@ -define(["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function(b,c){var d=[];return a.each(c,function(a,b){d.push({value:b.id,label:b._label})}),d},transport:function(d,e,f,g){var h,i=a(d).attr("courseid");"undefined"==typeof i&&(i="1");var j=a(d).attr("enrolid");"undefined"==typeof j&&(j=""),h=b.call([{methodname:"core_enrol_get_potential_users",args:{courseid:i,enrolid:j,search:e,searchanywhere:!0,page:0,perpage:30}}]),h[0].then(function(b){var d=[],e=0;return a.each(b,function(b,e){var f=e,g=[];a.each(["idnumber","email","phone1","phone2","department","institution"],function(a,b){"undefined"!=typeof e[b]&&""!==e[b]&&(f.hasidentity=!0,g.push(e[b]))}),f.identity=g.join(", "),d.push(c.render("enrol_manual/form-user-selector-suggestion",f))}),a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b,function(a,b){b._label=c[e],e++}),f(b)})},g)}}}); \ No newline at end of file +define(["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function(b,c){var d=[];return a.each(c,function(a,b){d.push({value:b.id,label:b._label})}),d},transport:function(d,e,f,g){var h,i=a(d).attr("courseid");"undefined"==typeof i&&(i="1");var j=a(d).attr("enrolid");"undefined"==typeof j&&(j=""),h=b.call([{methodname:"core_enrol_get_potential_users",args:{courseid:i,enrolid:j,search:e,searchanywhere:!0,page:0,perpage:30}}]),h[0].then(function(b){var d=[],e=0;return a.each(b,function(b,e){var f=e,g=[];a.each(["idnumber","email","phone1","phone2","department","institution"],function(a,b){"undefined"!=typeof e[b]&&""!==e[b]&&(f.hasidentity=!0,g.push(e[b]))}),f.identity=g.join(", "),d.push(c.render("enrol_manual/form-user-selector-suggestion",f))}),a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b,function(a,b){b._label=c[e],e++}),f(b)})}).fail(g)}}}); \ No newline at end of file diff --git a/enrol/manual/amd/src/form-potential-user-selector.js b/enrol/manual/amd/src/form-potential-user-selector.js index d09aa82238b..49bdcbfc30e 100644 --- a/enrol/manual/amd/src/form-potential-user-selector.js +++ b/enrol/manual/amd/src/form-potential-user-selector.js @@ -87,9 +87,10 @@ define(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) { i++; }); success(results); + return; }); - }, failure); + }).fail(failure); } }; diff --git a/enrol/manual/amd/src/quickenrolment.js b/enrol/manual/amd/src/quickenrolment.js index 107345628f6..6650786c837 100644 --- a/enrol/manual/amd/src/quickenrolment.js +++ b/enrol/manual/amd/src/quickenrolment.js @@ -34,6 +34,7 @@ define(['core/templates', /** * Constructor * + * @param {Object} options Object containing options. The only valid option at this time is contextid. * Each call to templates.render gets it's own instance of this class. */ var QuickEnrolment = function(options) { @@ -82,6 +83,7 @@ define(['core/templates', * This triggers a form submission, so that any mform elements can do final tricks before the form submission is processed. * * @method submitForm + * @param {Event} e Form submission event. * @private */ QuickEnrolment.prototype.submitForm = function(e) { @@ -94,7 +96,7 @@ define(['core/templates', * * @method submitForm * @private - * @return Promise + * @param {Event} e Form submission event. */ QuickEnrolment.prototype.submitFormAjax = function(e) { // We don't want to do a real form submission. @@ -126,6 +128,7 @@ define(['core/templates', } window.location.reload(); } + return; }) .fail(Notification.exception); }; @@ -135,7 +138,7 @@ define(['core/templates', * * @method getBody * @private - * @return Promise + * @return {Promise} */ QuickEnrolment.prototype.getBody = function() { return Fragment.loadFragment('enrol_manual', 'enrol_users_form', this.contextid, {}).fail(Notification.exception); @@ -146,7 +149,7 @@ define(['core/templates', * * @method getFooter * @private - * @return Promise + * @return {Promise} */ QuickEnrolment.prototype.getFooter = function() { return Template.render('enrol_manual/enrol_modal_footer', {}); diff --git a/lib/amd/src/form-cohort-selector.js b/lib/amd/src/form-cohort-selector.js index f154991053b..de9b2c6b116 100644 --- a/lib/amd/src/form-cohort-selector.js +++ b/lib/amd/src/form-cohort-selector.js @@ -59,7 +59,7 @@ define(['core/ajax', 'jquery'], function(ajax, $) { includes: 'parents', limitfrom: 0, limitnum: 100, - context: { contextid: contextid } + context: {contextid: contextid} }; var calls = [{