mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 11:22:04 +00:00
login_to_access: Rename module to spectators.
This allows us to call spectators.login_to_access which is more clear for what it does.
This commit is contained in:
@@ -44,8 +44,8 @@ const emoji_picker = mock_esm("../../static/js/emoji_picker", {
|
|||||||
});
|
});
|
||||||
const message_lists = mock_esm("../../static/js/message_lists");
|
const message_lists = mock_esm("../../static/js/message_lists");
|
||||||
const message_store = mock_esm("../../static/js/message_store");
|
const message_store = mock_esm("../../static/js/message_store");
|
||||||
const login_to_access = mock_esm("../../static/js/login_to_access", {
|
const spectators = mock_esm("../../static/js/spectators", {
|
||||||
show() {},
|
login_to_access() {},
|
||||||
});
|
});
|
||||||
|
|
||||||
message_lists.current = {
|
message_lists.current = {
|
||||||
@@ -914,7 +914,7 @@ test("process_reaction_click", ({override}) => {
|
|||||||
// Test spectator cannot react.
|
// Test spectator cannot react.
|
||||||
page_params.is_spectator = true;
|
page_params.is_spectator = true;
|
||||||
let stub = make_stub();
|
let stub = make_stub();
|
||||||
login_to_access.show = stub.f;
|
spectators.login_to_access = stub.f;
|
||||||
reactions.process_reaction_click(message.id, "unicode_emoji,1f642");
|
reactions.process_reaction_click(message.id, "unicode_emoji,1f642");
|
||||||
let args = stub.get_args("args").args;
|
let args = stub.get_args("args").args;
|
||||||
assert.equal(args, undefined);
|
assert.equal(args, undefined);
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import * as compose_validate from "./compose_validate";
|
|||||||
import * as drafts from "./drafts";
|
import * as drafts from "./drafts";
|
||||||
import * as hash_util from "./hash_util";
|
import * as hash_util from "./hash_util";
|
||||||
import {$t} from "./i18n";
|
import {$t} from "./i18n";
|
||||||
import * as login_to_access from "./login_to_access";
|
|
||||||
import * as message_lists from "./message_lists";
|
import * as message_lists from "./message_lists";
|
||||||
import * as message_viewport from "./message_viewport";
|
import * as message_viewport from "./message_viewport";
|
||||||
import * as narrow_state from "./narrow_state";
|
import * as narrow_state from "./narrow_state";
|
||||||
@@ -26,6 +25,7 @@ import * as recent_topics_ui from "./recent_topics_ui";
|
|||||||
import * as recent_topics_util from "./recent_topics_util";
|
import * as recent_topics_util from "./recent_topics_util";
|
||||||
import * as reload_state from "./reload_state";
|
import * as reload_state from "./reload_state";
|
||||||
import * as resize from "./resize";
|
import * as resize from "./resize";
|
||||||
|
import * as spectators from "./spectators";
|
||||||
import * as stream_bar from "./stream_bar";
|
import * as stream_bar from "./stream_bar";
|
||||||
import * as stream_data from "./stream_data";
|
import * as stream_data from "./stream_data";
|
||||||
import * as unread_ops from "./unread_ops";
|
import * as unread_ops from "./unread_ops";
|
||||||
@@ -216,7 +216,7 @@ export function update_placeholder_text() {
|
|||||||
|
|
||||||
export function start(msg_type, opts) {
|
export function start(msg_type, opts) {
|
||||||
if (page_params.is_spectator) {
|
if (page_params.is_spectator) {
|
||||||
login_to_access.show();
|
spectators.login_to_access();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import * as floating_recipient_bar from "./floating_recipient_bar";
|
|||||||
import * as hash_util from "./hash_util";
|
import * as hash_util from "./hash_util";
|
||||||
import * as info_overlay from "./info_overlay";
|
import * as info_overlay from "./info_overlay";
|
||||||
import * as invite from "./invite";
|
import * as invite from "./invite";
|
||||||
import * as login_to_access from "./login_to_access";
|
|
||||||
import * as message_lists from "./message_lists";
|
import * as message_lists from "./message_lists";
|
||||||
import * as message_viewport from "./message_viewport";
|
import * as message_viewport from "./message_viewport";
|
||||||
import * as narrow from "./narrow";
|
import * as narrow from "./narrow";
|
||||||
@@ -22,6 +21,7 @@ import * as search from "./search";
|
|||||||
import * as settings from "./settings";
|
import * as settings from "./settings";
|
||||||
import * as settings_panel_menu from "./settings_panel_menu";
|
import * as settings_panel_menu from "./settings_panel_menu";
|
||||||
import * as settings_toggle from "./settings_toggle";
|
import * as settings_toggle from "./settings_toggle";
|
||||||
|
import * as spectators from "./spectators";
|
||||||
import * as stream_settings_ui from "./stream_settings_ui";
|
import * as stream_settings_ui from "./stream_settings_ui";
|
||||||
import * as top_left_corner from "./top_left_corner";
|
import * as top_left_corner from "./top_left_corner";
|
||||||
import * as ui_util from "./ui_util";
|
import * as ui_util from "./ui_util";
|
||||||
@@ -335,7 +335,7 @@ function hashchanged(from_reload, e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (page_params.is_spectator && !is_hash_web_public_compatible) {
|
if (page_params.is_spectator && !is_hash_web_public_compatible) {
|
||||||
login_to_access.show();
|
spectators.login_to_access();
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import * as blueslip from "./blueslip";
|
|||||||
import * as channel from "./channel";
|
import * as channel from "./channel";
|
||||||
import * as emoji_picker from "./emoji_picker";
|
import * as emoji_picker from "./emoji_picker";
|
||||||
import {$t} from "./i18n";
|
import {$t} from "./i18n";
|
||||||
import * as login_to_access from "./login_to_access";
|
|
||||||
import * as message_lists from "./message_lists";
|
import * as message_lists from "./message_lists";
|
||||||
import * as message_store from "./message_store";
|
import * as message_store from "./message_store";
|
||||||
import {page_params} from "./page_params";
|
import {page_params} from "./page_params";
|
||||||
import * as people from "./people";
|
import * as people from "./people";
|
||||||
|
import * as spectators from "./spectators";
|
||||||
import {user_settings} from "./user_settings";
|
import {user_settings} from "./user_settings";
|
||||||
|
|
||||||
export const view = {}; // function namespace
|
export const view = {}; // function namespace
|
||||||
@@ -114,7 +114,7 @@ export function process_reaction_click(message_id, local_id) {
|
|||||||
if (page_params.is_spectator) {
|
if (page_params.is_spectator) {
|
||||||
// Spectators can't react, since they don't have accounts. We
|
// Spectators can't react, since they don't have accounts. We
|
||||||
// stop here to avoid a confusing reaction local echo.
|
// stop here to avoid a confusing reaction local echo.
|
||||||
login_to_access.show();
|
spectators.login_to_access();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import render_login_to_access_modal from "../templates/login_to_access.hbs";
|
|||||||
import * as hash_util from "./hash_util";
|
import * as hash_util from "./hash_util";
|
||||||
import {page_params} from "./page_params";
|
import {page_params} from "./page_params";
|
||||||
|
|
||||||
export function show() {
|
export function login_to_access() {
|
||||||
// Hide all overlays, popover and go back to the previous hash if the
|
// Hide all overlays, popover and go back to the previous hash if the
|
||||||
// hash has changed.
|
// hash has changed.
|
||||||
let login_link;
|
let login_link;
|
||||||
@@ -84,7 +84,7 @@ EXEMPT_FILES = {
|
|||||||
"static/js/loading.ts",
|
"static/js/loading.ts",
|
||||||
"static/js/local_message.js",
|
"static/js/local_message.js",
|
||||||
"static/js/localstorage.js",
|
"static/js/localstorage.js",
|
||||||
"static/js/login_to_access.js",
|
"static/js/spectators.js",
|
||||||
"static/js/message_edit.js",
|
"static/js/message_edit.js",
|
||||||
"static/js/message_edit_history.js",
|
"static/js/message_edit_history.js",
|
||||||
"static/js/message_events.js",
|
"static/js/message_events.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user