@thoughtspot/visual-embed-sdk 1.8.0-plugins.4 → 1.8.0
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/base.d.ts +4 -2
- package/dist/src/embed/liveboard.d.ts +1 -1
- package/dist/src/embed/search.d.ts +4 -0
- package/dist/src/embed/ts-embed.d.ts +2 -19
- package/dist/src/index.d.ts +2 -2
- package/dist/src/types.d.ts +14 -55
- package/dist/tsembed.es.js +14 -67
- package/dist/tsembed.js +14 -67
- package/lib/package.json +3 -2
- package/lib/src/embed/base.d.ts +4 -2
- package/lib/src/embed/base.js +4 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +1 -1
- package/lib/src/embed/search.d.ts +4 -0
- package/lib/src/embed/search.js +1 -4
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +2 -19
- package/lib/src/embed/ts-embed.js +1 -17
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +5 -24
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/index.spec.js +1 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +14 -55
- package/lib/src/types.js +6 -45
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processData.js +1 -1
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +27 -78
- package/package.json +3 -2
- package/src/embed/base.ts +6 -2
- package/src/embed/liveboard.ts +1 -1
- package/src/embed/search.ts +5 -3
- package/src/embed/ts-embed.spec.ts +6 -29
- package/src/embed/ts-embed.ts +1 -35
- package/src/index.ts +0 -2
- package/src/react/index.spec.tsx +1 -1
- package/src/types.ts +12 -57
- package/src/utils/processData.ts +1 -1
- package/src/utils/plugin.ts +0 -2
package/lib/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAiB,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACH,aAAa,EAEb,cAAc,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EACH,QAAQ,EAER,eAAe,EACf,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAiB,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACH,aAAa,EAEb,cAAc,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EACH,QAAQ,EAER,eAAe,EACf,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,MAAM,GAET,MAAM,SAAS,CAAC;AAEjB,OAAO,EACH,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,aAAa,EACb,cAAc,EACd,QAAQ;AACR,QAAQ;AACR,IAAI,EACJ,QAAQ,EAER,eAAe,EACf,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,MAAM,GAKT,CAAC"}
|
|
@@ -19,7 +19,7 @@ describe('React Components', () => {
|
|
|
19
19
|
it('Should Render the Iframe with props', async () => {
|
|
20
20
|
const { container } = render(React.createElement(SearchEmbed, { hideDataSources: true }));
|
|
21
21
|
await waitFor(() => getIFrameEl(container));
|
|
22
|
-
expect(getIFrameSrc(container)).toBe(`http://${thoughtSpotHost}/?hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}&hideAction=[%22editACopy%22,%22saveAsView%22
|
|
22
|
+
expect(getIFrameSrc(container)).toBe(`http://${thoughtSpotHost}/?hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}&hideAction=[%22editACopy%22,%22saveAsView%22]&dataSourceMode=hide&useLastSelectedSources=false&isSearchEmbed=true#/embed/answer`);
|
|
23
23
|
});
|
|
24
24
|
it('Should attach event listeners', async () => {
|
|
25
25
|
const userGUID = 'absfdfgd';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../src/react/index.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AACnC,OAAO,yCAAyC,CAAC;AACjD,OAAO,EAAsB,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EACH,WAAW,EACX,YAAY,EACZ,mBAAmB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAA2B,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,MAAM,eAAe,GAAG,WAAW,CAAC;AAEpC,SAAS,CAAC,GAAG,EAAE;IACX,IAAI,CAAC;QACD,eAAe;QACf,QAAQ,EAAE,QAAQ,CAAC,IAAI;KAC1B,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC9B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QACzB,EAAE,CAAC,qCAA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interface EmbedConfig {
|
|
|
64
64
|
* and returns a Promise that resolves to the `auth token` string.
|
|
65
65
|
* For trusted authentication, the `authEndpoint` or `getAuthToken`
|
|
66
66
|
* attribute is required.
|
|
67
|
+
*
|
|
68
|
+
* It is advisable to fetch a new token inside this method and not
|
|
69
|
+
* reuse and older issued token, as because when auth expires this is
|
|
70
|
+
* called again and if it is called with an older token the authentication
|
|
71
|
+
* will not succeed.
|
|
67
72
|
*/
|
|
68
73
|
getAuthToken?: () => Promise<string>;
|
|
69
74
|
/**
|
|
@@ -104,7 +109,7 @@ export interface EmbedConfig {
|
|
|
104
109
|
suppressNoCookieAccessAlert?: boolean;
|
|
105
110
|
/**
|
|
106
111
|
* Re-login when session expires with the previous login options
|
|
107
|
-
* @default
|
|
112
|
+
* @default false
|
|
108
113
|
*/
|
|
109
114
|
autoLogin?: boolean;
|
|
110
115
|
/**
|
|
@@ -122,7 +127,6 @@ export interface EmbedConfig {
|
|
|
122
127
|
queueMultiRenders?: boolean;
|
|
123
128
|
/**
|
|
124
129
|
* Dynamic CSS Url to be injected in the loaded application.
|
|
125
|
-
* You would also need to set `style-src` in the CSP settings.
|
|
126
130
|
* @version 1.6.0 or later
|
|
127
131
|
* @default ''
|
|
128
132
|
*/
|
|
@@ -262,36 +266,18 @@ export declare enum EmbedEvent {
|
|
|
262
266
|
* @return dataSourceIds - the list of data sources
|
|
263
267
|
*/
|
|
264
268
|
DataSourceSelected = "dataSourceSelected",
|
|
265
|
-
/**
|
|
266
|
-
* One or more data columns have been selected.
|
|
267
|
-
* @return columnIds - the list of columns
|
|
268
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.2.0.cl
|
|
269
|
-
*/
|
|
270
|
-
AddRemoveColumns = "addRemoveColumns",
|
|
271
269
|
/**
|
|
272
270
|
* A custom action has been triggered
|
|
273
271
|
* @return actionId - The id of the custom action
|
|
274
272
|
* @return data - The answer or Liveboard data
|
|
275
273
|
*/
|
|
276
274
|
CustomAction = "customAction",
|
|
277
|
-
/**
|
|
278
|
-
* A click has been triggered on table/chart
|
|
279
|
-
* @return ContextMenuInputPoints - data point that is double clicked
|
|
280
|
-
* @version 1.10.0
|
|
281
|
-
*/
|
|
282
|
-
VizPointClick = "vizPointClick",
|
|
283
275
|
/**
|
|
284
276
|
* A double click has been triggered on table/chart
|
|
285
277
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
286
278
|
* @version 1.5.0 or later
|
|
287
279
|
*/
|
|
288
280
|
VizPointDoubleClick = "vizPointDoubleClick",
|
|
289
|
-
/**
|
|
290
|
-
* Event troggered when rendering a chart, call the supplied
|
|
291
|
-
* callback with the config overrides.
|
|
292
|
-
* @version 1.10.0
|
|
293
|
-
*/
|
|
294
|
-
GetVizConfigOverrides = "getVizConfigOverrides",
|
|
295
281
|
/**
|
|
296
282
|
* An error has occurred.
|
|
297
283
|
* @return error - An error object or message
|
|
@@ -392,17 +378,11 @@ export declare enum HostEvent {
|
|
|
392
378
|
*/
|
|
393
379
|
SetVisibleVizs = "SetPinboardVisibleVizs",
|
|
394
380
|
/**
|
|
395
|
-
* Update the runtime filters
|
|
396
|
-
* on to the existing runtime filters if they exist.
|
|
381
|
+
* Update the runtime filters
|
|
397
382
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
398
383
|
* @version 1.8.0 or later
|
|
399
384
|
*/
|
|
400
|
-
UpdateRuntimeFilters = "UpdateRuntimeFilters"
|
|
401
|
-
/**
|
|
402
|
-
* Highlight the point in the chart defined by the InputPoint passed.
|
|
403
|
-
* @verion 1.10.0
|
|
404
|
-
*/
|
|
405
|
-
HighlightPoint = "HighlightPoint"
|
|
385
|
+
UpdateRuntimeFilters = "UpdateRuntimeFilters"
|
|
406
386
|
}
|
|
407
387
|
/**
|
|
408
388
|
* The different visual modes that the data sources panel within
|
|
@@ -429,6 +409,7 @@ export declare enum DataSourceVisualMode {
|
|
|
429
409
|
export declare enum Param {
|
|
430
410
|
DataSources = "dataSources",
|
|
431
411
|
DataSourceMode = "dataSourceMode",
|
|
412
|
+
ExpandAllDataSource = "expandAllDataSource",
|
|
432
413
|
DisableActions = "disableAction",
|
|
433
414
|
DisableActionReason = "disableHint",
|
|
434
415
|
ForceTable = "forceTable",
|
|
@@ -503,6 +484,10 @@ export declare enum Action {
|
|
|
503
484
|
PinboardInfo = "pinboardInfo",
|
|
504
485
|
LiveboardInfo = "pinboardInfo",
|
|
505
486
|
SendAnswerFeedback = "sendFeedback",
|
|
487
|
+
/**
|
|
488
|
+
* @deprecated Will be removed in next version
|
|
489
|
+
*/
|
|
490
|
+
CustomAction = "customAction",
|
|
506
491
|
DownloadEmbraceQueries = "downloadEmbraceQueries",
|
|
507
492
|
Pin = "pin",
|
|
508
493
|
AnalysisInfo = "analysisInfo",
|
|
@@ -517,27 +502,7 @@ export declare enum Action {
|
|
|
517
502
|
Separator = "context-menu-item-separator",
|
|
518
503
|
DrillDown = "DRILL",
|
|
519
504
|
RequestAccess = "requestAccess",
|
|
520
|
-
QueryDetailsButtons = "queryDetailsButtons"
|
|
521
|
-
/**
|
|
522
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
523
|
-
*/
|
|
524
|
-
Monitor = "createMonitor",
|
|
525
|
-
/**
|
|
526
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
527
|
-
*/
|
|
528
|
-
AnswerDelete = "onDeleteAnswer",
|
|
529
|
-
/**
|
|
530
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
531
|
-
*/
|
|
532
|
-
AnswerChartSwitcher = "answerChartSwitcher",
|
|
533
|
-
/**
|
|
534
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
535
|
-
*/
|
|
536
|
-
AddToFavorites = "addToFavorites",
|
|
537
|
-
/**
|
|
538
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
539
|
-
*/
|
|
540
|
-
EditDetails = "editDetails"
|
|
505
|
+
QueryDetailsButtons = "queryDetailsButtons"
|
|
541
506
|
}
|
|
542
507
|
export interface SessionInterface {
|
|
543
508
|
sessionId: string;
|
|
@@ -554,9 +519,3 @@ export declare enum OperationType {
|
|
|
554
519
|
export interface AnswerServiceType {
|
|
555
520
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
556
521
|
}
|
|
557
|
-
export interface Plugin {
|
|
558
|
-
name: string;
|
|
559
|
-
handlers: {
|
|
560
|
-
[key in EmbedEvent]?: (payload: any, cb: (data: any) => void) => void;
|
|
561
|
-
};
|
|
562
|
-
}
|
package/lib/src/types.js
CHANGED
|
@@ -147,36 +147,18 @@ export var EmbedEvent;
|
|
|
147
147
|
* @return dataSourceIds - the list of data sources
|
|
148
148
|
*/
|
|
149
149
|
EmbedEvent["DataSourceSelected"] = "dataSourceSelected";
|
|
150
|
-
/**
|
|
151
|
-
* One or more data columns have been selected.
|
|
152
|
-
* @return columnIds - the list of columns
|
|
153
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.2.0.cl
|
|
154
|
-
*/
|
|
155
|
-
EmbedEvent["AddRemoveColumns"] = "addRemoveColumns";
|
|
156
150
|
/**
|
|
157
151
|
* A custom action has been triggered
|
|
158
152
|
* @return actionId - The id of the custom action
|
|
159
153
|
* @return data - The answer or Liveboard data
|
|
160
154
|
*/
|
|
161
155
|
EmbedEvent["CustomAction"] = "customAction";
|
|
162
|
-
/**
|
|
163
|
-
* A click has been triggered on table/chart
|
|
164
|
-
* @return ContextMenuInputPoints - data point that is double clicked
|
|
165
|
-
* @version 1.10.0
|
|
166
|
-
*/
|
|
167
|
-
EmbedEvent["VizPointClick"] = "vizPointClick";
|
|
168
156
|
/**
|
|
169
157
|
* A double click has been triggered on table/chart
|
|
170
158
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
171
159
|
* @version 1.5.0 or later
|
|
172
160
|
*/
|
|
173
161
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
174
|
-
/**
|
|
175
|
-
* Event troggered when rendering a chart, call the supplied
|
|
176
|
-
* callback with the config overrides.
|
|
177
|
-
* @version 1.10.0
|
|
178
|
-
*/
|
|
179
|
-
EmbedEvent["GetVizConfigOverrides"] = "getVizConfigOverrides";
|
|
180
162
|
/**
|
|
181
163
|
* An error has occurred.
|
|
182
164
|
* @return error - An error object or message
|
|
@@ -279,17 +261,11 @@ export var HostEvent;
|
|
|
279
261
|
*/
|
|
280
262
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
281
263
|
/**
|
|
282
|
-
* Update the runtime filters
|
|
283
|
-
* on to the existing runtime filters if they exist.
|
|
264
|
+
* Update the runtime filters
|
|
284
265
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
285
266
|
* @version 1.8.0 or later
|
|
286
267
|
*/
|
|
287
268
|
HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
|
|
288
|
-
/**
|
|
289
|
-
* Highlight the point in the chart defined by the InputPoint passed.
|
|
290
|
-
* @verion 1.10.0
|
|
291
|
-
*/
|
|
292
|
-
HostEvent["HighlightPoint"] = "HighlightPoint";
|
|
293
269
|
})(HostEvent || (HostEvent = {}));
|
|
294
270
|
/**
|
|
295
271
|
* The different visual modes that the data sources panel within
|
|
@@ -320,6 +296,7 @@ export var Param;
|
|
|
320
296
|
(function (Param) {
|
|
321
297
|
Param["DataSources"] = "dataSources";
|
|
322
298
|
Param["DataSourceMode"] = "dataSourceMode";
|
|
299
|
+
Param["ExpandAllDataSource"] = "expandAllDataSource";
|
|
323
300
|
Param["DisableActions"] = "disableAction";
|
|
324
301
|
Param["DisableActionReason"] = "disableHint";
|
|
325
302
|
Param["ForceTable"] = "forceTable";
|
|
@@ -396,6 +373,10 @@ export var Action;
|
|
|
396
373
|
Action["PinboardInfo"] = "pinboardInfo";
|
|
397
374
|
Action["LiveboardInfo"] = "pinboardInfo";
|
|
398
375
|
Action["SendAnswerFeedback"] = "sendFeedback";
|
|
376
|
+
/**
|
|
377
|
+
* @deprecated Will be removed in next version
|
|
378
|
+
*/
|
|
379
|
+
Action["CustomAction"] = "customAction";
|
|
399
380
|
Action["DownloadEmbraceQueries"] = "downloadEmbraceQueries";
|
|
400
381
|
Action["Pin"] = "pin";
|
|
401
382
|
Action["AnalysisInfo"] = "analysisInfo";
|
|
@@ -411,26 +392,6 @@ export var Action;
|
|
|
411
392
|
Action["DrillDown"] = "DRILL";
|
|
412
393
|
Action["RequestAccess"] = "requestAccess";
|
|
413
394
|
Action["QueryDetailsButtons"] = "queryDetailsButtons";
|
|
414
|
-
/**
|
|
415
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
416
|
-
*/
|
|
417
|
-
Action["Monitor"] = "createMonitor";
|
|
418
|
-
/**
|
|
419
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
420
|
-
*/
|
|
421
|
-
Action["AnswerDelete"] = "onDeleteAnswer";
|
|
422
|
-
/**
|
|
423
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
424
|
-
*/
|
|
425
|
-
Action["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
426
|
-
/**
|
|
427
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
428
|
-
*/
|
|
429
|
-
Action["AddToFavorites"] = "addToFavorites";
|
|
430
|
-
/**
|
|
431
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
432
|
-
*/
|
|
433
|
-
Action["EditDetails"] = "editDetails";
|
|
434
395
|
})(Action || (Action = {}));
|
|
435
396
|
// eslint-disable-next-line no-shadow
|
|
436
397
|
export var OperationType;
|
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,QAwBX;AAxBD,WAAY,QAAQ;IAChB;;OAEG;IACH,yBAAa,CAAA;IACb;;OAEG;IACH,4BAAgB,CAAA;IAChB;;OAEG;IACH,6BAAiB,CAAA;IACjB;;OAEG;IACH,qCAAyB,CAAA;IACzB;;;;;OAKG;IACH,2BAAe,CAAA;AACnB,CAAC,EAxBW,QAAQ,KAAR,QAAQ,QAwBnB;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,QAwBX;AAxBD,WAAY,QAAQ;IAChB;;OAEG;IACH,yBAAa,CAAA;IACb;;OAEG;IACH,4BAAgB,CAAA;IAChB;;OAEG;IACH,6BAAiB,CAAA;IACjB;;OAEG;IACH,qCAAyB,CAAA;IACzB;;;;;OAKG;IACH,2BAAe,CAAA;AACnB,CAAC,EAxBW,QAAQ,KAAR,QAAQ,QAwBnB;AA0HD;;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,CAA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C7B,+BAAqB,CAAA;IACrB,uCAA6B,CAAA;IAC7B,mDAAyC,CAAA;IACzC,+BAAqB,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,yDAA+C,CAAA;IAC/C,8CAAoC,CAAA;IACpC,wDAA8C,CAAA;IAC9C,mDAAyC,CAAA;IACzC,6BAAmB,CAAA;IACnB,yCAA+B,CAAA;IAC/B,qDAA2C,CAAA;AAC/C,CAAC,EAjEW,MAAM,KAAN,MAAM,QAiEjB;AAQD,qCAAqC;AACrC,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,sDAAqC,CAAA;IACrC,sEAAqD,CAAA;AACzD,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB"}
|
|
@@ -30,7 +30,7 @@ function processAuthInit(e) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
function processAuthExpire(e) {
|
|
33
|
-
const { autoLogin =
|
|
33
|
+
const { autoLogin = false } = getEmbedConfig(); // Set default to false
|
|
34
34
|
if (autoLogin) {
|
|
35
35
|
handleAuth();
|
|
36
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processData.js","sourceRoot":"","sources":["../../../src/utils/processData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,UAAU,mBAAmB,CAAC,CAAM,EAAE,eAAuB;;IAC/D,IACI;QACI,aAAa,CAAC,gBAAgB;QAC9B,aAAa,CAAC,wBAAwB;KACzC,CAAC,QAAQ,CAAC,MAAA,CAAC,CAAC,IAAI,0CAAE,SAAS,CAAC,EAC/B;QACE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC;QAC7C,MAAM,aAAa,GAAG,wBAAwB,CAC1C,OAAO,EACP,KAAK,EACL,SAAS,EACT,eAAe,CAClB,CAAC;QACF,OAAO;YACH,GAAG,CAAC;YACJ,aAAa;SAChB,CAAC;KACL;IACD,OAAO,CAAC,CAAC;AACb,CAAC;AAED,SAAS,eAAe,CAAC,CAAM;;IAC3B,0CAA0C;IAC1C,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAEpB,gEAAgE;IAChE,OAAO;QACH,GAAG,CAAC;QACJ,IAAI,EAAE;YACF,QAAQ,EAAE,CAAA,MAAA,CAAC,CAAC,IAAI,0CAAE,QAAQ,MAAI,MAAA,CAAC,CAAC,OAAO,0CAAE,QAAQ,CAAA;SACpD;KACJ,CAAC;AACN,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAM;IAC7B,MAAM,EAAE,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"processData.js","sourceRoot":"","sources":["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Ac,CAC1B,IAAgB,EAChB,CAAM,EACN,eAAuB;IAEvB,QAAQ,IAAI,EAAE;QACV,KAAK,UAAU,CAAC,YAAY;YACxB,OAAO,mBAAmB,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;QACnD,KAAK,UAAU,CAAC,QAAQ;YACpB,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC;QAC9B,KAAK,UAAU,CAAC,UAAU;YACtB,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAChC,QAAQ;KACX;IACD,OAAO,CAAC,CAAC;AACb,CAAC"}
|
|
@@ -14,8 +14,8 @@ declare module '@thoughtspot/visual-embed-sdk' {
|
|
|
14
14
|
import { init, prefetch } from '@thoughtspot/visual-embed-sdk/embed/base';
|
|
15
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
|
-
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig
|
|
18
|
-
export { init, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig,
|
|
17
|
+
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig } from '@thoughtspot/visual-embed-sdk/types';
|
|
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' {
|
|
@@ -125,7 +125,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/base' {
|
|
|
125
125
|
/**
|
|
126
126
|
* Perform authentication on the ThoughtSpot app as applicable.
|
|
127
127
|
*/
|
|
128
|
-
export const handleAuth: () => void
|
|
128
|
+
export const handleAuth: () => Promise<void>;
|
|
129
129
|
export const getEmbedConfig: () => EmbedConfig;
|
|
130
130
|
export const getAuthPromise: () => Promise<void>;
|
|
131
131
|
/**
|
|
@@ -138,8 +138,10 @@ declare module '@thoughtspot/visual-embed-sdk/embed/base' {
|
|
|
138
138
|
* authentication if applicable.
|
|
139
139
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
140
140
|
* authentication mechanism and so on.
|
|
141
|
+
*
|
|
142
|
+
* @returns authPromise Promise which resolves when authentication is complete.
|
|
141
143
|
*/
|
|
142
|
-
export const init: (embedConfig: EmbedConfig) => void
|
|
144
|
+
export const init: (embedConfig: EmbedConfig) => Promise<void>;
|
|
143
145
|
/**
|
|
144
146
|
* Renders functions in a queue, resolves to next function only after the callback next is called
|
|
145
147
|
* @param fn The function being registered
|
|
@@ -174,7 +176,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
|
|
|
174
176
|
* This is the minimum height(in pixels) for a full height Liveboard.
|
|
175
177
|
* Setting this height helps resolves issues with empty Liveboards and
|
|
176
178
|
* other screens navigable from a Liveboard.
|
|
177
|
-
*
|
|
179
|
+
* *_since 1.5.0_
|
|
178
180
|
* @default 500
|
|
179
181
|
*/
|
|
180
182
|
defaultHeight?: number;
|
|
@@ -275,6 +277,10 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
|
|
|
275
277
|
* using raw answer data.
|
|
276
278
|
*/
|
|
277
279
|
hideResults?: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* If set to true, expands all the data sources panel.
|
|
282
|
+
*/
|
|
283
|
+
expandAllDataSource?: boolean;
|
|
278
284
|
/**
|
|
279
285
|
* If set to true, the Search Assist feature is enabled.
|
|
280
286
|
*/
|
|
@@ -381,6 +387,11 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
381
387
|
* and returns a Promise that resolves to the `auth token` string.
|
|
382
388
|
* For trusted authentication, the `authEndpoint` or `getAuthToken`
|
|
383
389
|
* attribute is required.
|
|
390
|
+
*
|
|
391
|
+
* It is advisable to fetch a new token inside this method and not
|
|
392
|
+
* reuse and older issued token, as because when auth expires this is
|
|
393
|
+
* called again and if it is called with an older token the authentication
|
|
394
|
+
* will not succeed.
|
|
384
395
|
*/
|
|
385
396
|
getAuthToken?: () => Promise<string>;
|
|
386
397
|
/**
|
|
@@ -421,7 +432,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
421
432
|
suppressNoCookieAccessAlert?: boolean;
|
|
422
433
|
/**
|
|
423
434
|
* Re-login when session expires with the previous login options
|
|
424
|
-
* @default
|
|
435
|
+
* @default false
|
|
425
436
|
*/
|
|
426
437
|
autoLogin?: boolean;
|
|
427
438
|
/**
|
|
@@ -439,7 +450,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
439
450
|
queueMultiRenders?: boolean;
|
|
440
451
|
/**
|
|
441
452
|
* Dynamic CSS Url to be injected in the loaded application.
|
|
442
|
-
* You would also need to set `style-src` in the CSP settings.
|
|
443
453
|
* @version 1.6.0 or later
|
|
444
454
|
* @default ''
|
|
445
455
|
*/
|
|
@@ -579,36 +589,18 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
579
589
|
* @return dataSourceIds - the list of data sources
|
|
580
590
|
*/
|
|
581
591
|
DataSourceSelected = "dataSourceSelected",
|
|
582
|
-
/**
|
|
583
|
-
* One or more data columns have been selected.
|
|
584
|
-
* @return columnIds - the list of columns
|
|
585
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.2.0.cl
|
|
586
|
-
*/
|
|
587
|
-
AddRemoveColumns = "addRemoveColumns",
|
|
588
592
|
/**
|
|
589
593
|
* A custom action has been triggered
|
|
590
594
|
* @return actionId - The id of the custom action
|
|
591
595
|
* @return data - The answer or Liveboard data
|
|
592
596
|
*/
|
|
593
597
|
CustomAction = "customAction",
|
|
594
|
-
/**
|
|
595
|
-
* A click has been triggered on table/chart
|
|
596
|
-
* @return ContextMenuInputPoints - data point that is double clicked
|
|
597
|
-
* @version 1.10.0
|
|
598
|
-
*/
|
|
599
|
-
VizPointClick = "vizPointClick",
|
|
600
598
|
/**
|
|
601
599
|
* A double click has been triggered on table/chart
|
|
602
600
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
603
601
|
* @version 1.5.0 or later
|
|
604
602
|
*/
|
|
605
603
|
VizPointDoubleClick = "vizPointDoubleClick",
|
|
606
|
-
/**
|
|
607
|
-
* Event troggered when rendering a chart, call the supplied
|
|
608
|
-
* callback with the config overrides.
|
|
609
|
-
* @version 1.10.0
|
|
610
|
-
*/
|
|
611
|
-
GetVizConfigOverrides = "getVizConfigOverrides",
|
|
612
604
|
/**
|
|
613
605
|
* An error has occurred.
|
|
614
606
|
* @return error - An error object or message
|
|
@@ -709,17 +701,11 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
709
701
|
*/
|
|
710
702
|
SetVisibleVizs = "SetPinboardVisibleVizs",
|
|
711
703
|
/**
|
|
712
|
-
* Update the runtime filters
|
|
713
|
-
* on to the existing runtime filters if they exist.
|
|
704
|
+
* Update the runtime filters
|
|
714
705
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
715
706
|
* @version 1.8.0 or later
|
|
716
707
|
*/
|
|
717
|
-
UpdateRuntimeFilters = "UpdateRuntimeFilters"
|
|
718
|
-
/**
|
|
719
|
-
* Highlight the point in the chart defined by the InputPoint passed.
|
|
720
|
-
* @verion 1.10.0
|
|
721
|
-
*/
|
|
722
|
-
HighlightPoint = "HighlightPoint"
|
|
708
|
+
UpdateRuntimeFilters = "UpdateRuntimeFilters"
|
|
723
709
|
}
|
|
724
710
|
/**
|
|
725
711
|
* The different visual modes that the data sources panel within
|
|
@@ -746,6 +732,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
746
732
|
export enum Param {
|
|
747
733
|
DataSources = "dataSources",
|
|
748
734
|
DataSourceMode = "dataSourceMode",
|
|
735
|
+
ExpandAllDataSource = "expandAllDataSource",
|
|
749
736
|
DisableActions = "disableAction",
|
|
750
737
|
DisableActionReason = "disableHint",
|
|
751
738
|
ForceTable = "forceTable",
|
|
@@ -820,6 +807,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
820
807
|
PinboardInfo = "pinboardInfo",
|
|
821
808
|
LiveboardInfo = "pinboardInfo",
|
|
822
809
|
SendAnswerFeedback = "sendFeedback",
|
|
810
|
+
/**
|
|
811
|
+
* @deprecated Will be removed in next version
|
|
812
|
+
*/
|
|
813
|
+
CustomAction = "customAction",
|
|
823
814
|
DownloadEmbraceQueries = "downloadEmbraceQueries",
|
|
824
815
|
Pin = "pin",
|
|
825
816
|
AnalysisInfo = "analysisInfo",
|
|
@@ -834,27 +825,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
834
825
|
Separator = "context-menu-item-separator",
|
|
835
826
|
DrillDown = "DRILL",
|
|
836
827
|
RequestAccess = "requestAccess",
|
|
837
|
-
QueryDetailsButtons = "queryDetailsButtons"
|
|
838
|
-
/**
|
|
839
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
840
|
-
*/
|
|
841
|
-
Monitor = "createMonitor",
|
|
842
|
-
/**
|
|
843
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
844
|
-
*/
|
|
845
|
-
AnswerDelete = "onDeleteAnswer",
|
|
846
|
-
/**
|
|
847
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
848
|
-
*/
|
|
849
|
-
AnswerChartSwitcher = "answerChartSwitcher",
|
|
850
|
-
/**
|
|
851
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
852
|
-
*/
|
|
853
|
-
AddToFavorites = "addToFavorites",
|
|
854
|
-
/**
|
|
855
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
856
|
-
*/
|
|
857
|
-
EditDetails = "editDetails"
|
|
828
|
+
QueryDetailsButtons = "queryDetailsButtons"
|
|
858
829
|
}
|
|
859
830
|
export interface SessionInterface {
|
|
860
831
|
sessionId: string;
|
|
@@ -871,12 +842,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
871
842
|
export interface AnswerServiceType {
|
|
872
843
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
873
844
|
}
|
|
874
|
-
export interface Plugin {
|
|
875
|
-
name: string;
|
|
876
|
-
handlers: {
|
|
877
|
-
[key in EmbedEvent]?: (payload: any, cb: (data: any) => void) => void;
|
|
878
|
-
};
|
|
879
|
-
}
|
|
880
845
|
}
|
|
881
846
|
|
|
882
847
|
declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
@@ -888,7 +853,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
|
888
853
|
* @summary Base classes
|
|
889
854
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
890
855
|
*/
|
|
891
|
-
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig
|
|
856
|
+
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig } from '@thoughtspot/visual-embed-sdk/types';
|
|
892
857
|
export interface LayoutConfig {
|
|
893
858
|
}
|
|
894
859
|
/**
|
|
@@ -941,7 +906,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
|
941
906
|
/**
|
|
942
907
|
* The list of actions to display from the primary menu, more menu
|
|
943
908
|
* (...), and the contextual menu.
|
|
944
|
-
*
|
|
909
|
+
* * _since 1.6.0_
|
|
945
910
|
*/
|
|
946
911
|
visibleActions?: Action[];
|
|
947
912
|
/**
|
|
@@ -949,22 +914,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
|
949
914
|
* visualization, or Liveboard.
|
|
950
915
|
*/
|
|
951
916
|
runtimeFilters?: RuntimeFilter[];
|
|
952
|
-
/**
|
|
953
|
-
* This is an object (key/val) of override flags which will be applied
|
|
954
|
-
* to the internal embedded object. This can be used to add any
|
|
955
|
-
* URL flag.
|
|
956
|
-
* @version 1.8.0
|
|
957
|
-
*/
|
|
958
|
-
additionalFlags?: {
|
|
959
|
-
[key: string]: string | number | boolean;
|
|
960
|
-
};
|
|
961
|
-
/**
|
|
962
|
-
* Provide a list of plugins, the plugins are executed in the order
|
|
963
|
-
* provided below,
|
|
964
|
-
*
|
|
965
|
-
* @version alpha
|
|
966
|
-
*/
|
|
967
|
-
plugins?: Plugin[];
|
|
968
917
|
}
|
|
969
918
|
/**
|
|
970
919
|
* Base class for embedding v2 experience
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.8.0
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"test": "npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",
|
|
35
35
|
"posttest": "cat ./coverage/lcov.info | coveralls",
|
|
36
36
|
"prepublishOnly": "npm run test; npm run tsc; npm run bundle-dts; npm run build",
|
|
37
|
-
"publish-dev": "npm publish --tag
|
|
37
|
+
"publish-dev": "npm publish --tag dev",
|
|
38
38
|
"publish-prod": "npm publish --tag latest"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -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",
|
package/src/embed/base.ts
CHANGED
|
@@ -19,12 +19,13 @@ export let authPromise: Promise<void>;
|
|
|
19
19
|
/**
|
|
20
20
|
* Perform authentication on the ThoughtSpot app as applicable.
|
|
21
21
|
*/
|
|
22
|
-
export const handleAuth = (): void => {
|
|
22
|
+
export const handleAuth = (): Promise<void> => {
|
|
23
23
|
const authConfig = {
|
|
24
24
|
...config,
|
|
25
25
|
thoughtSpotHost: getThoughtSpotHost(config),
|
|
26
26
|
};
|
|
27
27
|
authPromise = authenticate(authConfig);
|
|
28
|
+
return authPromise;
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
export const getEmbedConfig = (): EmbedConfig => config;
|
|
@@ -55,8 +56,10 @@ export const prefetch = (url?: string): void => {
|
|
|
55
56
|
* authentication if applicable.
|
|
56
57
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
57
58
|
* authentication mechanism and so on.
|
|
59
|
+
*
|
|
60
|
+
* @returns authPromise Promise which resolves when authentication is complete.
|
|
58
61
|
*/
|
|
59
|
-
export const init = (embedConfig: EmbedConfig): void => {
|
|
62
|
+
export const init = (embedConfig: EmbedConfig): Promise<void> => {
|
|
60
63
|
config = embedConfig;
|
|
61
64
|
handleAuth();
|
|
62
65
|
|
|
@@ -68,6 +71,7 @@ export const init = (embedConfig: EmbedConfig): void => {
|
|
|
68
71
|
if (config.callPrefetch) {
|
|
69
72
|
prefetch(config.thoughtSpotHost);
|
|
70
73
|
}
|
|
74
|
+
return authPromise;
|
|
71
75
|
};
|
|
72
76
|
|
|
73
77
|
let renderQueue: Promise<any> = Promise.resolve();
|
package/src/embed/liveboard.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface LiveboardViewConfig extends ViewConfig {
|
|
|
35
35
|
* This is the minimum height(in pixels) for a full height Liveboard.
|
|
36
36
|
* Setting this height helps resolves issues with empty Liveboards and
|
|
37
37
|
* other screens navigable from a Liveboard.
|
|
38
|
-
*
|
|
38
|
+
* *_since 1.5.0_
|
|
39
39
|
* @default 500
|
|
40
40
|
*/
|
|
41
41
|
defaultHeight?: number;
|
package/src/embed/search.ts
CHANGED
|
@@ -49,6 +49,10 @@ export interface SearchViewConfig extends ViewConfig {
|
|
|
49
49
|
* using raw answer data.
|
|
50
50
|
*/
|
|
51
51
|
hideResults?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* If set to true, expands all the data sources panel.
|
|
54
|
+
*/
|
|
55
|
+
expandAllDataSource?: boolean;
|
|
52
56
|
/**
|
|
53
57
|
* If set to true, the Search Assist feature is enabled.
|
|
54
58
|
*/
|
|
@@ -80,9 +84,6 @@ export interface SearchViewConfig extends ViewConfig {
|
|
|
80
84
|
export const HiddenActionItemByDefaultForSearchEmbed = [
|
|
81
85
|
Action.EditACopy,
|
|
82
86
|
Action.SaveAsView,
|
|
83
|
-
Action.UpdateTML,
|
|
84
|
-
Action.EditTML,
|
|
85
|
-
Action.AnswerDelete,
|
|
86
87
|
];
|
|
87
88
|
|
|
88
89
|
/**
|
|
@@ -126,6 +127,7 @@ export class SearchEmbed extends TsEmbed {
|
|
|
126
127
|
private getIFrameSrc(answerId: string, dataSources?: string[]) {
|
|
127
128
|
const {
|
|
128
129
|
hideResults,
|
|
130
|
+
expandAllDataSource,
|
|
129
131
|
enableSearchAssist,
|
|
130
132
|
forceTable,
|
|
131
133
|
searchOptions,
|