js: Purge pm_conversations module from window.

All the changes are done using a script followed by updates to Node
tests and running eslint and prettier to fix formatting issues.
This commit is contained in:
Priyank Patel 2020-08-18 17:53:22 +00:00 committed by Anders Kaseorg
parent 305a1ac57d
commit d774bba1b9
11 changed files with 16 additions and 13 deletions

View File

@ -192,7 +192,6 @@
"panels": false,
"pill_typeahead": false,
"people": false,
"pm_conversations": false,
"pm_list": false,
"pm_list_dom": false,
"pointer": false,

View File

@ -21,7 +21,7 @@ zrequire("presence");
zrequire("buddy_data");
zrequire("hash_util");
zrequire("people");
zrequire("pm_conversations");
const pm_conversations = zrequire("pm_conversations");
zrequire("pm_list");
const alice = {

View File

@ -1,8 +1,7 @@
"use strict";
set_global("pm_conversations", {
recent: {},
});
const pm_conversations = zrequire("pm_conversations");
pm_conversations.recent = {};
zrequire("muting");
zrequire("unread");

View File

@ -4,11 +4,12 @@ set_global("page_params", {realm_is_zephyr_mirror_realm: false});
set_global("md5", (s) => "md5-" + s);
const settings_config = zrequire("settings_config");
const pm_conversations = zrequire("pm_conversations");
page_params.realm_email_address_visibility =
settings_config.email_address_visibility_values.admins_only.code;
zrequire("recent_senders");
zrequire("pm_conversations");
zrequire("people");
zrequire("stream_data");
zrequire("narrow");
@ -241,10 +242,10 @@ run_test("sort_recipients", () => {
stream_data.update_calculated_fields(linux_sub);
// For splitting based on whether a PM was sent
global.pm_conversations.set_partner(5);
global.pm_conversations.set_partner(6);
global.pm_conversations.set_partner(2);
global.pm_conversations.set_partner(7);
pm_conversations.set_partner(5);
pm_conversations.set_partner(6);
pm_conversations.set_partner(2);
pm_conversations.set_partner(7);
// For splitting based on recency
global.recent_senders.process_message_for_senders({

View File

@ -90,7 +90,6 @@ declare let page_params: any;
declare let panels: any;
declare let people: any;
declare let pill_typeahead: any;
declare let pm_conversations: any;
declare let pm_list: any;
declare let pointer: any;
declare let poll_widget: any;

View File

@ -1,5 +1,6 @@
"use strict";
const pm_conversations = require("./pm_conversations");
const util = require("./util");
const stored_messages = new Map();

View File

@ -77,5 +77,3 @@ class RecentPrivateMessages {
}
exports.recent = new RecentPrivateMessages();
window.pm_conversations = exports;

View File

@ -1,5 +1,7 @@
"use strict";
const pm_conversations = require("./pm_conversations");
let prior_dom;
let private_messages_open = false;

View File

@ -1,5 +1,7 @@
"use strict";
const pm_conversations = require("./pm_conversations");
exports.sub_list_generator = function (lst, lower, upper) {
// lower/upper has Python range semantics so if you pass
// in lower=5 and upper=8, you get elements 5/6/7

View File

@ -8,6 +8,7 @@ const emoji = require("../shared/js/emoji");
const typeahead = require("../shared/js/typeahead");
const render_typeahead_list_item = require("../templates/typeahead_list_item.hbs");
const pm_conversations = require("./pm_conversations");
const settings_data = require("./settings_data");
const util = require("./util");

View File

@ -8,6 +8,7 @@ const render_edit_content_button = require("../templates/edit_content_button.hbs
const emojisets = require("./emojisets");
const markdown_config = require("./markdown_config");
const pm_conversations = require("./pm_conversations");
// This is where most of our initialization takes place.
// TODO: Organize it a lot better. In particular, move bigger