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.

hotspots: Add 'type' field to objects in 'hotspots' array.

Prakhar Pratyushdf379b5e866d
diff --git a/zerver/lib/event_schema.py b/zerver/lib/event_schema.py
index a8e9fa80690..0152c9f4e98 100644
--- a/zerver/lib/event_schema.py
+++ b/zerver/lib/event_schema.py
@@ -334,6 +334,7 @@ def check_heartbeat(
_hotspot = DictType(
required_keys=[
+ ("type", str),
("name", str),
("title", str),
("description", str),
diff --git a/zerver/lib/hotspots.py b/zerver/lib/hotspots.py
index cf1ad7539e9..0febb7ad7a8 100644
--- a/zerver/lib/hotspots.py
+++ b/zerver/lib/hotspots.py
@@ -19,6 +19,7 @@ class Hotspot:
def to_dict(self, delay: float = 0) -> Dict[str, Union[str, float, bool]]:
return {
+ "type": "hotspot",
"name": self.name,
"title": str(self.title),
"description": str(self.description),
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 56b876ff947..fc8ead919dd 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -2298,6 +2298,7 @@ paths:
"hotspots":
[
{
+ "type": "hotspot",
"name": "intro_streams",
"title": "Catch up on a stream",
"description": "Messages sent to a stream are seen by everyone subscribed to that stream. Try clicking on one of the stream links below.",
@@ -18557,10 +18558,11 @@ components:
description: |
Dictionary containing details of a single hotspot.
properties:
- delay:
- type: number
+ type:
+ type: string
description: |
- The delay after which the user should be shown the hotspot.
+ The type of the onboarding step. Valid values are either
+ 'hotspot' or 'one_time_notice'.
name:
type: string
description: |
@@ -18574,6 +18576,10 @@ components:
description: |
The description of the hotspot, as will be displayed to the
user.
+ delay:
+ type: number
+ description: |
+ The delay after which the user should be shown the hotspot.
has_trigger:
type: boolean
description: |