Skip to content

Commit b94c87f

Browse files
version fixes and docgen (#41)
Co-authored-by: Aditya Mittal <[email protected]>
1 parent c9cc975 commit b94c87f

File tree

6 files changed

+9273
-4731
lines changed

6 files changed

+9273
-4731
lines changed

src/embed/app.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
366366
*/
367367
dataPanelCustomGroupsAccordionInitialState?: DataPanelCustomColumnGroupsAccordionState;
368368
/**
369-
* This flag is used to enable the 2 column layout in liveboard
369+
* This attribute can be used to enable the two-column layout on an embedded Liveboard
370370
* @type {boolean}
371371
* @default false
372372
* @version SDK: 1.32.0 | ThoughtSpot:10.1.0.cl
@@ -380,17 +380,17 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
380380
*/
381381
enable2ColumnLayout?: boolean;
382382
/**
383-
* Flag to use OnBeforeSearchExecute embed event
383+
* Flag that allows using `EmbedEvent.OnBeforeGetVizDataIntercept`.
384384
* @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
385385
*/
386386
isOnBeforeGetVizDataInterceptEnabled?: boolean;
387387
/**
388388
* Flag to use home page search bar mode
389-
* @version SDK : 1.33.0 | Thoughtspot : 10.2.0.cl
389+
* @version SDK : 1.33.0 | Thoughtspot : 10.3.0.cl
390390
*/
391391
homePageSearchBarMode?: HomePageSearchBarMode;
392392
/**
393-
* This flag is used to enable the compact header in liveboard
393+
* This flag can be used to enable the compact header in Liveboard
394394
* @type {boolean}
395395
* @default false
396396
* @version SDK: 1.35.0 | ThoughtSpot:10.3.0.cl
@@ -404,7 +404,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
404404
*/
405405
isLiveboardCompactHeaderEnabled?: boolean;
406406
/**
407-
* This flag is used to show/hide verified Icon in liveboard compact header
407+
* This flag can be used to show or hide the Liveboard verified icon in the compact header.
408408
* @type {boolean}
409409
* @default true
410410
* @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl
@@ -418,7 +418,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
418418
*/
419419
showLiveboardVerifiedBadge?: boolean;
420420
/**
421-
* This flag is used to show/hide re-verify banner in liveboard compact header
421+
* This flag can be used to show or hide the re-verify banner on the Liveboard compact header
422422
* @type {boolean}
423423
* @default true
424424
* @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl

src/embed/base.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('Base TS Embed', () => {
5656
authEE.on(auth.AuthStatus.FAILURE, (reason) => {
5757
expect(reason).toEqual(auth.AuthFailureType.NO_COOKIE_ACCESS);
5858
expect(window.alert).toBeCalledWith(
59-
'Third party cookie access is blocked on this browser, please allow third party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
59+
'Third-party cookie access is blocked on this browser. Please allow third-party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
6060
);
6161
done();
6262
});

src/embed/ts-embed.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ describe('Unit test case for ts embed', () => {
16151615
});
16161616
libEmbed.preRender();
16171617

1618-
expect(logger.error).toHaveBeenCalledWith('PreRender id is required for preRender');
1618+
expect(logger.error).toHaveBeenCalledWith('PreRender ID is required for preRender');
16191619
});
16201620

16211621
it('showPreRender should preRender if not available', async () => {

src/errors.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
export const ERROR_MESSAGE = {
22
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
3-
LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a liveboard to embed.',
4-
TRIGGER_TIMED_OUT: 'Trigger timedout in getting response',
5-
SEARCHEMBED_BETA_WRANING_MESSAGE: 'Search Embed is in Beta in this release.',
6-
SAGE_EMBED_BETA_WARNING_MESSAGE: 'Sage Embed is in Beta in this release.',
7-
THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third party cookie access is blocked on this browser, please allow third party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
8-
DUPLICATE_TOKEN_ERR: 'Duplicate token, please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
3+
LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
4+
TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
5+
SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
6+
SAGE_EMBED_BETA_WARNING_MESSAGE: 'SageEmbed is in Beta in this release.',
7+
THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third-party cookie access is blocked on this browser. Please allow third-party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
8+
DUPLICATE_TOKEN_ERR: 'Duplicate token. Please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
99
SDK_NOT_INITIALIZED: 'SDK not initialized',
10-
SESSION_INFO_FAILED: 'Failed to get session info',
10+
SESSION_INFO_FAILED: 'Failed to get session information',
1111
INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
1212
MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
13-
PRERENDER_ID_MISSING: 'PreRender id is required for preRender',
13+
PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
1414
SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
1515
CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
16-
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please setup CSP Correctly for the Application to start working. You can know more about setting CSP Correctly here: https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n In case you are still facing error, please read: https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
16+
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
1717
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
1818
};

src/types.ts

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ export interface ViewConfig {
10171017
// eslint-disable-next-line camelcase
10181018
enableV2Shell_experimental?: boolean;
10191019
/**
1020-
* To set the initial state of the search bar in case of saved-answers.
1020+
* To set the initial state of the search bar in case of saved Answers.
10211021
* @default true
10221022
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
10231023
* @example
@@ -1030,7 +1030,7 @@ export interface ViewConfig {
10301030
collapseSearchBar?: boolean;
10311031
/**
10321032
* This flag can be used to disable links inside the embedded app,
1033-
* and disables redirection of links in a new tab.
1033+
* and disable redirection of links in a new tab.
10341034
* @example
10351035
* ```js
10361036
* const embed = new LiveboardEmbed('#embed', {
@@ -2167,22 +2167,26 @@ export enum EmbedEvent {
21672167
*/
21682168
Rename = 'rename',
21692169
/**
2170-
* Emitted if the user wants to intercept the search execution
2171-
* and implement logic to decide whether to run the search or not
21722170
*
2173-
* Prerequisite: Set isOnBeforeGetVizDataInterceptEnabled : true
2171+
* This event can be emitted to intercept search execution initiated by
2172+
* the users and implement the logic to allow or restrict search execution.
2173+
* You can can also show custom error text if the search query must be
2174+
* restricted due to your application or business requirements.
2175+
2176+
* Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
21742177
* for this embed event to get emitted.
21752178
* @param: payload
21762179
* @param: responder
21772180
* Contains elements that lets developers define whether ThoughtSpot
2178-
* will run the search or not, and if not, which error message to provide.
2181+
* should run the search, and if not, what error message
2182+
* should be shown to the user.
21792183
*
2180-
* execute: When execute returns true, the search will be run.
2181-
* When execute returns false, the search will not be executed.
2184+
* execute: When execute returns `true`, the search will be run.
2185+
* When execute returns `false`, the search will not be executed.
21822186
*
2183-
* error: Developers can customize the user facing message when execute is
2184-
* set to false using the error parameter in responder
2185-
* @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
2187+
* error: Developers can customize the error message text when `execute`
2188+
* returns `false` using the error parameter in responder.
2189+
* @version SDK : 1.29.0 | Thoughtspot : 10.3.0.cl
21862190
* @example
21872191
*```js
21882192
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
@@ -2222,15 +2226,15 @@ export enum EmbedEvent {
22222226
*/
22232227
OnBeforeGetVizDataIntercept = 'onBeforeGetVizDataIntercept',
22242228
/**
2225-
* Emitted when parameter changes in an answer
2226-
* or liveboard
2229+
* Emitted when parameter changes in an Answer
2230+
* or Liveboard
22272231
*
22282232
* ```js
22292233
* liveboardEmbed.on(EmbedEvent.ParameterChanged, (payload) => {
22302234
* console.log('payload', payload);
22312235
* })
22322236
*```
2233-
* @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
2237+
* @version SDK : 1.29.0 | Thoughtspot : 10.3.0.cl
22342238
*/
22352239
ParameterChanged = 'parameterChanged',
22362240
}
@@ -2962,7 +2966,8 @@ export enum HostEvent {
29622966
*
29632967
* `values` - An array of one or several values. The value definition on the
29642968
* data type you choose to filter on. For a complete list of supported data types, see
2965-
* link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Supported data types]
2969+
* link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Supported data types].
2970+
*
29662971
* `type` - To update filters for date time, specify the date format type.
29672972
* For more information and examples, see link:https://developers.thoughtspot.com/docs/embed-liveboard#_date_filters[Date filters].
29682973
*
@@ -4237,7 +4242,7 @@ export enum Action {
42374242
AIHighlights = 'AIHighlights',
42384243

42394244
/**
4240-
* Action ID for edit schedule action on schedule on homepage
4245+
* Action ID for edit the schedule action on schedule on homepage
42414246
* @example
42424247
* ```js
42434248
* disabledActions: [Action.EditScheduleHomepage]

0 commit comments

Comments
 (0)