-
Notifications
You must be signed in to change notification settings - Fork 6
[SCAL-265458] Added flags for enable save chat in spotter embed #331
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,6 +164,22 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct | |
| * @version SDK: 1.41.0 | ThoughtSpot: 10.13.0.cl | ||
| */ | ||
| excludeRuntimeParametersfromURL?: boolean; | ||
| /** | ||
| * enablePastConversationsSidebar : Controls the visibility of the past conversations | ||
| * sidebar. | ||
| * | ||
| * Supported embed types: `SpotterEmbed` | ||
| * @default false | ||
| * @example | ||
| * ```js | ||
| * const embed = new SpotterEmbed('#tsEmbed', { | ||
| * ... //other embed view config | ||
| * enablePastConversationsSidebar : true, | ||
| * }) | ||
| * ``` | ||
| * @version SDK: 1.43.0 | ThoughtSpot: 10.14.0.cl | ||
| */ | ||
| enablePastConversationsSidebar?: boolean; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -205,6 +221,7 @@ export class SpotterEmbed extends TsEmbed { | |
| dataPanelV2, | ||
| showSpotterLimitations, | ||
| hideSampleQuestions, | ||
| enablePastConversationsSidebar, | ||
| runtimeFilters, | ||
| excludeRuntimeFiltersfromURL, | ||
| runtimeParameters, | ||
|
|
@@ -246,10 +263,15 @@ export class SpotterEmbed extends TsEmbed { | |
| excludeRuntimeFiltersfromURL, | ||
| runtimeParameters, | ||
| excludeRuntimeParametersfromURL, | ||
| enablePastConversationsSidebar | ||
| } = this.viewConfig; | ||
| const path = 'insights/conv-assist'; | ||
| const queryParams = this.getEmbedParamsObject(); | ||
|
|
||
| if (!isUndefined(enablePastConversationsSidebar)) { | ||
| queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar; | ||
| } | ||
|
Comment on lines
+271
to
+273
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency with how other boolean flags are handled in this class, the logic for adding the After moving this block, you can also remove You can add the following block inside if (!isUndefined(enablePastConversationsSidebar)) {
queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar;
} |
||
|
|
||
| let query = ''; | ||
| const queryParamsString = getQueryParamString(queryParams, true); | ||
| if (queryParamsString) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two test cases for
enablePastConversationsSidebarare very similar and can be refactored into a single, more concise parameterized test usingit.each. This will reduce code duplication and improve the maintainability of the test suite.