@thoughtspot/visual-embed-sdk 1.32.1 → 1.32.3-alpha-1

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.
Files changed (106) hide show
  1. package/cjs/package.json +4 -22
  2. package/cjs/src/css-variables.d.ts +28 -0
  3. package/cjs/src/css-variables.d.ts.map +1 -1
  4. package/cjs/src/embed/app.d.ts +15 -14
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js +18 -3
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +32 -0
  9. package/cjs/src/embed/app.spec.js.map +1 -1
  10. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  11. package/cjs/src/embed/liveboard.js +2 -1
  12. package/cjs/src/embed/liveboard.js.map +1 -1
  13. package/cjs/src/embed/liveboard.spec.js +10 -0
  14. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  15. package/cjs/src/embed/search.d.ts +0 -13
  16. package/cjs/src/embed/search.d.ts.map +1 -1
  17. package/cjs/src/embed/search.js +1 -1
  18. package/cjs/src/embed/search.js.map +1 -1
  19. package/cjs/src/embed/search.spec.js +9 -9
  20. package/cjs/src/embed/search.spec.js.map +1 -1
  21. package/cjs/src/hostEventsTypeMapping.d.ts +2 -0
  22. package/cjs/src/hostEventsTypeMapping.d.ts.map +1 -0
  23. package/cjs/src/hostEventsTypeMapping.js +4 -0
  24. package/cjs/src/hostEventsTypeMapping.js.map +1 -0
  25. package/cjs/src/mixpanel-service.d.ts +4 -0
  26. package/cjs/src/mixpanel-service.d.ts.map +1 -1
  27. package/cjs/src/mixpanel-service.js +4 -0
  28. package/cjs/src/mixpanel-service.js.map +1 -1
  29. package/cjs/src/react/index.spec.js +1 -1
  30. package/cjs/src/react/index.spec.js.map +1 -1
  31. package/cjs/src/types.d.ts +32 -15
  32. package/cjs/src/types.d.ts.map +1 -1
  33. package/cjs/src/types.js +12 -14
  34. package/cjs/src/types.js.map +1 -1
  35. package/cjs/src/utils/processData.js +2 -2
  36. package/cjs/src/utils/processData.js.map +1 -1
  37. package/dist/src/css-variables.d.ts +28 -0
  38. package/dist/src/css-variables.d.ts.map +1 -1
  39. package/dist/src/embed/app.d.ts +15 -14
  40. package/dist/src/embed/app.d.ts.map +1 -1
  41. package/dist/src/embed/liveboard.d.ts.map +1 -1
  42. package/dist/src/embed/search.d.ts +0 -13
  43. package/dist/src/embed/search.d.ts.map +1 -1
  44. package/dist/src/hostEventsTypeMapping.d.ts +2 -0
  45. package/dist/src/hostEventsTypeMapping.d.ts.map +1 -0
  46. package/dist/src/mixpanel-service.d.ts +4 -0
  47. package/dist/src/mixpanel-service.d.ts.map +1 -1
  48. package/dist/src/types.d.ts +32 -15
  49. package/dist/src/types.d.ts.map +1 -1
  50. package/dist/tsembed-react.es.js +39 -21
  51. package/dist/tsembed-react.js +39 -21
  52. package/dist/tsembed.es.js +39 -21
  53. package/dist/tsembed.js +39 -21
  54. package/dist/visual-embed-sdk-react-full.d.ts +79 -42
  55. package/dist/visual-embed-sdk-react.d.ts +79 -42
  56. package/dist/visual-embed-sdk.d.ts +79 -42
  57. package/lib/package.json +4 -22
  58. package/lib/src/css-variables.d.ts +28 -0
  59. package/lib/src/css-variables.d.ts.map +1 -1
  60. package/lib/src/embed/app.d.ts +15 -14
  61. package/lib/src/embed/app.d.ts.map +1 -1
  62. package/lib/src/embed/app.js +17 -2
  63. package/lib/src/embed/app.js.map +1 -1
  64. package/lib/src/embed/app.spec.js +33 -1
  65. package/lib/src/embed/app.spec.js.map +1 -1
  66. package/lib/src/embed/liveboard.d.ts.map +1 -1
  67. package/lib/src/embed/liveboard.js +2 -1
  68. package/lib/src/embed/liveboard.js.map +1 -1
  69. package/lib/src/embed/liveboard.spec.js +10 -0
  70. package/lib/src/embed/liveboard.spec.js.map +1 -1
  71. package/lib/src/embed/search.d.ts +0 -13
  72. package/lib/src/embed/search.d.ts.map +1 -1
  73. package/lib/src/embed/search.js +1 -1
  74. package/lib/src/embed/search.js.map +1 -1
  75. package/lib/src/embed/search.spec.js +9 -9
  76. package/lib/src/embed/search.spec.js.map +1 -1
  77. package/lib/src/hostEventsTypeMapping.d.ts +2 -0
  78. package/lib/src/hostEventsTypeMapping.d.ts.map +1 -0
  79. package/lib/src/hostEventsTypeMapping.js +2 -0
  80. package/lib/src/hostEventsTypeMapping.js.map +1 -0
  81. package/lib/src/mixpanel-service.d.ts +4 -0
  82. package/lib/src/mixpanel-service.d.ts.map +1 -1
  83. package/lib/src/mixpanel-service.js +4 -0
  84. package/lib/src/mixpanel-service.js.map +1 -1
  85. package/lib/src/react/index.spec.js +1 -1
  86. package/lib/src/react/index.spec.js.map +1 -1
  87. package/lib/src/types.d.ts +32 -15
  88. package/lib/src/types.d.ts.map +1 -1
  89. package/lib/src/types.js +12 -14
  90. package/lib/src/types.js.map +1 -1
  91. package/lib/src/utils/processData.js +2 -2
  92. package/lib/src/utils/processData.js.map +1 -1
  93. package/lib/src/visual-embed-sdk.d.ts +79 -42
  94. package/package.json +4 -22
  95. package/src/css-variables.ts +28 -0
  96. package/src/embed/app.spec.ts +48 -0
  97. package/src/embed/app.ts +22 -14
  98. package/src/embed/liveboard.spec.ts +14 -0
  99. package/src/embed/liveboard.ts +2 -0
  100. package/src/embed/search.spec.ts +9 -9
  101. package/src/embed/search.ts +1 -14
  102. package/src/hostEventsTypeMapping.ts +23 -0
  103. package/src/mixpanel-service.ts +4 -0
  104. package/src/react/index.spec.tsx +1 -1
  105. package/src/types.ts +43 -24
  106. package/src/utils/processData.ts +2 -2
@@ -72,7 +72,11 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
72
72
  /**
73
73
  * SpotIQ listing page
74
74
  */
75
- SpotIQ = "insights"
75
+ SpotIQ = "insights",
76
+ /**
77
+ * Monitor Alerts Page
78
+ */
79
+ Monitor = "monitor"
76
80
  }
77
81
  /**
78
82
  * Define the initial state os column custom group accordions
@@ -92,6 +96,11 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
92
96
  */
93
97
  EXPAND_FIRST = "EXPAND_FIRST"
94
98
  }
99
+ export enum HomePageSearchBarMode {
100
+ OBJECT_SEARCH = "objectSearch",
101
+ AI_ANSWER = "aiAnswer",
102
+ NONE = "none"
103
+ }
95
104
  /**
96
105
  * The view configuration for full app embedding.
97
106
  * @group Embed components
@@ -278,19 +287,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
278
287
  * ```
279
288
  */
280
289
  fullHeight?: boolean;
281
- /**
282
- * Flag to control Data panel experience
283
- * @default false
284
- * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
285
- * @example
286
- * ```js
287
- * const embed = new AppEmbed('#tsEmbed', {
288
- * ... // other options
289
- * dataPanelV2: true,
290
- * })
291
- * ```
292
- */
293
- dataPanelV2?: boolean;
294
290
  /**
295
291
  * Show or hide Liveboard header
296
292
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
@@ -419,6 +415,11 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
419
415
  * @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
420
416
  */
421
417
  isOnBeforeGetVizDataInterceptEnabled?: boolean;
418
+ /**
419
+ * Flag to use home page search bar mode
420
+ * @version SDK : 1.33.0 | Thoughtspot : 10.2.0.cl
421
+ */
422
+ homePageSearchBarMode?: HomePageSearchBarMode;
422
423
  }
423
424
  /**
424
425
  * Embeds full ThoughtSpot experience in a host application.
@@ -1117,19 +1118,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
1117
1118
  * ```
1118
1119
  */
1119
1120
  hideSearchBar?: boolean;
1120
- /**
1121
- * Flag to control Data panel experience
1122
- * @default false
1123
- * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
1124
- * @example
1125
- * ```js
1126
- * const embed = new SearchEmbed('#tsEmbed', {
1127
- * ... // other options
1128
- * dataPanelV2:false,
1129
- * })
1130
- * ```
1131
- */
1132
- dataPanelV2?: boolean;
1133
1121
  /**
1134
1122
  * Flag to set if last selected dataSource should be used
1135
1123
  * @version: SDK: 1.24.0
@@ -2116,6 +2104,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2116
2104
  * @version SDK: 1.28.5 | Thoughtspot: *
2117
2105
  */
2118
2106
  disableTokenVerification?: boolean;
2107
+ /**
2108
+ * This flag is used to disable showing the login failure page in the embedded app.
2109
+ *
2110
+ * @version SDK 1.32.3 | Thoughtspot: *
2111
+ */
2112
+ disableLoginFailurePage?: boolean;
2119
2113
  }
2120
2114
  export interface LayoutConfig {
2121
2115
  }
@@ -2563,6 +2557,19 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2563
2557
  * @version SDK: 1.32.1 | ThoughtSpot: 10.3.0.cl
2564
2558
  */
2565
2559
  disableRedirectionLinksInNewTab?: boolean;
2560
+ /**
2561
+ * Flag to control Data panel experience
2562
+ * @default true
2563
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
2564
+ * @example
2565
+ * ```js
2566
+ * const embed = new AppEmbed('#tsEmbed', {
2567
+ * ... // other options
2568
+ * dataPanelV2: true,
2569
+ * })
2570
+ * ```
2571
+ */
2572
+ dataPanelV2?: boolean;
2566
2573
  }
2567
2574
  /**
2568
2575
  * MessagePayload: Embed event payload: message type, data and status (start/end)
@@ -3307,7 +3314,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3307
3314
  /**
3308
3315
  * Emitted when a user clicks the **Update TML** action on
3309
3316
  * embedded Liveboard.
3310
- *
3311
3317
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3312
3318
  * @example
3313
3319
  *```js
@@ -3319,7 +3325,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3319
3325
  /**
3320
3326
  * Emitted when a user clicks the **Edit TML** action
3321
3327
  * on an embedded Liveboard.
3322
- *
3323
3328
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
3324
3329
  * @example
3325
3330
  *```js
@@ -3927,20 +3932,16 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3927
3932
  /**
3928
3933
  * Trigger the **Export TML** action on an embedded Liveboard or
3929
3934
  * Answer.
3930
- *
3931
3935
  * @example
3932
3936
  * ```js
3933
3937
  * liveboardEmbed.trigger(HostEvent.ExportTML)
3934
3938
  * ```
3935
- *
3936
3939
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
3937
3940
  */
3938
3941
  ExportTML = "exportTSL",
3939
3942
  /**
3940
3943
  * Trigger the **Edit TML** action on an embedded Liveboard or
3941
3944
  * saved Answers in the full application embedding.
3942
- *
3943
- *
3944
3945
  * @example
3945
3946
  * ```js
3946
3947
  * liveboardEmbed.trigger(HostEvent.EditTML)
@@ -4067,7 +4068,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4067
4068
  * This event is not supported in visualization embed and search embed.
4068
4069
  * @param - object - To trigger the action for a specific visualization
4069
4070
  * in Liveboard embed, pass in `vizId` as a key.
4070
- *
4071
4071
  * @example
4072
4072
  * ```js
4073
4073
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -4334,7 +4334,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4334
4334
  /**
4335
4335
  * Get details of filters applied on the Liveboard.
4336
4336
  * Returns arrays containing Liveboard filter and runtime filter elements.
4337
- *
4338
4337
  * @example
4339
4338
  * ```js
4340
4339
  * const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
@@ -4631,7 +4630,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4631
4630
  IsFullAppEmbed = "isFullAppEmbed",
4632
4631
  IsOnBeforeGetVizDataInterceptEnabled = "isOnBeforeGetVizDataInterceptEnabled",
4633
4632
  FocusSearchBarOnRender = "focusSearchBarOnRender",
4634
- DisableRedirectionLinksInNewTab = "disableRedirectionLinksInNewTab"
4633
+ DisableRedirectionLinksInNewTab = "disableRedirectionLinksInNewTab",
4634
+ HomePageSearchBarMode = "homePageSearchBarMode"
4635
4635
  }
4636
4636
  /**
4637
4637
  * ThoughtSpot application pages include actions and menu commands
@@ -4681,7 +4681,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4681
4681
  * The **Save as View** action on the Answer
4682
4682
  * page. Saves an Answer as a View object in the full
4683
4683
  * application embedding mode.
4684
- *
4685
4684
  * @example
4686
4685
  * ```js
4687
4686
  * disabledActions: [Action.SaveAsView]
@@ -5139,7 +5138,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5139
5138
  /**
5140
5139
  * The **Delete** action for Answers in the full application
5141
5140
  * embedding mode.
5142
- *
5143
5141
  * @example
5144
5142
  * ```js
5145
5143
  * disabledActions: [Action.AnswerDelete]
@@ -5411,9 +5409,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5411
5409
  */
5412
5410
  RenameModalTitleDescription = "renameModalTitleDescription",
5413
5411
  /**
5414
- *
5415
- * The **Request Verification** action on the Liveboard.
5416
- * Triggers a Liveboard verification request.
5417
5412
  *
5418
5413
  * @example
5419
5414
  * ```js
@@ -5558,7 +5553,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5558
5553
  *
5559
5554
  * @version SDK: 1.32.0 | Thoughtspot: 10.1.0.cl
5560
5555
  */
5561
- CreateLiveboard = "CreateLiveboard",
5556
+ CreateLiveboard = "createLiveboard",
5562
5557
  /**
5563
5558
  * Action ID for to hide Verified Liveboard Banner
5564
5559
  * @example
@@ -5649,6 +5644,16 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5649
5644
  * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
5650
5645
  */
5651
5646
  UnsubscribeScheduleHomepage = "unsubscribeScheduleHomepage",
5647
+ /**
5648
+ * The **Manage Tags** action on Homepage Favourite Module.
5649
+ *
5650
+ * @example
5651
+ * ```js
5652
+ * disabledActions: [Action.ManageTags]
5653
+ * ```
5654
+ * @version SDK : 1.34.0 | Thoughtspot: 10.3.0.cl
5655
+ */
5656
+ ManageTags = "manageTags",
5652
5657
  /**
5653
5658
  * Action ID for delete schedule action on schedule on homepage
5654
5659
  * @example
@@ -6141,6 +6146,34 @@ declare module '@thoughtspot/visual-embed-sdk/css-variables' {
6141
6146
  * Background for favorite carousel find your favorites card in modular home.
6142
6147
  */
6143
6148
  '--ts-var-home-favorite-suggestion-card-background'?: string;
6149
+ /**
6150
+ * Border color of checkbox in error state.
6151
+ */
6152
+ '--ts-var-checkbox-error-border'?: string;
6153
+ /**
6154
+ * Border color of checkbox.
6155
+ */
6156
+ '--ts-var-checkbox-border-color'?: string;
6157
+ /**
6158
+ * Border color of checkbox in hover state.
6159
+ */
6160
+ '--ts-var-checkbox-hover-border'?: string;
6161
+ /**
6162
+ * Border and font color of checkbox in active state.
6163
+ */
6164
+ '--ts-var-checkbox-active-color'?: string;
6165
+ /**
6166
+ * Border color and font color of checkbox in checked state.
6167
+ */
6168
+ '--ts-var-checkbox-checked-color'?: string;
6169
+ /**
6170
+ * Border and font color of checkbox in disabled state.
6171
+ */
6172
+ '--ts-var-checkbox-checked-disabled'?: string;
6173
+ /**
6174
+ * Background color of checkbox.
6175
+ */
6176
+ '--ts-var-checkbox-background-color'?: string;
6144
6177
  }
6145
6178
  }
6146
6179
 
@@ -6473,6 +6506,10 @@ declare module '@thoughtspot/visual-embed-sdk/mixpanel-service' {
6473
6506
  export const EndPoints: {
6474
6507
  CONFIG: string;
6475
6508
  };
6509
+ /**
6510
+ * Enum of mixpanel events
6511
+ * @hidden
6512
+ */
6476
6513
  export const MIXPANEL_EVENT: {
6477
6514
  VISUAL_SDK_RENDER_START: string;
6478
6515
  VISUAL_SDK_CALLED_INIT: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.32.1",
3
+ "version": "1.32.3-alpha-1",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
@@ -45,11 +45,6 @@
45
45
  "lint": "eslint 'src/**'",
46
46
  "lint:fix": "eslint 'src/**/*.*' --fix",
47
47
  "tsc": "tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",
48
- "start": "gatsby develop",
49
- "build:gatsby": "npm run clean:gatsby && gatsby build --prefix-paths",
50
- "build:gatsby:noprefix": "npm run clean:gatsby && gatsby build",
51
- "serve:gatsby": "gatsby serve",
52
- "clean:gatsby": "gatsby clean",
53
48
  "build-and-publish": "npm run build:gatsby && npm run publish",
54
49
  "bundle-dts-file": "dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",
55
50
  "bundle-dts": "dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true",
@@ -57,11 +52,9 @@
57
52
  "bundle-dts-react-full": "dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",
58
53
  "build": "rollup -c",
59
54
  "watch": "rollup -cw",
60
- "docs-cmd": "node scripts/gatsby-commands.js",
61
- "docgen": "typedoc --tsconfig tsconfig.json --theme typedoc-theme",
55
+ "docgen": "typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck",
62
56
  "test-sdk": "jest -c jest.config.sdk.js --runInBand",
63
- "test-docs": "jest -c jest.config.docs.js",
64
- "test": "npm run test-sdk && npm run test-docs",
57
+ "test": "npm run test-sdk",
65
58
  "posttest": "cat ./coverage/sdk/lcov.info | coveralls",
66
59
  "is-publish-allowed": "node scripts/is-publish-allowed.js",
67
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",
@@ -104,6 +97,7 @@
104
97
  "@testing-library/user-event": "^13.1.8",
105
98
  "@types/jest": "^22.2.3",
106
99
  "@types/mixpanel-browser": "^2.35.6",
100
+ "@types/lodash": "^4.17.0",
107
101
  "@types/react-test-renderer": "^17.0.1",
108
102
  "@typescript-eslint/eslint-plugin": "^4.6.0",
109
103
  "@typescript-eslint/parser": "^4.6.0",
@@ -122,18 +116,6 @@
122
116
  "eslint-plugin-prettier": "^3.1.4",
123
117
  "eslint-plugin-react-hooks": "^4.2.0",
124
118
  "fs-extra": "^10.0.0",
125
- "gatsby": "3.13.1",
126
- "gatsby-plugin-algolia": "^0.22.2",
127
- "gatsby-plugin-catch-links": "^3.1.0",
128
- "gatsby-plugin-env-variables": "^2.1.0",
129
- "gatsby-plugin-intl": "^0.3.3",
130
- "gatsby-plugin-manifest": "^3.2.0",
131
- "gatsby-plugin-output": "^0.1.3",
132
- "gatsby-plugin-sass": "6.7.0",
133
- "gatsby-plugin-sitemap": "^4.10.0",
134
- "gatsby-source-filesystem": "3.1.0",
135
- "gatsby-transformer-asciidoc": "2.1.0",
136
- "gatsby-transformer-rehype": "2.0.0",
137
119
  "gh-pages": "^3.1.0",
138
120
  "highlight.js": "^10.6.0",
139
121
  "html-to-text": "^8.0.0",
@@ -416,4 +416,32 @@ export interface CustomCssVariables {
416
416
  * Background for favorite carousel find your favorites card in modular home.
417
417
  */
418
418
  '--ts-var-home-favorite-suggestion-card-background'?: string;
419
+ /**
420
+ * Border color of checkbox in error state.
421
+ */
422
+ '--ts-var-checkbox-error-border'?: string;
423
+ /**
424
+ * Border color of checkbox.
425
+ */
426
+ '--ts-var-checkbox-border-color'?: string;
427
+ /**
428
+ * Border color of checkbox in hover state.
429
+ */
430
+ '--ts-var-checkbox-hover-border'?: string;
431
+ /**
432
+ * Border and font color of checkbox in active state.
433
+ */
434
+ '--ts-var-checkbox-active-color'?: string;
435
+ /**
436
+ * Border color and font color of checkbox in checked state.
437
+ */
438
+ '--ts-var-checkbox-checked-color'?: string;
439
+ /**
440
+ * Border and font color of checkbox in disabled state.
441
+ */
442
+ '--ts-var-checkbox-checked-disabled'?: string;
443
+ /**
444
+ * Background color of checkbox.
445
+ */
446
+ '--ts-var-checkbox-background-color'?: string;
419
447
  }
@@ -3,6 +3,7 @@ import {
3
3
  AppViewConfig,
4
4
  DataPanelCustomColumnGroupsAccordionState,
5
5
  Page,
6
+ HomePageSearchBarMode,
6
7
  } from './app';
7
8
  import { init } from '../index';
8
9
  import {
@@ -137,6 +138,7 @@ describe('App embed tests', () => {
137
138
  [Page.Data]: 'data/tables',
138
139
  [Page.Home]: 'home',
139
140
  [Page.SpotIQ]: 'insights/results',
141
+ [Page.Monitor]: 'insights/monitor-alerts',
140
142
  };
141
143
 
142
144
  const pageIds = Object.keys(pageRouteMap);
@@ -169,6 +171,7 @@ describe('App embed tests', () => {
169
171
  [Page.Data]: 'data/tables',
170
172
  [Page.Home]: 'home',
171
173
  [Page.SpotIQ]: 'home/spotiq-analysis',
174
+ [Page.Monitor]: 'home/monitor-alerts',
172
175
  };
173
176
 
174
177
  const pageIdsForModularHomes = Object.keys(pageRouteMapForModularHome);
@@ -431,6 +434,51 @@ describe('App embed tests', () => {
431
434
  });
432
435
  });
433
436
 
437
+ test('Should add HomePageSearchBarMode flag with object search to the iframe src', async () => {
438
+ const appEmbed = new AppEmbed(getRootEl(), {
439
+ ...defaultViewConfig,
440
+ homePageSearchBarMode: HomePageSearchBarMode.OBJECT_SEARCH,
441
+ } as AppViewConfig);
442
+
443
+ await appEmbed.render();
444
+ await executeAfterWait(() => {
445
+ expectUrlMatchesWithParams(
446
+ getIFrameSrc(),
447
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=objectSearch${defaultParams}${defaultParamsPost}#/home`,
448
+ );
449
+ });
450
+ });
451
+
452
+ test('Should add HomePageSearchBarMode flag with ai answer to the iframe src', async () => {
453
+ const appEmbed = new AppEmbed(getRootEl(), {
454
+ ...defaultViewConfig,
455
+ homePageSearchBarMode: HomePageSearchBarMode.AI_ANSWER,
456
+ } as AppViewConfig);
457
+
458
+ await appEmbed.render();
459
+ await executeAfterWait(() => {
460
+ expectUrlMatchesWithParams(
461
+ getIFrameSrc(),
462
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=aiAnswer${defaultParams}${defaultParamsPost}#/home`,
463
+ );
464
+ });
465
+ });
466
+
467
+ test('Should add HomePageSearchBarMode flag with none to the iframe src', async () => {
468
+ const appEmbed = new AppEmbed(getRootEl(), {
469
+ ...defaultViewConfig,
470
+ homePageSearchBarMode: HomePageSearchBarMode.NONE,
471
+ } as AppViewConfig);
472
+
473
+ await appEmbed.render();
474
+ await executeAfterWait(() => {
475
+ expectUrlMatchesWithParams(
476
+ getIFrameSrc(),
477
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&homePageSearchBarMode=none${defaultParams}${defaultParamsPost}#/home`,
478
+ );
479
+ });
480
+ });
481
+
434
482
  test('Should add dataPanelCustomGroupsAccordionInitialState flag to the iframe src', async () => {
435
483
  const appEmbed = new AppEmbed(getRootEl(), {
436
484
  ...defaultViewConfig,
package/src/embed/app.ts CHANGED
@@ -53,6 +53,10 @@ export enum Page {
53
53
  * SpotIQ listing page
54
54
  */
55
55
  SpotIQ = 'insights',
56
+ /**
57
+ * Monitor Alerts Page
58
+ */
59
+ Monitor = 'monitor'
56
60
  }
57
61
 
58
62
  /**
@@ -74,6 +78,11 @@ export enum DataPanelCustomColumnGroupsAccordionState {
74
78
  EXPAND_FIRST = 'EXPAND_FIRST',
75
79
  }
76
80
 
81
+ export enum HomePageSearchBarMode {
82
+ OBJECT_SEARCH = 'objectSearch',
83
+ AI_ANSWER = 'aiAnswer',
84
+ NONE = 'none'
85
+ }
77
86
  /**
78
87
  * The view configuration for full app embedding.
79
88
  * @group Embed components
@@ -260,19 +269,6 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
260
269
  * ```
261
270
  */
262
271
  fullHeight?: boolean;
263
- /**
264
- * Flag to control Data panel experience
265
- * @default false
266
- * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
267
- * @example
268
- * ```js
269
- * const embed = new AppEmbed('#tsEmbed', {
270
- * ... // other options
271
- * dataPanelV2: true,
272
- * })
273
- * ```
274
- */
275
- dataPanelV2?: boolean;
276
272
  /**
277
273
  * Show or hide Liveboard header
278
274
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
@@ -401,6 +397,11 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
401
397
  * @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
402
398
  */
403
399
  isOnBeforeGetVizDataInterceptEnabled?: boolean;
400
+ /**
401
+ * Flag to use home page search bar mode
402
+ * @version SDK : 1.33.0 | Thoughtspot : 10.2.0.cl
403
+ */
404
+ homePageSearchBarMode?: HomePageSearchBarMode;
404
405
  }
405
406
 
406
407
  /**
@@ -438,7 +439,7 @@ export class AppEmbed extends V1Embed {
438
439
  hideOrgSwitcher,
439
440
  enableSearchAssist,
440
441
  fullHeight,
441
- dataPanelV2 = false,
442
+ dataPanelV2 = true,
442
443
  hideLiveboardHeader = false,
443
444
  showLiveboardTitle = true,
444
445
  showLiveboardDescription = true,
@@ -453,6 +454,7 @@ export class AppEmbed extends V1Embed {
453
454
  /* eslint-disable-next-line max-len */
454
455
  dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL,
455
456
  collapseSearchBar = true,
457
+ homePageSearchBarMode,
456
458
  } = this.viewConfig;
457
459
 
458
460
  let params = {};
@@ -502,6 +504,10 @@ export class AppEmbed extends V1Embed {
502
504
  ] = isOnBeforeGetVizDataInterceptEnabled;
503
505
  }
504
506
 
507
+ if (homePageSearchBarMode) {
508
+ params[Param.HomePageSearchBarMode] = homePageSearchBarMode;
509
+ }
510
+
505
511
  params[Param.DataPanelV2Enabled] = dataPanelV2;
506
512
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
507
513
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -580,6 +586,8 @@ export class AppEmbed extends V1Embed {
580
586
  return 'data/tables';
581
587
  case Page.SpotIQ:
582
588
  return modularHomeExperience ? 'home/spotiq-analysis' : 'insights/results';
589
+ case Page.Monitor:
590
+ return modularHomeExperience ? 'home/monitor-alerts' : 'insights/monitor-alerts';
583
591
  case Page.Home:
584
592
  default:
585
593
  return 'home';
@@ -67,6 +67,20 @@ describe('Liveboard/viz embed tests', () => {
67
67
  });
68
68
  });
69
69
 
70
+ test('should render liveboard with data panel v2 flag set to true by default', async () => {
71
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
72
+ ...defaultViewConfig,
73
+ liveboardId,
74
+ } as LiveboardViewConfig);
75
+ liveboardEmbed.render();
76
+ await executeAfterWait(() => {
77
+ expectUrlMatchesWithParams(
78
+ getIFrameSrc(),
79
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&enableDataPanelV2=true#/embed/viz/${liveboardId}`,
80
+ );
81
+ });
82
+ });
83
+
70
84
  test('should set disabled actions', async () => {
71
85
  const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
72
86
  disabledActions: [Action.DownloadAsCsv, Action.DownloadAsPdf, Action.DownloadAsXlsx],
@@ -340,6 +340,7 @@ export class LiveboardEmbed extends V1Embed {
340
340
  isLiveboardHeaderSticky = true,
341
341
  enableAskSage,
342
342
  enable2ColumnLayout,
343
+ dataPanelV2 = true,
343
344
  } = this.viewConfig;
344
345
 
345
346
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
@@ -388,6 +389,7 @@ export class LiveboardEmbed extends V1Embed {
388
389
 
389
390
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
390
391
 
392
+ params[Param.DataPanelV2Enabled] = dataPanelV2;
391
393
  const queryParams = getQueryParamString(params, true);
392
394
 
393
395
  return queryParams;
@@ -52,7 +52,7 @@ describe('Search embed tests', () => {
52
52
  await executeAfterWait(() => {
53
53
  expectUrlMatchesWithParams(
54
54
  getIFrameSrc(),
55
- `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&enableDataPanelV2=false&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
55
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&enableDataPanelV2=true&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
56
56
  );
57
57
  });
58
58
  });
@@ -416,16 +416,16 @@ describe('Search embed tests', () => {
416
416
  });
417
417
  });
418
418
 
419
- test('should set enableDataPanelV2 to true if data panel v2 flag is true', async () => {
419
+ test('should set enableDataPanelV2 to false if data panel v2 flag is false', async () => {
420
420
  const searchEmbed = new SearchEmbed(getRootEl(), {
421
421
  ...defaultViewConfig,
422
- dataPanelV2: true,
422
+ dataPanelV2: false,
423
423
  });
424
424
  searchEmbed.render();
425
425
  await executeAfterWait(() => {
426
426
  expectUrlMatchesWithParams(
427
427
  getIFrameSrc(),
428
- `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=true&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
428
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
429
429
  );
430
430
  });
431
431
  });
@@ -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=false&useLastSelectedSources=true${prefixParams}#/embed/saved-answer/${answerId}`,
441
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=true&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=false&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
456
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=true&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=false&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
471
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=true&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=false&useLastSelectedSources=false&hideSearchBar=true${prefixParams}#/embed/saved-answer/${answerId}`,
502
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=true&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=false&useLastSelectedSources=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST${prefixParams}#/embed/saved-answer/${answerId}`,
517
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=true&useLastSelectedSources=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST${prefixParams}#/embed/saved-answer/${answerId}`,
518
518
  );
519
519
  });
520
520
  });
@@ -227,19 +227,6 @@ export interface SearchViewConfig
227
227
  * ```
228
228
  */
229
229
  hideSearchBar?: boolean;
230
- /**
231
- * Flag to control Data panel experience
232
- * @default false
233
- * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
234
- * @example
235
- * ```js
236
- * const embed = new SearchEmbed('#tsEmbed', {
237
- * ... // other options
238
- * dataPanelV2:false,
239
- * })
240
- * ```
241
- */
242
- dataPanelV2?: boolean;
243
230
  /**
244
231
  * Flag to set if last selected dataSource should be used
245
232
  * @version: SDK: 1.24.0
@@ -356,7 +343,7 @@ export class SearchEmbed extends TsEmbed {
356
343
  dataSources,
357
344
  excludeRuntimeFiltersfromURL,
358
345
  hideSearchBar,
359
- dataPanelV2 = false,
346
+ dataPanelV2 = true,
360
347
  useLastSelectedSources = false,
361
348
  runtimeParameters,
362
349
  collapseSearchBarInitially = false,