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.

zulip_logo: Remove custom click handling.

Aman Agrawalce3f1355e1b1
diff --git a/frontend_tests/puppeteer_tests/02-message-basics.ts b/frontend_tests/puppeteer_tests/02-message-basics.ts
index b5f909f0ef9..5e731707f94 100644
--- a/frontend_tests/puppeteer_tests/02-message-basics.ts
+++ b/frontend_tests/puppeteer_tests/02-message-basics.ts
@@ -85,6 +85,11 @@ async function un_narrow_by_clicking_org_icon(page: Page): Promise<void> {
await page.click(".brand");
}
+async function expect_recent_topics(page: Page): Promise<void> {
+ await page.waitForSelector("#recent_topics_table", {visible: true});
+ assert.strictEqual(await page.title(), "Home - Zulip Dev - Zulip");
+}
+
async function test_navigations_from_home(page: Page): Promise<void> {
console.log("Narrowing by clicking stream");
await page.evaluate(() => $(`*[title='Narrow to stream "Verona"']`).trigger("click"));
@@ -98,7 +103,7 @@ async function test_navigations_from_home(page: Page): Promise<void> {
await page.click('*[title="Narrow to stream \\"Verona\\", topic \\"test\\""]');
await expect_verona_stream_test_topic(page);
- await un_narrow_by_clicking_org_icon(page);
+ await un_narrow(page);
await expect_home(page);
console.log("Narrowing by clicking group personal header");
@@ -109,8 +114,14 @@ async function test_navigations_from_home(page: Page): Promise<void> {
);
await expect_huddle(page);
- await un_narrow_by_clicking_org_icon(page);
+ await un_narrow(page);
await expect_home(page);
+
+ await page.evaluate(() =>
+ $('*[title="Narrow to your private messages with Cordelia Lear, King Hamlet"]').click(),
+ );
+ await un_narrow_by_clicking_org_icon(page);
+ await expect_recent_topics(page);
}
async function search_and_check(
diff --git a/static/js/click_handlers.js b/static/js/click_handlers.js
index 26816250a62..1f1c24d0a40 100644
--- a/static/js/click_handlers.js
+++ b/static/js/click_handlers.js
@@ -580,18 +580,6 @@ exports.initialize = function () {
$(e.currentTarget).tooltip("destroy");
});
- // HOME
-
- $(".brand").on("click", (e) => {
- if (overlays.is_active()) {
- overlays.close_active();
- } else {
- narrow.restore_home_state();
- }
- navigate.maybe_scroll_to_selected();
- e.preventDefault();
- });
-
// MISC
(function () {
diff --git a/static/js/narrow.js b/static/js/narrow.js
index 37acbff4bf1..3365dd36a9a 100644
--- a/static/js/narrow.js
+++ b/static/js/narrow.js
@@ -867,17 +867,6 @@ exports.deactivate = function (coming_from_recent_topics = false) {
});
};
-exports.restore_home_state = function () {
- // If we click on the All messages link while already at All messages, unnarrow.
- // If we click on the All messages link from another nav pane, just go
- // back to the state you were in (possibly still narrowed) before
- // you left the All messages pane.
- if (!overlays.is_active()) {
- exports.deactivate();
- }
- navigate.maybe_scroll_to_selected();
-};
-
function set_invalid_narrow_message(invalid_narrow_message) {
const search_string_display = $("#empty_search_stop_words_string");
search_string_display.text(invalid_narrow_message);