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

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-02-27 16:17:21 -08:00 committed by Tim Abbott
parent 542a77f5d5
commit db6e3a41d3
6 changed files with 8 additions and 12 deletions

View File

@ -131,7 +131,6 @@
"compose_actions": false,
"compose_ui": false,
"composebox_typeahead": false,
"confirm_dialog": false,
"csrf_token": false,
"current_msg_list": true,
"dropdown_list_widget": false,

View File

@ -10,7 +10,9 @@ const {set_global, zrequire} = require("../zjsunit/namespace");
const {run_test} = require("../zjsunit/test");
const $ = require("../zjsunit/zjquery");
const confirm_dialog = set_global("confirm_dialog", {});
const confirm_dialog = {__esModule: true};
rewiremock("../../static/js/confirm_dialog").with(confirm_dialog);
const noop = () => {};

View File

@ -34,7 +34,6 @@ import "../message_events";
import "../server_events";
import "../zulip";
import "../templates";
import "../confirm_dialog";
import "../dropdown_list_widget";
import "../settings_account";
import "../settings_display";

View File

@ -1,8 +1,6 @@
"use strict";
import render_confirm_dialog from "../templates/confirm_dialog.hbs";
const render_confirm_dialog = require("../templates/confirm_dialog.hbs");
const overlays = require("./overlays");
import * as overlays from "./overlays";
/*
Look for confirm_dialog in settings_user_groups
@ -29,7 +27,7 @@ const overlays = require("./overlays");
*/
exports.launch = function (conf) {
export function launch(conf) {
const html = render_confirm_dialog();
const confirm_dialog = $(html);
@ -77,6 +75,4 @@ exports.launch = function (conf) {
// Open the modal
overlays.open_modal("#confirm_dialog_modal");
};
window.confirm_dialog = exports;
}

View File

@ -9,7 +9,6 @@ declare let bot_data: any;
declare let compose_actions: any;
declare let composebox_typeahead: any;
declare let compose_ui: any;
declare let confirm_dialog: any;
declare let csrf_token: any;
declare let current_msg_list: any;
declare let emoji: any;

View File

@ -6,6 +6,7 @@ const render_admin_user_group_list = require("../templates/admin_user_group_list
const render_confirm_delete_user = require("../templates/confirm_delete_user.hbs");
const channel = require("./channel");
const confirm_dialog = require("./confirm_dialog");
const people = require("./people");
const pill_typeahead = require("./pill_typeahead");
const ui_report = require("./ui_report");