SCAL-314423 GA lb feature flags#539
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the AppEmbed and LiveboardEmbed classes to optimize URL parameter handling for boolean flags. By removing default false values and implementing isUndefined checks, the SDK now avoids sending unnecessary parameters to ThoughtSpot, adhering to the repository's style guide. The review feedback correctly identifies a redundant double-negation (!!) in app.ts that should be removed for better consistency and clarity.
| } | ||
| params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF; | ||
| if (!isUndefined(coverAndFilterOptionInPDF)) { | ||
| params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF; |
There was a problem hiding this comment.
The !! coercion is redundant here because the block is already guarded by an isUndefined check, and coverAndFilterOptionInPDF is typed as a boolean. Removing it would also improve consistency with the implementation in src/embed/liveboard.ts.
| params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF; | |
| params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF; |
References
- Boolean parameters for ThoughtSpot should prefer
undefinedoverfalse. Omit the parameter entirely when the value is not explicitly provided, and only add it when the caller explicitly provides a value. (link)
|
Summary Promotes five Liveboard feature flags out of "opt-in" state by removing their hardcoded false defaults in AppEmbed and LiveboardEmbed. The SDK now only appends each flag to the iframe URL when the host app explicitly sets it, letting the backend's GA defaults take over otherwise. Flags affected:
Reasoning
|
JIRA: https://thoughtspot.atlassian.net/browse/SCAL-295712
cc: @goutham-sidhardha