Skip to content

Documentation fixes for SCAL-258631 #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 44 additions & 3 deletions src/embed/embedConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,49 @@ import { EmbedConfig } from '../types';
const configKey = 'embedConfig';

/**
* Gets the configuration embed was initialized with.
* @returns {@link EmbedConfig} The configuration embed was initialized with.
* Gets the `EmbedConfig` object that was used to
* initialize the SDK. You can use this method to access the
* embed configuration settings such as the ThoughtSpot host,
* authentication type, and other such parameters used when
* initializing the SDK.
*
* @example
* ```
* const config = getInitConfig();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this as description for getEmbedConfig instead of getInitConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK docs point to this section (embedConfig.ts#L12) - https://developers.thoughtspot.com/docs/Function_getInitConfig.

console.log(config);
* ````
* @returns {@link EmbedConfig} The embed configuration settings that the SDK
* was initialized with. This includes:
*
* - `thoughtSpotHost` - ThoughtSpot host URL
* - `authType`: The authentication method used. For example, `AuthServerCookieless` for
* `AuthType.TrustedAuthTokenCookieless`
* - `customizations` - Style, text, and icon customization settings
* that were applied during the SDK initialization
*
* @example
* ```
* {
* "thoughtSpotHost": "https://{ThoughtSpot-Host}",
* "authType": "AuthServerCookieless",
* "customizations": {
* "style": {
* "customCSS": {
* "variables": {
* "--ts-var-button--secondary-background": "#7492d5",
* "--ts-var-button--secondary--hovers-background": "#aac2f8",
* "--ts-var-root-background": "#f1f4f8"
* }
* }
* }
* },
* "loginFailedMessage": "Login failed, please try again",
* "authTriggerText": "Authorize",
* "disableTokenVerification": true,
* "authTriggerContainer": "#your-own-div"
* }
* ```
* For a comprehensive list of embed configuration settings, see {@link EmbedConfig}.
* @version SDK: 1.19.0 | ThoughtSpot: *
* @group Global methods
*/
Expand All @@ -21,4 +62,4 @@ export const getEmbedConfig = (): EmbedConfig => getValueFromWindow(configKey) |
export const setEmbedConfig = (newConfig: EmbedConfig) => {
storeValueInWindow(configKey, newConfig);
return getValueFromWindow(configKey);
};
};
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export interface CustomStyles {
* Configuration to define the customization on the Embedded
* ThoughtSpot components.
* You can customize styles, text strings, and icons.
* For more information, see https://developers.thoughtspot.com/docs/custom-css.
* For more information, see link:https://developers.thoughtspot.com/docs/custom-css[CSS customization framework].
* @example
* ```js
* init({
Expand Down Expand Up @@ -3925,6 +3925,7 @@ export enum Param {
* hiddenActions: [Action.Edit, ActionAction.Explore],
* })
* ```
* See also link:https://developers.thoughtspot.com/docs/actions[Action IDs in the SDK]
*/
// eslint-disable-next-line no-shadow
export enum Action {
Expand Down
14 changes: 11 additions & 3 deletions static/typedoc/typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39310,7 +39310,7 @@
"sources": [
{
"fileName": "embed/embedConfig.ts",
"line": 12,
"line": 53,
"character": 13
}
],
Expand All @@ -39322,9 +39322,17 @@
"kindString": "Call signature",
"flags": {},
"comment": {
"shortText": "Gets the configuration embed was initialized with.",
"returns": "{@link EmbedConfig} The configuration embed was initialized with.",
"shortText": "Gets the `EmbedConfig` object that was used to\ninitialize the SDK. You can use this method to access the\nembed configuration settings such as the ThoughtSpot host,\nauthentication type, and other such parameters used when\ninitializing the SDK.",
"returns": "{@link EmbedConfig} The embed configuration settings that the SDK\nwas initialized with. This includes:\n\n - `thoughtSpotHost` - ThoughtSpot host URL\n - `authType`: The authentication method used. For example, `AuthServerCookieless` for\n `AuthType.TrustedAuthTokenCookieless`\n - `customizations` - Style, text, and icon customization settings\n that were applied during the SDK initialization\n",
"tags": [
{
"tag": "example",
"text": "\n```\nconst config = getInitConfig();\nconsole.log(config);\n````"
},
{
"tag": "example",
"text": "\n```\n{\n \"thoughtSpotHost\": \"https://{ThoughtSpot-Host}\",\n \"authType\": \"AuthServerCookieless\",\n \"customizations\": {\n \"style\": {\n \"customCSS\": {\n \"variables\": {\n \"--ts-var-button--secondary-background\": \"#7492d5\",\n \"--ts-var-button--secondary--hovers-background\": \"#aac2f8\",\n \"--ts-var-root-background\": \"#f1f4f8\"\n }\n }\n }\n },\n \"loginFailedMessage\": \"Login failed, please try again\",\n \"authTriggerText\": \"Authorize\",\n \"disableTokenVerification\": true,\n \"authTriggerContainer\": \"#your-own-div\"\n }\n```\nFor a comprehensive list of embed configuration settings, see {@link EmbedConfig}."
},
{
"tag": "version",
"text": "SDK: 1.19.0 | ThoughtSpot: *"
Expand Down
Loading