Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

js: Convert static/js/user_search.js to ES6 module.

Anders Kaseorg229aacb8191d
diff --git a/.eslintrc.json b/.eslintrc.json
index c725fdb44cf..0b982d0e34f 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -134,7 +134,6 @@
"ListCursor": false,
"MessageListData": false,
"MessageListView": false,
- "UserSearch": false,
"activity": false,
"admin": false,
"alert_words_ui": false,
diff --git a/frontend_tests/node_tests/activity.js b/frontend_tests/node_tests/activity.js
index 243a427fe98..32f0e126a11 100644
--- a/frontend_tests/node_tests/activity.js
+++ b/frontend_tests/node_tests/activity.js
@@ -86,7 +86,6 @@ const presence = zrequire("presence");
const people = zrequire("people");
const buddy_data = zrequire("buddy_data");
const buddy_list = zrequire("buddy_list");
-zrequire("user_search");
const user_status = zrequire("user_status");
zrequire("list_cursor");
const activity = zrequire("activity");
diff --git a/static/js/activity.js b/static/js/activity.js
index faa48ebbdf8..4e49feefc3b 100644
--- a/static/js/activity.js
+++ b/static/js/activity.js
@@ -3,6 +3,7 @@
const _ = require("lodash");
const people = require("./people");
+const {UserSearch} = require("./user_search");
/*
Helpers for detecting user activity and managing user idle states
diff --git a/static/js/bundles/app.js b/static/js/bundles/app.js
index eb649c5060e..28244852067 100644
--- a/static/js/bundles/app.js
+++ b/static/js/bundles/app.js
@@ -112,7 +112,6 @@ import "../message_fetch";
import "../server_events";
import "../zulip";
import "../presence";
-import "../user_search";
import "../user_status";
import "../user_status_ui";
import "../buddy_data";
diff --git a/static/js/global.d.ts b/static/js/global.d.ts
index 403b88627d1..ded077e7108 100644
--- a/static/js/global.d.ts
+++ b/static/js/global.d.ts
@@ -8,7 +8,6 @@ declare let Filter: any;
declare let ListCursor: any;
declare let MessageListData: any;
declare let MessageListView: any;
-declare let UserSearch: any;
declare let activity: any;
declare let admin: any;
declare let alert_words_ui: any;
diff --git a/static/js/user_search.js b/static/js/user_search.js
index 6f3acf8f2c3..0e5bee92245 100644
--- a/static/js/user_search.js
+++ b/static/js/user_search.js
@@ -1,6 +1,4 @@
-"use strict";
-
-class UserSearch {
+export class UserSearch {
// This is mostly view code to manage the user search widget
// above the buddy list. We rely on other code to manage the
// details of populating the list when we change.
@@ -119,6 +117,3 @@ class UserSearch {
e.stopPropagation();
}
}
-
-module.exports = UserSearch;
-window.UserSearch = UserSearch;