Repository navigation
[SCAL-349233] Add DataAppEmbed and enableDataApps - #734
Open
akshay-pandey-thoughtspot wants to merge 3 commits into
Open
akshay-pandey-thoughtspot wants to merge 3 commits into
akshay-pandey-thoughtspot wants to merge 3 commits into
Conversation
DataAppEmbed embeds a single ThoughtSpot App, the way LiveboardEmbed embeds one Liveboard. It loads the App embed route on the v2 shell, /v2/?...#/embed/insights/apps/<dataAppId>, which renders the App page inside ThoughtSpot. - dataAppId is required: without it, a DATA_APP_ID_MISSING validation error and no frame - fullHeight is not supported: it is dropped with a warning - React <DataAppEmbed> wrapper and type exports - embedComponentType 'dataApp' Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Embedded ThoughtSpot hides Apps unless the host opts in. The new enableDataApps view config sends enableDataApps on the iframe URL; the app shows Apps only when it is true and the instance has Apps on. - AppViewConfig and DataAppEmbedViewConfig take enableDataApps (default false); DataAppEmbed now sends its own embed params - Keep the param on the URL under excludeConfigFromURL, since the app reads it at boot for its route guards - Specs for both embed types and the excludeConfigFromURL case Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces the DataAppEmbed component and its React wrapper to support embedding a single ThoughtSpot App by its ID, alongside adding the enableDataApps configuration flag to both AppEmbed and DataAppEmbed. The review feedback identifies a critical bug in DataAppEmbed where declaring viewConfig as a constructor parameter property overwrites the base class initialization. It also recommends performing dataAppId validation before calling super.render() to prevent unintended side effects, and highlights a style guide violation in the React component's JSDoc example where the function name should match the component name.
commit: |
6 of 7 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two additions for showing ThoughtSpot Apps in an embed:
DataAppEmbedembeds a single App by id, the wayLiveboardEmbedembeds one Liveboard. It loads the App embed route on the v2 shell,/v2/?…#/embed/insights/apps/<dataAppId>.enableDataApps, a new view config onAppEmbedandDataAppEmbed, off by default. Embedded ThoughtSpot shows Apps only when the host sets it totrueand the instance has Apps turned on.The ThoughtSpot side is dev/scaligent#74710, which is internal. It adds the route and reads the flag.
This is a first skeleton, there to get a build to test against. Follow-ups are listed below.
Changes
src/embed/data-app.ts:DataAppEmbed(extendsTsEmbed) andDataAppEmbedViewConfig.dataAppIdis required. Without it,render()raises aVALIDATION_ERRORwith the newEmbedErrorCodes.DATA_APP_ID_MISSINGand renders no frame.fullHeightisn't supported. A JS caller that passes it gets a warning, and the option is dropped.embedComponentType: 'dataApp'.enableDataApps:AppViewConfigandDataAppEmbedViewConfig, and sent as the newParam.EnableDataAppsURL param;BOOTSTRAP_URL_PARAMS, so it stays on the URL underexcludeConfigFromURL. The app reads it at boot for its route guards, beforeAPP_INITarrives.DataAppEmbedshows a not-available message in the frame, andAppEmbedkeeps Apps hidden as today.<DataAppEmbed>viacomponentFactory, exported from/reacttogether withDataAppEmbedViewConfig.@versiontags readSDK: <TBD> | ThoughtSpot Cloud: 26.12.0.cl. The ThoughtSpot release still needs confirming: it is the one that ships the App embed route.Testing
data-app.spec.tscovers the URL, id encoding, the missing-id error andfullHeight. The fulltest-sdksuite passed (55 suites, 2,231 tests), and so did the React export parity spec.enableDataAppscommit:data-app.spec.ts(both values, andexcludeConfigFromURL) andapp.spec.ts. These have not been run locally; this PR's CI runs them.tsc --noEmit,check-size(32.78 kB of 34 kB) andlint-versionsall passed.DataAppEmbedwithenableDataApps: truerenders the App;AppEmbedatinsights/home/appsshows the Apps list with the flag, and ThoughtSpot Home without it.Follow-ups (not in this PR)
Errorevent whileenableDataAppsis off, and codes for not entitled, not found and nothing published.Actionvalues for the App's buttons.AppLoadevent.🤖 Generated with Claude Code