@thoughtspot/visual-embed-sdk 1.50.1 → 1.51.0-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/config.d.ts +1 -0
- package/cjs/src/config.d.ts.map +1 -1
- package/cjs/src/config.js +2 -1
- package/cjs/src/config.js.map +1 -1
- package/cjs/src/css-variables.d.ts +63 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +148 -25
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +74 -37
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +571 -150
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts +1 -1
- package/cjs/src/embed/base.js +1 -1
- package/cjs/src/embed/conversation.d.ts +375 -2
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +21 -15
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +323 -17
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +45 -0
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/host-events.spec.js +81 -0
- package/cjs/src/embed/host-events.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +15 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +1 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +1 -0
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +27 -0
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +76 -14
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +50 -9
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +432 -4
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +15 -1
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-utils.js +28 -1
- package/cjs/src/embed/spotter-utils.js.map +1 -1
- package/cjs/src/embed/spotter-utils.spec.js +129 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.d.ts +9 -10
- package/cjs/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +16 -8
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +82 -30
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +537 -3
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +3 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -2
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts +4 -0
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +4 -0
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/all-types-export.parity.spec.d.ts +2 -0
- package/cjs/src/react/all-types-export.parity.spec.d.ts.map +1 -0
- package/cjs/src/react/all-types-export.parity.spec.js +194 -0
- package/cjs/src/react/all-types-export.parity.spec.js.map +1 -0
- package/cjs/src/react/index.d.ts +66 -32
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +5 -3
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +101 -0
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +789 -32
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +610 -20
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.spec.js +4 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-fCne7kmU.js → index-Bivg-mDx.js} +1 -1
- package/dist/src/config.d.ts +1 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +63 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +148 -25
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +1 -1
- package/dist/src/embed/conversation.d.ts +375 -2
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +15 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +76 -14
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +15 -1
- package/dist/src/embed/spotter-utils.d.ts.map +1 -1
- package/dist/src/embed/spotter-viz-utils.d.ts +9 -10
- package/dist/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +16 -8
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts +4 -0
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/all-types-export.parity.spec.d.ts +2 -0
- package/dist/src/react/all-types-export.parity.spec.d.ts.map +1 -0
- package/dist/src/react/index.d.ts +66 -32
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +789 -32
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +878 -120
- package/dist/tsembed-react.js +877 -119
- package/dist/tsembed.es.js +936 -181
- package/dist/tsembed.js +938 -183
- package/dist/visual-embed-sdk-react-full.d.ts +1553 -128
- package/dist/visual-embed-sdk-react.d.ts +1555 -129
- package/dist/visual-embed-sdk.d.ts +1499 -100
- package/lib/package.json +1 -1
- package/lib/src/config.d.ts +1 -0
- package/lib/src/config.d.ts.map +1 -1
- package/lib/src/config.js +1 -0
- package/lib/src/config.js.map +1 -1
- package/lib/src/css-variables.d.ts +63 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +148 -25
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +75 -38
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +572 -151
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -1
- package/lib/src/embed/base.js +1 -1
- package/lib/src/embed/conversation.d.ts +375 -2
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +23 -17
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +323 -17
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +45 -0
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/host-events.spec.js +81 -0
- package/lib/src/embed/host-events.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +15 -0
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +1 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +1 -0
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +27 -0
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +76 -14
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +50 -9
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +432 -4
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +15 -1
- package/lib/src/embed/spotter-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-utils.js +25 -0
- package/lib/src/embed/spotter-utils.js.map +1 -1
- package/lib/src/embed/spotter-utils.spec.js +130 -1
- package/lib/src/embed/spotter-utils.spec.js.map +1 -1
- package/lib/src/embed/spotter-viz-utils.d.ts +9 -10
- package/lib/src/embed/spotter-viz-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-viz-utils.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +16 -8
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +82 -30
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +537 -3
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +3 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts +4 -0
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +4 -0
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/all-types-export.parity.spec.d.ts +2 -0
- package/lib/src/react/all-types-export.parity.spec.d.ts.map +1 -0
- package/lib/src/react/all-types-export.parity.spec.js +191 -0
- package/lib/src/react/all-types-export.parity.spec.js.map +1 -0
- package/lib/src/react/index.d.ts +66 -32
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +5 -3
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +102 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +789 -32
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +610 -20
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.spec.js +4 -0
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +1499 -100
- package/package.json +1 -1
- package/src/config.ts +1 -0
- package/src/css-variables.ts +77 -0
- package/src/embed/app.spec.ts +729 -188
- package/src/embed/app.ts +240 -75
- package/src/embed/base.ts +1 -1
- package/src/embed/conversation.spec.ts +379 -20
- package/src/embed/conversation.ts +412 -18
- package/src/embed/events.spec.ts +56 -0
- package/src/embed/host-events.spec.ts +118 -0
- package/src/embed/hostEventClient/contracts.ts +16 -0
- package/src/embed/hostEventClient/host-event-client.spec.ts +46 -0
- package/src/embed/hostEventClient/host-event-client.ts +3 -2
- package/src/embed/liveboard.spec.ts +565 -4
- package/src/embed/liveboard.ts +150 -29
- package/src/embed/spotter-utils.spec.ts +140 -1
- package/src/embed/spotter-utils.ts +36 -1
- package/src/embed/spotter-viz-utils.ts +9 -10
- package/src/embed/ts-embed.spec.ts +699 -3
- package/src/embed/ts-embed.ts +99 -35
- package/src/index.ts +44 -2
- package/src/mixpanel-service.ts +4 -0
- package/src/react/all-types-export.parity.spec.ts +208 -0
- package/src/react/all-types-export.ts +22 -0
- package/src/react/index.spec.tsx +158 -0
- package/src/react/index.tsx +70 -33
- package/src/types.ts +791 -30
- package/src/utils.spec.ts +5 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import isUndefined from 'lodash/isUndefined';
|
|
2
|
-
import { ERROR_MESSAGE } from '../errors';
|
|
3
1
|
import { Param, BaseViewConfig, RuntimeFilter, RuntimeParameter, ErrorDetailsTypes, EmbedErrorCodes, DefaultAppInitData, VisualizationOverrides, SpotterFileUploadFileTypes } from '../types';
|
|
4
2
|
import { TsEmbed } from './ts-embed';
|
|
5
|
-
import { buildSpotterSidebarAppInitData } from './spotter-utils';
|
|
3
|
+
import { buildSpotterSidebarAppInitData, buildSpotterShareConversationAppInitData, buildStarterPromptsAppInitData } from './spotter-utils';
|
|
6
4
|
import { getQueryParamString, getFilterQuery, getRuntimeParameters, setParamIfDefined } from '../utils';
|
|
7
5
|
|
|
8
6
|
/**
|
|
@@ -24,6 +22,38 @@ export enum SpotterQueryMode {
|
|
|
24
22
|
RESEARCH = 'research',
|
|
25
23
|
}
|
|
26
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for the pin/unpin conversation feature in the Spotter sidebar.
|
|
27
|
+
* Grouped into one object because pin exposes several related settings
|
|
28
|
+
* (enable + label overrides), unlike single-item actions like rename or
|
|
29
|
+
* delete.
|
|
30
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
31
|
+
*/
|
|
32
|
+
export interface SpotterChatPinConfig {
|
|
33
|
+
/**
|
|
34
|
+
* Enables the pin/unpin conversation feature in embedded Spotter. Disabled
|
|
35
|
+
* by default — hosts must opt in. When off, the Pin/Unpin menu entry and
|
|
36
|
+
* the pin glyph are hidden and the PinSpotterConversation /
|
|
37
|
+
* UnpinSpotterConversation host events are no-ops. Native (non-embedded)
|
|
38
|
+
* Spotter is unaffected and ships pin enabled.
|
|
39
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
enabled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Custom label text for the pin action in the conversation edit menu.
|
|
45
|
+
* Defaults to translated "Pin" text.
|
|
46
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
47
|
+
*/
|
|
48
|
+
pinLabel?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Custom label text for the unpin action in the conversation edit menu.
|
|
51
|
+
* Defaults to translated "Unpin" text.
|
|
52
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
53
|
+
*/
|
|
54
|
+
unpinLabel?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
27
57
|
/**
|
|
28
58
|
* Configuration for the Spotter sidebar.
|
|
29
59
|
* Can be used in SpotterEmbed and AppEmbed.
|
|
@@ -61,6 +91,12 @@ export interface SpotterSidebarViewConfig {
|
|
|
61
91
|
* @version SDK: 1.47.0 | ThoughtSpot: 26.4.0.cl
|
|
62
92
|
*/
|
|
63
93
|
spotterChatDeleteLabel?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Pin/unpin conversation feature config (enable + label overrides).
|
|
96
|
+
* Off by default in embed — hosts opt in via `enabled`.
|
|
97
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
98
|
+
*/
|
|
99
|
+
spotterChatPinConfig?: SpotterChatPinConfig;
|
|
64
100
|
/**
|
|
65
101
|
* Custom title text for the delete conversation confirmation modal.
|
|
66
102
|
* Defaults to translated "Delete chat" text.
|
|
@@ -112,6 +148,170 @@ export interface SpotterSidebarViewConfig {
|
|
|
112
148
|
spotterAnalystsLabel?: string;
|
|
113
149
|
}
|
|
114
150
|
|
|
151
|
+
/**
|
|
152
|
+
* Configuration for the Spotter conversation sharing feature.
|
|
153
|
+
* Can be used in SpotterEmbed and AppEmbed.
|
|
154
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
155
|
+
* @group Embed components
|
|
156
|
+
*/
|
|
157
|
+
export interface SpotterShareConversationConfig {
|
|
158
|
+
/**
|
|
159
|
+
* Enables sharing of the conversation.
|
|
160
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
161
|
+
* @default false
|
|
162
|
+
*/
|
|
163
|
+
enableShareConversation?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Header Share button + sidebar Share item label.
|
|
166
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
167
|
+
* @default "Share"
|
|
168
|
+
*/
|
|
169
|
+
spotterShareLabel?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Share modal title.
|
|
172
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
173
|
+
*/
|
|
174
|
+
spotterShareModalTitle?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Modal confirm button label.
|
|
177
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
178
|
+
* @default "Share"
|
|
179
|
+
*/
|
|
180
|
+
spotterShareConfirmLabel?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Modal cancel button label.
|
|
183
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
184
|
+
* @default "Cancel"
|
|
185
|
+
*/
|
|
186
|
+
spotterShareCancelLabel?: string;
|
|
187
|
+
/**
|
|
188
|
+
* "Add users or groups" label.
|
|
189
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
190
|
+
*/
|
|
191
|
+
spotterShareAddUsersLabel?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Empty-state title ("No users added yet").
|
|
194
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
195
|
+
*/
|
|
196
|
+
spotterShareEmptyTitle?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Empty-state subtitle ("Not shared with any user").
|
|
199
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
200
|
+
*/
|
|
201
|
+
spotterShareEmptySubtitle?: string;
|
|
202
|
+
/**
|
|
203
|
+
* "Include new messages since last shared version" checkbox label.
|
|
204
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
205
|
+
*/
|
|
206
|
+
spotterShareIncludeNewMessagesLabel?: string;
|
|
207
|
+
/**
|
|
208
|
+
* Footer note when the snapshot is current ("…up to the current moment…").
|
|
209
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
210
|
+
*/
|
|
211
|
+
spotterShareUpToCurrentLabel?: string;
|
|
212
|
+
/**
|
|
213
|
+
* Stale-snapshot info banner text ("All added users and groups will receive…").
|
|
214
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
215
|
+
*/
|
|
216
|
+
spotterShareStaleInfoLabel?: string;
|
|
217
|
+
/**
|
|
218
|
+
* Read-only shared-view data-access banner message.
|
|
219
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
220
|
+
*/
|
|
221
|
+
spotterSharedConversationBannerMessage?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Read-only shared-view Exit button label.
|
|
224
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
225
|
+
* @default "Exit"
|
|
226
|
+
*/
|
|
227
|
+
spotterSharedConversationExitLabel?: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* A single starter prompt question shown under a category pill.
|
|
232
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
233
|
+
* @group Embed components
|
|
234
|
+
*/
|
|
235
|
+
export interface StarterPromptQuestion {
|
|
236
|
+
/**
|
|
237
|
+
* Short label shown as a clickable suggestion. Falls back to `prompt` when
|
|
238
|
+
* omitted. ThoughtSpot truncates it beyond 80 characters.
|
|
239
|
+
*/
|
|
240
|
+
label?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Prompt text sent to Spotter on click. ThoughtSpot truncates it beyond
|
|
243
|
+
* 300 characters.
|
|
244
|
+
*/
|
|
245
|
+
prompt: string;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Configuration for a starter prompt category with questions
|
|
250
|
+
* (`quick` and `research`).
|
|
251
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
252
|
+
* @group Embed components
|
|
253
|
+
*/
|
|
254
|
+
export interface StarterPromptCategory {
|
|
255
|
+
/**
|
|
256
|
+
* Overrides the default category pill label. ThoughtSpot truncates it
|
|
257
|
+
* beyond 30 characters.
|
|
258
|
+
*/
|
|
259
|
+
label?: string;
|
|
260
|
+
/**
|
|
261
|
+
* Replaces the backend-generated prompts. ThoughtSpot renders the first 4
|
|
262
|
+
* and drops any entry without a `prompt`.
|
|
263
|
+
*/
|
|
264
|
+
questions?: StarterPromptQuestion[];
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Configuration for the Data Literacy starter prompt category.
|
|
269
|
+
* Only the label is customizable; the prompt text comes from the backend.
|
|
270
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
271
|
+
* @group Embed components
|
|
272
|
+
*/
|
|
273
|
+
export interface StarterPreviewDataCategory {
|
|
274
|
+
/**
|
|
275
|
+
* Overrides the default category pill label. ThoughtSpot truncates it
|
|
276
|
+
* beyond 30 characters.
|
|
277
|
+
*/
|
|
278
|
+
label?: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Content configuration for the Spotter starter prompts.
|
|
283
|
+
* Keys are fixed: `quick` (Basic Search), `research` (Deep Analysis),
|
|
284
|
+
* `previewData` (Data Literacy) and `liveboard` (Liveboard chat panel).
|
|
285
|
+
*
|
|
286
|
+
* Note: this controls the Spotter chat interface only. The starter prompts on
|
|
287
|
+
* the Liveboard SpotterViz surface are configured separately through
|
|
288
|
+
* {@link SpotterVizConfig.customStarterPrompts}.
|
|
289
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
290
|
+
* @group Embed components
|
|
291
|
+
*/
|
|
292
|
+
export interface StarterPromptsConfig {
|
|
293
|
+
/**
|
|
294
|
+
* Turns the starter prompts surface on. Must be set explicitly, an
|
|
295
|
+
* unset flag leaves the surface off.
|
|
296
|
+
*
|
|
297
|
+
* Either this or `enableStarterPrompts` turns the surface on, so `false`
|
|
298
|
+
* here does not switch it off while `enableStarterPrompts` is `true`.
|
|
299
|
+
* @default false
|
|
300
|
+
*/
|
|
301
|
+
enable?: boolean;
|
|
302
|
+
/** Basic Search category configuration. */
|
|
303
|
+
quick?: StarterPromptCategory;
|
|
304
|
+
/** Deep Analysis category configuration. */
|
|
305
|
+
research?: StarterPromptCategory;
|
|
306
|
+
/** Data Literacy category configuration. */
|
|
307
|
+
previewData?: StarterPreviewDataCategory;
|
|
308
|
+
/**
|
|
309
|
+
* Starter prompts for the Spotter chat panel on a Liveboard.
|
|
310
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
311
|
+
*/
|
|
312
|
+
liveboard?: StarterPromptQuestion[];
|
|
313
|
+
}
|
|
314
|
+
|
|
115
315
|
/**
|
|
116
316
|
* Configuration for customizing Spotter chat UI branding.
|
|
117
317
|
* @version SDK: 1.46.0 | ThoughtSpot: 26.4.0.cl
|
|
@@ -152,11 +352,84 @@ export interface SpotterChatViewConfig {
|
|
|
152
352
|
/**
|
|
153
353
|
* Enables starter prompts in the Spotter chat interface.
|
|
154
354
|
*
|
|
155
|
-
*
|
|
355
|
+
* Either this or `starterPrompts.enable` turns the surface on, so it stays
|
|
356
|
+
* on while this is `true` even if `starterPrompts.enable` is `false`.
|
|
357
|
+
*
|
|
358
|
+
* Supported embed types: `SpotterEmbed`, `LiveboardEmbed`, `AppEmbed`
|
|
156
359
|
* @version SDK: 1.51.0 | ThoughtSpot: 26.8.0.cl
|
|
157
360
|
* @default false
|
|
158
361
|
*/
|
|
159
362
|
enableStarterPrompts?: boolean;
|
|
363
|
+
/**
|
|
364
|
+
* Customizes the labels and questions of the Spotter starter prompts.
|
|
365
|
+
* Individual pills are hidden or shown with `hiddenActions` /
|
|
366
|
+
* `visibleActions` using `Action.QuickSearchPill`,
|
|
367
|
+
* `Action.DeepAnalysisPill` and `Action.DataLiteracyPill`.
|
|
368
|
+
*
|
|
369
|
+
* Supported embed types: `SpotterEmbed`, `LiveboardEmbed`, `AppEmbed`
|
|
370
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
371
|
+
* @example
|
|
372
|
+
* ```js
|
|
373
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
374
|
+
* worksheetId: 'worksheet-id',
|
|
375
|
+
* hiddenActions: [Action.DeepAnalysisPill],
|
|
376
|
+
* spotterChatConfig: {
|
|
377
|
+
* starterPrompts: {
|
|
378
|
+
* enable: true,
|
|
379
|
+
* quick: {
|
|
380
|
+
* label: 'Quick questions',
|
|
381
|
+
* questions: [
|
|
382
|
+
* { label: 'Top products', prompt: 'What are the top products by revenue?' },
|
|
383
|
+
* ],
|
|
384
|
+
* },
|
|
385
|
+
* previewData: { label: 'Explore your data' },
|
|
386
|
+
* },
|
|
387
|
+
* },
|
|
388
|
+
* })
|
|
389
|
+
* ```
|
|
390
|
+
*/
|
|
391
|
+
starterPrompts?: StarterPromptsConfig;
|
|
392
|
+
/**
|
|
393
|
+
* Opens the Spotter chat panel when the Liveboard loads.
|
|
394
|
+
*
|
|
395
|
+
* Supported embed types: `LiveboardEmbed`, `AppEmbed`
|
|
396
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
397
|
+
* @default true
|
|
398
|
+
* @example
|
|
399
|
+
* ```js
|
|
400
|
+
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
401
|
+
* liveboardId: 'liveboard-id',
|
|
402
|
+
* spotterChatConfig: {
|
|
403
|
+
* openSpotterOnLiveboardByDefault: false,
|
|
404
|
+
* },
|
|
405
|
+
* })
|
|
406
|
+
* ```
|
|
407
|
+
*/
|
|
408
|
+
openSpotterOnLiveboardByDefault?: boolean;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Configuration for the Spotter Analyst experience.
|
|
413
|
+
* Can be used in SpotterEmbed.
|
|
414
|
+
* @group Embed components
|
|
415
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
416
|
+
* @example
|
|
417
|
+
* ```js
|
|
418
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
419
|
+
* ... //other embed view config
|
|
420
|
+
* spotterAnalystConfig: {
|
|
421
|
+
* analystId: 'analyst-id-1234',
|
|
422
|
+
* },
|
|
423
|
+
* })
|
|
424
|
+
* ```
|
|
425
|
+
*/
|
|
426
|
+
export interface SpotterAnalystConfig {
|
|
427
|
+
/**
|
|
428
|
+
* Pins the embed to a single spotter analyst. Implies no default Spotter
|
|
429
|
+
* and no "Show all".
|
|
430
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
431
|
+
*/
|
|
432
|
+
analystId?: string;
|
|
160
433
|
}
|
|
161
434
|
|
|
162
435
|
/**
|
|
@@ -167,8 +440,43 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
|
|
|
167
440
|
/**
|
|
168
441
|
* The ID of the data source object. For example, Model, View, or Table. Spotter uses
|
|
169
442
|
* this object to query data and generate Answers.
|
|
443
|
+
* This field is optional. If not provided, Spotter loads using the
|
|
444
|
+
* previously selected user data source.
|
|
445
|
+
*/
|
|
446
|
+
worksheetId?: string;
|
|
447
|
+
/**
|
|
448
|
+
* The array of data source GUIDs to set on load. Spotter uses
|
|
449
|
+
* these GUIDs to query data and generate Answers.
|
|
450
|
+
* dataSources is preferred over worksheetId if both are provided.
|
|
451
|
+
* The feature is currently behind a feature flag.
|
|
452
|
+
*
|
|
453
|
+
* Supported embed types: `SpotterEmbed`
|
|
454
|
+
* @example
|
|
455
|
+
* ```js
|
|
456
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
457
|
+
* // ...other embed view config
|
|
458
|
+
* dataSources: ['id-2345', 'id-2345'],
|
|
459
|
+
* });
|
|
460
|
+
* ```
|
|
461
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
462
|
+
*/
|
|
463
|
+
dataSources?: string[];
|
|
464
|
+
/**
|
|
465
|
+
* Configuration for the Spotter Analyst experience.
|
|
466
|
+
*
|
|
467
|
+
* Supported embed types: `SpotterEmbed`
|
|
468
|
+
* @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
|
|
469
|
+
* @example
|
|
470
|
+
* ```js
|
|
471
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
472
|
+
* ... //other embed view config
|
|
473
|
+
* spotterAnalystConfig: {
|
|
474
|
+
* analystId: 'analyst-id-1234',
|
|
475
|
+
* },
|
|
476
|
+
* })
|
|
477
|
+
* ```
|
|
170
478
|
*/
|
|
171
|
-
|
|
479
|
+
spotterAnalystConfig?: SpotterAnalystConfig;
|
|
172
480
|
/**
|
|
173
481
|
* Ability to pass a starting search query to the conversation.
|
|
174
482
|
*/
|
|
@@ -328,6 +636,21 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
|
|
|
328
636
|
* ```
|
|
329
637
|
*/
|
|
330
638
|
updatedSpotterChatPrompt?: boolean;
|
|
639
|
+
/**
|
|
640
|
+
* showSpotterRadiance : Controls the radiance on the Spotter page.
|
|
641
|
+
*
|
|
642
|
+
* Supported embed types: `SpotterEmbed`
|
|
643
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
644
|
+
* @default false
|
|
645
|
+
* @example
|
|
646
|
+
* ```js
|
|
647
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
648
|
+
* ... //other embed view config
|
|
649
|
+
* showSpotterRadiance : true,
|
|
650
|
+
* })
|
|
651
|
+
* ```
|
|
652
|
+
*/
|
|
653
|
+
showSpotterRadiance?: boolean;
|
|
331
654
|
/**
|
|
332
655
|
* Sets the default query mode when Spotter loads — Fast Search or
|
|
333
656
|
* Research Mode. Applies fresh on every new session for this embed
|
|
@@ -404,6 +727,59 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
|
|
|
404
727
|
* ```
|
|
405
728
|
*/
|
|
406
729
|
spotterChatConfig?: SpotterChatViewConfig;
|
|
730
|
+
/**
|
|
731
|
+
* Configuration for the Spotter conversation sharing feature.
|
|
732
|
+
*
|
|
733
|
+
* Supported embed types: `SpotterEmbed`, `AppEmbed`
|
|
734
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
735
|
+
* @example
|
|
736
|
+
* ```js
|
|
737
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
738
|
+
* ... //other embed view config
|
|
739
|
+
* spotterShareConversationConfig: {
|
|
740
|
+
* enableShareConversation: true,
|
|
741
|
+
* },
|
|
742
|
+
* })
|
|
743
|
+
* ```
|
|
744
|
+
*/
|
|
745
|
+
spotterShareConversationConfig?: SpotterShareConversationConfig;
|
|
746
|
+
/**
|
|
747
|
+
* The ID of a shared Spotter conversation to open directly in the read-only
|
|
748
|
+
* reader view. Use this to land a share recipient in the shared conversation
|
|
749
|
+
* when they open a host-configured `CONVERSATION_URL` share link: read the
|
|
750
|
+
* `{conversation-id}` from your page URL and pass it here.
|
|
751
|
+
*
|
|
752
|
+
* Requires the Spotter conversation-sharing feature to be enabled
|
|
753
|
+
* (`spotterShareConversationConfig.enableShareConversation`). The recipient
|
|
754
|
+
* must be an authorized sharee — the server returns access-denied otherwise.
|
|
755
|
+
*
|
|
756
|
+
* Supported embed types: `SpotterEmbed`
|
|
757
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
758
|
+
* @example
|
|
759
|
+
* ```js
|
|
760
|
+
* const convId = new URLSearchParams(window.location.search).get('conversation-id');
|
|
761
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
762
|
+
* ... //other embed view config
|
|
763
|
+
* sharedConversationId: convId,
|
|
764
|
+
* })
|
|
765
|
+
* ```
|
|
766
|
+
*/
|
|
767
|
+
sharedConversationId?: string;
|
|
768
|
+
/**
|
|
769
|
+
* updatedSpotterExperience : Controls the updated Spotter experience.
|
|
770
|
+
*
|
|
771
|
+
* Supported embed types: `SpotterEmbed`
|
|
772
|
+
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
|
|
773
|
+
* @default false
|
|
774
|
+
* @example
|
|
775
|
+
* ```js
|
|
776
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
777
|
+
* ... //other embed view config
|
|
778
|
+
* updatedSpotterExperience : true,
|
|
779
|
+
* })
|
|
780
|
+
* ```
|
|
781
|
+
*/
|
|
782
|
+
updatedSpotterExperience?: boolean;
|
|
407
783
|
}
|
|
408
784
|
|
|
409
785
|
/**
|
|
@@ -422,7 +798,9 @@ export interface ConversationViewConfig extends SpotterEmbedViewConfig {}
|
|
|
422
798
|
export interface SpotterAppInitData extends DefaultAppInitData {
|
|
423
799
|
embedParams?: {
|
|
424
800
|
spotterSidebarConfig?: SpotterSidebarViewConfig;
|
|
801
|
+
spotterShareConversationConfig?: SpotterShareConversationConfig;
|
|
425
802
|
visualOverridesParams?: VisualizationOverrides | null;
|
|
803
|
+
starterPrompts?: StarterPromptsConfig;
|
|
426
804
|
};
|
|
427
805
|
}
|
|
428
806
|
|
|
@@ -466,16 +844,22 @@ export class SpotterEmbed extends TsEmbed {
|
|
|
466
844
|
*/
|
|
467
845
|
protected async getAppInitData(): Promise<SpotterAppInitData> {
|
|
468
846
|
const defaultAppInitData = await super.getAppInitData();
|
|
469
|
-
|
|
847
|
+
const sidebarInitData = buildSpotterSidebarAppInitData(
|
|
848
|
+
defaultAppInitData,
|
|
849
|
+
this.viewConfig,
|
|
850
|
+
this.handleError.bind(this),
|
|
851
|
+
);
|
|
852
|
+
const shareInitData = buildSpotterShareConversationAppInitData(sidebarInitData, this.viewConfig);
|
|
853
|
+
return buildStarterPromptsAppInitData(shareInitData, this.viewConfig);
|
|
470
854
|
}
|
|
471
855
|
|
|
472
856
|
protected getEmbedParamsObject() {
|
|
473
857
|
const {
|
|
474
|
-
worksheetId,
|
|
475
858
|
searchOptions,
|
|
476
859
|
disableSourceSelection,
|
|
477
860
|
hideSourceSelection,
|
|
478
861
|
dataPanelV2,
|
|
862
|
+
updatedSpotterExperience,
|
|
479
863
|
showSpotterLimitations,
|
|
480
864
|
hideSampleQuestions,
|
|
481
865
|
runtimeFilters,
|
|
@@ -483,19 +867,13 @@ export class SpotterEmbed extends TsEmbed {
|
|
|
483
867
|
runtimeParameters,
|
|
484
868
|
excludeRuntimeParametersfromURL,
|
|
485
869
|
updatedSpotterChatPrompt,
|
|
870
|
+
showSpotterRadiance,
|
|
486
871
|
defaultQueryMode,
|
|
487
872
|
enableStopAnswerGenerationEmbed,
|
|
488
873
|
spotterChatConfig,
|
|
874
|
+
spotterAnalystConfig,
|
|
489
875
|
} = this.viewConfig;
|
|
490
876
|
|
|
491
|
-
if (!worksheetId) {
|
|
492
|
-
this.handleError({
|
|
493
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
494
|
-
message: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
|
|
495
|
-
code: EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND,
|
|
496
|
-
error: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
877
|
const queryParams = this.getBaseQueryParams();
|
|
500
878
|
queryParams[Param.SpotterEnabled] = true;
|
|
501
879
|
|
|
@@ -506,8 +884,10 @@ export class SpotterEmbed extends TsEmbed {
|
|
|
506
884
|
setParamIfDefined(queryParams, Param.ShowSpotterLimitations, showSpotterLimitations, true);
|
|
507
885
|
setParamIfDefined(queryParams, Param.HideSampleQuestions, hideSampleQuestions, true);
|
|
508
886
|
setParamIfDefined(queryParams, Param.UpdatedSpotterChatPrompt, updatedSpotterChatPrompt, true);
|
|
887
|
+
setParamIfDefined(queryParams, Param.ShowSpotterRadiance, showSpotterRadiance, true);
|
|
509
888
|
setParamIfDefined(queryParams, Param.DefaultQueryMode, defaultQueryMode);
|
|
510
889
|
setParamIfDefined(queryParams, Param.EnableStopAnswerGenerationEmbed, enableStopAnswerGenerationEmbed, true);
|
|
890
|
+
setParamIfDefined(queryParams, Param.AnalystId, spotterAnalystConfig?.analystId);
|
|
511
891
|
|
|
512
892
|
// Handle spotterChatConfig params
|
|
513
893
|
if (spotterChatConfig) {
|
|
@@ -528,6 +908,8 @@ export class SpotterEmbed extends TsEmbed {
|
|
|
528
908
|
}
|
|
529
909
|
}
|
|
530
910
|
|
|
911
|
+
setParamIfDefined(queryParams, Param.UpdatedSpotterExperience, updatedSpotterExperience, true);
|
|
912
|
+
|
|
531
913
|
return queryParams;
|
|
532
914
|
}
|
|
533
915
|
|
|
@@ -539,8 +921,16 @@ export class SpotterEmbed extends TsEmbed {
|
|
|
539
921
|
excludeRuntimeFiltersfromURL,
|
|
540
922
|
runtimeParameters,
|
|
541
923
|
excludeRuntimeParametersfromURL,
|
|
924
|
+
sharedConversationId,
|
|
925
|
+
dataSources,
|
|
542
926
|
} = this.viewConfig;
|
|
543
|
-
|
|
927
|
+
// Deep-link into the read-only shared-conversation reader view when a
|
|
928
|
+
// shared conversation id is supplied (e.g. a recipient landing from a
|
|
929
|
+
// host-configured CONVERSATION_URL share link); otherwise the normal
|
|
930
|
+
// Spotter conversation surface.
|
|
931
|
+
const path = sharedConversationId
|
|
932
|
+
? `insights/conv-assist/s/${encodeURIComponent(sharedConversationId)}`
|
|
933
|
+
: 'insights/conv-assist';
|
|
544
934
|
const queryParams = this.getEmbedParamsObject();
|
|
545
935
|
|
|
546
936
|
let query = '';
|
|
@@ -560,8 +950,12 @@ export class SpotterEmbed extends TsEmbed {
|
|
|
560
950
|
}
|
|
561
951
|
|
|
562
952
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
563
|
-
|
|
564
|
-
|
|
953
|
+
...(!(Array.isArray(dataSources) && dataSources.length > 0) && worksheetId
|
|
954
|
+
&& { worksheet: worksheetId }),
|
|
955
|
+
...(searchOptions?.searchQuery && { query: searchOptions.searchQuery }),
|
|
956
|
+
...(Array.isArray(dataSources)
|
|
957
|
+
&& dataSources.length > 0
|
|
958
|
+
&& { dataSources: JSON.stringify(dataSources) }),
|
|
565
959
|
});
|
|
566
960
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
567
961
|
}
|
package/src/embed/events.spec.ts
CHANGED
|
@@ -82,6 +82,46 @@ describe('test communication between host app and ThoughtSpot', () => {
|
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
+
test('should trigger PinSpotterConversation host event to ThoughtSpot app', async () => {
|
|
86
|
+
mockMessageChannel();
|
|
87
|
+
const appEmbed = new AppEmbed(getRootEl(), defaultViewConfig);
|
|
88
|
+
await appEmbed.render();
|
|
89
|
+
const iframe = getIFrameEl();
|
|
90
|
+
jest.spyOn(iframe.contentWindow, 'postMessage');
|
|
91
|
+
await executeAfterWait(() => {
|
|
92
|
+
appEmbed.trigger(HostEvent.PinSpotterConversation, {
|
|
93
|
+
conversationId: 'c1',
|
|
94
|
+
});
|
|
95
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(
|
|
96
|
+
expect.objectContaining({
|
|
97
|
+
type: HostEvent.PinSpotterConversation,
|
|
98
|
+
}),
|
|
99
|
+
expect.anything(),
|
|
100
|
+
expect.anything(),
|
|
101
|
+
);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test('should trigger UnpinSpotterConversation host event to ThoughtSpot app', async () => {
|
|
106
|
+
mockMessageChannel();
|
|
107
|
+
const appEmbed = new AppEmbed(getRootEl(), defaultViewConfig);
|
|
108
|
+
await appEmbed.render();
|
|
109
|
+
const iframe = getIFrameEl();
|
|
110
|
+
jest.spyOn(iframe.contentWindow, 'postMessage');
|
|
111
|
+
await executeAfterWait(() => {
|
|
112
|
+
appEmbed.trigger(HostEvent.UnpinSpotterConversation, {
|
|
113
|
+
conversationId: 'c1',
|
|
114
|
+
});
|
|
115
|
+
expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(
|
|
116
|
+
expect.objectContaining({
|
|
117
|
+
type: HostEvent.UnpinSpotterConversation,
|
|
118
|
+
}),
|
|
119
|
+
expect.anything(),
|
|
120
|
+
expect.anything(),
|
|
121
|
+
);
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
85
125
|
// TODO: enable test once we are actually able to load stuff in the iframe
|
|
86
126
|
xtest('should trigger iframe load event', async () => {
|
|
87
127
|
const onLoadSpy = jest.fn();
|
|
@@ -434,6 +474,10 @@ describe('Action enum values', () => {
|
|
|
434
474
|
test('RemoveFromFavorites should resolve to its string value', () => {
|
|
435
475
|
expect(Action.RemoveFromFavorites).toBe('removeFromFavorites');
|
|
436
476
|
});
|
|
477
|
+
|
|
478
|
+
test('EditInputTable should resolve to its string value', () => {
|
|
479
|
+
expect(Action.EditInputTable).toBe('editInputTable');
|
|
480
|
+
});
|
|
437
481
|
});
|
|
438
482
|
|
|
439
483
|
describe('EmbedEvent basic routing', () => {
|
|
@@ -511,6 +555,8 @@ describe('EmbedEvent basic routing', () => {
|
|
|
511
555
|
['SpotterConversationRenamed', EmbedEvent.SpotterConversationRenamed],
|
|
512
556
|
['SpotterConversationDeleted', EmbedEvent.SpotterConversationDeleted],
|
|
513
557
|
['SpotterConversationSelected', EmbedEvent.SpotterConversationSelected],
|
|
558
|
+
['SpotterConversationPinned', EmbedEvent.SpotterConversationPinned],
|
|
559
|
+
['SpotterConversationUnpinned', EmbedEvent.SpotterConversationUnpinned],
|
|
514
560
|
['EmbedPageContextChanged', EmbedEvent.EmbedPageContextChanged],
|
|
515
561
|
['Subscribed', EmbedEvent.Subscribed],
|
|
516
562
|
['SendTestScheduleEmail', EmbedEvent.SendTestScheduleEmail],
|
|
@@ -523,6 +569,16 @@ describe('EmbedEvent basic routing', () => {
|
|
|
523
569
|
['SpotterVizClosed', EmbedEvent.SpotterVizClosed],
|
|
524
570
|
['RefreshLiveboardBrowserCache', EmbedEvent.RefreshLiveboardBrowserCache],
|
|
525
571
|
['V1Data', EmbedEvent.V1Data],
|
|
572
|
+
['SpotterShareConversationButtonHeaderClicked', EmbedEvent.SpotterShareConversationButtonHeaderClicked],
|
|
573
|
+
['SpotterShareConversationMenuItemSidebarClicked', EmbedEvent.SpotterShareConversationMenuItemSidebarClicked],
|
|
574
|
+
['SpotterConversationShared', EmbedEvent.SpotterConversationShared],
|
|
575
|
+
['SpotterConversationShareRevoked', EmbedEvent.SpotterConversationShareRevoked],
|
|
576
|
+
['SpotterSharedConversationViewed', EmbedEvent.SpotterSharedConversationViewed],
|
|
577
|
+
['SpotterShareIncludeNewMessagesCheckboxToggled', EmbedEvent.SpotterShareIncludeNewMessagesCheckboxToggled],
|
|
578
|
+
['SpotterShareStaleInfoBannerDismissed', EmbedEvent.SpotterShareStaleInfoBannerDismissed],
|
|
579
|
+
['SpotterShareModalConfirmButtonClicked', EmbedEvent.SpotterShareModalConfirmButtonClicked],
|
|
580
|
+
['SpotterShareModalCancelButtonClicked', EmbedEvent.SpotterShareModalCancelButtonClicked],
|
|
581
|
+
['SpotterSharedConversationExitButtonClicked', EmbedEvent.SpotterSharedConversationExitButtonClicked],
|
|
526
582
|
];
|
|
527
583
|
|
|
528
584
|
test.each(UNCOVERED_EVENTS)(
|