@thoughtspot/visual-embed-sdk 1.36.7 → 1.36.9-PA
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +23 -21
- package/cjs/src/embed/bodyless-conversation.d.ts +16 -0
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +1 -1
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +15 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +4 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +25 -1
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +1 -1
- package/cjs/src/embed/search.d.ts +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +14 -2
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +111 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/pages/embed-test.page.d.ts +8 -0
- package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
- package/cjs/src/pages/embed-test.page.js +20 -0
- package/cjs/src/pages/embed-test.page.js.map +1 -0
- package/cjs/src/pages/home.page.d.ts +6 -0
- package/cjs/src/pages/home.page.d.ts.map +1 -0
- package/cjs/src/pages/home.page.js +12 -0
- package/cjs/src/pages/home.page.js.map +1 -0
- package/cjs/src/pages/login.page.d.ts +15 -0
- package/cjs/src/pages/login.page.d.ts.map +1 -0
- package/cjs/src/pages/login.page.js +22 -0
- package/cjs/src/pages/login.page.js.map +1 -0
- package/cjs/src/react/index.d.ts +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +10 -5
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/util.d.ts +2 -0
- package/cjs/src/react/util.d.ts.map +1 -1
- package/cjs/src/react/util.js.map +1 -1
- package/cjs/src/tests/auth.test.d.ts +1 -0
- package/cjs/src/tests/auth.test.d.ts.map +1 -0
- package/cjs/src/tests/auth.test.js +1 -0
- package/cjs/src/tests/auth.test.js.map +1 -0
- package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
- package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
- package/cjs/src/tests/e2e/auth.spec.js +54 -0
- package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
- package/cjs/src/types.d.ts +93 -11
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +56 -9
- package/cjs/src/types.js.map +1 -1
- package/dist/index-BEyovSez.js +7370 -0
- package/dist/{index-BratITNz.js → index-BJx3m5_V.js} +1 -1
- package/dist/index-CpzF_6NO.js +7440 -0
- package/dist/index-Dg18PU5Z.js +7370 -0
- package/dist/index-Do_T8J8z.js +7370 -0
- package/dist/index-KdQfn0ah.js +7440 -0
- package/dist/src/embed/bodyless-conversation.d.ts +16 -0
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +15 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +1 -1
- package/dist/src/embed/search.d.ts +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/pages/embed-test.page.d.ts +8 -0
- package/dist/src/pages/embed-test.page.d.ts.map +1 -0
- package/dist/src/pages/home.page.d.ts +6 -0
- package/dist/src/pages/home.page.d.ts.map +1 -0
- package/dist/src/pages/login.page.d.ts +15 -0
- package/dist/src/pages/login.page.d.ts.map +1 -0
- package/dist/src/react/index.d.ts +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/react/util.d.ts +2 -0
- package/dist/src/react/util.d.ts.map +1 -1
- package/dist/src/tests/auth.test.d.ts +1 -0
- package/dist/src/tests/auth.test.d.ts.map +1 -0
- package/dist/src/tests/e2e/auth.spec.d.ts +2 -0
- package/dist/src/tests/e2e/auth.spec.d.ts.map +1 -0
- package/dist/src/types.d.ts +93 -11
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +85 -19
- package/dist/tsembed-react.js +269 -133
- package/dist/tsembed.es.js +78 -16
- package/dist/tsembed.js +261 -129
- package/dist/visual-embed-sdk-react-full.d.ts +127 -14
- package/dist/visual-embed-sdk-react.d.ts +127 -14
- package/dist/visual-embed-sdk.d.ts +126 -14
- package/lib/package.json +23 -21
- package/lib/src/embed/bodyless-conversation.d.ts +16 -0
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +1 -1
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +15 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +4 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +25 -1
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +1 -1
- package/lib/src/embed/search.d.ts +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +14 -2
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +111 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/pages/embed-test.page.d.ts +8 -0
- package/lib/src/pages/embed-test.page.d.ts.map +1 -0
- package/lib/src/pages/embed-test.page.js +16 -0
- package/lib/src/pages/embed-test.page.js.map +1 -0
- package/lib/src/pages/home.page.d.ts +6 -0
- package/lib/src/pages/home.page.d.ts.map +1 -0
- package/lib/src/pages/home.page.js +8 -0
- package/lib/src/pages/home.page.js.map +1 -0
- package/lib/src/pages/login.page.d.ts +15 -0
- package/lib/src/pages/login.page.d.ts.map +1 -0
- package/lib/src/pages/login.page.js +18 -0
- package/lib/src/pages/login.page.js.map +1 -0
- package/lib/src/react/index.d.ts +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +9 -5
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/util.d.ts +2 -0
- package/lib/src/react/util.d.ts.map +1 -1
- package/lib/src/react/util.js.map +1 -1
- package/lib/src/tests/auth.test.d.ts +1 -0
- package/lib/src/tests/auth.test.d.ts.map +1 -0
- package/lib/src/tests/auth.test.js +1 -0
- package/lib/src/tests/auth.test.js.map +1 -0
- package/lib/src/tests/e2e/auth.spec.d.ts +2 -0
- package/lib/src/tests/e2e/auth.spec.d.ts.map +1 -0
- package/lib/src/tests/e2e/auth.spec.js +52 -0
- package/lib/src/tests/e2e/auth.spec.js.map +1 -0
- package/lib/src/types.d.ts +93 -11
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +55 -8
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +128 -15
- package/package.json +23 -21
- package/src/embed/bodyless-conversation.ts +1 -1
- package/src/embed/liveboard.spec.ts +35 -7
- package/src/embed/liveboard.ts +21 -1
- package/src/embed/search-bar.tsx +1 -1
- package/src/embed/search.ts +1 -1
- package/src/embed/ts-embed.spec.ts +118 -0
- package/src/embed/ts-embed.ts +15 -0
- package/src/index.ts +2 -0
- package/src/react/index.tsx +12 -8
- package/src/react/util.ts +1 -0
- package/src/types.ts +94 -10
package/src/embed/search.ts
CHANGED
|
@@ -206,7 +206,7 @@ export interface SearchViewConfig
|
|
|
206
206
|
/**
|
|
207
207
|
* Exclude the search token string from the URL.
|
|
208
208
|
* If set to true, the search token string is not appended to the URL.
|
|
209
|
-
* @version: SDK: 1.35.7 | ThoughtSpot: 10.
|
|
209
|
+
* @version: SDK: 1.35.7 | ThoughtSpot: 10.8.0.cl
|
|
210
210
|
* @example
|
|
211
211
|
* ```js
|
|
212
212
|
* const embed = new SearchEmbed('#tsEmbed', {
|
|
@@ -346,6 +346,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
346
346
|
runtimeParameterParams: null,
|
|
347
347
|
hiddenHomeLeftNavItems: [],
|
|
348
348
|
hiddenHomepageModules: [],
|
|
349
|
+
hiddenListColumns: [],
|
|
349
350
|
hostConfig: undefined,
|
|
350
351
|
reorderedHomepageModules: [],
|
|
351
352
|
customVariablesForThirdPartyTools,
|
|
@@ -381,6 +382,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
381
382
|
runtimeParameterParams: null,
|
|
382
383
|
hiddenHomeLeftNavItems: [],
|
|
383
384
|
hiddenHomepageModules: [],
|
|
385
|
+
hiddenListColumns: [],
|
|
384
386
|
hostConfig: undefined,
|
|
385
387
|
reorderedHomepageModules: [],
|
|
386
388
|
customVariablesForThirdPartyTools,
|
|
@@ -422,6 +424,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
422
424
|
runtimeParameterParams: null,
|
|
423
425
|
hiddenHomeLeftNavItems: [],
|
|
424
426
|
hiddenHomepageModules: [HomepageModule.MyLibrary, HomepageModule.Learning],
|
|
427
|
+
hiddenListColumns: [],
|
|
425
428
|
reorderedHomepageModules: [],
|
|
426
429
|
customVariablesForThirdPartyTools,
|
|
427
430
|
},
|
|
@@ -459,6 +462,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
459
462
|
runtimeParameterParams: null,
|
|
460
463
|
hiddenHomeLeftNavItems: [],
|
|
461
464
|
hiddenHomepageModules: [],
|
|
465
|
+
hiddenListColumns: [],
|
|
462
466
|
reorderedHomepageModules: [],
|
|
463
467
|
customVariablesForThirdPartyTools,
|
|
464
468
|
},
|
|
@@ -499,6 +503,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
499
503
|
runtimeParameterParams: null,
|
|
500
504
|
hiddenHomeLeftNavItems: [],
|
|
501
505
|
hiddenHomepageModules: [],
|
|
506
|
+
hiddenListColumns: [],
|
|
502
507
|
reorderedHomepageModules:
|
|
503
508
|
[HomepageModule.MyLibrary, HomepageModule.Watchlist],
|
|
504
509
|
customVariablesForThirdPartyTools,
|
|
@@ -542,6 +547,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
542
547
|
runtimeParameterParams: 'param1=color¶mVal1=blue',
|
|
543
548
|
hiddenHomeLeftNavItems: [],
|
|
544
549
|
hiddenHomepageModules: [],
|
|
550
|
+
hiddenListColumns: [],
|
|
545
551
|
hostConfig: undefined,
|
|
546
552
|
reorderedHomepageModules: [],
|
|
547
553
|
customVariablesForThirdPartyTools,
|
|
@@ -586,6 +592,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
586
592
|
runtimeParameterParams: null,
|
|
587
593
|
hiddenHomeLeftNavItems: [],
|
|
588
594
|
hiddenHomepageModules: [],
|
|
595
|
+
hiddenListColumns: [],
|
|
589
596
|
hostConfig: undefined,
|
|
590
597
|
reorderedHomepageModules: [],
|
|
591
598
|
customVariablesForThirdPartyTools,
|
|
@@ -629,6 +636,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
629
636
|
runtimeParameterParams: null,
|
|
630
637
|
hiddenHomeLeftNavItems: [],
|
|
631
638
|
hiddenHomepageModules: [],
|
|
639
|
+
hiddenListColumns: [],
|
|
632
640
|
hostConfig: undefined,
|
|
633
641
|
reorderedHomepageModules: [],
|
|
634
642
|
customVariablesForThirdPartyTools,
|
|
@@ -673,6 +681,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
673
681
|
runtimeParameterParams: null,
|
|
674
682
|
hiddenHomeLeftNavItems: [],
|
|
675
683
|
hiddenHomepageModules: [],
|
|
684
|
+
hiddenListColumns: [],
|
|
676
685
|
hostConfig: undefined,
|
|
677
686
|
reorderedHomepageModules: [],
|
|
678
687
|
customVariablesForThirdPartyTools,
|
|
@@ -716,6 +725,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
716
725
|
hiddenHomeLeftNavItems:
|
|
717
726
|
[HomeLeftNavItem.Home, HomeLeftNavItem.MonitorSubscription],
|
|
718
727
|
hiddenHomepageModules: [],
|
|
728
|
+
hiddenListColumns: [],
|
|
719
729
|
reorderedHomepageModules: [],
|
|
720
730
|
customVariablesForThirdPartyTools,
|
|
721
731
|
},
|
|
@@ -883,6 +893,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
883
893
|
runtimeParameterParams: null,
|
|
884
894
|
hiddenHomeLeftNavItems: [],
|
|
885
895
|
hiddenHomepageModules: [],
|
|
896
|
+
hiddenListColumns: [],
|
|
886
897
|
hostConfig: undefined,
|
|
887
898
|
reorderedHomepageModules: [],
|
|
888
899
|
customVariablesForThirdPartyTools: {},
|
|
@@ -894,6 +905,113 @@ describe('Unit test case for ts embed', () => {
|
|
|
894
905
|
});
|
|
895
906
|
});
|
|
896
907
|
|
|
908
|
+
describe('StringIDs and StringIDsUrl in customisations', () => {
|
|
909
|
+
const customisationWithStringIds = {
|
|
910
|
+
style: {
|
|
911
|
+
customCSS: {},
|
|
912
|
+
},
|
|
913
|
+
content: {
|
|
914
|
+
strings: {
|
|
915
|
+
Liveboard: 'Dashboard',
|
|
916
|
+
},
|
|
917
|
+
stringIDsUrl: 'https://sample-string-ids-url.com',
|
|
918
|
+
stringIDs: {
|
|
919
|
+
'liveboard.header.title': 'Dashboard name',
|
|
920
|
+
},
|
|
921
|
+
},
|
|
922
|
+
};
|
|
923
|
+
beforeEach(() => {
|
|
924
|
+
jest.spyOn(authInstance, 'doCookielessTokenAuth').mockResolvedValueOnce(true);
|
|
925
|
+
jest.spyOn(authService, 'verifyTokenService').mockResolvedValue(true);
|
|
926
|
+
init({
|
|
927
|
+
thoughtSpotHost: 'tshost',
|
|
928
|
+
customizations: customisationWithStringIds,
|
|
929
|
+
authType: AuthType.TrustedAuthTokenCookieless,
|
|
930
|
+
getAuthToken: () => Promise.resolve('test_auth_token1'),
|
|
931
|
+
});
|
|
932
|
+
});
|
|
933
|
+
|
|
934
|
+
afterEach(() => {
|
|
935
|
+
baseInstance.reset();
|
|
936
|
+
jest.clearAllMocks();
|
|
937
|
+
});
|
|
938
|
+
|
|
939
|
+
test('should pass stringIDsUrl and stringIDs in customisations during APP_INIT', async () => {
|
|
940
|
+
const mockEmbedEventPayload = {
|
|
941
|
+
type: EmbedEvent.APP_INIT,
|
|
942
|
+
data: {},
|
|
943
|
+
};
|
|
944
|
+
const searchEmbed = new SearchEmbed(getRootEl(), defaultViewConfig);
|
|
945
|
+
searchEmbed.render();
|
|
946
|
+
const mockPort: any = {
|
|
947
|
+
postMessage: jest.fn(),
|
|
948
|
+
};
|
|
949
|
+
|
|
950
|
+
await executeAfterWait(() => {
|
|
951
|
+
const iframe = getIFrameEl();
|
|
952
|
+
expect(iframe.src).toContain('overrideStringIDsUrl=https://sample-string-ids-url.com');
|
|
953
|
+
postMessageToParent(iframe.contentWindow, mockEmbedEventPayload, mockPort);
|
|
954
|
+
});
|
|
955
|
+
|
|
956
|
+
await executeAfterWait(() => {
|
|
957
|
+
expect(mockPort.postMessage).toHaveBeenCalledWith({
|
|
958
|
+
type: EmbedEvent.APP_INIT,
|
|
959
|
+
data: {
|
|
960
|
+
customisations: {
|
|
961
|
+
content: {
|
|
962
|
+
strings: {
|
|
963
|
+
Liveboard: 'Dashboard',
|
|
964
|
+
},
|
|
965
|
+
stringIDsUrl: 'https://sample-string-ids-url.com',
|
|
966
|
+
stringIDs: {
|
|
967
|
+
'liveboard.header.title': 'Dashboard name',
|
|
968
|
+
},
|
|
969
|
+
},
|
|
970
|
+
style: {
|
|
971
|
+
customCSS: {},
|
|
972
|
+
customCSSUrl: undefined,
|
|
973
|
+
},
|
|
974
|
+
},
|
|
975
|
+
authToken: 'test_auth_token1',
|
|
976
|
+
runtimeFilterParams: null,
|
|
977
|
+
runtimeParameterParams: null,
|
|
978
|
+
hiddenHomeLeftNavItems: [],
|
|
979
|
+
hiddenHomepageModules: [],
|
|
980
|
+
hiddenListColumns: [],
|
|
981
|
+
hostConfig: undefined,
|
|
982
|
+
reorderedHomepageModules: [],
|
|
983
|
+
customVariablesForThirdPartyTools: {},
|
|
984
|
+
},
|
|
985
|
+
});
|
|
986
|
+
const customisationContent = mockPort.postMessage.mock.calls[0][0].data.customisations.content;
|
|
987
|
+
expect(customisationContent.stringIDsUrl)
|
|
988
|
+
.toBe('https://sample-string-ids-url.com');
|
|
989
|
+
expect(customisationContent.stringIDs)
|
|
990
|
+
.toEqual({
|
|
991
|
+
'liveboard.header.title': 'Dashboard name',
|
|
992
|
+
});
|
|
993
|
+
});
|
|
994
|
+
});
|
|
995
|
+
|
|
996
|
+
test('should allow passing exposeTranslationIDs in viewConfig', async () => {
|
|
997
|
+
const mockEmbedEventPayload = {
|
|
998
|
+
type: EmbedEvent.APP_INIT,
|
|
999
|
+
data: {},
|
|
1000
|
+
};
|
|
1001
|
+
const searchEmbed = new SearchEmbed(getRootEl(), { ...defaultViewConfig, exposeTranslationIDs: true });
|
|
1002
|
+
searchEmbed.render();
|
|
1003
|
+
const mockPort: any = {
|
|
1004
|
+
postMessage: jest.fn(),
|
|
1005
|
+
};
|
|
1006
|
+
|
|
1007
|
+
await executeAfterWait(() => {
|
|
1008
|
+
const iframe = getIFrameEl();
|
|
1009
|
+
expect(iframe.src).toContain('exposeTranslationIDs=true');
|
|
1010
|
+
postMessageToParent(iframe.contentWindow, mockEmbedEventPayload, mockPort);
|
|
1011
|
+
});
|
|
1012
|
+
});
|
|
1013
|
+
});
|
|
1014
|
+
|
|
897
1015
|
describe('Token fetch fails in cookieless authentication authType', () => {
|
|
898
1016
|
beforeEach(() => {
|
|
899
1017
|
jest.spyOn(authInstance, 'doCookielessTokenAuth').mockResolvedValueOnce(true);
|
package/src/embed/ts-embed.ts
CHANGED
|
@@ -377,6 +377,7 @@ export class TsEmbed {
|
|
|
377
377
|
: [],
|
|
378
378
|
customVariablesForThirdPartyTools:
|
|
379
379
|
this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
380
|
+
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
380
381
|
};
|
|
381
382
|
}
|
|
382
383
|
|
|
@@ -538,6 +539,8 @@ export class TsEmbed {
|
|
|
538
539
|
insertInToSlide,
|
|
539
540
|
disableRedirectionLinksInNewTab,
|
|
540
541
|
overrideOrgId,
|
|
542
|
+
exposeTranslationIDs,
|
|
543
|
+
primaryAction,
|
|
541
544
|
} = this.viewConfig;
|
|
542
545
|
|
|
543
546
|
const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
|
|
@@ -556,6 +559,9 @@ export class TsEmbed {
|
|
|
556
559
|
this.handleError('You cannot have both hidden Tabs and visible Tabs');
|
|
557
560
|
return queryParams;
|
|
558
561
|
}
|
|
562
|
+
if (primaryAction) {
|
|
563
|
+
queryParams[Param.PrimaryAction] = primaryAction;
|
|
564
|
+
}
|
|
559
565
|
|
|
560
566
|
if (disabledActions?.length) {
|
|
561
567
|
queryParams[Param.DisableActions] = disabledActions;
|
|
@@ -563,6 +569,9 @@ export class TsEmbed {
|
|
|
563
569
|
if (disabledActionReason) {
|
|
564
570
|
queryParams[Param.DisableActionReason] = disabledActionReason;
|
|
565
571
|
}
|
|
572
|
+
if (exposeTranslationIDs) {
|
|
573
|
+
queryParams[Param.ExposeTranslationIDs] = exposeTranslationIDs;
|
|
574
|
+
}
|
|
566
575
|
queryParams[Param.HideActions] = [...this.defaultHiddenActions, ...(hiddenActions ?? [])];
|
|
567
576
|
if (Array.isArray(visibleActions)) {
|
|
568
577
|
queryParams[Param.VisibleActions] = visibleActions;
|
|
@@ -592,6 +601,12 @@ export class TsEmbed {
|
|
|
592
601
|
queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
|
|
593
602
|
}
|
|
594
603
|
|
|
604
|
+
const stringIDsUrl = customizations?.content?.stringIDsUrl
|
|
605
|
+
|| embedCustomizations?.content?.stringIDsUrl;
|
|
606
|
+
if (stringIDsUrl) {
|
|
607
|
+
queryParams[Param.StringIDsUrl] = stringIDsUrl;
|
|
608
|
+
}
|
|
609
|
+
|
|
595
610
|
if (showAlerts !== undefined) {
|
|
596
611
|
queryParams[Param.ShowAlerts] = showAlerts;
|
|
597
612
|
}
|
package/src/index.ts
CHANGED
|
@@ -52,6 +52,7 @@ import {
|
|
|
52
52
|
LogLevel,
|
|
53
53
|
VizPoint,
|
|
54
54
|
CustomActionPayload,
|
|
55
|
+
ListPageColumns,
|
|
55
56
|
} from './types';
|
|
56
57
|
import { CustomCssVariables } from './css-variables';
|
|
57
58
|
import { SageEmbed, SageViewConfig } from './embed/sage';
|
|
@@ -129,6 +130,7 @@ export {
|
|
|
129
130
|
VizPoint,
|
|
130
131
|
CustomActionPayload,
|
|
131
132
|
UIPassthroughEvent,
|
|
133
|
+
ListPageColumns,
|
|
132
134
|
};
|
|
133
135
|
|
|
134
136
|
export { resetCachedAuthToken } from './authToken';
|
package/src/react/index.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
1
|
+
import React, { useRef, PropsWithoutRef } from 'react';
|
|
2
2
|
import useDeepCompareEffect from 'use-deep-compare-effect';
|
|
3
3
|
import { AuthEventEmitter } from '../auth';
|
|
4
4
|
import { deepMerge } from '../utils';
|
|
@@ -21,11 +21,11 @@ const componentFactory = <T extends typeof TsEmbed, U extends EmbedProps, V exte
|
|
|
21
21
|
// Embed.preRender() method instead of the usual render method, and it will
|
|
22
22
|
// not be destroyed when the component is unmounted.
|
|
23
23
|
isPreRenderedComponent = false,
|
|
24
|
-
) => React.forwardRef<InstanceType<T>, U
|
|
25
|
-
(props
|
|
24
|
+
) => React.forwardRef<InstanceType<T>, PropsWithoutRef<U>>(
|
|
25
|
+
(props, forwardedRef) => {
|
|
26
26
|
const ref = React.useRef<HTMLDivElement>(null);
|
|
27
|
-
const { className, ...embedProps } = props;
|
|
28
|
-
const { viewConfig, listeners } = getViewPropsAndListeners<Omit<U, 'className'>, V>(
|
|
27
|
+
const { className, style, ...embedProps } = props as U;
|
|
28
|
+
const { viewConfig, listeners } = getViewPropsAndListeners<Omit<U, 'className' | 'style'>, V>(
|
|
29
29
|
embedProps,
|
|
30
30
|
);
|
|
31
31
|
|
|
@@ -82,8 +82,11 @@ const componentFactory = <T extends typeof TsEmbed, U extends EmbedProps, V exte
|
|
|
82
82
|
});
|
|
83
83
|
handleRendering(tsEmbed);
|
|
84
84
|
if (forwardedRef) {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
if (typeof forwardedRef === 'function') {
|
|
86
|
+
forwardedRef(tsEmbed);
|
|
87
|
+
} else {
|
|
88
|
+
forwardedRef.current = tsEmbed;
|
|
89
|
+
}
|
|
87
90
|
}
|
|
88
91
|
return () => {
|
|
89
92
|
handleDestroy(tsEmbed);
|
|
@@ -93,7 +96,7 @@ const componentFactory = <T extends typeof TsEmbed, U extends EmbedProps, V exte
|
|
|
93
96
|
return viewConfig.insertAsSibling ? (
|
|
94
97
|
<span data-testid="tsEmbed" ref={ref} style={{ position: 'absolute' }}></span>
|
|
95
98
|
) : (
|
|
96
|
-
<div data-testid="tsEmbed" ref={ref} className={className}></div>
|
|
99
|
+
<div data-testid="tsEmbed" ref={ref} style={style} className={`ts-embed-container ${className}`}></div>
|
|
97
100
|
);
|
|
98
101
|
},
|
|
99
102
|
);
|
|
@@ -444,4 +447,5 @@ export {
|
|
|
444
447
|
HomepageModule,
|
|
445
448
|
LogLevel,
|
|
446
449
|
getSessionInfo,
|
|
450
|
+
ListPageColumns,
|
|
447
451
|
} from '../index';
|
package/src/react/util.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type EmbedEventHandlers = { [key in keyof typeof EmbedEvent as `on${Capit
|
|
|
4
4
|
|
|
5
5
|
export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
|
|
6
6
|
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export interface ViewConfigAndListeners<T extends ViewConfig> {
|
package/src/types.ts
CHANGED
|
@@ -297,6 +297,8 @@ export interface CustomisationsInterface {
|
|
|
297
297
|
* @version SDK: 1.26.0 | 9.7.0.cl
|
|
298
298
|
*/
|
|
299
299
|
strings?: Record<string, any>;
|
|
300
|
+
stringIDs?: Record<string, string>;
|
|
301
|
+
stringIDsUrl?: string;
|
|
300
302
|
[key: string]: any;
|
|
301
303
|
};
|
|
302
304
|
iconSpriteUrl?: string;
|
|
@@ -626,14 +628,14 @@ export interface EmbedConfig {
|
|
|
626
628
|
* }
|
|
627
629
|
* });
|
|
628
630
|
* ```
|
|
629
|
-
* @version SDK 1.37.0 | ThoughtSpot: 10.
|
|
631
|
+
* @version SDK 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
630
632
|
*/
|
|
631
633
|
customVariablesForThirdPartyTools?: Record< string, any >;
|
|
632
634
|
|
|
633
635
|
disablePreauthCache?: boolean;
|
|
634
636
|
}
|
|
635
637
|
|
|
636
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
638
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
637
639
|
export interface LayoutConfig {}
|
|
638
640
|
|
|
639
641
|
/**
|
|
@@ -710,6 +712,19 @@ export interface ViewConfig {
|
|
|
710
712
|
* ```
|
|
711
713
|
*/
|
|
712
714
|
disabledActions?: Action[];
|
|
715
|
+
/**
|
|
716
|
+
* The primary action to display on top of the viz for Liveboard and App Embed.
|
|
717
|
+
* Use this to set the primary action.
|
|
718
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
719
|
+
* @example
|
|
720
|
+
* ```js
|
|
721
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
722
|
+
* ... // other liveboard view config
|
|
723
|
+
* primaryAction: Action.Download
|
|
724
|
+
* });
|
|
725
|
+
* ```
|
|
726
|
+
*/
|
|
727
|
+
primaryAction?: Action | string;
|
|
713
728
|
/**
|
|
714
729
|
* The tooltip to display for disabled actions.
|
|
715
730
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
@@ -1072,6 +1087,12 @@ export interface ViewConfig {
|
|
|
1072
1087
|
* });
|
|
1073
1088
|
*/
|
|
1074
1089
|
collapseSearchBar?: boolean;
|
|
1090
|
+
/**
|
|
1091
|
+
* This flag can be used to expose translation IDs on the embedded app.
|
|
1092
|
+
* @default false
|
|
1093
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
1094
|
+
*/
|
|
1095
|
+
exposeTranslationIDs?: boolean;
|
|
1075
1096
|
/**
|
|
1076
1097
|
* This flag can be used to disable links inside the embedded app,
|
|
1077
1098
|
* and disable redirection of links in a new tab.
|
|
@@ -1126,6 +1147,21 @@ export interface ViewConfig {
|
|
|
1126
1147
|
* @version SDK: 1.35.0 | ThoughtSpot: 10.5.0.cl
|
|
1127
1148
|
*/
|
|
1128
1149
|
overrideOrgId?: number;
|
|
1150
|
+
/**
|
|
1151
|
+
* Hide list page columns
|
|
1152
|
+
* For example: hiddenListColumns = [ListPageColumns.Author]
|
|
1153
|
+
*
|
|
1154
|
+
* **Note**: This option is appplicable only in full app embedding.
|
|
1155
|
+
* @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
|
|
1156
|
+
* @example
|
|
1157
|
+
* ```js
|
|
1158
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
1159
|
+
* ... // other options
|
|
1160
|
+
* hiddenListColumns : [ListPageColumns.Favorite,ListPageColumns.Author],
|
|
1161
|
+
* })
|
|
1162
|
+
* ```
|
|
1163
|
+
*/
|
|
1164
|
+
hiddenListColumns?: ListPageColumns[];
|
|
1129
1165
|
}
|
|
1130
1166
|
|
|
1131
1167
|
/**
|
|
@@ -1286,6 +1322,35 @@ export enum HomepageModule {
|
|
|
1286
1322
|
Learning = 'LEARNING',
|
|
1287
1323
|
}
|
|
1288
1324
|
|
|
1325
|
+
/**
|
|
1326
|
+
* List page columns that can be hidden.
|
|
1327
|
+
* **Note**: This option is applicable only in full app embedding.
|
|
1328
|
+
* @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
|
|
1329
|
+
*/
|
|
1330
|
+
// eslint-disable-next-line no-shadow
|
|
1331
|
+
export enum ListPageColumns {
|
|
1332
|
+
/**
|
|
1333
|
+
* Favourite
|
|
1334
|
+
*/
|
|
1335
|
+
Favourite = 'FAVOURITE',
|
|
1336
|
+
/**
|
|
1337
|
+
* Tags
|
|
1338
|
+
*/
|
|
1339
|
+
Tags = 'TAGS',
|
|
1340
|
+
/**
|
|
1341
|
+
* Author
|
|
1342
|
+
*/
|
|
1343
|
+
Author = 'AUTHOR',
|
|
1344
|
+
/**
|
|
1345
|
+
* Last viewed/Last modified
|
|
1346
|
+
*/
|
|
1347
|
+
DateSort = 'DATE_SORT',
|
|
1348
|
+
/**
|
|
1349
|
+
* Share
|
|
1350
|
+
*/
|
|
1351
|
+
Share = 'SHARE',
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1289
1354
|
/**
|
|
1290
1355
|
* A filter that can be applied to ThoughtSpot answers, Liveboards, or
|
|
1291
1356
|
* visualizations at runtime.
|
|
@@ -2312,16 +2377,19 @@ export enum EmbedEvent {
|
|
|
2312
2377
|
/**
|
|
2313
2378
|
* Emits when a table visualization is rendered in
|
|
2314
2379
|
* the ThoughtSpot embedded app.
|
|
2380
|
+
*
|
|
2315
2381
|
* You can also use this event as a hook to trigger host events
|
|
2316
2382
|
* such as `HostEvent.TransformTableVizData` on the table visualization.
|
|
2317
2383
|
* The event payload contains the data used in the rendered table.
|
|
2318
2384
|
* You can extract the relevant data from the payload
|
|
2319
2385
|
* stored in `payload.data.data.columnDataLite`.
|
|
2386
|
+
*
|
|
2320
2387
|
* `columnDataLite` is a multidimensional array that contains
|
|
2321
2388
|
* data values for each column, which was used in the query to
|
|
2322
2389
|
* generate the table visualization. To find and modify specific cell data,
|
|
2323
2390
|
* you can either loop through the array or directly access a cell if
|
|
2324
2391
|
* you know its position and data index.
|
|
2392
|
+
*
|
|
2325
2393
|
* In the following code sample, the first cell in the first column
|
|
2326
2394
|
* (`columnDataLite[0].dataValue[0]`) is set to `new fob`.
|
|
2327
2395
|
* Note that any changes made to the data in the payload will only update the
|
|
@@ -2331,6 +2399,7 @@ export enum EmbedEvent {
|
|
|
2331
2399
|
* payload in the `columnDataLite` is passed on to
|
|
2332
2400
|
* `HostEvent.TransformTableVizData` and trigger an update to
|
|
2333
2401
|
* the table visualization.
|
|
2402
|
+
*
|
|
2334
2403
|
* If the Row-Level Security (RLS) rules are applied on the
|
|
2335
2404
|
* Worksheet or Model, exercise caution when changing column
|
|
2336
2405
|
* or table cell values to maintain data security.
|
|
@@ -2345,7 +2414,7 @@ export enum EmbedEvent {
|
|
|
2345
2414
|
* searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
|
|
2346
2415
|
* })
|
|
2347
2416
|
* ```
|
|
2348
|
-
* @version SDK: 1.
|
|
2417
|
+
* @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
|
|
2349
2418
|
*/
|
|
2350
2419
|
TableVizRendered = 'TableVizRendered',
|
|
2351
2420
|
/**
|
|
@@ -2358,7 +2427,7 @@ export enum EmbedEvent {
|
|
|
2358
2427
|
* console.log('payload', payload);
|
|
2359
2428
|
* })
|
|
2360
2429
|
*```
|
|
2361
|
-
* @version SDK : 1.
|
|
2430
|
+
* @version SDK : 1.38.0 | ThoughtSpot : 10.8.0.cl
|
|
2362
2431
|
*/
|
|
2363
2432
|
CreateLiveboard = 'createLiveboard',
|
|
2364
2433
|
/**
|
|
@@ -2807,7 +2876,7 @@ export enum HostEvent {
|
|
|
2807
2876
|
* ```js
|
|
2808
2877
|
* liveboardEmbed.trigger(HostEvent.Remove)
|
|
2809
2878
|
* ```
|
|
2810
|
-
* @version SDK: 1.
|
|
2879
|
+
* @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
|
|
2811
2880
|
*/
|
|
2812
2881
|
Remove = 'delete',
|
|
2813
2882
|
/**
|
|
@@ -3355,7 +3424,7 @@ export enum HostEvent {
|
|
|
3355
3424
|
* ```js
|
|
3356
3425
|
* liveboardEmbed.trigger(HostEvent.InfoSuccess, data);
|
|
3357
3426
|
*```
|
|
3358
|
-
* @version SDK: 1.36.0 |
|
|
3427
|
+
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3359
3428
|
*/
|
|
3360
3429
|
InfoSuccess = 'InfoSuccess',
|
|
3361
3430
|
/**
|
|
@@ -3402,7 +3471,7 @@ export enum HostEvent {
|
|
|
3402
3471
|
* searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
|
|
3403
3472
|
* })
|
|
3404
3473
|
* ```
|
|
3405
|
-
* @version SDK: 1.
|
|
3474
|
+
* @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
|
|
3406
3475
|
*/
|
|
3407
3476
|
TransformTableVizData = 'TransformTableVizData',
|
|
3408
3477
|
}
|
|
@@ -3457,6 +3526,7 @@ export enum Param {
|
|
|
3457
3526
|
livedBoardEmbed = 'isLiveboardEmbed',
|
|
3458
3527
|
searchEmbed = 'isSearchEmbed',
|
|
3459
3528
|
vizEmbed = 'isVizEmbed',
|
|
3529
|
+
StringIDsUrl = 'overrideStringIDsUrl',
|
|
3460
3530
|
Version = 'sdkVersion',
|
|
3461
3531
|
ViewPortHeight = 'viewPortHeight',
|
|
3462
3532
|
ViewPortWidth = 'viewPortWidth',
|
|
@@ -3512,6 +3582,7 @@ export enum Param {
|
|
|
3512
3582
|
HideSageAnswerHeader = 'hideSageAnswerHeader',
|
|
3513
3583
|
HideSearchBar = 'hideSearchBar',
|
|
3514
3584
|
ClientLogLevel = 'clientLogLevel',
|
|
3585
|
+
ExposeTranslationIDs = 'exposeTranslationIDs',
|
|
3515
3586
|
OverrideNativeConsole = 'overrideConsoleLogs',
|
|
3516
3587
|
enableAskSage = 'enableAskSage',
|
|
3517
3588
|
CollapseSearchBarInitially = 'collapseSearchBarInitially',
|
|
@@ -3538,6 +3609,8 @@ export enum Param {
|
|
|
3538
3609
|
DataSourceId = 'dataSourceId',
|
|
3539
3610
|
preAuthCache = 'preAuthCache',
|
|
3540
3611
|
ShowSpotterLimitations = 'showSpotterLimitations',
|
|
3612
|
+
CoverAndFilterOptionInPDF = 'coverAndFilterOptionInPDF',
|
|
3613
|
+
PrimaryAction = 'primaryAction',
|
|
3541
3614
|
}
|
|
3542
3615
|
|
|
3543
3616
|
/**
|
|
@@ -3704,7 +3777,7 @@ export enum Action {
|
|
|
3704
3777
|
* The **Collapse data panel** icon on the Search page.
|
|
3705
3778
|
* Collapses the data panel view.
|
|
3706
3779
|
*
|
|
3707
|
-
* @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
|
|
3780
|
+
* @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
|
|
3708
3781
|
*
|
|
3709
3782
|
* @example
|
|
3710
3783
|
* ```js
|
|
@@ -4766,6 +4839,16 @@ export enum Action {
|
|
|
4766
4839
|
* @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
|
|
4767
4840
|
*/
|
|
4768
4841
|
ColumnRename = 'columnRename',
|
|
4842
|
+
/**
|
|
4843
|
+
* Action ID for hide checkboxes for include or exclude
|
|
4844
|
+
* cover and filter pages in the Liveboard PDF
|
|
4845
|
+
* @example
|
|
4846
|
+
* ```js
|
|
4847
|
+
* hiddenAction: [Action.CoverAndFilterOptionInPDF]
|
|
4848
|
+
* ```
|
|
4849
|
+
* @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
|
|
4850
|
+
*/
|
|
4851
|
+
CoverAndFilterOptionInPDF = 'coverAndFilterOptionInPDF',
|
|
4769
4852
|
}
|
|
4770
4853
|
|
|
4771
4854
|
export interface AnswerServiceType {
|
|
@@ -4780,8 +4863,8 @@ export enum PrefetchFeatures {
|
|
|
4780
4863
|
}
|
|
4781
4864
|
|
|
4782
4865
|
/**
|
|
4783
|
-
* Enum for options to change context trigger
|
|
4784
|
-
* BOTH_CLICKS option is
|
|
4866
|
+
* Enum for options to change context trigger.
|
|
4867
|
+
* The `BOTH_CLICKS` option is available from 10.8.0.cl.
|
|
4785
4868
|
*/
|
|
4786
4869
|
export enum ContextMenuTriggerOptions {
|
|
4787
4870
|
LEFT_CLICK = 'left-click',
|
|
@@ -4933,4 +5016,5 @@ export interface DefaultAppInitData {
|
|
|
4933
5016
|
hostConfig: Record<string, any>;
|
|
4934
5017
|
hiddenHomeLeftNavItems: string[];
|
|
4935
5018
|
customVariablesForThirdPartyTools: Record<string, any>;
|
|
5019
|
+
hiddenListColumns: ListPageColumns[];
|
|
4936
5020
|
}
|