Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
hotspots: Remove intro_reply hotspot.
Nikhil Maske091772b53401
diff --git a/static/js/click_handlers.js b/static/js/click_handlers.jsindex 7224102c762..b4d962eb647 100644--- a/static/js/click_handlers.js+++ b/static/js/click_handlers.js@@ -800,15 +800,6 @@ export function initialize() {$(`#hotspot_${CSS.escape(hotspot_name)}_icon`).remove();});- $("body").on("click", ".hotspot-button", (e) => {- e.preventDefault();- e.stopPropagation();-- hotspots.post_hotspot_as_read("intro_reply");- hotspots.close_hotspot_icon($("#hotspot_intro_reply_icon"));- $("#hotspot_intro_reply_icon").remove();- });-// stop propagation$("body").on("click", ".hotspot.overlay .hotspot-popover", (e) => {e.stopPropagation();diff --git a/static/js/hotspots.js b/static/js/hotspots.jsindex 6c24f3fb77d..002d5dab3d9 100644--- a/static/js/hotspots.js+++ b/static/js/hotspots.js@@ -3,7 +3,6 @@ import _ from "lodash";import render_hotspot_icon from "../templates/hotspot_icon.hbs";import render_hotspot_overlay from "../templates/hotspot_overlay.hbs";-import render_intro_reply_hotspot from "../templates/intro_reply_hotspot.hbs";import * as blueslip from "./blueslip";import * as channel from "./channel";@@ -21,15 +20,6 @@ const VIEWPORT_CENTER = "viewport_center";// popover orientation can optionally be fixed here (property: popover),// otherwise popovers.compute_placement is used to compute orientationconst HOTSPOT_LOCATIONS = new Map([- [- "intro_reply",- {- element: ".selected_message .messagebox-content",- offset_x: 0.85,- offset_y: 0.7,- popover: BOTTOM,- },- ],["intro_streams",{@@ -213,11 +203,6 @@ function place_popover(hotspot) {}function insert_hotspot_into_DOM(hotspot) {- if (hotspot.name === "intro_reply") {- $("#bottom_whitespace").append(render_intro_reply_hotspot({}));- return;- }-const hotspot_overlay_HTML = render_hotspot_overlay({name: hotspot.name,title: hotspot.title,diff --git a/static/styles/dark_theme.css b/static/styles/dark_theme.cssindex cd021de4e8b..91dc811d999 100644--- a/static/styles/dark_theme.css+++ b/static/styles/dark_theme.css@@ -968,8 +968,7 @@ body.dark-theme {}/* Popover: */- .hotspot.overlay .hotspot-popover,- #hotspot_intro_reply_icon {+ .hotspot.overlay .hotspot-popover {border-color: hsla(0, 0%, 0%, 0.2) !important;/* Based on the `.hotspot-popover` shadow in `hotspots.css`, but with a newcolor. */@@ -1038,7 +1037,6 @@ body.dark-theme {/* Content: */.hotspot.overlay .hotspot-popover .hotspot-popover-content,- #hotspot_intro_reply_icon,.hotspot.overlay .hotspot-popover .hotspot-popover-bottom {background-color: hsl(212, 28%, 18%);}diff --git a/static/styles/hotspots.css b/static/styles/hotspots.cssindex a19e33a1f76..2d4219afa0e 100644--- a/static/styles/hotspots.css+++ b/static/styles/hotspots.css@@ -243,52 +243,3 @@#hotspot_intro_gear_icon {z-index: 103;}--.hotspot-inline {- width: 350px;- max-width: 95%;- box-shadow: 0 5px 10px hsla(220, 4%, 54%, 0.1);- border-radius: 4px;- background-color: hsl(0, 0%, 98%);- margin: 0 auto;- position: relative;-- .hotspot-img {- margin-left: 5px;- }-- .hotspot-confirm {- display: block;- }-- .hotspot-inline-top .hotspot-title {- background-color: hsl(168, 100%, 35%);- margin: 0;- color: hsl(0, 0%, 100%);- font-weight: 600;- line-height: 24px;- padding: 5px 13px;- font-size: 1.15em;- border-top-left-radius: 4px;- border-top-right-radius: 4px;- }-- .hotspot-inline-left {- display: inline-block;- width: 90px;- }-- .hotspot-inline-right {- display: inline-block;- width: auto;- margin-left: 10px;- vertical-align: middle;- }-}--#hotspot_intro_reply_icon {- position: relative;- background-color: hsl(0, 0%, 100%);- top: 50%;- transform: perspective(1px) translateY(-75%);-}diff --git a/static/templates/intro_reply_hotspot.hbs b/static/templates/intro_reply_hotspot.hbsdeleted file mode 100644index 310d3311ae1..00000000000--- a/static/templates/intro_reply_hotspot.hbs+++ /dev/null@@ -1,10 +0,0 @@-<div class="hotspot-inline trailing_bookend bookend hotspot-message" id="hotspot_intro_reply_icon">- <div class="hotspot-inline-top"><h1 class="hotspot-title">Send a reply</h1></div>- <div class="hotspot-inline-left">- <img class="hotspot-img" alt="" src="/static/images/hotspots/whale.svg" />- </div>- <div class="hotspot-inline-right">- <p>{{t 'Click anywhere on a message to reply.' }}</p>- <button class="hotspot-button hotspot-confirm" type="button">{{t 'Got it!' }}</button>- </div>-</div>diff --git a/zerver/lib/hotspots.py b/zerver/lib/hotspots.pyindex dba8e09df78..7066411cb4e 100644--- a/zerver/lib/hotspots.py+++ b/zerver/lib/hotspots.py@@ -9,10 +9,6 @@ from django.utils.translation import gettext_lazyfrom zerver.models import UserHotspot, UserProfileINTRO_HOTSPOTS: Dict[str, Dict[str, Promise]] = {- "intro_reply": {- "title": gettext_lazy("Reply to a message"),- "description": gettext_lazy("Click anywhere on a message to reply."),- },"intro_streams": {"title": gettext_lazy("Catch up on a stream"),"description": gettext_lazy(diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.pyindex 6a78ff90397..f8cdca659f1 100644--- a/zerver/tests/test_events.py+++ b/zerver/tests/test_events.py@@ -1806,7 +1806,7 @@ class NormalActionsTest(BaseAction):self.user_profile.save(update_fields=["tutorial_status"])events = self.verify_action(- lambda: do_mark_hotspot_as_read(self.user_profile, "intro_reply")+ lambda: do_mark_hotspot_as_read(self.user_profile, "intro_streams"))check_hotspots("events[0]", events[0])diff --git a/zerver/tests/test_hotspots.py b/zerver/tests/test_hotspots.pyindex 0927a54da7b..27cf2693d32 100644--- a/zerver/tests/test_hotspots.py+++ b/zerver/tests/test_hotspots.py@@ -16,14 +16,14 @@ class TestGetNextHotspots(ZulipTestCase):def test_first_hotspot(self) -> None:hotspots = get_next_hotspots(self.user)self.assert_length(hotspots, 1)- self.assertEqual(hotspots[0]["name"], "intro_reply")+ self.assertEqual(hotspots[0]["name"], "intro_streams")def test_some_done_some_not(self) -> None:- do_mark_hotspot_as_read(self.user, "intro_reply")+ do_mark_hotspot_as_read(self.user, "intro_streams")do_mark_hotspot_as_read(self.user, "intro_compose")hotspots = get_next_hotspots(self.user)self.assert_length(hotspots, 1)- self.assertEqual(hotspots[0]["name"], "intro_streams")+ self.assertEqual(hotspots[0]["name"], "intro_topics")def test_all_intro_hotspots_done(self) -> None:with self.settings(TUTORIAL_ENABLED=True):@@ -54,16 +54,16 @@ class TestHotspots(ZulipTestCase):def test_hotspots_url_endpoint(self) -> None:user = self.example_user("hamlet")self.login_user(user)- result = self.client_post("/json/users/me/hotspots", {"hotspot": "intro_reply"})+ result = self.client_post("/json/users/me/hotspots", {"hotspot": "intro_streams"})self.assert_json_success(result)self.assertEqual(list(UserHotspot.objects.filter(user=user).values_list("hotspot", flat=True)),- ["intro_reply"],+ ["intro_streams"],)result = self.client_post("/json/users/me/hotspots", {"hotspot": "invalid"})self.assert_json_error(result, "Unknown hotspot: invalid")self.assertEqual(list(UserHotspot.objects.filter(user=user).values_list("hotspot", flat=True)),- ["intro_reply"],+ ["intro_streams"],)diff --git a/zerver/tests/test_users.py b/zerver/tests/test_users.pyindex 26b112e2163..23198d2e77a 100644--- a/zerver/tests/test_users.py+++ b/zerver/tests/test_users.py@@ -1178,7 +1178,7 @@ class UserProfileTest(ZulipTestCase):UserHotspot.objects.filter(user=cordelia).delete()UserHotspot.objects.filter(user=iago).delete()- hotspots_completed = {"intro_reply", "intro_streams", "intro_topics"}+ hotspots_completed = {"intro_streams", "intro_topics"}for hotspot in hotspots_completed:UserHotspot.objects.create(user=cordelia, hotspot=hotspot)