@thoughtspot/visual-embed-sdk 1.46.5-beta.1 → 1.47.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/cjs/package.json +4 -4
- package/cjs/src/css-variables.d.ts +36 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +41 -17
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +26 -47
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +36 -79
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +24 -2
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +18 -33
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +129 -97
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +2 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +69 -9
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +185 -19
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +22 -0
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.js +57 -0
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js +190 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/cjs/src/embed/liveboard.d.ts +18 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +9 -11
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +29 -71
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +20 -0
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.js +52 -0
- package/cjs/src/embed/spotter-utils.js.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts +2 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.js +54 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +25 -5
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +28 -67
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +2 -1
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +2 -1
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +1 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -4
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +2 -2
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +1 -3
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +1 -36
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +1 -34
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/types.d.ts +143 -76
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +118 -47
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.d.ts +0 -9
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +1 -10
- package/cjs/src/utils.js.map +1 -1
- package/dist/{index-DW2wEHqy.js → index-Bm2Hck8q.js} +1 -1
- package/dist/src/css-variables.d.ts +36 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +41 -17
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +24 -2
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +22 -0
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/dist/src/embed/liveboard.d.ts +18 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +20 -0
- package/dist/src/embed/spotter-utils.d.ts.map +1 -0
- package/dist/src/embed/spotter-utils.spec.d.ts +2 -0
- package/dist/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/errors.d.ts +2 -1
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +2 -2
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +1 -36
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +143 -76
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +0 -9
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +378 -304
- package/dist/tsembed-react.js +366 -294
- package/dist/tsembed.es.js +393 -285
- package/dist/tsembed.js +30798 -30691
- package/dist/visual-embed-sdk-react-full.d.ts +310 -273
- package/dist/visual-embed-sdk-react.d.ts +310 -273
- package/dist/visual-embed-sdk.d.ts +308 -243
- package/lib/package.json +4 -4
- package/lib/src/css-variables.d.ts +36 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +41 -17
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +28 -49
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +36 -79
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +24 -2
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +19 -34
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +131 -99
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +2 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +69 -9
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +185 -19
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +22 -0
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.js +49 -0
- package/lib/src/embed/hostEventClient/utils.js.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.js +188 -0
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/lib/src/embed/liveboard.d.ts +18 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +9 -11
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +29 -71
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +20 -0
- package/lib/src/embed/spotter-utils.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.js +47 -0
- package/lib/src/embed/spotter-utils.js.map +1 -0
- package/lib/src/embed/spotter-utils.spec.d.ts +2 -0
- package/lib/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.spec.js +52 -0
- package/lib/src/embed/spotter-utils.spec.js.map +1 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +25 -5
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +30 -69
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +2 -1
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +2 -1
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +1 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +1 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +2 -2
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/index.d.ts +1 -36
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +0 -33
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/types.d.ts +143 -76
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +118 -47
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +0 -9
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +0 -8
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +308 -243
- package/package.json +4 -4
- package/src/css-variables.ts +45 -0
- package/src/embed/app.spec.ts +51 -107
- package/src/embed/app.ts +60 -82
- package/src/embed/conversation.spec.ts +150 -119
- package/src/embed/conversation.ts +34 -58
- package/src/embed/hostEventClient/contracts.ts +31 -0
- package/src/embed/hostEventClient/host-event-client.spec.ts +260 -19
- package/src/embed/hostEventClient/host-event-client.ts +87 -11
- package/src/embed/hostEventClient/utils.spec.ts +225 -0
- package/src/embed/hostEventClient/utils.ts +74 -0
- package/src/embed/liveboard.spec.ts +38 -93
- package/src/embed/liveboard.ts +28 -10
- package/src/embed/spotter-utils.spec.ts +56 -0
- package/src/embed/spotter-utils.ts +65 -0
- package/src/embed/ts-embed.spec.ts +56 -108
- package/src/embed/ts-embed.ts +25 -4
- package/src/errors.ts +2 -1
- package/src/index.ts +2 -5
- package/src/react/all-types-export.ts +0 -3
- package/src/react/index.tsx +15 -59
- package/src/types.ts +206 -138
- package/src/utils.ts +0 -14
- package/cjs/src/embed/sage.d.ts +0 -164
- package/cjs/src/embed/sage.d.ts.map +0 -1
- package/cjs/src/embed/sage.js +0 -88
- package/cjs/src/embed/sage.js.map +0 -1
- package/cjs/src/embed/sage.spec.d.ts +0 -2
- package/cjs/src/embed/sage.spec.d.ts.map +0 -1
- package/cjs/src/embed/sage.spec.js +0 -151
- package/cjs/src/embed/sage.spec.js.map +0 -1
- package/dist/src/embed/sage.d.ts +0 -164
- package/dist/src/embed/sage.d.ts.map +0 -1
- package/dist/src/embed/sage.spec.d.ts +0 -2
- package/dist/src/embed/sage.spec.d.ts.map +0 -1
- package/lib/src/embed/sage.d.ts +0 -164
- package/lib/src/embed/sage.d.ts.map +0 -1
- package/lib/src/embed/sage.js +0 -84
- package/lib/src/embed/sage.js.map +0 -1
- package/lib/src/embed/sage.spec.d.ts +0 -2
- package/lib/src/embed/sage.spec.d.ts.map +0 -1
- package/lib/src/embed/sage.spec.js +0 -148
- package/lib/src/embed/sage.spec.js.map +0 -1
- package/src/embed/sage.spec.ts +0 -206
- package/src/embed/sage.ts +0 -231
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"size-limit": [
|
|
39
39
|
{
|
|
40
40
|
"path": "dist/tsembed.es.js",
|
|
41
|
-
"limit": "
|
|
41
|
+
"limit": "34 kB"
|
|
42
42
|
}
|
|
43
43
|
],
|
|
44
44
|
"scripts": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"test": "npm run test-sdk",
|
|
58
58
|
"posttest": "cat ./coverage/sdk/lcov.info | npx coveralls-next || echo 'Warning: Coveralls upload failed but not breaking the build.'",
|
|
59
59
|
"is-publish-allowed": "node scripts/is-publish-allowed.js",
|
|
60
|
-
"prepublishOnly": "npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build",
|
|
60
|
+
"prepublishOnly": "npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build",
|
|
61
61
|
"check-size": "npm run build && size-limit",
|
|
62
62
|
"publish-dev": "npm publish --tag dev",
|
|
63
63
|
"publish-prod": "npm publish --tag latest",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"react-resize-detector": "^6.6.0",
|
|
134
134
|
"react-test-renderer": "^17.0.2",
|
|
135
135
|
"react-use-flexsearch": "^0.1.1",
|
|
136
|
-
"rollup": "4.
|
|
136
|
+
"rollup": "4.59.0",
|
|
137
137
|
"rollup-plugin-typescript2": "0.27.3",
|
|
138
138
|
"ts-jest": "^29.4.6",
|
|
139
139
|
"ts-loader": "8.0.4",
|
package/src/css-variables.ts
CHANGED
|
@@ -946,4 +946,49 @@ export interface CustomCssVariables {
|
|
|
946
946
|
* Color for section title text (e.g., "Recent", "Older") in the saved chats sidebar.
|
|
947
947
|
*/
|
|
948
948
|
'--ts-var-saved-chats-section-title-color'?: string;
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* Text color of the styling panel in the Liveboard.
|
|
952
|
+
*/
|
|
953
|
+
'--ts-var-liveboard-styling-panel-text-color'?: string;
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Border color of the styling panel in the Liveboard.
|
|
957
|
+
*/
|
|
958
|
+
'--ts-var-liveboard-styling-panel-border-color'?: string;
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* Background color of the styling button in the Liveboard.
|
|
962
|
+
*/
|
|
963
|
+
'--ts-var-liveboard-styling-button-background'?: string;
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Text color of the styling button in the Liveboard.
|
|
967
|
+
*/
|
|
968
|
+
'--ts-var-liveboard-styling-button-text-color'?: string;
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Background color of the styling button in the Liveboard on hover.
|
|
972
|
+
*/
|
|
973
|
+
'--ts-var-liveboard-styling-button-hover-background'?: string;
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* Background color of the styling button in the Liveboard when active.
|
|
977
|
+
*/
|
|
978
|
+
'--ts-var-liveboard-styling-button-active-background'?: string;
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* Text color of the styling button in the Liveboard on hover.
|
|
982
|
+
*/
|
|
983
|
+
'--ts-var-liveboard-styling-button-hover-text-color'?: string;
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* Box shadow of the styling button in the Liveboard.
|
|
987
|
+
*/
|
|
988
|
+
'--ts-var-liveboard-styling-button-shadow'?: string;
|
|
989
|
+
|
|
990
|
+
/**
|
|
991
|
+
* Background color of the color palette in the Liveboard styling panel.
|
|
992
|
+
*/
|
|
993
|
+
'--ts-var-liveboard-styling-color-palette-background'?: string;
|
|
949
994
|
}
|
package/src/embed/app.spec.ts
CHANGED
|
@@ -439,117 +439,111 @@ describe('App embed tests', () => {
|
|
|
439
439
|
});
|
|
440
440
|
});
|
|
441
441
|
|
|
442
|
-
test('should set
|
|
443
|
-
const appEmbed = new AppEmbed(getRootEl(),
|
|
444
|
-
...defaultViewConfig,
|
|
445
|
-
isPNGInScheduledEmailsEnabled: true,
|
|
446
|
-
} as AppViewConfig);
|
|
442
|
+
test('should set enableHomepageAnnouncement to false in url when not provided in AppViewConfig', async () => {
|
|
443
|
+
const appEmbed = new AppEmbed(getRootEl(), defaultViewConfig);
|
|
447
444
|
appEmbed.render();
|
|
448
445
|
await executeAfterWait(() => {
|
|
449
446
|
expectUrlMatchesWithParams(
|
|
450
447
|
getIFrameSrc(),
|
|
451
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
448
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableHomepageAnnouncement=false${defaultParamsPost}#/home`,
|
|
452
449
|
);
|
|
453
450
|
});
|
|
454
451
|
});
|
|
455
452
|
|
|
456
|
-
test('should set
|
|
453
|
+
test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
|
|
457
454
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
458
455
|
...defaultViewConfig,
|
|
459
|
-
|
|
456
|
+
isPNGInScheduledEmailsEnabled: true,
|
|
460
457
|
} as AppViewConfig);
|
|
461
458
|
appEmbed.render();
|
|
462
459
|
await executeAfterWait(() => {
|
|
463
460
|
expectUrlMatchesWithParams(
|
|
464
461
|
getIFrameSrc(),
|
|
465
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
462
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true${defaultParamsPost}#/home`,
|
|
466
463
|
);
|
|
467
464
|
});
|
|
468
465
|
});
|
|
469
466
|
|
|
470
|
-
test('should set
|
|
467
|
+
test('should set isWYSIWYGLiveboardPDFEnabled to true in url', async () => {
|
|
471
468
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
472
469
|
...defaultViewConfig,
|
|
473
|
-
|
|
470
|
+
isContinuousLiveboardPDFEnabled: true,
|
|
474
471
|
} as AppViewConfig);
|
|
475
472
|
appEmbed.render();
|
|
476
473
|
await executeAfterWait(() => {
|
|
477
474
|
expectUrlMatchesWithParams(
|
|
478
475
|
getIFrameSrc(),
|
|
479
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
476
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isWYSIWYGLiveboardPDFEnabled=true${defaultParamsPost}#/home`,
|
|
480
477
|
);
|
|
481
478
|
});
|
|
482
479
|
});
|
|
483
480
|
|
|
484
|
-
test('should set
|
|
481
|
+
test('should set isLinkParametersEnabled to true in url', async () => {
|
|
485
482
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
486
483
|
...defaultViewConfig,
|
|
487
|
-
|
|
484
|
+
isLinkParametersEnabled: true,
|
|
488
485
|
} as AppViewConfig);
|
|
489
486
|
appEmbed.render();
|
|
490
487
|
await executeAfterWait(() => {
|
|
491
488
|
expectUrlMatchesWithParams(
|
|
492
489
|
getIFrameSrc(),
|
|
493
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
490
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=true${defaultParamsPost}#/home`,
|
|
494
491
|
);
|
|
495
492
|
});
|
|
496
493
|
});
|
|
497
494
|
|
|
498
|
-
test('should set
|
|
495
|
+
test('should set isLinkParametersEnabled to false in url', async () => {
|
|
499
496
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
500
497
|
...defaultViewConfig,
|
|
501
|
-
|
|
498
|
+
isLinkParametersEnabled: false,
|
|
502
499
|
} as AppViewConfig);
|
|
503
500
|
appEmbed.render();
|
|
504
501
|
await executeAfterWait(() => {
|
|
505
502
|
expectUrlMatchesWithParams(
|
|
506
503
|
getIFrameSrc(),
|
|
507
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
504
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLinkParametersEnabled=false${defaultParamsPost}#/home`,
|
|
508
505
|
);
|
|
509
506
|
});
|
|
510
507
|
});
|
|
511
508
|
|
|
512
|
-
test('should set
|
|
509
|
+
test('should set isLiveboardXLSXCSVDownloadEnabled to true in url', async () => {
|
|
513
510
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
514
511
|
...defaultViewConfig,
|
|
515
|
-
|
|
512
|
+
isLiveboardXLSXCSVDownloadEnabled: true,
|
|
516
513
|
} as AppViewConfig);
|
|
517
514
|
appEmbed.render();
|
|
518
515
|
await executeAfterWait(() => {
|
|
519
516
|
expectUrlMatchesWithParams(
|
|
520
517
|
getIFrameSrc(),
|
|
521
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
518
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isLiveboardXLSXCSVDownloadEnabled=true${defaultParamsPost}#/home`,
|
|
522
519
|
);
|
|
523
520
|
});
|
|
524
521
|
});
|
|
525
522
|
|
|
526
|
-
test('should set
|
|
523
|
+
test('should set updatedSpotterChatPrompt to true in url', async () => {
|
|
527
524
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
528
525
|
...defaultViewConfig,
|
|
529
|
-
|
|
526
|
+
updatedSpotterChatPrompt: true,
|
|
530
527
|
} as AppViewConfig);
|
|
531
528
|
appEmbed.render();
|
|
532
529
|
await executeAfterWait(() => {
|
|
533
530
|
expectUrlMatchesWithParams(
|
|
534
531
|
getIFrameSrc(),
|
|
535
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
532
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=true${defaultParamsPost}#/home`,
|
|
536
533
|
);
|
|
537
534
|
});
|
|
538
535
|
});
|
|
539
536
|
|
|
540
|
-
test('should
|
|
537
|
+
test('should set updatedSpotterChatPrompt to false in url', async () => {
|
|
541
538
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
542
539
|
...defaultViewConfig,
|
|
543
|
-
|
|
544
|
-
spotterSidebarConfig: {
|
|
545
|
-
enablePastConversationsSidebar: true,
|
|
546
|
-
},
|
|
540
|
+
updatedSpotterChatPrompt: false,
|
|
547
541
|
} as AppViewConfig);
|
|
548
542
|
appEmbed.render();
|
|
549
543
|
await executeAfterWait(() => {
|
|
550
544
|
expectUrlMatchesWithParams(
|
|
551
545
|
getIFrameSrc(),
|
|
552
|
-
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&
|
|
546
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&updatedSpotterChatPrompt=false${defaultParamsPost}#/home`,
|
|
553
547
|
);
|
|
554
548
|
});
|
|
555
549
|
});
|
|
@@ -886,21 +880,6 @@ describe('App embed tests', () => {
|
|
|
886
880
|
});
|
|
887
881
|
});
|
|
888
882
|
|
|
889
|
-
test('Should add isUnifiedSearchExperienceEnabled flag to the iframe src', async () => {
|
|
890
|
-
const appEmbed = new AppEmbed(getRootEl(), {
|
|
891
|
-
...defaultViewConfig,
|
|
892
|
-
isUnifiedSearchExperienceEnabled: false,
|
|
893
|
-
} as AppViewConfig);
|
|
894
|
-
|
|
895
|
-
appEmbed.render();
|
|
896
|
-
await executeAfterWait(() => {
|
|
897
|
-
expectUrlMatchesWithParams(
|
|
898
|
-
getIFrameSrc(),
|
|
899
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
900
|
-
);
|
|
901
|
-
});
|
|
902
|
-
});
|
|
903
|
-
|
|
904
883
|
test('Should add hideIrrelevantFiltersAtTabLevel flag to the iframe src', async () => {
|
|
905
884
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
906
885
|
...defaultViewConfig,
|
|
@@ -1247,7 +1226,6 @@ describe('App embed tests', () => {
|
|
|
1247
1226
|
});
|
|
1248
1227
|
|
|
1249
1228
|
test('should register event handlers to adjust iframe height', async () => {
|
|
1250
|
-
jest.spyOn(logger, 'error').mockImplementation(() => {});
|
|
1251
1229
|
let embedHeightCallback: any = () => { };
|
|
1252
1230
|
const onSpy = jest.spyOn(AppEmbed.prototype, 'on').mockImplementation((event, callback) => {
|
|
1253
1231
|
if (event === EmbedEvent.RouteChange) {
|
|
@@ -1520,6 +1498,28 @@ describe('App embed tests', () => {
|
|
|
1520
1498
|
width: 650,
|
|
1521
1499
|
});
|
|
1522
1500
|
});
|
|
1501
|
+
test('should not send correct visible data when RequestFullHeightLazyLoadData is triggered if lazyLoadingForFullHeight is false', async () => {
|
|
1502
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1503
|
+
...defaultViewConfig,
|
|
1504
|
+
fullHeight: true,
|
|
1505
|
+
lazyLoadingForFullHeight: false,
|
|
1506
|
+
lazyLoadingMargin: '10px',
|
|
1507
|
+
} as AppViewConfig);
|
|
1508
|
+
|
|
1509
|
+
const mockTrigger = jest.spyOn(appEmbed, 'trigger');
|
|
1510
|
+
|
|
1511
|
+
await appEmbed.render();
|
|
1512
|
+
|
|
1513
|
+
// Trigger the lazy load data calculation
|
|
1514
|
+
(appEmbed as any).sendFullHeightLazyLoadData();
|
|
1515
|
+
|
|
1516
|
+
expect(mockTrigger).not.toHaveBeenCalledWith(HostEvent.VisibleEmbedCoordinates, {
|
|
1517
|
+
top: 0,
|
|
1518
|
+
height: 500,
|
|
1519
|
+
left: 0,
|
|
1520
|
+
width: 650,
|
|
1521
|
+
});
|
|
1522
|
+
});
|
|
1523
1523
|
|
|
1524
1524
|
test('should calculate correct visible data for partially visible full height element', async () => {
|
|
1525
1525
|
// Mock iframe partially clipped from top and left
|
|
@@ -1639,8 +1639,8 @@ describe('App embed tests', () => {
|
|
|
1639
1639
|
|
|
1640
1640
|
describe('IFrame height management', () => {
|
|
1641
1641
|
let mockIFrame: HTMLIFrameElement;
|
|
1642
|
+
|
|
1642
1643
|
beforeEach(() => {
|
|
1643
|
-
jest.spyOn(logger, 'error').mockImplementation(() => {});
|
|
1644
1644
|
mockIFrame = document.createElement('iframe');
|
|
1645
1645
|
mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
|
|
1646
1646
|
top: 100,
|
|
@@ -1692,16 +1692,13 @@ describe('App embed tests', () => {
|
|
|
1692
1692
|
fullHeight: true,
|
|
1693
1693
|
} as AppViewConfig) as any;
|
|
1694
1694
|
|
|
1695
|
-
// Set up the mock iframe
|
|
1696
|
-
mockIFrame.getBoundingClientRect = jest.fn().mockReturnValue({
|
|
1697
|
-
top: 100, left: 150, bottom: 100, right: 800, width: 650, height: 0,
|
|
1698
|
-
});
|
|
1695
|
+
// Set up the mock iframe
|
|
1699
1696
|
appEmbed.iFrame = mockIFrame;
|
|
1700
1697
|
document.body.appendChild(mockIFrame);
|
|
1701
1698
|
|
|
1702
1699
|
await appEmbed.render();
|
|
1703
1700
|
const mockEvent = {
|
|
1704
|
-
data: 0, // This will make it use the default height
|
|
1701
|
+
data: 0, // This will make it use the default height
|
|
1705
1702
|
type: EmbedEvent.EmbedHeight,
|
|
1706
1703
|
};
|
|
1707
1704
|
appEmbed.updateIFrameHeight(mockEvent);
|
|
@@ -1709,61 +1706,6 @@ describe('App embed tests', () => {
|
|
|
1709
1706
|
// Should use the default height
|
|
1710
1707
|
expect(mockIFrame.style.height).toBe('500px');
|
|
1711
1708
|
});
|
|
1712
|
-
|
|
1713
|
-
test('should skip height update when change is below threshold', async () => {
|
|
1714
|
-
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1715
|
-
...defaultViewConfig,
|
|
1716
|
-
fullHeight: true,
|
|
1717
|
-
} as AppViewConfig) as any;
|
|
1718
|
-
|
|
1719
|
-
appEmbed.iFrame = mockIFrame;
|
|
1720
|
-
document.body.appendChild(mockIFrame);
|
|
1721
|
-
await appEmbed.render();
|
|
1722
|
-
|
|
1723
|
-
const spySetIFrameHeight = jest.spyOn(appEmbed, 'setIFrameHeight');
|
|
1724
|
-
|
|
1725
|
-
// currentHeight is 500; heightToSet will be max(510, 500) = 510; change = 10 < 30
|
|
1726
|
-
appEmbed.updateIFrameHeight({ data: 510, type: EmbedEvent.EmbedHeight });
|
|
1727
|
-
|
|
1728
|
-
expect(spySetIFrameHeight).not.toHaveBeenCalled();
|
|
1729
|
-
});
|
|
1730
|
-
|
|
1731
|
-
test('should update height when change meets threshold', async () => {
|
|
1732
|
-
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1733
|
-
...defaultViewConfig,
|
|
1734
|
-
fullHeight: true,
|
|
1735
|
-
} as AppViewConfig) as any;
|
|
1736
|
-
|
|
1737
|
-
appEmbed.iFrame = mockIFrame;
|
|
1738
|
-
document.body.appendChild(mockIFrame);
|
|
1739
|
-
await appEmbed.render();
|
|
1740
|
-
|
|
1741
|
-
const spySetIFrameHeight = jest.spyOn(appEmbed, 'setIFrameHeight');
|
|
1742
|
-
|
|
1743
|
-
// currentHeight is 500; heightToSet = max(600, 500) = 600; change = 100 >= 30
|
|
1744
|
-
appEmbed.updateIFrameHeight({ data: 600, type: EmbedEvent.EmbedHeight });
|
|
1745
|
-
|
|
1746
|
-
expect(spySetIFrameHeight).toHaveBeenCalledWith(600);
|
|
1747
|
-
});
|
|
1748
|
-
|
|
1749
|
-
test('should use defaultHeight when data is below it and check threshold', async () => {
|
|
1750
|
-
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1751
|
-
...defaultViewConfig,
|
|
1752
|
-
fullHeight: true,
|
|
1753
|
-
minimumHeight: 800,
|
|
1754
|
-
} as AppViewConfig) as any;
|
|
1755
|
-
|
|
1756
|
-
appEmbed.iFrame = mockIFrame;
|
|
1757
|
-
document.body.appendChild(mockIFrame);
|
|
1758
|
-
await appEmbed.render();
|
|
1759
|
-
|
|
1760
|
-
const spySetIFrameHeight = jest.spyOn(appEmbed, 'setIFrameHeight');
|
|
1761
|
-
|
|
1762
|
-
// currentHeight is 500; heightToSet = max(100, 800) = 800; change = 300 >= 30
|
|
1763
|
-
appEmbed.updateIFrameHeight({ data: 100, type: EmbedEvent.EmbedHeight });
|
|
1764
|
-
|
|
1765
|
-
expect(spySetIFrameHeight).toHaveBeenCalledWith(800);
|
|
1766
|
-
});
|
|
1767
1709
|
});
|
|
1768
1710
|
});
|
|
1769
1711
|
|
|
@@ -1786,3 +1728,5 @@ describe('App Embed Default Height and Minimum Height Handling', () => {
|
|
|
1786
1728
|
expect(appEmbed['defaultHeight']).toBe(700);
|
|
1787
1729
|
});
|
|
1788
1730
|
});
|
|
1731
|
+
|
|
1732
|
+
|
package/src/embed/app.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { logger } from '../utils/logger';
|
|
12
|
-
import { calculateVisibleElementData, getQueryParamString, isUndefined, isValidCssMargin, setParamIfDefined
|
|
12
|
+
import { calculateVisibleElementData, getQueryParamString, isUndefined, isValidCssMargin, setParamIfDefined } from '../utils';
|
|
13
13
|
import {
|
|
14
14
|
Param,
|
|
15
15
|
DOMSelector,
|
|
@@ -17,12 +17,11 @@ import {
|
|
|
17
17
|
EmbedEvent,
|
|
18
18
|
MessagePayload,
|
|
19
19
|
AllEmbedViewConfig,
|
|
20
|
-
|
|
21
|
-
EmbedErrorCodes,
|
|
20
|
+
DefaultAppInitData,
|
|
22
21
|
} from '../types';
|
|
23
22
|
import { V1Embed } from './ts-embed';
|
|
24
23
|
import { SpotterChatViewConfig, SpotterSidebarViewConfig } from './conversation';
|
|
25
|
-
import {
|
|
24
|
+
import { buildSpotterSidebarAppInitData } from './spotter-utils';
|
|
26
25
|
|
|
27
26
|
/**
|
|
28
27
|
* Pages within the ThoughtSpot app that can be embedded.
|
|
@@ -535,22 +534,6 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
535
534
|
* @version SDK: 1.33.0 | ThoughtSpot: 10.3.0.cl
|
|
536
535
|
*/
|
|
537
536
|
homePageSearchBarMode?: HomePageSearchBarMode;
|
|
538
|
-
/**
|
|
539
|
-
* This flag is used to enable unified search experience for full app embed.
|
|
540
|
-
*
|
|
541
|
-
* Supported embed types: `AppEmbed`
|
|
542
|
-
* @version SDK: 1.34.0 | ThoughtSpot: 10.5.0.cl
|
|
543
|
-
* @default true
|
|
544
|
-
* @example
|
|
545
|
-
* ```js
|
|
546
|
-
* const embed = new AppEmbed('#tsEmbed', {
|
|
547
|
-
* ... // other embed view config
|
|
548
|
-
* isUnifiedSearchExperienceEnabled: true,
|
|
549
|
-
* })
|
|
550
|
-
* ```
|
|
551
|
-
*/
|
|
552
|
-
isUnifiedSearchExperienceEnabled?: boolean;
|
|
553
|
-
|
|
554
537
|
/**
|
|
555
538
|
* This flag is used to enable/disable the styling and grouping in a Liveboard. Use {@link isLiveboardMasterpiecesEnabled} instead.
|
|
556
539
|
* @deprecated This flag is deprecated.
|
|
@@ -587,6 +570,25 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
587
570
|
*/
|
|
588
571
|
isPNGInScheduledEmailsEnabled?: boolean;
|
|
589
572
|
|
|
573
|
+
/**
|
|
574
|
+
* Enables the 'what you see is what you get' PDF export for Liveboards. Each tab is rendered on a single page
|
|
575
|
+
* following the exact UI layout, instead of splitting visualizations across multiple A4 pages.
|
|
576
|
+
* This feature is GA from version 26.5.0.cl and is enabled by default on embed deployments.
|
|
577
|
+
*
|
|
578
|
+
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
579
|
+
* @type {boolean}
|
|
580
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
581
|
+
* @example
|
|
582
|
+
* ```js
|
|
583
|
+
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
584
|
+
* const embed = new <EmbedComponent>('#tsEmbed', {
|
|
585
|
+
* ... // other embed view config
|
|
586
|
+
* isContinuousLiveboardPDFEnabled: true,
|
|
587
|
+
* })
|
|
588
|
+
* ```
|
|
589
|
+
*/
|
|
590
|
+
isContinuousLiveboardPDFEnabled?: boolean;
|
|
591
|
+
|
|
590
592
|
/**
|
|
591
593
|
* This flag is used to enable/disable the XLSX/CSV download option for Liveboards
|
|
592
594
|
*
|
|
@@ -760,6 +762,16 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
760
762
|
enableHomepageAnnouncement?: boolean;
|
|
761
763
|
}
|
|
762
764
|
|
|
765
|
+
/**
|
|
766
|
+
* APP_INIT data shape for AppEmbed.
|
|
767
|
+
* @internal
|
|
768
|
+
*/
|
|
769
|
+
export interface AppEmbedAppInitData extends DefaultAppInitData {
|
|
770
|
+
embedParams?: {
|
|
771
|
+
spotterSidebarConfig?: SpotterSidebarViewConfig;
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
|
|
763
775
|
/**
|
|
764
776
|
* Embeds full ThoughtSpot experience in a host application.
|
|
765
777
|
* @group Embed components
|
|
@@ -783,6 +795,23 @@ export class AppEmbed extends V1Embed {
|
|
|
783
795
|
}
|
|
784
796
|
}
|
|
785
797
|
|
|
798
|
+
/**
|
|
799
|
+
* Extends the default APP_INIT payload with `embedParams.spotterSidebarConfig`
|
|
800
|
+
* so the conv-assist app can read sidebar configuration on initialisation.
|
|
801
|
+
*
|
|
802
|
+
* Precedence for `enablePastConversationsSidebar`:
|
|
803
|
+
* `spotterSidebarConfig.enablePastConversationsSidebar` wins over the
|
|
804
|
+
* deprecated top-level `enablePastConversationsSidebar` flag; if the former
|
|
805
|
+
* is absent the latter is used as a fallback.
|
|
806
|
+
*
|
|
807
|
+
* An invalid `spotterDocumentationUrl` triggers a validation error and is
|
|
808
|
+
* excluded from the payload rather than forwarded to the app.
|
|
809
|
+
*/
|
|
810
|
+
protected async getAppInitData(): Promise<AppEmbedAppInitData> {
|
|
811
|
+
const defaultAppInitData = await super.getAppInitData();
|
|
812
|
+
return buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
813
|
+
}
|
|
814
|
+
|
|
786
815
|
/**
|
|
787
816
|
* Constructs a map of parameters to be passed on to the
|
|
788
817
|
* embedded Liveboard or visualization.
|
|
@@ -823,7 +852,6 @@ export class AppEmbed extends V1Embed {
|
|
|
823
852
|
hideIrrelevantChipsInLiveboardTabs = false,
|
|
824
853
|
isEnhancedFilterInteractivityEnabled = false,
|
|
825
854
|
homePageSearchBarMode,
|
|
826
|
-
isUnifiedSearchExperienceEnabled = true,
|
|
827
855
|
enablePendoHelp = true,
|
|
828
856
|
discoveryExperience,
|
|
829
857
|
coverAndFilterOptionInPDF = false,
|
|
@@ -834,11 +862,11 @@ export class AppEmbed extends V1Embed {
|
|
|
834
862
|
isCentralizedLiveboardFilterUXEnabled = false,
|
|
835
863
|
isLinkParametersEnabled,
|
|
836
864
|
updatedSpotterChatPrompt,
|
|
837
|
-
spotterSidebarConfig,
|
|
838
865
|
spotterChatConfig,
|
|
839
866
|
minimumHeight,
|
|
840
867
|
isThisPeriodInDateFiltersEnabled,
|
|
841
|
-
enableHomepageAnnouncement,
|
|
868
|
+
enableHomepageAnnouncement = false,
|
|
869
|
+
isContinuousLiveboardPDFEnabled,
|
|
842
870
|
} = this.viewConfig;
|
|
843
871
|
|
|
844
872
|
let params: any = {};
|
|
@@ -858,7 +886,6 @@ export class AppEmbed extends V1Embed {
|
|
|
858
886
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
859
887
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
860
888
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
861
|
-
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
862
889
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
863
890
|
|
|
864
891
|
params = this.getBaseQueryParams(params);
|
|
@@ -867,53 +894,6 @@ export class AppEmbed extends V1Embed {
|
|
|
867
894
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
868
895
|
}
|
|
869
896
|
|
|
870
|
-
const resolvedEnablePastConversationsSidebar = resolveEnablePastConversationsSidebar({
|
|
871
|
-
spotterSidebarConfigValue: spotterSidebarConfig?.enablePastConversationsSidebar,
|
|
872
|
-
standaloneValue: this.viewConfig.enablePastConversationsSidebar,
|
|
873
|
-
});
|
|
874
|
-
setParamIfDefined(params, Param.EnablePastConversationsSidebar, resolvedEnablePastConversationsSidebar, true);
|
|
875
|
-
|
|
876
|
-
// Handle spotterSidebarConfig params
|
|
877
|
-
if (spotterSidebarConfig) {
|
|
878
|
-
const {
|
|
879
|
-
spotterSidebarTitle,
|
|
880
|
-
spotterSidebarDefaultExpanded,
|
|
881
|
-
spotterChatRenameLabel,
|
|
882
|
-
spotterChatDeleteLabel,
|
|
883
|
-
spotterDeleteConversationModalTitle,
|
|
884
|
-
spotterPastConversationAlertMessage,
|
|
885
|
-
spotterDocumentationUrl,
|
|
886
|
-
spotterBestPracticesLabel,
|
|
887
|
-
spotterConversationsBatchSize,
|
|
888
|
-
spotterNewChatButtonTitle,
|
|
889
|
-
} = spotterSidebarConfig;
|
|
890
|
-
|
|
891
|
-
setParamIfDefined(params, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
892
|
-
setParamIfDefined(params, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
893
|
-
setParamIfDefined(params, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
894
|
-
setParamIfDefined(params, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
895
|
-
setParamIfDefined(params, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
896
|
-
setParamIfDefined(params, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
897
|
-
setParamIfDefined(params, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
898
|
-
setParamIfDefined(params, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
899
|
-
setParamIfDefined(params, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
900
|
-
|
|
901
|
-
// URL param with validation
|
|
902
|
-
if (spotterDocumentationUrl !== undefined) {
|
|
903
|
-
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
904
|
-
if (isValid) {
|
|
905
|
-
params[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
906
|
-
} else {
|
|
907
|
-
this.handleError({
|
|
908
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
909
|
-
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
910
|
-
code: EmbedErrorCodes.INVALID_URL,
|
|
911
|
-
error: validationError?.message || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
912
|
-
});
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
|
|
917
897
|
// Handle spotterChatConfig params
|
|
918
898
|
if (spotterChatConfig) {
|
|
919
899
|
const {
|
|
@@ -1017,6 +997,10 @@ export class AppEmbed extends V1Embed {
|
|
|
1017
997
|
params[Param.EnableHomepageAnnouncement] = enableHomepageAnnouncement;
|
|
1018
998
|
}
|
|
1019
999
|
|
|
1000
|
+
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
1001
|
+
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1020
1004
|
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
1021
1005
|
|
|
1022
1006
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
@@ -1085,7 +1069,10 @@ export class AppEmbed extends V1Embed {
|
|
|
1085
1069
|
|
|
1086
1070
|
private sendFullHeightLazyLoadData = () => {
|
|
1087
1071
|
const data = calculateVisibleElementData(this.iFrame);
|
|
1088
|
-
this
|
|
1072
|
+
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
1073
|
+
if(this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight){
|
|
1074
|
+
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
1075
|
+
}
|
|
1089
1076
|
}
|
|
1090
1077
|
|
|
1091
1078
|
/**
|
|
@@ -1115,22 +1102,13 @@ export class AppEmbed extends V1Embed {
|
|
|
1115
1102
|
return url;
|
|
1116
1103
|
}
|
|
1117
1104
|
|
|
1118
|
-
private HEIGHT_CHANAGE_THRESHOLD = 30;
|
|
1119
1105
|
/**
|
|
1120
1106
|
* Set the iframe height as per the computed height received
|
|
1121
1107
|
* from the ThoughtSpot app.
|
|
1122
1108
|
* @param data The event payload
|
|
1123
1109
|
*/
|
|
1124
1110
|
protected updateIFrameHeight = (data: MessagePayload) => {
|
|
1125
|
-
|
|
1126
|
-
const currentHeight = this.iFrame.getBoundingClientRect().height;
|
|
1127
|
-
const heightToSet = Math.max(data.data, this.defaultHeight);
|
|
1128
|
-
const heightChange = Math.abs(heightToSet - currentHeight);
|
|
1129
|
-
if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) {
|
|
1130
|
-
logger.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight });
|
|
1131
|
-
return;
|
|
1132
|
-
}
|
|
1133
|
-
this.setIFrameHeight(heightToSet);
|
|
1111
|
+
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
1134
1112
|
this.sendFullHeightLazyLoadData();
|
|
1135
1113
|
};
|
|
1136
1114
|
|