@thoughtspot/visual-embed-sdk 1.6.0-alpha.1 → 1.6.1
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/README.md +8 -8
- package/dist/src/embed/app.d.ts +14 -3
- package/dist/src/embed/liveboard.d.ts +101 -0
- package/dist/src/embed/liveboard.spec.d.ts +1 -0
- package/dist/src/embed/pinboard.d.ts +6 -0
- package/dist/src/embed/search.d.ts +4 -0
- package/dist/src/embed/ts-embed.d.ts +2 -11
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/react/index.d.ts +4 -3
- package/dist/src/types.d.ts +24 -20
- package/dist/src/v1/api.d.ts +19 -0
- package/dist/tsembed.es.js +87 -72
- package/dist/tsembed.js +86 -70
- package/lib/package.json +5 -1
- package/lib/src/embed/app.d.ts +14 -3
- package/lib/src/embed/app.js +25 -2
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +32 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +55 -2
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +101 -0
- package/lib/src/embed/liveboard.js +115 -0
- package/lib/src/embed/liveboard.js.map +1 -0
- package/lib/src/embed/liveboard.spec.d.ts +1 -0
- package/lib/src/embed/liveboard.spec.js +159 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -0
- package/lib/src/embed/pinboard.d.ts +6 -0
- package/lib/src/embed/pinboard.js +4 -1
- package/lib/src/embed/pinboard.js.map +1 -1
- package/lib/src/embed/pinboard.spec.js +1 -1
- package/lib/src/embed/pinboard.spec.js.map +1 -1
- package/lib/src/embed/search.d.ts +4 -0
- package/lib/src/embed/search.js +1 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +2 -11
- package/lib/src/embed/ts-embed.js +4 -23
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +63 -6
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -1
- package/lib/src/errors.js +1 -1
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/index.d.ts +4 -3
- package/lib/src/react/index.js +3 -2
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/types.d.ts +24 -20
- package/lib/src/types.js +21 -18
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +84 -58
- package/package.json +5 -1
- package/src/embed/app.spec.ts +41 -0
- package/src/embed/app.ts +28 -3
- package/src/embed/events.spec.ts +64 -5
- package/src/embed/liveboard.spec.ts +199 -0
- package/src/embed/{pinboard.ts → liveboard.ts} +60 -42
- package/src/embed/pinboard.spec.ts +11 -11
- package/src/embed/search.ts +5 -0
- package/src/embed/ts-embed.spec.ts +81 -8
- package/src/embed/ts-embed.ts +6 -25
- package/src/errors.ts +2 -2
- package/src/index.ts +7 -2
- package/src/react/index.tsx +14 -8
- package/src/types.ts +24 -20
package/lib/src/types.js
CHANGED
|
@@ -118,12 +118,12 @@ export var EmbedEvent;
|
|
|
118
118
|
*/
|
|
119
119
|
EmbedEvent["Load"] = "load";
|
|
120
120
|
/**
|
|
121
|
-
* Data pertaining to answer or
|
|
122
|
-
* @return data - The answer or
|
|
121
|
+
* Data pertaining to answer or Liveboard is received
|
|
122
|
+
* @return data - The answer or Liveboard data
|
|
123
123
|
*/
|
|
124
124
|
EmbedEvent["Data"] = "data";
|
|
125
125
|
/**
|
|
126
|
-
* Search/answer/
|
|
126
|
+
* Search/answer/Liveboard filters have been applied/updated
|
|
127
127
|
* @hidden
|
|
128
128
|
*/
|
|
129
129
|
EmbedEvent["FiltersChanged"] = "filtersChanged";
|
|
@@ -146,13 +146,13 @@ export var EmbedEvent;
|
|
|
146
146
|
/**
|
|
147
147
|
* A custom action has been triggered
|
|
148
148
|
* @return actionId - The id of the custom action
|
|
149
|
-
* @return data - The answer or
|
|
149
|
+
* @return data - The answer or Liveboard data
|
|
150
150
|
*/
|
|
151
151
|
EmbedEvent["CustomAction"] = "customAction";
|
|
152
152
|
/**
|
|
153
153
|
* A double click has been triggered on table/chart
|
|
154
154
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
155
|
-
*
|
|
155
|
+
* @version 1.5.0 or later
|
|
156
156
|
*/
|
|
157
157
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
158
158
|
/**
|
|
@@ -170,8 +170,8 @@ export var EmbedEvent;
|
|
|
170
170
|
*/
|
|
171
171
|
EmbedEvent["AuthExpire"] = "ThoughtspotAuthExpired";
|
|
172
172
|
/**
|
|
173
|
-
* The height of the embedded
|
|
174
|
-
* @return data - The height of the embedded
|
|
173
|
+
* The height of the embedded Liveboard or visualization has been computed.
|
|
174
|
+
* @return data - The height of the embedded Liveboard or visualization
|
|
175
175
|
* @hidden
|
|
176
176
|
*/
|
|
177
177
|
EmbedEvent["EmbedHeight"] = "EMBED_HEIGHT";
|
|
@@ -183,7 +183,6 @@ export var EmbedEvent;
|
|
|
183
183
|
EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
|
|
184
184
|
/**
|
|
185
185
|
* Detects the route change.
|
|
186
|
-
* @hidden
|
|
187
186
|
*/
|
|
188
187
|
EmbedEvent["RouteChange"] = "ROUTE_CHANGE";
|
|
189
188
|
/**
|
|
@@ -195,7 +194,7 @@ export var EmbedEvent;
|
|
|
195
194
|
* Emitted when the embed does not have cookie access. This
|
|
196
195
|
* happens on Safari where third-party cookies are blocked by default.
|
|
197
196
|
*
|
|
198
|
-
* @version 1.1.0
|
|
197
|
+
* @version 1.1.0 or later
|
|
199
198
|
*/
|
|
200
199
|
EmbedEvent["NoCookieAccess"] = "noCookieAccess";
|
|
201
200
|
/**
|
|
@@ -206,12 +205,12 @@ export var EmbedEvent;
|
|
|
206
205
|
EmbedEvent["SAMLComplete"] = "samlComplete";
|
|
207
206
|
/**
|
|
208
207
|
* Emitted when any modal is opened in the app
|
|
209
|
-
*
|
|
208
|
+
* @version 1.6.0 or later
|
|
210
209
|
*/
|
|
211
210
|
EmbedEvent["DialogOpen"] = "dialog-open";
|
|
212
211
|
/**
|
|
213
212
|
* Emitted when any modal is closed in the app
|
|
214
|
-
*
|
|
213
|
+
* @version 1.6.0 or later
|
|
215
214
|
*/
|
|
216
215
|
EmbedEvent["DialogClose"] = "dialog-close";
|
|
217
216
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
@@ -234,7 +233,7 @@ export var HostEvent;
|
|
|
234
233
|
* eg. { selectedPoints: []}
|
|
235
234
|
* @param columnGuid - a string guid of the column to drill by. This is optional,
|
|
236
235
|
* if not provided it will auto drill by the configured column. \
|
|
237
|
-
*
|
|
236
|
+
* @version 1.5.0 or later
|
|
238
237
|
*/
|
|
239
238
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
240
239
|
/**
|
|
@@ -248,10 +247,10 @@ export var HostEvent;
|
|
|
248
247
|
*/
|
|
249
248
|
HostEvent["Reload"] = "reload";
|
|
250
249
|
/**
|
|
251
|
-
* Set the visible
|
|
252
|
-
* @param - an array of ids of
|
|
250
|
+
* Set the visible visualizations on a Liveboard.
|
|
251
|
+
* @param - an array of ids of visualizations to show, the ids not passed
|
|
253
252
|
* will be hidden.
|
|
254
|
-
*
|
|
253
|
+
* @version 1.6.0 or later
|
|
255
254
|
*/
|
|
256
255
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
257
256
|
})(HostEvent || (HostEvent = {}));
|
|
@@ -284,10 +283,11 @@ export var Param;
|
|
|
284
283
|
(function (Param) {
|
|
285
284
|
Param["DataSources"] = "dataSources";
|
|
286
285
|
Param["DataSourceMode"] = "dataSourceMode";
|
|
286
|
+
Param["ExpandAllDataSource"] = "expandAllDataSource";
|
|
287
287
|
Param["DisableActions"] = "disableAction";
|
|
288
288
|
Param["DisableActionReason"] = "disableHint";
|
|
289
289
|
Param["ForceTable"] = "forceTable";
|
|
290
|
-
Param["
|
|
290
|
+
Param["preventLiveboardFilterRemoval"] = "preventPinboardFilterRemoval";
|
|
291
291
|
Param["SearchQuery"] = "searchQuery";
|
|
292
292
|
Param["HideActions"] = "hideAction";
|
|
293
293
|
Param["HideObjects"] = "hideObjects";
|
|
@@ -309,7 +309,7 @@ export var Param;
|
|
|
309
309
|
})(Param || (Param = {}));
|
|
310
310
|
/**
|
|
311
311
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
312
|
-
* entities, such as answers and
|
|
312
|
+
* entities, such as answers and Liveboards.
|
|
313
313
|
*/
|
|
314
314
|
// eslint-disable-next-line no-shadow
|
|
315
315
|
export var Action;
|
|
@@ -321,7 +321,6 @@ export var Action;
|
|
|
321
321
|
Action["MakeACopy"] = "makeACopy";
|
|
322
322
|
Action["EditACopy"] = "editACopy";
|
|
323
323
|
Action["CopyLink"] = "embedDocument";
|
|
324
|
-
Action["PinboardSnapshot"] = "pinboardSnapshot";
|
|
325
324
|
Action["ResetLayout"] = "resetLayout";
|
|
326
325
|
Action["Schedule"] = "schedule";
|
|
327
326
|
Action["SchedulesList"] = "schedule-list";
|
|
@@ -354,7 +353,11 @@ export var Action;
|
|
|
354
353
|
Action["Describe"] = "describe";
|
|
355
354
|
Action["Relate"] = "relate";
|
|
356
355
|
Action["CustomizeHeadlines"] = "customizeHeadlines";
|
|
356
|
+
/**
|
|
357
|
+
* @hidden
|
|
358
|
+
*/
|
|
357
359
|
Action["PinboardInfo"] = "pinboardInfo";
|
|
360
|
+
Action["LiveboardInfo"] = "pinboardInfo";
|
|
358
361
|
Action["SendAnswerFeedback"] = "sendFeedback";
|
|
359
362
|
/**
|
|
360
363
|
* @deprecated Will be removed in next version
|
package/lib/src/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,QAoBX;AApBD,WAAY,QAAQ;IAChB;;OAEG;IACH,yBAAa,CAAA;IACb;;OAEG;IACH,4BAAgB,CAAA;IAChB;;OAEG;IACH,qCAAyB,CAAA;IACzB;;;;;OAKG;IACH,2BAAe,CAAA;AACnB,CAAC,EApBW,QAAQ,KAAR,QAAQ,QAoBnB;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,QAoBX;AApBD,WAAY,QAAQ;IAChB;;OAEG;IACH,yBAAa,CAAA;IACb;;OAEG;IACH,4BAAgB,CAAA;IAChB;;OAEG;IACH,qCAAyB,CAAA;IACzB;;;;;OAKG;IACH,2BAAe,CAAA;AACnB,CAAC,EApBW,QAAQ,KAAR,QAAQ,QAoBnB;AAqHD;;GAEG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,eAyDX;AAzDD,WAAY,eAAe;IACvB;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,wCAAqB,CAAA;IACrB;;OAEG;IACH,8CAA2B,CAAA;IAC3B;;OAEG;IACH,0CAAuB,CAAA;IACvB;;OAEG;IACH,4CAAyB,CAAA;IACzB;;OAEG;IACH,4CAAyB,CAAA;IACzB;;OAEG;IACH,oCAAiB,CAAA;IACjB;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;AACb,CAAC,EAzDW,eAAe,KAAf,eAAe,QAyD1B;AAsBD;;GAEG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,UA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AAqB,CAAA;IACrB,yCAA+B,CAAA;IAC/B,yCAA+B,CAAA;IAC/B,2CAAiC,CAAA;IACjC,yCAA+B,CAAA;IAC/B,iCAAuB,CAAA;IACvB,iCAAuB,CAAA;IACvB,iCAAuB,CAAA;IACvB,6BAAmB,CAAA;IACnB,6BAAmB,CAAA;IACnB,mCAAyB,CAAA;IACzB,uBAAa,CAAA;IACb,iCAAuB,CAAA;IACvB,2BAAiB,CAAA;IACjB,6BAAmB,CAAA;IACnB,+BAAqB,CAAA;IACrB,2BAAiB,CAAA;IACjB,mDAAyC,CAAA;IACzC;;OAEG;IACH,uCAA6B,CAAA;IAC7B,wCAA8B,CAAA;IAC9B,6CAAmC,CAAA;IACnC;;OAEG;IACH,uCAA6B,CAAA;IAC7B,2DAAiD,CAAA;IACjD,qBAAW,CAAA;IACX,uCAA6B,CAAA;IAC7B,uCAA6B,CAAA;IAC7B,6BAAmB,CAAA;IACnB,oDAA0C,CAAA;IAC1C,oDAA0C,CAAA;IAC1C,iEAAuD,CAAA;IACvD,8CAAoC,CAAA;IACpC,wDAA8C,CAAA;IAC9C,mDAAyC,CAAA;IACzC,6BAAmB,CAAA;IACnB,yCAA+B,CAAA;IAC/B,qDAA2C,CAAA;AAC/C,CAAC,EAhEW,MAAM,KAAN,MAAM,QAgEjB;AAQD,qCAAqC;AACrC,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,sDAAqC,CAAA;IACrC,sEAAqD,CAAA;AACzD,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB"}
|
|
@@ -12,10 +12,10 @@ declare module '@thoughtspot/visual-embed-sdk' {
|
|
|
12
12
|
*/
|
|
13
13
|
import { AppEmbed, Page, AppViewConfig } from '@thoughtspot/visual-embed-sdk/embed/app';
|
|
14
14
|
import { init, prefetch } from '@thoughtspot/visual-embed-sdk/embed/base';
|
|
15
|
-
import { PinboardEmbed,
|
|
15
|
+
import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from '@thoughtspot/visual-embed-sdk/embed/liveboard';
|
|
16
16
|
import { SearchEmbed, SearchViewConfig } from '@thoughtspot/visual-embed-sdk/embed/search';
|
|
17
17
|
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig } from '@thoughtspot/visual-embed-sdk/types';
|
|
18
|
-
export { init, prefetch, SearchEmbed, PinboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig,
|
|
18
|
+
export { init, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig, };
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
@@ -48,7 +48,11 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
48
48
|
*/
|
|
49
49
|
Answers = "answers",
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Liveboards listing page
|
|
52
|
+
*/
|
|
53
|
+
Liveboards = "liveboards",
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
52
56
|
*/
|
|
53
57
|
Pinboards = "pinboards",
|
|
54
58
|
/**
|
|
@@ -84,7 +88,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
84
88
|
pageId?: Page;
|
|
85
89
|
/**
|
|
86
90
|
* This puts a filter tag on the application. All metadata lists in the application, such as
|
|
87
|
-
*
|
|
91
|
+
* Liveboards and answers, would be filtered by this tag.
|
|
88
92
|
*/
|
|
89
93
|
tag?: string;
|
|
90
94
|
/**
|
|
@@ -99,6 +103,13 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
99
103
|
export class AppEmbed extends V1Embed {
|
|
100
104
|
protected viewConfig: AppViewConfig;
|
|
101
105
|
constructor(domSelector: DOMSelector, viewConfig: AppViewConfig);
|
|
106
|
+
/**
|
|
107
|
+
* Navigate to particular page for app embed. eg:answers/pinboards/home
|
|
108
|
+
* This is used for embedding answers, pinboards, visualizations and full application only.
|
|
109
|
+
* @param path The string, set to iframe src and navigate to new page
|
|
110
|
+
* eg: appEmbed.navigateToPage('pinboards')
|
|
111
|
+
*/
|
|
112
|
+
navigateToPage(path: string): void;
|
|
102
113
|
/**
|
|
103
114
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
104
115
|
* @param renderOptions An object containing the page ID
|
|
@@ -136,35 +147,35 @@ declare module '@thoughtspot/visual-embed-sdk/embed/base' {
|
|
|
136
147
|
export const renderInQueue: (fn: (next?: (val?: any) => void) => void) => void;
|
|
137
148
|
}
|
|
138
149
|
|
|
139
|
-
declare module '@thoughtspot/visual-embed-sdk/embed/
|
|
150
|
+
declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
|
|
140
151
|
/**
|
|
141
152
|
* Copyright (c) 2021
|
|
142
153
|
*
|
|
143
|
-
* Embed a ThoughtSpot
|
|
154
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
144
155
|
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
145
156
|
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
146
157
|
*
|
|
147
|
-
* @summary
|
|
158
|
+
* @summary Liveboard & visualization embed
|
|
148
159
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
149
160
|
*/
|
|
150
161
|
import { DOMSelector } from '@thoughtspot/visual-embed-sdk/types';
|
|
151
162
|
import { V1Embed, ViewConfig } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
|
|
152
163
|
/**
|
|
153
|
-
* The configuration for the embedded
|
|
154
|
-
* @Category
|
|
164
|
+
* The configuration for the embedded Liveboard or visualization page view.
|
|
165
|
+
* @Category Liveboards and Charts
|
|
155
166
|
*/
|
|
156
|
-
export interface
|
|
167
|
+
export interface LiveboardViewConfig extends ViewConfig {
|
|
157
168
|
/**
|
|
158
169
|
* If set to true, the embedded object container dynamically resizes
|
|
159
|
-
* according to the height of the
|
|
170
|
+
* according to the height of the Liveboard.
|
|
160
171
|
*/
|
|
161
172
|
fullHeight?: boolean;
|
|
162
173
|
/**
|
|
163
|
-
* This is the minimum height(in pixels) for a full height
|
|
164
|
-
* Setting this height helps resolves issues with empty
|
|
165
|
-
* other screens navigable from a
|
|
174
|
+
* This is the minimum height(in pixels) for a full height Liveboard.
|
|
175
|
+
* Setting this height helps resolves issues with empty Liveboards and
|
|
176
|
+
* other screens navigable from a Liveboard.
|
|
177
|
+
* *_since 1.5.0_
|
|
166
178
|
* @default 500
|
|
167
|
-
* * _since 1.5.0_
|
|
168
179
|
*/
|
|
169
180
|
defaultHeight?: number;
|
|
170
181
|
/**
|
|
@@ -172,32 +183,48 @@ declare module '@thoughtspot/visual-embed-sdk/embed/pinboard' {
|
|
|
172
183
|
*/
|
|
173
184
|
enableVizTransformations?: boolean;
|
|
174
185
|
/**
|
|
175
|
-
* The
|
|
186
|
+
* The Liveboard to display in the embedded view.
|
|
187
|
+
* Use either of liveboardId or pinboardId to reference the Liveboard to embed.
|
|
176
188
|
*/
|
|
177
|
-
|
|
189
|
+
liveboardId?: string;
|
|
178
190
|
/**
|
|
179
|
-
*
|
|
191
|
+
* To support backward compatibilty
|
|
192
|
+
* @hidden
|
|
193
|
+
*/
|
|
194
|
+
pinboardId?: string;
|
|
195
|
+
/**
|
|
196
|
+
* The visualization within the Liveboard to display.
|
|
180
197
|
*/
|
|
181
198
|
vizId?: string;
|
|
182
199
|
/**
|
|
183
200
|
* If set to true, all filter chips from a
|
|
184
|
-
*
|
|
201
|
+
* Liveboard page will be read-only (no X buttons)
|
|
202
|
+
*/
|
|
203
|
+
preventLiveboardFilterRemoval?: boolean;
|
|
204
|
+
/**
|
|
205
|
+
* To support backward compatibilty
|
|
206
|
+
* @hidden
|
|
185
207
|
*/
|
|
186
208
|
preventPinboardFilterRemoval?: boolean;
|
|
187
209
|
}
|
|
188
210
|
/**
|
|
189
|
-
* Embed a ThoughtSpot
|
|
190
|
-
* @Category
|
|
211
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
212
|
+
* @Category Liveboards and Charts
|
|
191
213
|
*/
|
|
192
|
-
export class
|
|
193
|
-
protected viewConfig:
|
|
194
|
-
constructor(domSelector: DOMSelector, viewConfig:
|
|
214
|
+
export class LiveboardEmbed extends V1Embed {
|
|
215
|
+
protected viewConfig: LiveboardViewConfig;
|
|
216
|
+
constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig);
|
|
195
217
|
/**
|
|
196
|
-
* Render an embedded ThoughtSpot
|
|
197
|
-
* @param renderOptions An object specifying the
|
|
218
|
+
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
219
|
+
* @param renderOptions An object specifying the Liveboard ID,
|
|
198
220
|
* visualization ID and the runtime filters.
|
|
199
221
|
*/
|
|
200
|
-
render():
|
|
222
|
+
render(): LiveboardEmbed;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* @hidden
|
|
226
|
+
*/
|
|
227
|
+
export class PinboardEmbed extends LiveboardEmbed {
|
|
201
228
|
}
|
|
202
229
|
}
|
|
203
230
|
|
|
@@ -248,6 +275,10 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
|
|
|
248
275
|
* using raw answer data.
|
|
249
276
|
*/
|
|
250
277
|
hideResults?: boolean;
|
|
278
|
+
/**
|
|
279
|
+
* If set to true, expands all the data sources panel.
|
|
280
|
+
*/
|
|
281
|
+
expandAllDataSource?: boolean;
|
|
251
282
|
/**
|
|
252
283
|
* If set to true, the Search Assist feature is enabled.
|
|
253
284
|
*/
|
|
@@ -401,12 +432,13 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
401
432
|
* When there are multiple embeds, queue the render of embed to start
|
|
402
433
|
* after the previous embed's render is complete. This helps in the load performance
|
|
403
434
|
* by decreasing the load on the browser.
|
|
435
|
+
* @version 1.5.0 or later
|
|
404
436
|
* @default false
|
|
405
437
|
*/
|
|
406
438
|
queueMultiRenders?: boolean;
|
|
407
439
|
/**
|
|
408
440
|
* Dynamic CSS Url to be injected in the loaded application.
|
|
409
|
-
*
|
|
441
|
+
* @version 1.6.0 or later
|
|
410
442
|
* @default ''
|
|
411
443
|
*/
|
|
412
444
|
customCssUrl?: string;
|
|
@@ -482,7 +514,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
482
514
|
IN = "IN"
|
|
483
515
|
}
|
|
484
516
|
/**
|
|
485
|
-
* A filter that can be applied to ThoughtSpot answers,
|
|
517
|
+
* A filter that can be applied to ThoughtSpot answers, Liveboards, or
|
|
486
518
|
* visualizations at runtime.
|
|
487
519
|
*/
|
|
488
520
|
export interface RuntimeFilter {
|
|
@@ -520,12 +552,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
520
552
|
*/
|
|
521
553
|
Load = "load",
|
|
522
554
|
/**
|
|
523
|
-
* Data pertaining to answer or
|
|
524
|
-
* @return data - The answer or
|
|
555
|
+
* Data pertaining to answer or Liveboard is received
|
|
556
|
+
* @return data - The answer or Liveboard data
|
|
525
557
|
*/
|
|
526
558
|
Data = "data",
|
|
527
559
|
/**
|
|
528
|
-
* Search/answer/
|
|
560
|
+
* Search/answer/Liveboard filters have been applied/updated
|
|
529
561
|
* @hidden
|
|
530
562
|
*/
|
|
531
563
|
FiltersChanged = "filtersChanged",
|
|
@@ -548,13 +580,13 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
548
580
|
/**
|
|
549
581
|
* A custom action has been triggered
|
|
550
582
|
* @return actionId - The id of the custom action
|
|
551
|
-
* @return data - The answer or
|
|
583
|
+
* @return data - The answer or Liveboard data
|
|
552
584
|
*/
|
|
553
585
|
CustomAction = "customAction",
|
|
554
586
|
/**
|
|
555
587
|
* A double click has been triggered on table/chart
|
|
556
588
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
557
|
-
*
|
|
589
|
+
* @version 1.5.0 or later
|
|
558
590
|
*/
|
|
559
591
|
VizPointDoubleClick = "vizPointDoubleClick",
|
|
560
592
|
/**
|
|
@@ -572,8 +604,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
572
604
|
*/
|
|
573
605
|
AuthExpire = "ThoughtspotAuthExpired",
|
|
574
606
|
/**
|
|
575
|
-
* The height of the embedded
|
|
576
|
-
* @return data - The height of the embedded
|
|
607
|
+
* The height of the embedded Liveboard or visualization has been computed.
|
|
608
|
+
* @return data - The height of the embedded Liveboard or visualization
|
|
577
609
|
* @hidden
|
|
578
610
|
*/
|
|
579
611
|
EmbedHeight = "EMBED_HEIGHT",
|
|
@@ -585,7 +617,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
585
617
|
EmbedIframeCenter = "EmbedIframeCenter",
|
|
586
618
|
/**
|
|
587
619
|
* Detects the route change.
|
|
588
|
-
* @hidden
|
|
589
620
|
*/
|
|
590
621
|
RouteChange = "ROUTE_CHANGE",
|
|
591
622
|
/**
|
|
@@ -597,7 +628,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
597
628
|
* Emitted when the embed does not have cookie access. This
|
|
598
629
|
* happens on Safari where third-party cookies are blocked by default.
|
|
599
630
|
*
|
|
600
|
-
* @version 1.1.0
|
|
631
|
+
* @version 1.1.0 or later
|
|
601
632
|
*/
|
|
602
633
|
NoCookieAccess = "noCookieAccess",
|
|
603
634
|
/**
|
|
@@ -608,12 +639,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
608
639
|
SAMLComplete = "samlComplete",
|
|
609
640
|
/**
|
|
610
641
|
* Emitted when any modal is opened in the app
|
|
611
|
-
*
|
|
642
|
+
* @version 1.6.0 or later
|
|
612
643
|
*/
|
|
613
644
|
DialogOpen = "dialog-open",
|
|
614
645
|
/**
|
|
615
646
|
* Emitted when any modal is closed in the app
|
|
616
|
-
*
|
|
647
|
+
* @version 1.6.0 or later
|
|
617
648
|
*/
|
|
618
649
|
DialogClose = "dialog-close"
|
|
619
650
|
}
|
|
@@ -634,7 +665,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
634
665
|
* eg. { selectedPoints: []}
|
|
635
666
|
* @param columnGuid - a string guid of the column to drill by. This is optional,
|
|
636
667
|
* if not provided it will auto drill by the configured column. \
|
|
637
|
-
*
|
|
668
|
+
* @version 1.5.0 or later
|
|
638
669
|
*/
|
|
639
670
|
DrillDown = "triggerDrillDown",
|
|
640
671
|
/**
|
|
@@ -648,10 +679,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
648
679
|
*/
|
|
649
680
|
Reload = "reload",
|
|
650
681
|
/**
|
|
651
|
-
* Set the visible
|
|
652
|
-
* @param - an array of ids of
|
|
682
|
+
* Set the visible visualizations on a Liveboard.
|
|
683
|
+
* @param - an array of ids of visualizations to show, the ids not passed
|
|
653
684
|
* will be hidden.
|
|
654
|
-
*
|
|
685
|
+
* @version 1.6.0 or later
|
|
655
686
|
*/
|
|
656
687
|
SetVisibleVizs = "SetPinboardVisibleVizs"
|
|
657
688
|
}
|
|
@@ -680,10 +711,11 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
680
711
|
export enum Param {
|
|
681
712
|
DataSources = "dataSources",
|
|
682
713
|
DataSourceMode = "dataSourceMode",
|
|
714
|
+
ExpandAllDataSource = "expandAllDataSource",
|
|
683
715
|
DisableActions = "disableAction",
|
|
684
716
|
DisableActionReason = "disableHint",
|
|
685
717
|
ForceTable = "forceTable",
|
|
686
|
-
|
|
718
|
+
preventLiveboardFilterRemoval = "preventPinboardFilterRemoval",
|
|
687
719
|
SearchQuery = "searchQuery",
|
|
688
720
|
HideActions = "hideAction",
|
|
689
721
|
HideObjects = "hideObjects",
|
|
@@ -705,7 +737,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
705
737
|
}
|
|
706
738
|
/**
|
|
707
739
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
708
|
-
* entities, such as answers and
|
|
740
|
+
* entities, such as answers and Liveboards.
|
|
709
741
|
*/
|
|
710
742
|
export enum Action {
|
|
711
743
|
Save = "save",
|
|
@@ -715,7 +747,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
715
747
|
MakeACopy = "makeACopy",
|
|
716
748
|
EditACopy = "editACopy",
|
|
717
749
|
CopyLink = "embedDocument",
|
|
718
|
-
PinboardSnapshot = "pinboardSnapshot",
|
|
719
750
|
ResetLayout = "resetLayout",
|
|
720
751
|
Schedule = "schedule",
|
|
721
752
|
SchedulesList = "schedule-list",
|
|
@@ -748,7 +779,11 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
748
779
|
Describe = "describe",
|
|
749
780
|
Relate = "relate",
|
|
750
781
|
CustomizeHeadlines = "customizeHeadlines",
|
|
782
|
+
/**
|
|
783
|
+
* @hidden
|
|
784
|
+
*/
|
|
751
785
|
PinboardInfo = "pinboardInfo",
|
|
786
|
+
LiveboardInfo = "pinboardInfo",
|
|
752
787
|
SendAnswerFeedback = "sendFeedback",
|
|
753
788
|
/**
|
|
754
789
|
* @deprecated Will be removed in next version
|
|
@@ -853,7 +888,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
|
853
888
|
visibleActions?: Action[];
|
|
854
889
|
/**
|
|
855
890
|
* The list of runtime filters to apply to a search answer,
|
|
856
|
-
* visualization, or
|
|
891
|
+
* visualization, or Liveboard.
|
|
857
892
|
*/
|
|
858
893
|
runtimeFilters?: RuntimeFilter[];
|
|
859
894
|
}
|
|
@@ -892,7 +927,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
|
892
927
|
protected getBaseQueryParams(): {};
|
|
893
928
|
/**
|
|
894
929
|
* Constructs the base URL string to load v1 of the ThoughtSpot app.
|
|
895
|
-
* This is used for embedding
|
|
930
|
+
* This is used for embedding Liveboards, visualizations, and full application.
|
|
896
931
|
* @param queryString The query string to append to the URL.
|
|
897
932
|
* @param isAppEmbed A Boolean parameter to specify if you are embedding
|
|
898
933
|
* the full application.
|
|
@@ -951,15 +986,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
|
951
986
|
* @param callback A callback function
|
|
952
987
|
*/
|
|
953
988
|
on(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
|
|
954
|
-
/**
|
|
955
|
-
* Navigates users to the specified application page.
|
|
956
|
-
* Use this method to navigate users from the embedded
|
|
957
|
-
* ThoughtSpot context to a specific page in your app.
|
|
958
|
-
* @param path The page path string.
|
|
959
|
-
* For example, to navigate users to a pinboard page,
|
|
960
|
-
* define the method as navigateToPage('pinboard/<pinboardId>').
|
|
961
|
-
*/
|
|
962
|
-
navigateToPage(path: string): void;
|
|
963
989
|
/**
|
|
964
990
|
* Triggers an event to the embedded app
|
|
965
991
|
* @param messageType The event type
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"asciidoctor": "^2.2.1",
|
|
66
66
|
"babel-jest": "^26.6.3",
|
|
67
67
|
"babel-preset-gatsby": "^1.10.0",
|
|
68
|
+
"classnames": "^2.3.1",
|
|
68
69
|
"command-line-args": "^5.1.1",
|
|
69
70
|
"coveralls": "^3.1.0",
|
|
70
71
|
"dts-bundle": "0.7.3",
|
|
@@ -126,6 +127,9 @@
|
|
|
126
127
|
"type": "git",
|
|
127
128
|
"url": "git+https://github.com/thoughtspot/visual-embed-sdk.git"
|
|
128
129
|
},
|
|
130
|
+
"publishConfig": {
|
|
131
|
+
"registry": "https://registry.npmjs.org"
|
|
132
|
+
},
|
|
129
133
|
"keywords": [
|
|
130
134
|
"thoughtspot",
|
|
131
135
|
"everywhere",
|
package/src/embed/app.spec.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
getRootEl,
|
|
9
9
|
} from '../test/test-utils';
|
|
10
10
|
import { version } from '../../package.json';
|
|
11
|
+
import * as config from '../config';
|
|
11
12
|
|
|
12
13
|
const defaultViewConfig = {
|
|
13
14
|
frameParams: {
|
|
@@ -17,6 +18,7 @@ const defaultViewConfig = {
|
|
|
17
18
|
};
|
|
18
19
|
const thoughtSpotHost = 'tshost';
|
|
19
20
|
const defaultParams = `&hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}`;
|
|
21
|
+
const defaultParamsForPinboardEmbed = `hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}`;
|
|
20
22
|
|
|
21
23
|
beforeAll(() => {
|
|
22
24
|
init({
|
|
@@ -76,6 +78,7 @@ describe('App embed tests', () => {
|
|
|
76
78
|
[Page.Search]: 'answer',
|
|
77
79
|
[Page.Answers]: 'answers',
|
|
78
80
|
[Page.Pinboards]: 'pinboards',
|
|
81
|
+
[Page.Liveboards]: 'pinboards',
|
|
79
82
|
[Page.Data]: 'data/tables',
|
|
80
83
|
[Page.Home]: 'home',
|
|
81
84
|
};
|
|
@@ -167,4 +170,42 @@ describe('App embed tests', () => {
|
|
|
167
170
|
);
|
|
168
171
|
});
|
|
169
172
|
});
|
|
173
|
+
|
|
174
|
+
describe('Naviage to Page API', () => {
|
|
175
|
+
const path = 'pinboard/e0836cad-4fdf-42d4-bd97-567a6b2a6058';
|
|
176
|
+
beforeEach(() => {
|
|
177
|
+
jest.spyOn(config, 'getThoughtSpotHost').mockImplementation(
|
|
178
|
+
() => 'http://tshost',
|
|
179
|
+
);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
test('when app is AppEmbed after navigateToPage function call, new path should be set to iframe', async () => {
|
|
183
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
184
|
+
frameParams: {
|
|
185
|
+
width: '100%',
|
|
186
|
+
height: '100%',
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
await appEmbed.render();
|
|
190
|
+
appEmbed.navigateToPage(path);
|
|
191
|
+
expect(getIFrameSrc()).toBe(
|
|
192
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}#/${path}`,
|
|
193
|
+
);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
test('navigateToPage function use before render', async () => {
|
|
197
|
+
spyOn(console, 'log');
|
|
198
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
199
|
+
frameParams: {
|
|
200
|
+
width: '100%',
|
|
201
|
+
height: '100%',
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
appEmbed.navigateToPage(path);
|
|
205
|
+
await appEmbed.render();
|
|
206
|
+
expect(console.log).toHaveBeenCalledWith(
|
|
207
|
+
'Please call render before invoking this method',
|
|
208
|
+
);
|
|
209
|
+
});
|
|
210
|
+
});
|
|
170
211
|
});
|