@thoughtspot/visual-embed-sdk 1.33.2 → 1.33.4
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 +1 -1
- package/cjs/package.json +1 -1
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +5 -2
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/auth.spec.js +15 -3
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/css-variables.d.ts +2 -2
- package/cjs/src/embed/app.d.ts +20 -6
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +3 -2
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +10 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.spec.js +13 -1
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +4 -0
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +13 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +0 -3
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +1 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +2 -2
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search.js +1 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +6 -6
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +10 -9
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/react/index.spec.js +1 -1
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/tokenizedFetch.d.ts +0 -1
- package/cjs/src/tokenizedFetch.d.ts.map +1 -1
- package/cjs/src/tokenizedFetch.js +0 -1
- package/cjs/src/tokenizedFetch.js.map +1 -1
- package/cjs/src/types.d.ts +40 -22
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +35 -17
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +0 -1
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/sessionInfoService.d.ts +0 -4
- package/cjs/src/utils/sessionInfoService.d.ts.map +1 -1
- package/cjs/src/utils/sessionInfoService.js +0 -4
- package/cjs/src/utils/sessionInfoService.js.map +1 -1
- package/cjs/src/utils.d.ts +1 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +13 -3
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +6 -6
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-CqrIh3Vj.js → index-Cl8Rsh6W.js} +1 -1
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +2 -2
- package/dist/src/embed/app.d.ts +20 -6
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +0 -3
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/tokenizedFetch.d.ts +0 -1
- package/dist/src/tokenizedFetch.d.ts.map +1 -1
- package/dist/src/types.d.ts +40 -22
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/src/utils/sessionInfoService.d.ts +0 -4
- package/dist/src/utils/sessionInfoService.d.ts.map +1 -1
- package/dist/src/utils.d.ts +1 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +72 -42
- package/dist/tsembed-react.js +71 -41
- package/dist/tsembed.es.js +72 -42
- package/dist/tsembed.js +71 -41
- package/dist/visual-embed-sdk-react-full.d.ts +62 -38
- package/dist/visual-embed-sdk-react.d.ts +62 -38
- package/dist/visual-embed-sdk.d.ts +62 -38
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +6 -3
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +15 -3
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/css-variables.d.ts +2 -2
- package/lib/src/embed/app.d.ts +20 -6
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +3 -2
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +10 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.spec.js +13 -1
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +4 -0
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +13 -0
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +0 -3
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +1 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +2 -2
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search.js +1 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +6 -6
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +10 -9
- package/lib/src/errors.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/tokenizedFetch.d.ts +0 -1
- package/lib/src/tokenizedFetch.d.ts.map +1 -1
- package/lib/src/tokenizedFetch.js +0 -1
- package/lib/src/tokenizedFetch.js.map +1 -1
- package/lib/src/types.d.ts +40 -22
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +35 -17
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +0 -1
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/sessionInfoService.d.ts +0 -4
- package/lib/src/utils/sessionInfoService.d.ts.map +1 -1
- package/lib/src/utils/sessionInfoService.js +0 -4
- package/lib/src/utils/sessionInfoService.js.map +1 -1
- package/lib/src/utils.d.ts +1 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +11 -2
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +6 -6
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +62 -38
- package/package.json +1 -1
- package/src/auth.spec.ts +15 -3
- package/src/auth.ts +7 -3
- package/src/css-variables.ts +2 -2
- package/src/embed/app.spec.ts +15 -0
- package/src/embed/app.ts +23 -7
- package/src/embed/base.spec.ts +13 -1
- package/src/embed/conversation.spec.ts +16 -0
- package/src/embed/conversation.ts +4 -0
- package/src/embed/liveboard.spec.ts +2 -2
- package/src/embed/liveboard.ts +1 -4
- package/src/embed/search.spec.ts +6 -6
- package/src/embed/search.ts +1 -1
- package/src/embed/ts-embed.spec.ts +1 -1
- package/src/errors.ts +10 -9
- package/src/react/index.spec.tsx +1 -1
- package/src/tokenizedFetch.ts +0 -1
- package/src/types.ts +38 -20
- package/src/utils/processData.ts +0 -1
- package/src/utils/sessionInfoService.ts +0 -4
- package/src/utils.spec.ts +6 -6
- package/src/utils.ts +14 -2
|
@@ -67,7 +67,7 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
test('should render liveboard with data panel v2 flag set to
|
|
70
|
+
test('should render liveboard with data panel v2 flag set to false by default', async () => {
|
|
71
71
|
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
72
72
|
...defaultViewConfig,
|
|
73
73
|
liveboardId,
|
|
@@ -76,7 +76,7 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
76
76
|
await executeAfterWait(() => {
|
|
77
77
|
expectUrlMatchesWithParams(
|
|
78
78
|
getIFrameSrc(),
|
|
79
|
-
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&enableDataPanelV2=
|
|
79
|
+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&enableDataPanelV2=false#/embed/viz/${liveboardId}`,
|
|
80
80
|
);
|
|
81
81
|
});
|
|
82
82
|
});
|
package/src/embed/liveboard.ts
CHANGED
|
@@ -270,7 +270,6 @@ export interface LiveboardViewConfig
|
|
|
270
270
|
*
|
|
271
271
|
* Since, this will show preview images, be careful that it may show
|
|
272
272
|
* undesired data to the user when using row level security.
|
|
273
|
-
*
|
|
274
273
|
* @example
|
|
275
274
|
* ```js
|
|
276
275
|
* const embed = new LiveboardEmbed('#embed-container', {
|
|
@@ -280,7 +279,6 @@ export interface LiveboardViewConfig
|
|
|
280
279
|
* });
|
|
281
280
|
* embed.render();
|
|
282
281
|
* ```
|
|
283
|
-
*
|
|
284
282
|
* @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
|
|
285
283
|
*/
|
|
286
284
|
showPreviewLoader?: boolean;
|
|
@@ -385,7 +383,7 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
385
383
|
showLiveboardReverifyBanner = true,
|
|
386
384
|
enableAskSage,
|
|
387
385
|
enable2ColumnLayout,
|
|
388
|
-
dataPanelV2 =
|
|
386
|
+
dataPanelV2 = false,
|
|
389
387
|
enableCustomColumnGroups = false,
|
|
390
388
|
} = this.viewConfig;
|
|
391
389
|
|
|
@@ -613,7 +611,6 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
613
611
|
/**
|
|
614
612
|
* Returns the full url of the liveboard/viz which can be used to open
|
|
615
613
|
* this liveboard inside the full Thoughtspot application in a new tab.
|
|
616
|
-
*
|
|
617
614
|
* @returns url string
|
|
618
615
|
*/
|
|
619
616
|
public getLiveboardUrl(): string {
|
package/src/embed/search.spec.ts
CHANGED
|
@@ -52,7 +52,7 @@ describe('Search embed tests', () => {
|
|
|
52
52
|
await executeAfterWait(() => {
|
|
53
53
|
expectUrlMatchesWithParams(
|
|
54
54
|
getIFrameSrc(),
|
|
55
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&enableDataPanelV2=
|
|
55
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&enableDataPanelV2=false&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
|
|
56
56
|
);
|
|
57
57
|
});
|
|
58
58
|
});
|
|
@@ -438,7 +438,7 @@ describe('Search embed tests', () => {
|
|
|
438
438
|
await executeAfterWait(() => {
|
|
439
439
|
expectUrlMatchesWithParams(
|
|
440
440
|
getIFrameSrc(),
|
|
441
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=
|
|
441
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=true${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
442
442
|
);
|
|
443
443
|
});
|
|
444
444
|
});
|
|
@@ -453,7 +453,7 @@ describe('Search embed tests', () => {
|
|
|
453
453
|
await executeAfterWait(() => {
|
|
454
454
|
expectUrlMatchesWithParams(
|
|
455
455
|
getIFrameSrc(),
|
|
456
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=
|
|
456
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
457
457
|
);
|
|
458
458
|
});
|
|
459
459
|
});
|
|
@@ -468,7 +468,7 @@ describe('Search embed tests', () => {
|
|
|
468
468
|
await executeAfterWait(() => {
|
|
469
469
|
expectUrlMatchesWithParams(
|
|
470
470
|
getIFrameSrc(),
|
|
471
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=
|
|
471
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
472
472
|
);
|
|
473
473
|
});
|
|
474
474
|
});
|
|
@@ -499,7 +499,7 @@ describe('Search embed tests', () => {
|
|
|
499
499
|
await executeAfterWait(() => {
|
|
500
500
|
expectUrlMatchesWithParams(
|
|
501
501
|
getIFrameSrc(),
|
|
502
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=
|
|
502
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false&hideSearchBar=true${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
503
503
|
);
|
|
504
504
|
});
|
|
505
505
|
});
|
|
@@ -514,7 +514,7 @@ describe('Search embed tests', () => {
|
|
|
514
514
|
await executeAfterWait(() => {
|
|
515
515
|
expectUrlMatchesWithParams(
|
|
516
516
|
getIFrameSrc(),
|
|
517
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=
|
|
517
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
518
518
|
);
|
|
519
519
|
});
|
|
520
520
|
});
|
package/src/embed/search.ts
CHANGED
|
@@ -330,7 +330,7 @@ export class SearchEmbed extends TsEmbed {
|
|
|
330
330
|
dataSources,
|
|
331
331
|
excludeRuntimeFiltersfromURL,
|
|
332
332
|
hideSearchBar,
|
|
333
|
-
dataPanelV2 =
|
|
333
|
+
dataPanelV2 = false,
|
|
334
334
|
useLastSelectedSources = false,
|
|
335
335
|
runtimeParameters,
|
|
336
336
|
collapseSearchBarInitially = false,
|
|
@@ -1615,7 +1615,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
1615
1615
|
});
|
|
1616
1616
|
libEmbed.preRender();
|
|
1617
1617
|
|
|
1618
|
-
expect(logger.error).toHaveBeenCalledWith('PreRender
|
|
1618
|
+
expect(logger.error).toHaveBeenCalledWith('PreRender ID is required for preRender');
|
|
1619
1619
|
});
|
|
1620
1620
|
|
|
1621
1621
|
it('showPreRender should preRender if not available', async () => {
|
package/src/errors.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
export const ERROR_MESSAGE = {
|
|
2
2
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a worksheet to get started',
|
|
4
|
+
LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
|
|
5
|
+
TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
|
|
6
|
+
SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
|
|
7
|
+
SAGE_EMBED_BETA_WARNING_MESSAGE: 'SageEmbed is in Beta in this release.',
|
|
8
|
+
THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third-party cookie access is blocked on this browser. Please allow third-party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
|
|
9
|
+
DUPLICATE_TOKEN_ERR: 'Duplicate token. Please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
|
|
9
10
|
SDK_NOT_INITIALIZED: 'SDK not initialized',
|
|
10
|
-
SESSION_INFO_FAILED: 'Failed to get session
|
|
11
|
+
SESSION_INFO_FAILED: 'Failed to get session information',
|
|
11
12
|
INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
|
|
12
13
|
MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
|
|
13
|
-
PRERENDER_ID_MISSING: 'PreRender
|
|
14
|
+
PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
|
|
14
15
|
SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
|
|
15
16
|
CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
|
|
16
|
-
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please
|
|
17
|
+
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
|
|
17
18
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
18
19
|
};
|
package/src/react/index.spec.tsx
CHANGED
|
@@ -56,7 +56,7 @@ describe('React Components', () => {
|
|
|
56
56
|
),
|
|
57
57
|
).toBe(true);
|
|
58
58
|
expect(getIFrameSrc(container)).toBe(
|
|
59
|
-
`http://${thoughtSpotHost}/?hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}&authType=None&blockNonEmbedFullAppAccess=true&hideAction=[%22${Action.ReportError}%22,%22editACopy%22,%22saveAsView%22,%22updateTSL%22,%22editTSL%22,%22onDeleteAnswer%22]&overrideConsoleLogs=true&clientLogLevel=ERROR&enableDataPanelV2=
|
|
59
|
+
`http://${thoughtSpotHost}/?hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}&authType=None&blockNonEmbedFullAppAccess=true&hideAction=[%22${Action.ReportError}%22,%22editACopy%22,%22saveAsView%22,%22updateTSL%22,%22editTSL%22,%22onDeleteAnswer%22]&overrideConsoleLogs=true&clientLogLevel=ERROR&enableDataPanelV2=false&dataSourceMode=hide&useLastSelectedSources=false&isSearchEmbed=true&collapseSearchBarInitially=true&enableCustomColumnGroups=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_ALL#/embed/answer`,
|
|
60
60
|
);
|
|
61
61
|
});
|
|
62
62
|
|
package/src/tokenizedFetch.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { AuthType } from './types';
|
|
|
7
7
|
* Fetch wrapper that adds the authentication token to the request.
|
|
8
8
|
* Use this to call the ThoughtSpot APIs when using the visual embed sdk.
|
|
9
9
|
* The interface for this method is the same as Web `Fetch`.
|
|
10
|
-
*
|
|
11
10
|
* @param input
|
|
12
11
|
* @param init
|
|
13
12
|
* @example
|
package/src/types.ts
CHANGED
|
@@ -1017,7 +1017,7 @@ export interface ViewConfig {
|
|
|
1017
1017
|
// eslint-disable-next-line camelcase
|
|
1018
1018
|
enableV2Shell_experimental?: boolean;
|
|
1019
1019
|
/**
|
|
1020
|
-
* To set the initial state of the search bar in case of saved
|
|
1020
|
+
* To set the initial state of the search bar in case of saved Answers.
|
|
1021
1021
|
* @default true
|
|
1022
1022
|
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
1023
1023
|
* @example
|
|
@@ -1030,7 +1030,7 @@ export interface ViewConfig {
|
|
|
1030
1030
|
collapseSearchBar?: boolean;
|
|
1031
1031
|
/**
|
|
1032
1032
|
* This flag can be used to disable links inside the embedded app,
|
|
1033
|
-
* and
|
|
1033
|
+
* and disable redirection of links in a new tab.
|
|
1034
1034
|
* @example
|
|
1035
1035
|
* ```js
|
|
1036
1036
|
* const embed = new LiveboardEmbed('#embed', {
|
|
@@ -1042,7 +1042,7 @@ export interface ViewConfig {
|
|
|
1042
1042
|
disableRedirectionLinksInNewTab?: boolean;
|
|
1043
1043
|
/**
|
|
1044
1044
|
* Flag to control Data panel experience
|
|
1045
|
-
* @default
|
|
1045
|
+
* @default false
|
|
1046
1046
|
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
1047
1047
|
* @example
|
|
1048
1048
|
* ```js
|
|
@@ -2167,22 +2167,26 @@ export enum EmbedEvent {
|
|
|
2167
2167
|
*/
|
|
2168
2168
|
Rename = 'rename',
|
|
2169
2169
|
/**
|
|
2170
|
-
* Emitted if the user wants to intercept the search execution
|
|
2171
|
-
* and implement logic to decide whether to run the search or not
|
|
2172
2170
|
*
|
|
2173
|
-
*
|
|
2171
|
+
* This event can be emitted to intercept search execution initiated by
|
|
2172
|
+
* the users and implement the logic to allow or restrict search execution.
|
|
2173
|
+
* You can can also show custom error text if the search query must be
|
|
2174
|
+
* restricted due to your application or business requirements.
|
|
2175
|
+
|
|
2176
|
+
* Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
2174
2177
|
* for this embed event to get emitted.
|
|
2175
2178
|
* @param: payload
|
|
2176
2179
|
* @param: responder
|
|
2177
2180
|
* Contains elements that lets developers define whether ThoughtSpot
|
|
2178
|
-
*
|
|
2181
|
+
* should run the search, and if not, what error message
|
|
2182
|
+
* should be shown to the user.
|
|
2179
2183
|
*
|
|
2180
|
-
* execute: When execute returns true
|
|
2181
|
-
* When execute returns false
|
|
2184
|
+
* execute: When execute returns `true`, the search will be run.
|
|
2185
|
+
* When execute returns `false`, the search will not be executed.
|
|
2182
2186
|
*
|
|
2183
|
-
* error: Developers can customize the
|
|
2184
|
-
*
|
|
2185
|
-
* @version SDK : 1.29.0 | Thoughtspot : 10.
|
|
2187
|
+
* error: Developers can customize the error message text when `execute`
|
|
2188
|
+
* returns `false` using the error parameter in responder.
|
|
2189
|
+
* @version SDK : 1.29.0 | Thoughtspot : 10.3.0.cl
|
|
2186
2190
|
* @example
|
|
2187
2191
|
*```js
|
|
2188
2192
|
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
@@ -2222,15 +2226,15 @@ export enum EmbedEvent {
|
|
|
2222
2226
|
*/
|
|
2223
2227
|
OnBeforeGetVizDataIntercept = 'onBeforeGetVizDataIntercept',
|
|
2224
2228
|
/**
|
|
2225
|
-
* Emitted when parameter changes in an
|
|
2226
|
-
* or
|
|
2229
|
+
* Emitted when parameter changes in an Answer
|
|
2230
|
+
* or Liveboard
|
|
2227
2231
|
*
|
|
2228
2232
|
* ```js
|
|
2229
2233
|
* liveboardEmbed.on(EmbedEvent.ParameterChanged, (payload) => {
|
|
2230
2234
|
* console.log('payload', payload);
|
|
2231
2235
|
* })
|
|
2232
2236
|
*```
|
|
2233
|
-
* @version SDK : 1.29.0 | Thoughtspot : 10.
|
|
2237
|
+
* @version SDK : 1.29.0 | Thoughtspot : 10.3.0.cl
|
|
2234
2238
|
*/
|
|
2235
2239
|
ParameterChanged = 'parameterChanged',
|
|
2236
2240
|
}
|
|
@@ -2961,8 +2965,12 @@ export enum HostEvent {
|
|
|
2961
2965
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
|
|
2962
2966
|
*
|
|
2963
2967
|
* `values` - An array of one or several values. The value definition on the
|
|
2964
|
-
* data type you choose to filter on. For a complete list of supported data types,
|
|
2965
|
-
*
|
|
2968
|
+
* data type you choose to filter on. For a complete list of supported data types, see
|
|
2969
|
+
* link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Supported data types].
|
|
2970
|
+
*
|
|
2971
|
+
* `type` - To update filters for date time, specify the date format type.
|
|
2972
|
+
* For more information and examples, see link:https://developers.thoughtspot.com/docs/embed-liveboard#_date_filters[Date filters].
|
|
2973
|
+
*
|
|
2966
2974
|
* @example
|
|
2967
2975
|
* ```js
|
|
2968
2976
|
*
|
|
@@ -3092,7 +3100,7 @@ export enum HostEvent {
|
|
|
3092
3100
|
*/
|
|
3093
3101
|
AskSage = 'AskSage',
|
|
3094
3102
|
/**
|
|
3095
|
-
* Trigger
|
|
3103
|
+
* Trigger cross filter update action on a Liveboard
|
|
3096
3104
|
* @example
|
|
3097
3105
|
* ```js
|
|
3098
3106
|
* liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
|
|
@@ -3107,7 +3115,7 @@ export enum HostEvent {
|
|
|
3107
3115
|
*/
|
|
3108
3116
|
UpdateCrossFilter = 'UpdateCrossFilter',
|
|
3109
3117
|
/**
|
|
3110
|
-
* Trigger
|
|
3118
|
+
* Trigger reset action for a personalized Liveboard view.
|
|
3111
3119
|
* @example
|
|
3112
3120
|
* ```js
|
|
3113
3121
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
@@ -3253,6 +3261,7 @@ export enum Param {
|
|
|
3253
3261
|
ShowLiveboardReverifyBanner = 'showLiveboardReverifyBanner',
|
|
3254
3262
|
LiveboardHeaderV2 = 'isLiveboardHeaderV2Enabled',
|
|
3255
3263
|
SpotterEnabled = 'isSpotterExperienceEnabled',
|
|
3264
|
+
IsUnifiedSearchExperienceEnabled = 'isUnifiedSearchExperienceEnabled',
|
|
3256
3265
|
}
|
|
3257
3266
|
|
|
3258
3267
|
/**
|
|
@@ -4234,7 +4243,7 @@ export enum Action {
|
|
|
4234
4243
|
AIHighlights = 'AIHighlights',
|
|
4235
4244
|
|
|
4236
4245
|
/**
|
|
4237
|
-
* Action ID for edit schedule action on schedule on homepage
|
|
4246
|
+
* Action ID for edit the schedule action on schedule on homepage
|
|
4238
4247
|
* @example
|
|
4239
4248
|
* ```js
|
|
4240
4249
|
* disabledActions: [Action.EditScheduleHomepage]
|
|
@@ -4302,6 +4311,15 @@ export enum Action {
|
|
|
4302
4311
|
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
4303
4312
|
*/
|
|
4304
4313
|
KPIAnalysisCTA = 'kpiAnalysisCTA',
|
|
4314
|
+
/**
|
|
4315
|
+
* Action ID for disabling chip reorder in Answer and Liveboard
|
|
4316
|
+
* @example
|
|
4317
|
+
* ```js
|
|
4318
|
+
* const disabledActions = [Action.DisableChipReorder]
|
|
4319
|
+
* ```
|
|
4320
|
+
* @version SDK: 1.35.0 | Thoughtspot: 10.5.0.cl
|
|
4321
|
+
*/
|
|
4322
|
+
DisableChipReorder = 'disableChipReorder',
|
|
4305
4323
|
}
|
|
4306
4324
|
|
|
4307
4325
|
export interface AnswerServiceType {
|
package/src/utils/processData.ts
CHANGED
|
@@ -19,7 +19,6 @@ let sessionInfo: null | SessionInfo = null;
|
|
|
19
19
|
* Returns the session info object and caches it for future use.
|
|
20
20
|
* Once fetched the session info object is cached and returned from the cache on
|
|
21
21
|
* subsequent calls.
|
|
22
|
-
*
|
|
23
22
|
* @example ```js
|
|
24
23
|
* const sessionInfo = await getSessionInfo();
|
|
25
24
|
* console.log(sessionInfo);
|
|
@@ -40,7 +39,6 @@ export async function getSessionInfo(): Promise<SessionInfo> {
|
|
|
40
39
|
/**
|
|
41
40
|
* Returns the cached session info object. If the client is not authenticated the
|
|
42
41
|
* function will return null.
|
|
43
|
-
*
|
|
44
42
|
* @example ```js
|
|
45
43
|
* const sessionInfo = getCachedSessionInfo();
|
|
46
44
|
* if (sessionInfo) {
|
|
@@ -58,7 +56,6 @@ export function getCachedSessionInfo(): SessionInfo | null {
|
|
|
58
56
|
|
|
59
57
|
/**
|
|
60
58
|
* Processes the session info response and returns the session info object.
|
|
61
|
-
*
|
|
62
59
|
* @param sessionInfoResp {any} Response from the session info API.
|
|
63
60
|
* @returns {SessionInfo} The session info object.
|
|
64
61
|
* @example ```js
|
|
@@ -87,7 +84,6 @@ export const getSessionDetails = (sessionInfoResp: any): SessionInfo => {
|
|
|
87
84
|
|
|
88
85
|
/**
|
|
89
86
|
* Resets the cached session info object and forces a new fetch on the next call.
|
|
90
|
-
*
|
|
91
87
|
* @example ```js
|
|
92
88
|
* resetCachedSessionInfo();
|
|
93
89
|
* const sessionInfo = await getSessionInfo();
|
package/src/utils.spec.ts
CHANGED
|
@@ -119,9 +119,9 @@ describe('unit test for utils', () => {
|
|
|
119
119
|
|
|
120
120
|
test('appendToUrlHash', () => {
|
|
121
121
|
expect(appendToUrlHash('http://myhost:3000', 'hashFrag')).toBe(
|
|
122
|
-
'http://myhost:3000
|
|
122
|
+
'http://myhost:3000#?tsSSOMarker=hashFrag',
|
|
123
123
|
);
|
|
124
|
-
expect(appendToUrlHash('http://xyz.com/#foo', 'bar')).toBe('http://xyz.com/#
|
|
124
|
+
expect(appendToUrlHash('http://xyz.com/#foo', 'bar')).toBe('http://xyz.com/#foo?tsSSOMarker=bar');
|
|
125
125
|
});
|
|
126
126
|
|
|
127
127
|
describe('getRedirectURL', () => {
|
|
@@ -135,9 +135,9 @@ describe('unit test for utils', () => {
|
|
|
135
135
|
|
|
136
136
|
test('Should return correct value when path is undefined', () => {
|
|
137
137
|
expect(getRedirectUrl('http://myhost:3000', 'hashFrag')).toBe(
|
|
138
|
-
'http://myhost:3000
|
|
138
|
+
'http://myhost:3000#?tsSSOMarker=hashFrag',
|
|
139
139
|
);
|
|
140
|
-
expect(getRedirectUrl('http://xyz.com/#foo', 'bar')).toBe('http://xyz.com/#
|
|
140
|
+
expect(getRedirectUrl('http://xyz.com/#foo', 'bar')).toBe('http://xyz.com/#foo?tsSSOMarker=bar');
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
test('Should return correct value when path is set', () => {
|
|
@@ -148,11 +148,11 @@ describe('unit test for utils', () => {
|
|
|
148
148
|
}));
|
|
149
149
|
|
|
150
150
|
expect(getRedirectUrl('http://myhost:3000/', 'hashFrag', '/bar')).toBe(
|
|
151
|
-
'http://myhost:3000/bar
|
|
151
|
+
'http://myhost:3000/bar#?tsSSOMarker=hashFrag',
|
|
152
152
|
);
|
|
153
153
|
|
|
154
154
|
expect(getRedirectUrl('http://myhost:3000/#/foo', 'hashFrag', '#/bar')).toBe(
|
|
155
|
-
'http://myhost:3000/#/
|
|
155
|
+
'http://myhost:3000/#/bar?tsSSOMarker=hashFrag',
|
|
156
156
|
);
|
|
157
157
|
});
|
|
158
158
|
});
|
package/src/utils.ts
CHANGED
|
@@ -131,6 +131,11 @@ export const getCssDimension = (value: number | string): string => {
|
|
|
131
131
|
return value;
|
|
132
132
|
};
|
|
133
133
|
|
|
134
|
+
export const getSSOMarker = (markerId: string) => {
|
|
135
|
+
const encStringToAppend = encodeURIComponent(markerId);
|
|
136
|
+
return `tsSSOMarker=${encStringToAppend}`;
|
|
137
|
+
};
|
|
138
|
+
|
|
134
139
|
/**
|
|
135
140
|
* Append a string to a URL's hash fragment
|
|
136
141
|
* @param url A URL
|
|
@@ -140,11 +145,18 @@ export const appendToUrlHash = (url: string, stringToAppend: string) => {
|
|
|
140
145
|
let outputUrl = url;
|
|
141
146
|
const encStringToAppend = encodeURIComponent(stringToAppend);
|
|
142
147
|
|
|
148
|
+
const marker = `tsSSOMarker=${encStringToAppend}`;
|
|
149
|
+
|
|
150
|
+
let splitAdder = '';
|
|
151
|
+
|
|
143
152
|
if (url.indexOf('#') >= 0) {
|
|
144
|
-
|
|
153
|
+
// If second half of hash contains a '?' already add a '&' instead of
|
|
154
|
+
// '?' which appends to query params.
|
|
155
|
+
splitAdder = url.split('#')[1].indexOf('?') >= 0 ? '&' : '?';
|
|
145
156
|
} else {
|
|
146
|
-
|
|
157
|
+
splitAdder = '#?';
|
|
147
158
|
}
|
|
159
|
+
outputUrl = `${outputUrl}${splitAdder}${marker}`;
|
|
148
160
|
|
|
149
161
|
return outputUrl;
|
|
150
162
|
};
|