minor: Rename function to get_active_humans().

Saying `human_persons` is a bit redundant (although
kind of an artifact of our legacy use of `person`
when we really mean `user`.)
This commit is contained in:
Steve Howell
2020-03-21 17:09:45 +00:00
committed by Tim Abbott
parent 26daeeb358
commit 7ac5d0602b
4 changed files with 6 additions and 6 deletions

View File

@@ -142,10 +142,10 @@ run_test('basics', () => {
// Reactivating issac
people.add_in_realm(isaac);
const active_human_persons = people.get_active_human_persons();
assert.equal(active_human_persons.length, 2);
const active_humans = people.get_active_humans();
assert.equal(active_humans.length, 2);
assert.deepEqual(
active_human_persons.sort((p) => p.user_id),
active_humans.sort((p) => p.user_id),
[me, isaac]);
});

View File

@@ -689,7 +689,7 @@ exports.get_realm_persons = function () {
return Array.from(active_user_dict.values());
};
exports.get_active_human_persons = function () {
exports.get_active_humans = function () {
const humans = [];
for (const user of active_user_dict.values()) {

View File

@@ -389,7 +389,7 @@ exports.set_up = function () {
const li = $(e.currentTarget).closest('li');
const bot_id = parseInt(li.find('.bot_info').attr('data-user-id'), 10);
const bot = bot_data.get(bot_id);
const users_list = people.get_active_human_persons();
const users_list = people.get_active_humans();
$("#edit_bot").empty();
$("#edit_bot").append(render_edit_bot({
bot: bot,

View File

@@ -306,7 +306,7 @@ function open_user_info_form_modal(person) {
if (person.is_bot) {
// Dynamically add the owner select control in order to
// avoid performance issues in case of large number of users.
const users_list = people.get_active_human_persons();
const users_list = people.get_active_humans();
const owner_select = $(render_bot_owner_select({users_list: users_list}));
owner_select.val(bot_data.get(person.user_id).owner || "");
modal_container.find(".edit_bot_owner_container").append(owner_select);