Skip to content

Commit aa08154

Browse files
SCAL-274111 Add hideTagFilterChips option to BaseViewConfig for cleaner UI
1 parent 3e6d3d4 commit aa08154

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

src/embed/ts-embed.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import {
5757
ContextMenuTriggerOptions,
5858
DefaultAppInitData,
5959
AllEmbedViewConfig as ViewConfig,
60+
ListPageColumns,
6061
} from '../types';
6162
import { uploadMixpanelEvent, MIXPANEL_EVENT } from '../mixpanel-service';
6263
import { processEventData, processAuthFailure } from '../utils/processData';
@@ -426,6 +427,12 @@ export class TsEmbed {
426427
message: customActionsResult.errors,
427428
});
428429
}
430+
const finalHiddenListColumns = [...(this.viewConfig.hiddenListColumns || [])];
431+
if (this.viewConfig.hideTagFilterChips) {
432+
if (!finalHiddenListColumns.includes(ListPageColumns.Tags)) {
433+
finalHiddenListColumns.push(ListPageColumns.Tags);
434+
}
435+
}
429436
return {
430437
customisations: getCustomisations(this.embedConfig, this.viewConfig),
431438
authToken,
@@ -443,7 +450,7 @@ export class TsEmbed {
443450
: [],
444451
customVariablesForThirdPartyTools:
445452
this.embedConfig.customVariablesForThirdPartyTools || {},
446-
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
453+
hiddenListColumns: finalHiddenListColumns,
447454
customActions: customActionsResult.actions,
448455
};
449456
}
@@ -623,6 +630,7 @@ export class TsEmbed {
623630
overrideOrgId,
624631
exposeTranslationIDs,
625632
primaryAction,
633+
hideTagFilterChips,
626634
} = this.viewConfig;
627635

628636
const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
@@ -654,7 +662,13 @@ export class TsEmbed {
654662
if (exposeTranslationIDs) {
655663
queryParams[Param.ExposeTranslationIDs] = exposeTranslationIDs;
656664
}
657-
queryParams[Param.HideActions] = [...this.defaultHiddenActions, ...(hiddenActions ?? [])];
665+
const finalHiddenActions = [...(hiddenActions ?? [])];
666+
if (hideTagFilterChips) {
667+
if (!finalHiddenActions.includes(Action.ManageTags)) {
668+
finalHiddenActions.push(Action.ManageTags);
669+
}
670+
}
671+
queryParams[Param.HideActions] = [...this.defaultHiddenActions, ...finalHiddenActions];
658672
if (Array.isArray(visibleActions)) {
659673
queryParams[Param.VisibleActions] = visibleActions;
660674
}

src/types.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,32 @@ export interface BaseViewConfig {
10841084
* ```
10851085
*/
10861086
customActions?: CustomAction[];
1087+
/**
1088+
* Hide tag filter chips that appear when content is filtered by tags.
1089+
* When enabled, this automatically:
1090+
* - Hides tag filter indicators/chips from the UI
1091+
* - Adds Action.ManageTags to hiddenActions (if not already present)
1092+
* - Adds ListPageColumns.Tags to hiddenListColumns (if not already present)
1093+
*
1094+
* This provides a clean interface without tag-related UI elements.
1095+
*
1096+
* Supported embed types: `AppEmbed`
1097+
* @version SDK: 1.42.1 | ThoughtSpot: 10.14.0.cl
1098+
* @example
1099+
* ```js
1100+
* // Simple usage - automatically hides all tag-related UI
1101+
* const embed = new AppEmbed('#tsEmbed', {
1102+
* ... // other embed view config
1103+
* tag: 'Retail Sales',
1104+
* hideTagFilterChips: true, // This is all you need!
1105+
* });
1106+
*
1107+
* // No need to manually specify:
1108+
* // hiddenActions: [Action.ManageTags],
1109+
* // hiddenListColumns: [ListPageColumns.Tags]
1110+
* ```
1111+
*/
1112+
hideTagFilterChips?: boolean;
10871113
}
10881114

10891115
/**

0 commit comments

Comments
 (0)