@thoughtspot/visual-embed-sdk 1.23.1 → 1.23.2

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 (91) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +1 -1
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +1 -3
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/embed/app.d.ts +8 -0
  7. package/cjs/src/embed/app.d.ts.map +1 -1
  8. package/cjs/src/embed/app.js +2 -1
  9. package/cjs/src/embed/app.js.map +1 -1
  10. package/cjs/src/embed/app.spec.js +10 -0
  11. package/cjs/src/embed/app.spec.js.map +1 -1
  12. package/cjs/src/embed/sage.d.ts +25 -2
  13. package/cjs/src/embed/sage.d.ts.map +1 -1
  14. package/cjs/src/embed/sage.js +10 -5
  15. package/cjs/src/embed/sage.js.map +1 -1
  16. package/cjs/src/embed/sage.spec.js +26 -0
  17. package/cjs/src/embed/sage.spec.js.map +1 -1
  18. package/cjs/src/embed/search-bar.d.ts +1 -1
  19. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  20. package/cjs/src/embed/search.d.ts +8 -0
  21. package/cjs/src/embed/search.d.ts.map +1 -1
  22. package/cjs/src/embed/search.js +2 -1
  23. package/cjs/src/embed/search.js.map +1 -1
  24. package/cjs/src/embed/search.spec.js +11 -1
  25. package/cjs/src/embed/search.spec.js.map +1 -1
  26. package/cjs/src/react/index.spec.js +1 -1
  27. package/cjs/src/react/index.spec.js.map +1 -1
  28. package/cjs/src/types.d.ts +18 -3
  29. package/cjs/src/types.d.ts.map +1 -1
  30. package/cjs/src/types.js +17 -2
  31. package/cjs/src/types.js.map +1 -1
  32. package/dist/src/auth.d.ts.map +1 -1
  33. package/dist/src/embed/app.d.ts +8 -0
  34. package/dist/src/embed/app.d.ts.map +1 -1
  35. package/dist/src/embed/sage.d.ts +25 -2
  36. package/dist/src/embed/sage.d.ts.map +1 -1
  37. package/dist/src/embed/search-bar.d.ts +1 -1
  38. package/dist/src/embed/search-bar.d.ts.map +1 -1
  39. package/dist/src/embed/search.d.ts +8 -0
  40. package/dist/src/embed/search.d.ts.map +1 -1
  41. package/dist/src/types.d.ts +18 -3
  42. package/dist/src/types.d.ts.map +1 -1
  43. package/dist/tsembed-react.es.js +115 -17292
  44. package/dist/tsembed-react.js +115 -17292
  45. package/dist/tsembed.es.js +128 -17305
  46. package/dist/tsembed.js +128 -17305
  47. package/dist/visual-embed-sdk-react-full.d.ts +60 -6
  48. package/dist/visual-embed-sdk-react.d.ts +60 -6
  49. package/dist/visual-embed-sdk.d.ts +60 -6
  50. package/lib/package.json +1 -1
  51. package/lib/src/auth.d.ts.map +1 -1
  52. package/lib/src/auth.js +1 -2
  53. package/lib/src/auth.js.map +1 -1
  54. package/lib/src/embed/app.d.ts +8 -0
  55. package/lib/src/embed/app.d.ts.map +1 -1
  56. package/lib/src/embed/app.js +2 -1
  57. package/lib/src/embed/app.js.map +1 -1
  58. package/lib/src/embed/app.spec.js +10 -0
  59. package/lib/src/embed/app.spec.js.map +1 -1
  60. package/lib/src/embed/sage.d.ts +25 -2
  61. package/lib/src/embed/sage.d.ts.map +1 -1
  62. package/lib/src/embed/sage.js +10 -5
  63. package/lib/src/embed/sage.js.map +1 -1
  64. package/lib/src/embed/sage.spec.js +26 -0
  65. package/lib/src/embed/sage.spec.js.map +1 -1
  66. package/lib/src/embed/search-bar.d.ts +1 -1
  67. package/lib/src/embed/search-bar.d.ts.map +1 -1
  68. package/lib/src/embed/search.d.ts +8 -0
  69. package/lib/src/embed/search.d.ts.map +1 -1
  70. package/lib/src/embed/search.js +2 -1
  71. package/lib/src/embed/search.js.map +1 -1
  72. package/lib/src/embed/search.spec.js +11 -1
  73. package/lib/src/embed/search.spec.js.map +1 -1
  74. package/lib/src/react/index.spec.js +1 -1
  75. package/lib/src/react/index.spec.js.map +1 -1
  76. package/lib/src/types.d.ts +18 -3
  77. package/lib/src/types.d.ts.map +1 -1
  78. package/lib/src/types.js +17 -2
  79. package/lib/src/types.js.map +1 -1
  80. package/lib/src/visual-embed-sdk.d.ts +60 -6
  81. package/package.json +1 -1
  82. package/src/auth.ts +1 -2
  83. package/src/embed/app.spec.ts +15 -0
  84. package/src/embed/app.ts +10 -0
  85. package/src/embed/sage.spec.ts +32 -0
  86. package/src/embed/sage.ts +38 -5
  87. package/src/embed/search-bar.tsx +1 -1
  88. package/src/embed/search.spec.ts +15 -1
  89. package/src/embed/search.ts +10 -0
  90. package/src/react/index.spec.tsx +1 -1
  91. package/src/types.ts +17 -2
@@ -138,6 +138,14 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
138
138
  * @version SDK: 1.21.0 | ThoughtSpot: 9.4.0.cl, 9.4.0-sw
139
139
  */
140
140
  fullHeight?: boolean;
141
+ /**
142
+ * Flag to control Data panel experience
143
+ *
144
+ * @default false
145
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
146
+ * @hidden
147
+ */
148
+ dataPanelV2?: boolean;
141
149
  }
142
150
  /**
143
151
  * Embeds full ThoughtSpot experience in a host application.
@@ -526,6 +534,14 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
526
534
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
527
535
  */
528
536
  hideSearchBar?: boolean;
537
+ /**
538
+ * Flag to control Data panel experience
539
+ *
540
+ * @default false
541
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
542
+ * @hidden
543
+ */
544
+ dataPanelV2?: boolean;
529
545
  }
530
546
  export const HiddenActionItemByDefaultForSearchEmbed: Action[];
531
547
  /**
@@ -554,7 +570,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search-bar' {
554
570
  /**
555
571
  * @group Embed components
556
572
  */
557
- export interface SearchBarViewConfig extends Omit<ViewConfig, 'runtimeFilters' | 'showAlerts'> {
573
+ export interface SearchBarViewConfig extends Omit<ViewConfig, 'runtimeFilters' | 'showAlerts' | 'dataPanelV2'> {
558
574
  /**
559
575
  * The array of data source GUIDs to set on load.
560
576
  * Only a single dataSource supported currently.
@@ -2775,7 +2791,21 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2775
2791
  * ```
2776
2792
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
2777
2793
  */
2778
- SetHiddenTabs = "SetPinboardHiddenTabs"
2794
+ SetHiddenTabs = "SetPinboardHiddenTabs",
2795
+ /**
2796
+ * Updates the search query for sage embed.
2797
+ *
2798
+ * @param - searchOptions: an object queryString and option to execute the query.
2799
+ * @example
2800
+ * ```js
2801
+ * sageEmbed.trigger(HostEvent.UpdateSageQuery, {
2802
+ * queryString: 'revenue per year',
2803
+ * executeSearch: true,
2804
+ * })
2805
+ * ```
2806
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
2807
+ */
2808
+ UpdateSageQuery = "updateSageQuery"
2779
2809
  }
2780
2810
  /**
2781
2811
  * The different visual modes that the data sources panel within
@@ -2830,6 +2860,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2830
2860
  DisableLoginRedirect = "disableLoginRedirect",
2831
2861
  visibleVizs = "pinboardVisibleVizs",
2832
2862
  LiveboardV2Enabled = "isPinboardV2Enabled",
2863
+ DataPanelV2Enabled = "enableDataPanelV2",
2833
2864
  ShowAlerts = "showAlerts",
2834
2865
  Locale = "locale",
2835
2866
  CustomStyle = "customStyle",
@@ -2857,8 +2888,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2857
2888
  VisibleTabs = "visibleTabs",
2858
2889
  HideTabPanel = "hideTabPanel",
2859
2890
  HideSampleQuestions = "hideSampleQuestions",
2860
- WorksheetId = "worksheetId",
2861
- Query = "query,"
2891
+ WorksheetId = "worksheet",
2892
+ Query = "query"
2862
2893
  }
2863
2894
  /**
2864
2895
  * ThoughtSpot application pages include actions and menu commands
@@ -4013,6 +4044,22 @@ declare module '@thoughtspot/visual-embed-sdk/embed/sage' {
4013
4044
  */
4014
4045
  import { Action, DOMSelector, ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
4015
4046
  import { V1Embed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
4047
+ /**
4048
+ * Configuration for search options
4049
+ */
4050
+ export interface SearchOptions {
4051
+ /**
4052
+ * The tml string to load the answer
4053
+ */
4054
+ searchQuery: string;
4055
+ /**
4056
+ * Boolean to determine if the search should be executed or not.
4057
+ * if it is executed, put the focus on the results.
4058
+ * if it’s not executed, put the focus in the search bar - at the end of
4059
+ * the tokens
4060
+ */
4061
+ executeSearch?: boolean;
4062
+ }
4016
4063
  /**
4017
4064
  * The configuration attributes for the embedded Natural language search view. Based on
4018
4065
  * GPT and LLM.
@@ -4022,7 +4069,9 @@ declare module '@thoughtspot/visual-embed-sdk/embed/sage' {
4022
4069
  */
4023
4070
  export interface SageViewConfig extends ViewConfig {
4024
4071
  /**
4025
- * If set to true, object results are shown.
4072
+ * If set to true, a list of liveboard and answers related
4073
+ * to the natural language search will be shown below the
4074
+ * AI generated answer.
4026
4075
  */
4027
4076
  showObjectResults?: boolean;
4028
4077
  /**
@@ -4034,7 +4083,8 @@ declare module '@thoughtspot/visual-embed-sdk/embed/sage' {
4034
4083
  */
4035
4084
  hideWorksheetSelector?: boolean;
4036
4085
  /**
4037
- * If set to true, the object search suggestions are not shown
4086
+ * If set to true, the search suggestions will contain existing
4087
+ * liveboards and answers in addition with the autocomplete
4038
4088
  *
4039
4089
  */
4040
4090
  showObjectSuggestions?: boolean;
@@ -4051,6 +4101,10 @@ declare module '@thoughtspot/visual-embed-sdk/embed/sage' {
4051
4101
  * The data source GUID to set on load.
4052
4102
  */
4053
4103
  dataSource?: string;
4104
+ /**
4105
+ * Configuration for search options
4106
+ */
4107
+ searchOptions?: SearchOptions;
4054
4108
  }
4055
4109
  export const HiddenActionItemByDefaultForSageEmbed: Action[];
4056
4110
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.23.1",
3
+ "version": "1.23.2",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
package/src/auth.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import EventEmitter from 'eventemitter3';
2
- import _ from 'lodash';
3
2
  import { initMixpanel } from './mixpanel-service';
4
3
  import {
5
4
  AuthType, DOMSelector, EmbedConfig, EmbedEvent, Param,
@@ -207,7 +206,7 @@ export function notifyLogout(): void {
207
206
  }
208
207
 
209
208
  export const initSession = (sessionDetails: sessionInfoInterface) => {
210
- if (_.isNull(sessionInfo)) {
209
+ if (sessionInfo == null) {
211
210
  sessionInfo = sessionDetails;
212
211
  initMixpanel(sessionInfo);
213
212
  sessionInfoResolver(sessionInfo);
@@ -254,6 +254,21 @@ describe('App embed tests', () => {
254
254
  });
255
255
  });
256
256
 
257
+ test('Should add enableDataPanelV2 flag to the iframe src', async () => {
258
+ const appEmbed = new AppEmbed(getRootEl(), {
259
+ ...defaultViewConfig,
260
+ dataPanelV2: true,
261
+ } as AppViewConfig);
262
+
263
+ appEmbed.render();
264
+ await executeAfterWait(() => {
265
+ expectUrlMatchesWithParams(
266
+ getIFrameSrc(),
267
+ `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableDataPanelV2=true${defaultParams}${defaultParamsPost}#/home`,
268
+ );
269
+ });
270
+ });
271
+
257
272
  test('should register event handlers to adjust iframe height', async () => {
258
273
  const onSpy = jest.spyOn(AppEmbed.prototype, 'on')
259
274
  .mockImplementation((event, callback) => {
package/src/embed/app.ts CHANGED
@@ -118,6 +118,14 @@ export interface AppViewConfig extends ViewConfig {
118
118
  * @version SDK: 1.21.0 | ThoughtSpot: 9.4.0.cl, 9.4.0-sw
119
119
  */
120
120
  fullHeight?:boolean;
121
+ /**
122
+ * Flag to control Data panel experience
123
+ *
124
+ * @default false
125
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
126
+ * @hidden
127
+ */
128
+ dataPanelV2?: boolean;
121
129
  }
122
130
 
123
131
  /**
@@ -155,6 +163,7 @@ export class AppEmbed extends V1Embed {
155
163
  hideOrgSwitcher,
156
164
  enableSearchAssist,
157
165
  fullHeight,
166
+ dataPanelV2 = false,
158
167
  } = this.viewConfig;
159
168
 
160
169
  let params = {};
@@ -184,6 +193,7 @@ export class AppEmbed extends V1Embed {
184
193
  params[Param.EnableSearchAssist] = enableSearchAssist;
185
194
  }
186
195
 
196
+ params[Param.DataPanelV2Enabled] = dataPanelV2;
187
197
  const queryParams = getQueryParamString(params, true);
188
198
 
189
199
  return queryParams;
@@ -41,4 +41,36 @@ describe('Sage embed tests', () => {
41
41
  );
42
42
  });
43
43
  });
44
+ test('embed url include pre-seed dataSource and query', async () => {
45
+ const sageEmbed = new SageEmbed(getRootEl(), {
46
+ ...defaultConfig,
47
+ dataSource: 'worksheet-id',
48
+ searchOptions: {
49
+ searchQuery: 'test-query',
50
+ },
51
+ });
52
+ sageEmbed.render();
53
+ await executeAfterWait(() => {
54
+ expectUrlMatch(
55
+ getIFrameSrc(),
56
+ `http://${thoughtSpotHost}/?embedApp=true&hideEurekaResults=false&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=true&hideEurekaSuggestions=true&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka?worksheet=worksheet-id&query=test-query`,
57
+ );
58
+ });
59
+ });
60
+ test('embed url include pre-seed execute flag with query', async () => {
61
+ const sageEmbed = new SageEmbed(getRootEl(), {
62
+ ...defaultConfig,
63
+ searchOptions: {
64
+ searchQuery: 'test-query',
65
+ executeSearch: true,
66
+ },
67
+ });
68
+ sageEmbed.render();
69
+ await executeAfterWait(() => {
70
+ expectUrlMatch(
71
+ getIFrameSrc(),
72
+ `http://${thoughtSpotHost}/?embedApp=true&hideEurekaResults=false&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=true&hideEurekaSuggestions=true&hideAction=%5B"reportError","save","pin","editACopy","saveAsView","updateTSL","editTSL","onDeleteAnswer","share"%5D#/embed/eureka?query=test-query&executeSearch=true`,
73
+ );
74
+ });
75
+ });
44
76
  });
package/src/embed/sage.ts CHANGED
@@ -13,6 +13,23 @@ import {
13
13
  import { getQueryParamString } from '../utils';
14
14
  import { V1Embed } from './ts-embed';
15
15
 
16
+ /**
17
+ * Configuration for search options
18
+ */
19
+ export interface SearchOptions {
20
+ /**
21
+ * The tml string to load the answer
22
+ */
23
+ searchQuery: string;
24
+ /**
25
+ * Boolean to determine if the search should be executed or not.
26
+ * if it is executed, put the focus on the results.
27
+ * if it’s not executed, put the focus in the search bar - at the end of
28
+ * the tokens
29
+ */
30
+ executeSearch?: boolean;
31
+ }
32
+
16
33
  /**
17
34
  * The configuration attributes for the embedded Natural language search view. Based on
18
35
  * GPT and LLM.
@@ -22,7 +39,9 @@ import { V1Embed } from './ts-embed';
22
39
  */
23
40
  export interface SageViewConfig extends ViewConfig {
24
41
  /**
25
- * If set to true, object results are shown.
42
+ * If set to true, a list of liveboard and answers related
43
+ * to the natural language search will be shown below the
44
+ * AI generated answer.
26
45
  */
27
46
  showObjectResults?: boolean;
28
47
  /**
@@ -34,7 +53,8 @@ export interface SageViewConfig extends ViewConfig {
34
53
  */
35
54
  hideWorksheetSelector?: boolean,
36
55
  /**
37
- * If set to true, the object search suggestions are not shown
56
+ * If set to true, the search suggestions will contain existing
57
+ * liveboards and answers in addition with the autocomplete
38
58
  *
39
59
  */
40
60
  showObjectSuggestions?: boolean;
@@ -51,6 +71,11 @@ export interface SageViewConfig extends ViewConfig {
51
71
  * The data source GUID to set on load.
52
72
  */
53
73
  dataSource?: string;
74
+ /**
75
+ * Configuration for search options
76
+ */
77
+ searchOptions?: SearchOptions;
78
+
54
79
  }
55
80
  export const HiddenActionItemByDefaultForSageEmbed = [
56
81
  Action.Save,
@@ -102,7 +127,7 @@ export class SageEmbed extends V1Embed {
102
127
  params[Param.DisableWorksheetChange] = !!disableWorksheetChange;
103
128
  params[Param.HideWorksheetSelector] = !!hideWorksheetSelector;
104
129
  params[Param.HideEurekaSuggestions] = !showObjectSuggestions;
105
- params[Param.HideSampleQuestions] = !hideSampleQuestions;
130
+ params[Param.HideSampleQuestions] = !!hideSampleQuestions;
106
131
  params[Param.HideActions] = [
107
132
  ...(params[Param.HideActions] ?? []),
108
133
  ...HiddenActionItemByDefaultForSageEmbed,
@@ -121,9 +146,17 @@ export class SageEmbed extends V1Embed {
121
146
  const path = 'eureka';
122
147
  const postHashObj = {};
123
148
  const tsPostHashParams = this.getThoughtSpotPostUrlParams();
149
+ const {
150
+ dataSource, searchOptions,
151
+ } = this.viewConfig;
124
152
 
125
- if (this.viewConfig.searchQuery) postHashObj[Param.Query] = this.viewConfig.searchQuery;
126
- if (this.viewConfig.dataSource) postHashObj[Param.WorksheetId] = this.viewConfig.dataSource;
153
+ if (dataSource) postHashObj[Param.WorksheetId] = dataSource;
154
+ if (searchOptions?.searchQuery) {
155
+ postHashObj[Param.Query] = searchOptions?.searchQuery;
156
+ if (searchOptions.executeSearch) {
157
+ postHashObj[Param.executeSearch] = true;
158
+ }
159
+ }
127
160
  let sagePostHashParams = new URLSearchParams(postHashObj).toString();
128
161
  if (sagePostHashParams) sagePostHashParams = `${tsPostHashParams ? '&' : '?'}${sagePostHashParams}`;
129
162
 
@@ -8,7 +8,7 @@ import { SearchOptions } from './search';
8
8
  /**
9
9
  * @group Embed components
10
10
  */
11
- export interface SearchBarViewConfig extends Omit<ViewConfig, 'runtimeFilters' | 'showAlerts'> {
11
+ export interface SearchBarViewConfig extends Omit<ViewConfig, 'runtimeFilters' | 'showAlerts' | 'dataPanelV2'> {
12
12
  /**
13
13
  * The array of data source GUIDs to set on load.
14
14
  * Only a single dataSource supported currently.
@@ -47,7 +47,7 @@ describe('Search embed tests', () => {
47
47
  await executeAfterWait(() => {
48
48
  expectUrlMatchesWithParams(
49
49
  getIFrameSrc(),
50
- `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
50
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&enableDataPanelV2=false&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
51
51
  );
52
52
  });
53
53
  });
@@ -336,4 +336,18 @@ describe('Search embed tests', () => {
336
336
  );
337
337
  });
338
338
  });
339
+
340
+ test('should set enableDataPanelV2 to true if data panel v2 flag is true', async () => {
341
+ const searchEmbed = new SearchEmbed(getRootEl(), {
342
+ ...defaultViewConfig,
343
+ dataPanelV2: true,
344
+ });
345
+ searchEmbed.render();
346
+ await executeAfterWait(() => {
347
+ expectUrlMatchesWithParams(
348
+ getIFrameSrc(),
349
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=true&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
350
+ );
351
+ });
352
+ });
339
353
  });
@@ -109,6 +109,14 @@ export interface SearchViewConfig extends ViewConfig {
109
109
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
110
110
  */
111
111
  hideSearchBar?: boolean;
112
+ /**
113
+ * Flag to control Data panel experience
114
+ *
115
+ * @default false
116
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
117
+ * @hidden
118
+ */
119
+ dataPanelV2?: boolean;
112
120
  }
113
121
 
114
122
  export const HiddenActionItemByDefaultForSearchEmbed = [
@@ -162,6 +170,7 @@ export class SearchEmbed extends TsEmbed {
162
170
  dataSource,
163
171
  dataSources,
164
172
  excludeRuntimeFiltersfromURL,
173
+ dataPanelV2 = false,
165
174
  } = this.viewConfig;
166
175
  const queryParams = this.getBaseQueryParams();
167
176
 
@@ -195,6 +204,7 @@ export class SearchEmbed extends TsEmbed {
195
204
  queryParams[Param.ForceTable] = true;
196
205
  }
197
206
 
207
+ queryParams[Param.DataPanelV2Enabled] = dataPanelV2;
198
208
  queryParams[Param.DataSourceMode] = this.getDataSourceMode();
199
209
  queryParams[Param.UseLastSelectedDataSource] = false;
200
210
  queryParams[Param.searchEmbed] = true;
@@ -47,7 +47,7 @@ describe('React Components', () => {
47
47
  ),
48
48
  ).toBe(true);
49
49
  expect(getIFrameSrc(container)).toBe(
50
- `http://${thoughtSpotHost}/?hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}&authType=None&blockNonEmbedFullAppAccess=true&hideAction=[%22${Action.ReportError}%22,%22editACopy%22,%22saveAsView%22,%22updateTSL%22,%22editTSL%22,%22onDeleteAnswer%22]&dataSourceMode=hide&useLastSelectedSources=false&isSearchEmbed=true#/embed/answer`,
50
+ `http://${thoughtSpotHost}/?hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}&authType=None&blockNonEmbedFullAppAccess=true&hideAction=[%22${Action.ReportError}%22,%22editACopy%22,%22saveAsView%22,%22updateTSL%22,%22editTSL%22,%22onDeleteAnswer%22]&enableDataPanelV2=false&dataSourceMode=hide&useLastSelectedSources=false&isSearchEmbed=true#/embed/answer`,
51
51
  );
52
52
  });
53
53
 
package/src/types.ts CHANGED
@@ -2037,6 +2037,20 @@ export enum HostEvent {
2037
2037
  * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
2038
2038
  */
2039
2039
  SetHiddenTabs = 'SetPinboardHiddenTabs',
2040
+ /**
2041
+ * Updates the search query for sage embed.
2042
+ *
2043
+ * @param - searchOptions: an object queryString and option to execute the query.
2044
+ * @example
2045
+ * ```js
2046
+ * sageEmbed.trigger(HostEvent.UpdateSageQuery, {
2047
+ * queryString: 'revenue per year',
2048
+ * executeSearch: true,
2049
+ * })
2050
+ * ```
2051
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
2052
+ */
2053
+ UpdateSageQuery = 'updateSageQuery',
2040
2054
  }
2041
2055
 
2042
2056
  /**
@@ -2095,6 +2109,7 @@ export enum Param {
2095
2109
  DisableLoginRedirect = 'disableLoginRedirect',
2096
2110
  visibleVizs = 'pinboardVisibleVizs',
2097
2111
  LiveboardV2Enabled = 'isPinboardV2Enabled',
2112
+ DataPanelV2Enabled ='enableDataPanelV2',
2098
2113
  ShowAlerts = 'showAlerts',
2099
2114
  Locale = 'locale',
2100
2115
  CustomStyle = 'customStyle',
@@ -2123,8 +2138,8 @@ export enum Param {
2123
2138
  VisibleTabs = 'visibleTabs',
2124
2139
  HideTabPanel = 'hideTabPanel',
2125
2140
  HideSampleQuestions = 'hideSampleQuestions',
2126
- WorksheetId = 'worksheetId',
2127
- Query = 'query,'
2141
+ WorksheetId = 'worksheet',
2142
+ Query = 'query'
2128
2143
  }
2129
2144
 
2130
2145
  /**