Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 34 additions & 14 deletions lms/static/js/instructor_dashboard/membership.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,14 +503,20 @@ such that the value can be defined later than this assignment (file load order).
}));
$idsList = $('<ul/>');
$taskResSection.append($idsList);
for (j = 0, len1 = ids.length; j < len1; j++) {
identifier = ids[j];
$idsList.append($('<li/>', {
text: identifier
}));
}
if (ids && ids.length > 0) {
for (j = 0, len1 = ids.length; j < len1; j++) {
identifier = ids[j];
$idsList.append($('<li/>', {
text: identifier
}));
}
}
return displayResponse.$task_response.append($taskResSection);
};
if (errors.length === 0 && successes.length === 0 && noUsers.length === 0) {
// Translators: For cases when the input field is empty;
renderList(gettext('This field must not be blank'), []);
}
if (successes.length && dataFromServer.action === 'add') {
var j, len1, inActiveUsers, activeUsers; // eslint-disable-line vars-on-top
activeUsers = [];
Expand Down Expand Up @@ -574,9 +580,6 @@ such that the value can be defined later than this assignment (file load order).
}()));
}
if (noUsers.length) {
noUsers.push($(
gettext('Users must create and activate their account before they can be promoted to beta tester.'))
);
return renderList(gettext('Could not find users associated with the following identifiers:'), (function() { // eslint-disable-line max-len
// eslint-disable-next-line no-shadow
var j, len1, results;
Expand All @@ -585,6 +588,9 @@ such that the value can be defined later than this assignment (file load order).
sr = noUsers[j];
results.push(sr.identifier);
}
results.unshift(
gettext('Users must create and activate their account before they can be promoted to beta tester.')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gettext('Users must create and activate their account before they can be promoted to beta tester.')
gettext('Users must create and activate their account before they can be promoted to beta tester.');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abdullahwaheed I disagree, this gettext is inside unshift

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you meant ; on the next line

);
return results;
}()));
}
Expand Down Expand Up @@ -699,14 +705,28 @@ such that the value can be defined later than this assignment (file load order).
}));
$idsList = $('<ul/>');
$taskResSection.append($idsList);
for (h = 0, len3 = ids.length; h < len3; h++) {
identifier = ids[h];
$idsList.append($('<li/>', {
text: identifier
}));
if (ids && ids.length > 0) {
for (h = 0, len3 = ids.length; h < len3; h++) {
identifier = ids[h];
$idsList.append($('<li/>', {
text: identifier
}));
}
}
return displayResponse.$task_response.append($taskResSection);
};
if (
invalidIdentifier.length === 0
&& errors.length === 0
&& enrolled.length === 0
&& allowed.length === 0
&& autoenrolled.length === 0
&& notenrolled.length === 0
&& notunenrolled.length === 0
) {
// Translators: For cases when the input field is empty;
renderList(gettext('This field must not be blank'), []);
}
if (invalidIdentifier.length) {
renderList(gettext('The following email addresses and/or usernames are invalid:'), (function() {
var m, len4, results;
Expand Down