@thoughtspot/visual-embed-sdk 1.6.0-alpha.2 → 1.6.0-alpha.3
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/dist/src/embed/app.d.ts +9 -2
- package/dist/src/embed/liveboard.d.ts +19 -19
- package/dist/src/embed/liveboard.spec.d.ts +1 -0
- package/dist/src/embed/ts-embed.d.ts +2 -11
- package/dist/src/types.d.ts +18 -23
- package/dist/tsembed.es.js +48 -58
- package/dist/tsembed.js +47 -57
- package/lib/package.json +1 -1
- package/lib/src/embed/app.d.ts +9 -2
- package/lib/src/embed/app.js +18 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +31 -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 +19 -19
- package/lib/src/embed/liveboard.js +12 -13
- package/lib/src/embed/liveboard.js.map +1 -1
- 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/ts-embed.d.ts +2 -11
- package/lib/src/embed/ts-embed.js +2 -22
- 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/types.d.ts +18 -23
- package/lib/src/types.js +15 -21
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +41 -48
- package/package.json +1 -1
- package/src/embed/app.spec.ts +40 -0
- package/src/embed/app.ts +21 -2
- package/src/embed/events.spec.ts +60 -1
- package/src/embed/liveboard.spec.ts +199 -0
- package/src/embed/liveboard.ts +21 -24
- package/src/embed/ts-embed.spec.ts +78 -5
- package/src/embed/ts-embed.ts +3 -24
- package/src/types.ts +18 -23
package/dist/tsembed.js
CHANGED
|
@@ -220,12 +220,12 @@
|
|
|
220
220
|
*/
|
|
221
221
|
EmbedEvent["Load"] = "load";
|
|
222
222
|
/**
|
|
223
|
-
* Data pertaining to answer or
|
|
224
|
-
* @return data - The answer or
|
|
223
|
+
* Data pertaining to answer or Liveboard is received
|
|
224
|
+
* @return data - The answer or Liveboard data
|
|
225
225
|
*/
|
|
226
226
|
EmbedEvent["Data"] = "data";
|
|
227
227
|
/**
|
|
228
|
-
* Search/answer/
|
|
228
|
+
* Search/answer/Liveboard filters have been applied/updated
|
|
229
229
|
* @hidden
|
|
230
230
|
*/
|
|
231
231
|
EmbedEvent["FiltersChanged"] = "filtersChanged";
|
|
@@ -248,13 +248,13 @@
|
|
|
248
248
|
/**
|
|
249
249
|
* A custom action has been triggered
|
|
250
250
|
* @return actionId - The id of the custom action
|
|
251
|
-
* @return data - The answer or
|
|
251
|
+
* @return data - The answer or Liveboard data
|
|
252
252
|
*/
|
|
253
253
|
EmbedEvent["CustomAction"] = "customAction";
|
|
254
254
|
/**
|
|
255
255
|
* A double click has been triggered on table/chart
|
|
256
256
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
257
|
-
* *
|
|
257
|
+
* * _Version 1.5.0 or later _
|
|
258
258
|
*/
|
|
259
259
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
260
260
|
/**
|
|
@@ -272,8 +272,8 @@
|
|
|
272
272
|
*/
|
|
273
273
|
EmbedEvent["AuthExpire"] = "ThoughtspotAuthExpired";
|
|
274
274
|
/**
|
|
275
|
-
* The height of the embedded
|
|
276
|
-
* @return data - The height of the embedded
|
|
275
|
+
* The height of the embedded Liveboard or visualization has been computed.
|
|
276
|
+
* @return data - The height of the embedded Liveboard or visualization
|
|
277
277
|
* @hidden
|
|
278
278
|
*/
|
|
279
279
|
EmbedEvent["EmbedHeight"] = "EMBED_HEIGHT";
|
|
@@ -285,7 +285,6 @@
|
|
|
285
285
|
EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
|
|
286
286
|
/**
|
|
287
287
|
* Detects the route change.
|
|
288
|
-
* @hidden
|
|
289
288
|
*/
|
|
290
289
|
EmbedEvent["RouteChange"] = "ROUTE_CHANGE";
|
|
291
290
|
/**
|
|
@@ -308,12 +307,12 @@
|
|
|
308
307
|
EmbedEvent["SAMLComplete"] = "samlComplete";
|
|
309
308
|
/**
|
|
310
309
|
* Emitted when any modal is opened in the app
|
|
311
|
-
* *
|
|
310
|
+
* * _Version 1.6.0 or later _
|
|
312
311
|
*/
|
|
313
312
|
EmbedEvent["DialogOpen"] = "dialog-open";
|
|
314
313
|
/**
|
|
315
314
|
* Emitted when any modal is closed in the app
|
|
316
|
-
* *
|
|
315
|
+
* * _Version 1.6.0 or later _
|
|
317
316
|
*/
|
|
318
317
|
EmbedEvent["DialogClose"] = "dialog-close";
|
|
319
318
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
@@ -330,7 +329,7 @@
|
|
|
330
329
|
* eg. { selectedPoints: []}
|
|
331
330
|
* @param columnGuid - a string guid of the column to drill by. This is optional,
|
|
332
331
|
* if not provided it will auto drill by the configured column. \
|
|
333
|
-
* *
|
|
332
|
+
* * _Version 1.5.0 or later _
|
|
334
333
|
*/
|
|
335
334
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
336
335
|
/**
|
|
@@ -344,10 +343,10 @@
|
|
|
344
343
|
*/
|
|
345
344
|
HostEvent["Reload"] = "reload";
|
|
346
345
|
/**
|
|
347
|
-
* Set the visible
|
|
348
|
-
* @param - an array of ids of
|
|
346
|
+
* Set the visible visualizations on a Liveboard.
|
|
347
|
+
* @param - an array of ids of visualizations to show, the ids not passed
|
|
349
348
|
* will be hidden.
|
|
350
|
-
*
|
|
349
|
+
* * _Version 1.6.0 or later _
|
|
351
350
|
*/
|
|
352
351
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
353
352
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
@@ -405,11 +404,6 @@
|
|
|
405
404
|
Action["MakeACopy"] = "makeACopy";
|
|
406
405
|
Action["EditACopy"] = "editACopy";
|
|
407
406
|
Action["CopyLink"] = "embedDocument";
|
|
408
|
-
/**
|
|
409
|
-
* @hidden
|
|
410
|
-
*/
|
|
411
|
-
Action["PinboardSnapshot"] = "pinboardSnapshot";
|
|
412
|
-
Action["LiveboardSnapshot"] = "liveboardSnapshot";
|
|
413
407
|
Action["ResetLayout"] = "resetLayout";
|
|
414
408
|
Action["Schedule"] = "schedule";
|
|
415
409
|
Action["SchedulesList"] = "schedule-list";
|
|
@@ -446,7 +440,7 @@
|
|
|
446
440
|
* @hidden
|
|
447
441
|
*/
|
|
448
442
|
Action["PinboardInfo"] = "pinboardInfo";
|
|
449
|
-
Action["LiveboardInfo"] = "
|
|
443
|
+
Action["LiveboardInfo"] = "pinboardInfo";
|
|
450
444
|
Action["SendAnswerFeedback"] = "sendFeedback";
|
|
451
445
|
/**
|
|
452
446
|
* @deprecated Will be removed in next version
|
|
@@ -8817,7 +8811,7 @@
|
|
|
8817
8811
|
}
|
|
8818
8812
|
}
|
|
8819
8813
|
|
|
8820
|
-
var version="1.6.0-alpha.
|
|
8814
|
+
var version="1.6.0-alpha.3";
|
|
8821
8815
|
|
|
8822
8816
|
/**
|
|
8823
8817
|
* Copyright (c) 2021
|
|
@@ -8983,7 +8977,7 @@
|
|
|
8983
8977
|
queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
|
|
8984
8978
|
}
|
|
8985
8979
|
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, } = this.viewConfig;
|
|
8986
|
-
if ((visibleActions
|
|
8980
|
+
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
8987
8981
|
this.handleError('You cannot have both hidden actions and visible actions');
|
|
8988
8982
|
return queryParams;
|
|
8989
8983
|
}
|
|
@@ -9003,7 +8997,7 @@
|
|
|
9003
8997
|
}
|
|
9004
8998
|
/**
|
|
9005
8999
|
* Constructs the base URL string to load v1 of the ThoughtSpot app.
|
|
9006
|
-
* This is used for embedding
|
|
9000
|
+
* This is used for embedding Liveboards, visualizations, and full application.
|
|
9007
9001
|
* @param queryString The query string to append to the URL.
|
|
9008
9002
|
* @param isAppEmbed A Boolean parameter to specify if you are embedding
|
|
9009
9003
|
* the full application.
|
|
@@ -9181,26 +9175,6 @@
|
|
|
9181
9175
|
this.eventHandlerMap.set(messageType, callbacks);
|
|
9182
9176
|
return this;
|
|
9183
9177
|
}
|
|
9184
|
-
/**
|
|
9185
|
-
* Navigates users to the specified application page.
|
|
9186
|
-
* Use this method to navigate users from the embedded
|
|
9187
|
-
* ThoughtSpot context to a specific page in your app.
|
|
9188
|
-
* @param path The page path string.
|
|
9189
|
-
* For example, to navigate users to a liveboard page,
|
|
9190
|
-
* define the method as navigateToPage('liveboard/<liveboardId>').
|
|
9191
|
-
*/
|
|
9192
|
-
navigateToPage(path) {
|
|
9193
|
-
var _a;
|
|
9194
|
-
const iframeSrc = (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.src;
|
|
9195
|
-
if (iframeSrc) {
|
|
9196
|
-
const embedPath = '#/embed';
|
|
9197
|
-
const currentPath = iframeSrc.includes(embedPath) ? embedPath : '#';
|
|
9198
|
-
this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
|
|
9199
|
-
}
|
|
9200
|
-
else {
|
|
9201
|
-
console.log('Please call render before invoking this method');
|
|
9202
|
-
}
|
|
9203
|
-
}
|
|
9204
9178
|
/**
|
|
9205
9179
|
* Triggers an event on specific Port registered against
|
|
9206
9180
|
* for the EmbedEvent
|
|
@@ -9316,7 +9290,7 @@
|
|
|
9316
9290
|
}
|
|
9317
9291
|
/**
|
|
9318
9292
|
* Constructs a map of parameters to be passed on to the
|
|
9319
|
-
* embedded
|
|
9293
|
+
* embedded Liveboard or visualization.
|
|
9320
9294
|
*/
|
|
9321
9295
|
getEmbedParams() {
|
|
9322
9296
|
const params = this.getBaseQueryParams();
|
|
@@ -9379,6 +9353,23 @@
|
|
|
9379
9353
|
}
|
|
9380
9354
|
return path;
|
|
9381
9355
|
}
|
|
9356
|
+
/**
|
|
9357
|
+
* Navigate to particular page for app embed. eg:answers/pinboards/home
|
|
9358
|
+
* This is used for embedding answers, pinboards, visualizations and full application only.
|
|
9359
|
+
* @param path The string, set to iframe src and navigate to new page
|
|
9360
|
+
* eg: appEmbed.navigateToPage('pinboards')
|
|
9361
|
+
*/
|
|
9362
|
+
navigateToPage(path) {
|
|
9363
|
+
if (this.iFrame) {
|
|
9364
|
+
const iframeSrc = this.iFrame.src;
|
|
9365
|
+
const embedPath = '#/embed';
|
|
9366
|
+
const currentPath = iframeSrc.includes(embedPath) ? embedPath : '#';
|
|
9367
|
+
this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
|
|
9368
|
+
}
|
|
9369
|
+
else {
|
|
9370
|
+
console.log('Please call render before invoking this method');
|
|
9371
|
+
}
|
|
9372
|
+
}
|
|
9382
9373
|
/**
|
|
9383
9374
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
9384
9375
|
* @param renderOptions An object containing the page ID
|
|
@@ -9397,7 +9388,7 @@
|
|
|
9397
9388
|
/**
|
|
9398
9389
|
* Copyright (c) 2021
|
|
9399
9390
|
*
|
|
9400
|
-
* Embed a ThoughtSpot
|
|
9391
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
9401
9392
|
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
9402
9393
|
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
9403
9394
|
*
|
|
@@ -9405,7 +9396,7 @@
|
|
|
9405
9396
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
9406
9397
|
*/
|
|
9407
9398
|
/**
|
|
9408
|
-
* Embed a ThoughtSpot
|
|
9399
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
9409
9400
|
* @Category Liveboards and Charts
|
|
9410
9401
|
*/
|
|
9411
9402
|
class LiveboardEmbed extends V1Embed {
|
|
@@ -9425,16 +9416,15 @@
|
|
|
9425
9416
|
const obj = this.getIframeCenter();
|
|
9426
9417
|
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
9427
9418
|
};
|
|
9428
|
-
this.
|
|
9429
|
-
if (data.data.
|
|
9430
|
-
data.data.canvasState !== 'pinboard') {
|
|
9419
|
+
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
9420
|
+
if (!data.data.currentPath.startsWith('/embed/viz/')) {
|
|
9431
9421
|
this.setIFrameHeight(this.defaultHeight);
|
|
9432
9422
|
}
|
|
9433
9423
|
};
|
|
9434
9424
|
}
|
|
9435
9425
|
/**
|
|
9436
9426
|
* Construct a map of params to be passed on to the
|
|
9437
|
-
* embedded
|
|
9427
|
+
* embedded Liveboard or visualization.
|
|
9438
9428
|
*/
|
|
9439
9429
|
getEmbedParams() {
|
|
9440
9430
|
const params = this.getBaseQueryParams();
|
|
@@ -9458,12 +9448,12 @@
|
|
|
9458
9448
|
return queryParams;
|
|
9459
9449
|
}
|
|
9460
9450
|
/**
|
|
9461
|
-
* Construct the URL of the embedded ThoughtSpot
|
|
9451
|
+
* Construct the URL of the embedded ThoughtSpot Liveboard or visualization
|
|
9462
9452
|
* to be loaded within the iframe.
|
|
9463
|
-
* @param liveboardId The GUID of the
|
|
9464
|
-
* @param vizId The optional GUID of a visualization within the
|
|
9453
|
+
* @param liveboardId The GUID of the Liveboard.
|
|
9454
|
+
* @param vizId The optional GUID of a visualization within the Liveboard.
|
|
9465
9455
|
* @param runtimeFilters A list of runtime filters to be applied to
|
|
9466
|
-
* the
|
|
9456
|
+
* the Liveboard or visualization on load.
|
|
9467
9457
|
*/
|
|
9468
9458
|
getIFrameSrc(liveboardId, vizId, runtimeFilters) {
|
|
9469
9459
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
@@ -9478,8 +9468,8 @@
|
|
|
9478
9468
|
return url;
|
|
9479
9469
|
}
|
|
9480
9470
|
/**
|
|
9481
|
-
* Render an embedded ThoughtSpot
|
|
9482
|
-
* @param renderOptions An object specifying the
|
|
9471
|
+
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
9472
|
+
* @param renderOptions An object specifying the Liveboard ID,
|
|
9483
9473
|
* visualization ID and the runtime filters.
|
|
9484
9474
|
*/
|
|
9485
9475
|
render() {
|
|
@@ -9490,7 +9480,7 @@
|
|
|
9490
9480
|
this.handleError(ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION);
|
|
9491
9481
|
}
|
|
9492
9482
|
if (this.viewConfig.fullHeight === true) {
|
|
9493
|
-
this.on(exports.EmbedEvent.RouteChange, this.
|
|
9483
|
+
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
9494
9484
|
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
9495
9485
|
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
9496
9486
|
}
|
package/lib/package.json
CHANGED
package/lib/src/embed/app.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export interface AppViewConfig extends ViewConfig {
|
|
|
67
67
|
pageId?: Page;
|
|
68
68
|
/**
|
|
69
69
|
* This puts a filter tag on the application. All metadata lists in the application, such as
|
|
70
|
-
*
|
|
70
|
+
* Liveboards and answers, would be filtered by this tag.
|
|
71
71
|
*/
|
|
72
72
|
tag?: string;
|
|
73
73
|
/**
|
|
@@ -84,7 +84,7 @@ export declare class AppEmbed extends V1Embed {
|
|
|
84
84
|
constructor(domSelector: DOMSelector, viewConfig: AppViewConfig);
|
|
85
85
|
/**
|
|
86
86
|
* Constructs a map of parameters to be passed on to the
|
|
87
|
-
* embedded
|
|
87
|
+
* embedded Liveboard or visualization.
|
|
88
88
|
*/
|
|
89
89
|
private getEmbedParams;
|
|
90
90
|
/**
|
|
@@ -103,6 +103,13 @@ export declare class AppEmbed extends V1Embed {
|
|
|
103
103
|
* @returns The URL path that the embedded app understands.
|
|
104
104
|
*/
|
|
105
105
|
private formatPath;
|
|
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;
|
|
106
113
|
/**
|
|
107
114
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
108
115
|
* @param renderOptions An object containing the page ID
|
package/lib/src/embed/app.js
CHANGED
|
@@ -53,7 +53,7 @@ export class AppEmbed extends V1Embed {
|
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Constructs a map of parameters to be passed on to the
|
|
56
|
-
* embedded
|
|
56
|
+
* embedded Liveboard or visualization.
|
|
57
57
|
*/
|
|
58
58
|
getEmbedParams() {
|
|
59
59
|
const params = this.getBaseQueryParams();
|
|
@@ -116,6 +116,23 @@ export class AppEmbed extends V1Embed {
|
|
|
116
116
|
}
|
|
117
117
|
return path;
|
|
118
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Navigate to particular page for app embed. eg:answers/pinboards/home
|
|
121
|
+
* This is used for embedding answers, pinboards, visualizations and full application only.
|
|
122
|
+
* @param path The string, set to iframe src and navigate to new page
|
|
123
|
+
* eg: appEmbed.navigateToPage('pinboards')
|
|
124
|
+
*/
|
|
125
|
+
navigateToPage(path) {
|
|
126
|
+
if (this.iFrame) {
|
|
127
|
+
const iframeSrc = this.iFrame.src;
|
|
128
|
+
const embedPath = '#/embed';
|
|
129
|
+
const currentPath = iframeSrc.includes(embedPath) ? embedPath : '#';
|
|
130
|
+
this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
console.log('Please call render before invoking this method');
|
|
134
|
+
}
|
|
135
|
+
}
|
|
119
136
|
/**
|
|
120
137
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
121
138
|
* @param renderOptions An object containing the page ID
|
package/lib/src/embed/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/embed/app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,KAAK,EAA8B,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAc,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,IAyBX;AAzBD,WAAY,IAAI;IACZ;;OAEG;IACH,qBAAa,CAAA;IACb;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,iCAAyB,CAAA;IACzB;;OAEG;IACH,+BAAuB,CAAA;IACvB;;OAEG;IACH,qBAAa,CAAA;AACjB,CAAC,EAzBW,IAAI,KAAJ,IAAI,QAyBf;AAuCD;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,OAAO;IAGjC,kDAAkD;IAClD,YAAY,WAAwB,EAAE,UAAyB;QAC3D,KAAK,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACK,cAAc;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACzC,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QAE7C,IAAI,GAAG,EAAE;YACL,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;SAC3B;QACD,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,EAAE;YACnC,MAAM,CAAC,KAAK,CAAC,WA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AAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACrE,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QACzD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAExB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -3,6 +3,7 @@ import { init } from '../index';
|
|
|
3
3
|
import { Action, AuthType, RuntimeFilterOp } from '../types';
|
|
4
4
|
import { executeAfterWait, getDocumentBody, getIFrameSrc, getRootEl, } from '../test/test-utils';
|
|
5
5
|
import { version } from '../../package.json';
|
|
6
|
+
import * as config from '../config';
|
|
6
7
|
const defaultViewConfig = {
|
|
7
8
|
frameParams: {
|
|
8
9
|
width: 1280,
|
|
@@ -11,6 +12,7 @@ const defaultViewConfig = {
|
|
|
11
12
|
};
|
|
12
13
|
const thoughtSpotHost = 'tshost';
|
|
13
14
|
const defaultParams = `&hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}`;
|
|
15
|
+
const defaultParamsForPinboardEmbed = `hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}`;
|
|
14
16
|
beforeAll(() => {
|
|
15
17
|
init({
|
|
16
18
|
thoughtSpotHost,
|
|
@@ -129,5 +131,34 @@ describe('App embed tests', () => {
|
|
|
129
131
|
expect(getIFrameSrc()).toBe(`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&tag=Finance#/home`);
|
|
130
132
|
});
|
|
131
133
|
});
|
|
134
|
+
describe('Naviage to Page API', () => {
|
|
135
|
+
const path = 'pinboard/e0836cad-4fdf-42d4-bd97-567a6b2a6058';
|
|
136
|
+
beforeEach(() => {
|
|
137
|
+
jest.spyOn(config, 'getThoughtSpotHost').mockImplementation(() => 'http://tshost');
|
|
138
|
+
});
|
|
139
|
+
test('when app is AppEmbed after navigateToPage function call, new path should be set to iframe', async () => {
|
|
140
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
141
|
+
frameParams: {
|
|
142
|
+
width: '100%',
|
|
143
|
+
height: '100%',
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
await appEmbed.render();
|
|
147
|
+
appEmbed.navigateToPage(path);
|
|
148
|
+
expect(getIFrameSrc()).toBe(`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}#/${path}`);
|
|
149
|
+
});
|
|
150
|
+
test('navigateToPage function use before render', async () => {
|
|
151
|
+
spyOn(console, 'log');
|
|
152
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
153
|
+
frameParams: {
|
|
154
|
+
width: '100%',
|
|
155
|
+
height: '100%',
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
appEmbed.navigateToPage(path);
|
|
159
|
+
await appEmbed.render();
|
|
160
|
+
expect(console.log).toHaveBeenCalledWith('Please call render before invoking this method');
|
|
161
|
+
});
|
|
162
|
+
});
|
|
132
163
|
});
|
|
133
164
|
//# sourceMappingURL=app.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.spec.js","sourceRoot":"","sources":["../../../src/embed/app.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiB,IAAI,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,SAAS,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"app.spec.js","sourceRoot":"","sources":["../../../src/embed/app.sp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AC,CAAC;YACH,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC9B,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,oBAAoB,CACpC,gDAAgD,CACnD,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init, AuthType, EmbedEvent, SearchEmbed, PinboardEmbed, HostEvent, } from '../index';
|
|
1
|
+
import { init, AuthType, EmbedEvent, SearchEmbed, PinboardEmbed, LiveboardEmbed, HostEvent, } from '../index';
|
|
2
2
|
import { EVENT_WAIT_TIME, executeAfterWait, getDocumentBody, getIFrameEl, getRootEl, getRootEl2, postMessageToParent, } from '../test/test-utils';
|
|
3
3
|
const thoughtSpotHost = 'tshost';
|
|
4
4
|
const defaultViewConfig = {
|
|
@@ -89,7 +89,13 @@ describe('test communication between host app and ThoughtSpot', () => {
|
|
|
89
89
|
...defaultViewConfig,
|
|
90
90
|
pinboardId: 'eca215d4-0d2c-4a55-90e3-d81ef6848ae0',
|
|
91
91
|
});
|
|
92
|
+
const spyThree = jest.fn();
|
|
93
|
+
const embedThree = new LiveboardEmbed(getRootEl2(), {
|
|
94
|
+
...defaultViewConfig,
|
|
95
|
+
liveboardId: 'eca215d4-0d2c-4a55-90e3-d81ef6848ae0',
|
|
96
|
+
});
|
|
92
97
|
embedTwo.on(EmbedEvent.CustomAction, spyTwo).render();
|
|
98
|
+
embedThree.on(EmbedEvent.CustomAction, spyThree).render();
|
|
93
99
|
await executeAfterWait(() => {
|
|
94
100
|
const iframeOne = getIFrameEl();
|
|
95
101
|
postMessageToParent(iframeOne.contentWindow, {
|
|
@@ -100,9 +106,27 @@ describe('test communication between host app and ThoughtSpot', () => {
|
|
|
100
106
|
await executeAfterWait(() => {
|
|
101
107
|
expect(spyOne).toHaveBeenCalled();
|
|
102
108
|
expect(spyTwo).not.toHaveBeenCalled();
|
|
109
|
+
expect(spyThree).not.toHaveBeenCalled();
|
|
103
110
|
}, EVENT_WAIT_TIME);
|
|
104
111
|
});
|
|
105
112
|
test('send getIframeCenter Event without eventPort', async () => {
|
|
113
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
114
|
+
...defaultViewConfig,
|
|
115
|
+
fullHeight: true,
|
|
116
|
+
pinboardId: 'eca215d4-0d2c-4a55-90e3-d81ef6848ae0',
|
|
117
|
+
});
|
|
118
|
+
liveboardEmbed.render();
|
|
119
|
+
const spy1 = jest.spyOn(global.console, 'log');
|
|
120
|
+
await executeAfterWait(() => {
|
|
121
|
+
const iframe = getIFrameEl();
|
|
122
|
+
postMessageToParent(iframe.contentWindow, {
|
|
123
|
+
type: EmbedEvent.EmbedIframeCenter,
|
|
124
|
+
data: PAYLOAD,
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
expect(spy1).toHaveBeenCalledWith('Event Port is not defined');
|
|
128
|
+
});
|
|
129
|
+
test('send getIframeCenter Event without eventPort - pinboard', async () => {
|
|
106
130
|
const pinboardEmbed = new PinboardEmbed(getRootEl(), {
|
|
107
131
|
...defaultViewConfig,
|
|
108
132
|
fullHeight: true,
|
|
@@ -119,7 +143,7 @@ describe('test communication between host app and ThoughtSpot', () => {
|
|
|
119
143
|
});
|
|
120
144
|
expect(spy1).toHaveBeenCalledWith('Event Port is not defined');
|
|
121
145
|
});
|
|
122
|
-
test('send getIframeCenter Event with eventPort', async () => {
|
|
146
|
+
test('send getIframeCenter Event with eventPort - pinboard', async () => {
|
|
123
147
|
const pinboardEmbed = new PinboardEmbed(getRootEl(), {
|
|
124
148
|
...defaultViewConfig,
|
|
125
149
|
fullHeight: true,
|
|
@@ -148,5 +172,34 @@ describe('test communication between host app and ThoughtSpot', () => {
|
|
|
148
172
|
};
|
|
149
173
|
expect(mockPort.postMessage).toHaveBeenCalledWith(heightObj);
|
|
150
174
|
});
|
|
175
|
+
test('send getIframeCenter Event with eventPort', async () => {
|
|
176
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
177
|
+
...defaultViewConfig,
|
|
178
|
+
fullHeight: true,
|
|
179
|
+
pinboardId: 'eca215d4-0d2c-4a55-90e3-d81ef6848ae0',
|
|
180
|
+
});
|
|
181
|
+
liveboardEmbed.render();
|
|
182
|
+
const mockPort = {
|
|
183
|
+
postMessage: jest.fn(),
|
|
184
|
+
};
|
|
185
|
+
await executeAfterWait(() => {
|
|
186
|
+
const iframe = getIFrameEl();
|
|
187
|
+
postMessageToParent(iframe.contentWindow, {
|
|
188
|
+
type: EmbedEvent.EmbedIframeCenter,
|
|
189
|
+
data: PAYLOAD,
|
|
190
|
+
}, mockPort);
|
|
191
|
+
});
|
|
192
|
+
const heightObj = {
|
|
193
|
+
data: {
|
|
194
|
+
iframeCenter: 0,
|
|
195
|
+
iframeHeight: 0,
|
|
196
|
+
iframeScrolled: 0,
|
|
197
|
+
iframeVisibleViewPort: 0,
|
|
198
|
+
viewPortHeight: 768,
|
|
199
|
+
},
|
|
200
|
+
type: EmbedEvent.EmbedIframeCenter,
|
|
201
|
+
};
|
|
202
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith(heightObj);
|
|
203
|
+
});
|
|
151
204
|
});
|
|
152
205
|
//# sourceMappingURL=events.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.spec.js","sourceRoot":"","sources":["../../../src/embed/events.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,WAAW,EACX,aAAa,EACb,SAAS,GACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EACH,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,SAAS,EACT,UAAU,EACV,mBAAmB,GACtB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,eAAe,GAAG,QAAQ,CAAC;AACjC,MAAM,iBAAiB,GAAG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AAC,aAAa,EACpB;gBACI,IAAI,EAAE,UAAU,CAAC,iBAAiB;gBAClC,IAAI,EAAE,OAAO;aAChB,EACD,QAAQ,CACX,CAAC;QACN,CAAC,CAAC,CAAC;QACH,MAAM,SAAS,GAAG;YACd,IAAI,EAAE;gBACF,YAAY,EAAE,CAAC;gBACf,YAAY,EAAE,CAAC;gBACf,cAAc,EAAE,CAAC;gBACjB,qBAAqB,EAAE,CAAC;gBACxB,cAAc,EAAE,GAAG;aACtB;YACD,IAAI,EAAE,UAAU,CAAC,iBAAiB;SACrC,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021
|
|
3
3
|
*
|
|
4
|
-
* Embed a ThoughtSpot
|
|
4
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
5
5
|
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
6
6
|
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
7
7
|
*
|
|
@@ -11,21 +11,21 @@
|
|
|
11
11
|
import { DOMSelector } from '../types';
|
|
12
12
|
import { V1Embed, ViewConfig } from './ts-embed';
|
|
13
13
|
/**
|
|
14
|
-
* The configuration for the embedded
|
|
14
|
+
* The configuration for the embedded Liveboard or visualization page view.
|
|
15
15
|
* @Category Liveboards and Charts
|
|
16
16
|
*/
|
|
17
17
|
export interface LiveboardViewConfig extends ViewConfig {
|
|
18
18
|
/**
|
|
19
19
|
* If set to true, the embedded object container dynamically resizes
|
|
20
|
-
* according to the height of the
|
|
20
|
+
* according to the height of the Liveboard.
|
|
21
21
|
*/
|
|
22
22
|
fullHeight?: boolean;
|
|
23
23
|
/**
|
|
24
|
-
* This is the minimum height(in pixels) for a full height
|
|
25
|
-
* Setting this height helps resolves issues with empty
|
|
26
|
-
* other screens navigable from a
|
|
24
|
+
* This is the minimum height(in pixels) for a full height Liveboard.
|
|
25
|
+
* Setting this height helps resolves issues with empty Liveboards and
|
|
26
|
+
* other screens navigable from a Liveboard.
|
|
27
|
+
* *_since 1.5.0_
|
|
27
28
|
* @default 500
|
|
28
|
-
* * _since 1.5.0_
|
|
29
29
|
*/
|
|
30
30
|
defaultHeight?: number;
|
|
31
31
|
/**
|
|
@@ -33,7 +33,7 @@ export interface LiveboardViewConfig extends ViewConfig {
|
|
|
33
33
|
*/
|
|
34
34
|
enableVizTransformations?: boolean;
|
|
35
35
|
/**
|
|
36
|
-
* The
|
|
36
|
+
* The Liveboard to display in the embedded view.
|
|
37
37
|
* Use either of liveboardId or pinboardId to reference the Liveboard to embed.
|
|
38
38
|
*/
|
|
39
39
|
liveboardId?: string;
|
|
@@ -43,12 +43,12 @@ export interface LiveboardViewConfig extends ViewConfig {
|
|
|
43
43
|
*/
|
|
44
44
|
pinboardId?: string;
|
|
45
45
|
/**
|
|
46
|
-
* The visualization within the
|
|
46
|
+
* The visualization within the Liveboard to display.
|
|
47
47
|
*/
|
|
48
48
|
vizId?: string;
|
|
49
49
|
/**
|
|
50
50
|
* If set to true, all filter chips from a
|
|
51
|
-
*
|
|
51
|
+
* Liveboard page will be read-only (no X buttons)
|
|
52
52
|
*/
|
|
53
53
|
preventLiveboardFilterRemoval?: boolean;
|
|
54
54
|
/**
|
|
@@ -58,7 +58,7 @@ export interface LiveboardViewConfig extends ViewConfig {
|
|
|
58
58
|
preventPinboardFilterRemoval?: boolean;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* Embed a ThoughtSpot
|
|
61
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
62
62
|
* @Category Liveboards and Charts
|
|
63
63
|
*/
|
|
64
64
|
export declare class LiveboardEmbed extends V1Embed {
|
|
@@ -67,16 +67,16 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
67
67
|
constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig);
|
|
68
68
|
/**
|
|
69
69
|
* Construct a map of params to be passed on to the
|
|
70
|
-
* embedded
|
|
70
|
+
* embedded Liveboard or visualization.
|
|
71
71
|
*/
|
|
72
72
|
private getEmbedParams;
|
|
73
73
|
/**
|
|
74
|
-
* Construct the URL of the embedded ThoughtSpot
|
|
74
|
+
* Construct the URL of the embedded ThoughtSpot Liveboard or visualization
|
|
75
75
|
* to be loaded within the iframe.
|
|
76
|
-
* @param liveboardId The GUID of the
|
|
77
|
-
* @param vizId The optional GUID of a visualization within the
|
|
76
|
+
* @param liveboardId The GUID of the Liveboard.
|
|
77
|
+
* @param vizId The optional GUID of a visualization within the Liveboard.
|
|
78
78
|
* @param runtimeFilters A list of runtime filters to be applied to
|
|
79
|
-
* the
|
|
79
|
+
* the Liveboard or visualization on load.
|
|
80
80
|
*/
|
|
81
81
|
private getIFrameSrc;
|
|
82
82
|
/**
|
|
@@ -86,10 +86,10 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
86
86
|
*/
|
|
87
87
|
private updateIFrameHeight;
|
|
88
88
|
private embedIframeCenter;
|
|
89
|
-
private
|
|
89
|
+
private setIframeHeightForNonEmbedLiveboard;
|
|
90
90
|
/**
|
|
91
|
-
* Render an embedded ThoughtSpot
|
|
92
|
-
* @param renderOptions An object specifying the
|
|
91
|
+
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
92
|
+
* @param renderOptions An object specifying the Liveboard ID,
|
|
93
93
|
* visualization ID and the runtime filters.
|
|
94
94
|
*/
|
|
95
95
|
render(): LiveboardEmbed;
|