@thoughtspot/visual-embed-sdk 1.24.0-sage.3 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cjs/package.json +9 -1
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +3 -0
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/css-variables.d.ts +38 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +32 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +11 -8
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +46 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts +4 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +6 -3
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +5 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +5 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +23 -7
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +6 -0
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +5 -2
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +15 -2
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +8 -2
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +49 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +3 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +28 -8
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +139 -3
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts +1 -0
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +10 -3
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/mixpanel-service.spec.js +12 -3
- package/cjs/src/mixpanel-service.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts +15 -15
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +7 -3
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +12 -0
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +176 -9
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +133 -7
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.d.ts +7 -1
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +20 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +24 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +38 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +32 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +4 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +5 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +6 -0
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +15 -2
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +3 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts +1 -0
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +15 -15
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +176 -9
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +7 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +226 -35
- package/dist/tsembed-react.js +219 -34
- package/dist/tsembed.es.js +228 -36
- package/dist/tsembed.js +221 -35
- package/dist/visual-embed-sdk-react-full.d.ts +512 -248
- package/dist/visual-embed-sdk-react.d.ts +514 -250
- package/dist/visual-embed-sdk.d.ts +277 -14
- package/lib/package.json +9 -1
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +3 -0
- package/lib/src/auth.js.map +1 -1
- package/lib/src/css-variables.d.ts +38 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +32 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +11 -8
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +46 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +4 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +6 -3
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +5 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +6 -3
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +23 -7
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +6 -0
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +6 -3
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +15 -2
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +9 -3
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +49 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +3 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +29 -9
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +140 -4
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts +1 -0
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +10 -3
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/mixpanel-service.spec.js +12 -3
- package/lib/src/mixpanel-service.spec.js.map +1 -1
- package/lib/src/react/index.d.ts +15 -15
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +5 -3
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +13 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +176 -9
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +132 -6
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +7 -1
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +18 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +25 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +280 -17
- package/package.json +9 -1
- package/src/auth.ts +6 -3
- package/src/css-variables.ts +47 -0
- package/src/embed/app.spec.ts +63 -0
- package/src/embed/app.ts +50 -15
- package/src/embed/base.ts +9 -6
- package/src/embed/liveboard.spec.ts +29 -10
- package/src/embed/liveboard.ts +11 -2
- package/src/embed/search-bar.tsx +19 -6
- package/src/embed/search.spec.ts +61 -0
- package/src/embed/search.ts +34 -3
- package/src/embed/ts-embed.spec.ts +162 -8
- package/src/embed/ts-embed.ts +30 -9
- package/src/index.ts +4 -0
- package/src/mixpanel-service.spec.ts +12 -3
- package/src/mixpanel-service.ts +10 -3
- package/src/react/index.spec.tsx +33 -2
- package/src/react/index.tsx +37 -26
- package/src/types.ts +263 -92
- package/src/utils.spec.ts +31 -0
- package/src/utils.ts +23 -0
package/dist/tsembed.es.js
CHANGED
|
@@ -28,6 +28,24 @@ const getFilterQuery = (runtimeFilters) => {
|
|
|
28
28
|
}
|
|
29
29
|
return null;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Construct a runtime parameter override query string from the given option.
|
|
33
|
+
*
|
|
34
|
+
* @param runtimeParameters
|
|
35
|
+
*/
|
|
36
|
+
const getRuntimeParameters = (runtimeParameters) => {
|
|
37
|
+
if (runtimeParameters && runtimeParameters.length) {
|
|
38
|
+
const params = runtimeParameters.map((param, valueIndex) => {
|
|
39
|
+
const index = valueIndex + 1;
|
|
40
|
+
const filterExpr = [];
|
|
41
|
+
filterExpr.push(`param${index}=${encodeURIComponent(param.name)}`);
|
|
42
|
+
filterExpr.push(`paramVal${index}=${encodeURIComponent(param.value)}`);
|
|
43
|
+
return filterExpr.join('&');
|
|
44
|
+
});
|
|
45
|
+
return `${params.join('&')}`;
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
};
|
|
31
49
|
/**
|
|
32
50
|
* Convert a value to a string representation to be sent as a query
|
|
33
51
|
* parameter to the ThoughtSpot app.
|
|
@@ -354,6 +372,18 @@ var AuthType;
|
|
|
354
372
|
*/
|
|
355
373
|
AuthType["Basic"] = "Basic";
|
|
356
374
|
})(AuthType || (AuthType = {}));
|
|
375
|
+
var HomeLeftNavItem;
|
|
376
|
+
(function (HomeLeftNavItem) {
|
|
377
|
+
HomeLeftNavItem["QueryBuilder"] = "query-builder";
|
|
378
|
+
HomeLeftNavItem["Home"] = "insights-home";
|
|
379
|
+
HomeLeftNavItem["Liveboards"] = "liveboards";
|
|
380
|
+
HomeLeftNavItem["Answers"] = "answers";
|
|
381
|
+
HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
|
|
382
|
+
HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
|
|
383
|
+
HomeLeftNavItem["Tutorials"] = "tutorials";
|
|
384
|
+
HomeLeftNavItem["Documentation"] = "documentation";
|
|
385
|
+
HomeLeftNavItem["Community"] = "community";
|
|
386
|
+
})(HomeLeftNavItem || (HomeLeftNavItem = {}));
|
|
357
387
|
/**
|
|
358
388
|
* A map of the supported runtime filter operations
|
|
359
389
|
*/
|
|
@@ -417,6 +447,37 @@ var RuntimeFilterOp;
|
|
|
417
447
|
*/
|
|
418
448
|
RuntimeFilterOp["IN"] = "IN";
|
|
419
449
|
})(RuntimeFilterOp || (RuntimeFilterOp = {}));
|
|
450
|
+
/**
|
|
451
|
+
* Home page module that can be hide
|
|
452
|
+
*/
|
|
453
|
+
// eslint-disable-next-line no-shadow
|
|
454
|
+
var HomepageModule;
|
|
455
|
+
(function (HomepageModule) {
|
|
456
|
+
/**
|
|
457
|
+
* Search bar
|
|
458
|
+
*/
|
|
459
|
+
HomepageModule["Search"] = "search";
|
|
460
|
+
/**
|
|
461
|
+
* kPI watchlist module
|
|
462
|
+
*/
|
|
463
|
+
HomepageModule["Watchlist"] = "watchlist";
|
|
464
|
+
/**
|
|
465
|
+
* favorite objects
|
|
466
|
+
*/
|
|
467
|
+
HomepageModule["Favorite"] = "favorite";
|
|
468
|
+
/**
|
|
469
|
+
* List of answers and liveboards
|
|
470
|
+
*/
|
|
471
|
+
HomepageModule["MyLibrary"] = "mylibrary";
|
|
472
|
+
/**
|
|
473
|
+
* Trending list
|
|
474
|
+
*/
|
|
475
|
+
HomepageModule["Trending"] = "trending";
|
|
476
|
+
/**
|
|
477
|
+
* Learning videos
|
|
478
|
+
*/
|
|
479
|
+
HomepageModule["Learning"] = "learning";
|
|
480
|
+
})(HomepageModule || (HomepageModule = {}));
|
|
420
481
|
/**
|
|
421
482
|
* Event types emitted by the embedded ThoughtSpot application.
|
|
422
483
|
*
|
|
@@ -843,23 +904,74 @@ var EmbedEvent;
|
|
|
843
904
|
*/
|
|
844
905
|
EmbedEvent["InsertIntoSlide"] = "insertInToSlide";
|
|
845
906
|
/**
|
|
907
|
+
* @hidden
|
|
846
908
|
* Emitted when a user changes any filter on a Liveboard.
|
|
847
|
-
*
|
|
848
909
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
849
910
|
*/
|
|
850
911
|
EmbedEvent["FilterChanged"] = "filterChanged";
|
|
851
912
|
/**
|
|
852
913
|
* Emitted when a user click on Go button in Sage Embed
|
|
853
914
|
*
|
|
854
|
-
* @version SDK : 1.
|
|
915
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
855
916
|
*/
|
|
856
917
|
EmbedEvent["SageEmbedQuery"] = "sageEmbedQuery";
|
|
857
918
|
/**
|
|
858
919
|
* Emitten when a user select data source in Sage Embed
|
|
859
920
|
*
|
|
860
|
-
* @version SDK : 1.
|
|
921
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
861
922
|
*/
|
|
862
923
|
EmbedEvent["SageWorksheetUpdated"] = "sageWorksheetUpdated";
|
|
924
|
+
/**
|
|
925
|
+
* Emitten when a user updates a connection in Data tab
|
|
926
|
+
*
|
|
927
|
+
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
928
|
+
*/
|
|
929
|
+
EmbedEvent["UpdateConnection"] = "updateConnection";
|
|
930
|
+
/**
|
|
931
|
+
* Emitted when name, status (private or public) or filter values of a
|
|
932
|
+
* PersonalisedView is updated.
|
|
933
|
+
*
|
|
934
|
+
* @returns viewName: string
|
|
935
|
+
* @returns viewId: string
|
|
936
|
+
* @returns liveboardId: string
|
|
937
|
+
* @returns isPublic: boolean
|
|
938
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
939
|
+
*/
|
|
940
|
+
EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
|
|
941
|
+
/**
|
|
942
|
+
* Emitted when a PersonalisedView is saved.
|
|
943
|
+
*
|
|
944
|
+
* @returns viewName: string
|
|
945
|
+
* @returns viewId: string
|
|
946
|
+
* @returns liveboardId: string
|
|
947
|
+
* @returns isPublic: boolean
|
|
948
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
949
|
+
*/
|
|
950
|
+
EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
|
|
951
|
+
/**
|
|
952
|
+
* Emitted when a Liveboard is reset.
|
|
953
|
+
*
|
|
954
|
+
* @returns viewName: string
|
|
955
|
+
* @returns viewId: string
|
|
956
|
+
* @returns liveboardId: string
|
|
957
|
+
* @returns isPublic: boolean
|
|
958
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
959
|
+
*/
|
|
960
|
+
EmbedEvent["ResetLiveboard"] = "resetLiveboard";
|
|
961
|
+
/**
|
|
962
|
+
* Emitted when a PersonalisedView is deleted.
|
|
963
|
+
*
|
|
964
|
+
* @returns views: string[]
|
|
965
|
+
* @returns liveboardId: string
|
|
966
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
967
|
+
*/
|
|
968
|
+
EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
|
|
969
|
+
/**
|
|
970
|
+
* Emitten when a user creates a new worksheet
|
|
971
|
+
*
|
|
972
|
+
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
973
|
+
*/
|
|
974
|
+
EmbedEvent["CreateWorksheet"] = "createWorksheet";
|
|
863
975
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
864
976
|
/**
|
|
865
977
|
* Event types that can be triggered by the host application
|
|
@@ -1504,16 +1616,16 @@ var HostEvent;
|
|
|
1504
1616
|
*/
|
|
1505
1617
|
HostEvent["ResetSearch"] = "resetSearch";
|
|
1506
1618
|
/**
|
|
1619
|
+
* @hidden
|
|
1507
1620
|
* Gets the currents visible and runtime filters applied on a Liveboard
|
|
1508
|
-
*
|
|
1509
1621
|
* @example
|
|
1510
1622
|
* liveboardEmbed.trigger(HostEvent.GetFilters)
|
|
1511
1623
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
1512
1624
|
*/
|
|
1513
1625
|
HostEvent["GetFilters"] = "getFilters";
|
|
1514
1626
|
/**
|
|
1627
|
+
* @hidden
|
|
1515
1628
|
* Updates the visible filters on the Liveboard.
|
|
1516
|
-
*
|
|
1517
1629
|
* @param - filter: filter object containing column name and filter operation and values
|
|
1518
1630
|
* @example
|
|
1519
1631
|
*
|
|
@@ -1670,6 +1782,9 @@ var Param;
|
|
|
1670
1782
|
Param["HideSampleQuestions"] = "hideSampleQuestions";
|
|
1671
1783
|
Param["WorksheetId"] = "worksheet";
|
|
1672
1784
|
Param["Query"] = "query";
|
|
1785
|
+
Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
|
|
1786
|
+
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
1787
|
+
Param["PendoTrackingKey"] = "additionalPendoKey";
|
|
1673
1788
|
})(Param || (Param = {}));
|
|
1674
1789
|
/**
|
|
1675
1790
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -2174,7 +2289,7 @@ var Action;
|
|
|
2174
2289
|
* disabledActions: [Action.QueryDetailsButtons]
|
|
2175
2290
|
* ```
|
|
2176
2291
|
*/
|
|
2177
|
-
Action["QueryDetailsButtons"] = "
|
|
2292
|
+
Action["QueryDetailsButtons"] = "queryDetailsButtons";
|
|
2178
2293
|
/**
|
|
2179
2294
|
* The **Delete** action for Answers.
|
|
2180
2295
|
*
|
|
@@ -2479,6 +2594,35 @@ var Action;
|
|
|
2479
2594
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
2480
2595
|
*/
|
|
2481
2596
|
Action["ModifySageAnswer"] = "modifySageAnswer";
|
|
2597
|
+
/**
|
|
2598
|
+
* The **Move to Tab** menu action on visualizations in liveboard edit mode.
|
|
2599
|
+
* Allows moving a visualization to a different tab.
|
|
2600
|
+
*
|
|
2601
|
+
* @example
|
|
2602
|
+
* ```js
|
|
2603
|
+
* disabledActions: [Action.MoveToTab]
|
|
2604
|
+
* ```
|
|
2605
|
+
*/
|
|
2606
|
+
Action["MoveToTab"] = "onContainerMove";
|
|
2607
|
+
/**
|
|
2608
|
+
* The **Manage Alertsb** menu action on KPI visualizations.
|
|
2609
|
+
*
|
|
2610
|
+
* @example
|
|
2611
|
+
* ```js
|
|
2612
|
+
* disabledActions: [Action.ManageMonitor]
|
|
2613
|
+
* ```
|
|
2614
|
+
*/
|
|
2615
|
+
Action["ManageMonitor"] = "ManageMonitor";
|
|
2616
|
+
/**
|
|
2617
|
+
* Action ID for Liveboard Personalised Views dropdown
|
|
2618
|
+
*
|
|
2619
|
+
* @example
|
|
2620
|
+
* ```js
|
|
2621
|
+
* disabledActions: [Action.PersonalisedViewsDropdown]
|
|
2622
|
+
* ```
|
|
2623
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
2624
|
+
*/
|
|
2625
|
+
Action["PersonalisedViewsDropdown"] = "personalisedViewsDropdown";
|
|
2482
2626
|
})(Action || (Action = {}));
|
|
2483
2627
|
// eslint-disable-next-line no-shadow
|
|
2484
2628
|
var OperationType;
|
|
@@ -8558,6 +8702,7 @@ var mixpanel$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE
|
|
|
8558
8702
|
|
|
8559
8703
|
// Needed to avoid error in CJS builds on some bundlers.
|
|
8560
8704
|
const mixpanelLib = mixpanel_cjs || mixpanel$1;
|
|
8705
|
+
let mixpanelInstance;
|
|
8561
8706
|
const MIXPANEL_EVENT = {
|
|
8562
8707
|
VISUAL_SDK_RENDER_START: 'visual-sdk-render-start',
|
|
8563
8708
|
VISUAL_SDK_CALLED_INIT: 'visual-sdk-called-init',
|
|
@@ -8566,6 +8711,7 @@ const MIXPANEL_EVENT = {
|
|
|
8566
8711
|
VISUAL_SDK_TRIGGER: 'visual-sdk-trigger',
|
|
8567
8712
|
VISUAL_SDK_ON: 'visual-sdk-on',
|
|
8568
8713
|
VISUAL_SDK_IFRAME_LOAD_PERFORMANCE: 'visual-sdk-iframe-load-performance',
|
|
8714
|
+
VISUAL_SDK_EMBED_CREATE: 'visual-sdk-embed-create',
|
|
8569
8715
|
};
|
|
8570
8716
|
let isMixpanelInitialized = false;
|
|
8571
8717
|
let eventQueue = [];
|
|
@@ -8580,7 +8726,7 @@ function uploadMixpanelEvent(eventId, eventProps = {}) {
|
|
|
8580
8726
|
eventQueue.push({ eventId, eventProps });
|
|
8581
8727
|
return;
|
|
8582
8728
|
}
|
|
8583
|
-
|
|
8729
|
+
mixpanelInstance.track(eventId, eventProps);
|
|
8584
8730
|
}
|
|
8585
8731
|
/**
|
|
8586
8732
|
*
|
|
@@ -8608,10 +8754,15 @@ function initMixpanel(sessionInfo) {
|
|
|
8608
8754
|
const token = sessionInfo.mixpanelToken;
|
|
8609
8755
|
try {
|
|
8610
8756
|
if (token) {
|
|
8611
|
-
mixpanelLib.init(token);
|
|
8757
|
+
mixpanelInstance = mixpanelLib.init(token, undefined, 'tsEmbed');
|
|
8612
8758
|
if (!isPublicCluster) {
|
|
8613
|
-
|
|
8759
|
+
mixpanelInstance.identify(sessionInfo.userGUID);
|
|
8614
8760
|
}
|
|
8761
|
+
mixpanelInstance.register_once({
|
|
8762
|
+
clusterId: sessionInfo.clusterId,
|
|
8763
|
+
clusterName: sessionInfo.clusterName,
|
|
8764
|
+
releaseVersion: sessionInfo.releaseVersion,
|
|
8765
|
+
});
|
|
8615
8766
|
isMixpanelInitialized = true;
|
|
8616
8767
|
emptyQueue();
|
|
8617
8768
|
}
|
|
@@ -10329,6 +10480,9 @@ const getSessionDetails = (sessionInfoResp) => {
|
|
|
10329
10480
|
userGUID: sessionInfoResp.userGUID,
|
|
10330
10481
|
mixpanelToken,
|
|
10331
10482
|
isPublicUser: sessionInfoResp.configInfo.isPublicUser,
|
|
10483
|
+
releaseVersion: sessionInfoResp.releaseVersion,
|
|
10484
|
+
clusterId: sessionInfoResp.configInfo.selfClusterId,
|
|
10485
|
+
clusterName: sessionInfoResp.configInfo.selfClusterName,
|
|
10332
10486
|
...sessionInfoResp,
|
|
10333
10487
|
};
|
|
10334
10488
|
};
|
|
@@ -10734,9 +10888,9 @@ const init = (embedConfig) => {
|
|
|
10734
10888
|
const authEE = new eventemitter3();
|
|
10735
10889
|
setAuthEE(authEE);
|
|
10736
10890
|
handleAuth();
|
|
10891
|
+
const { password, ...configToTrack } = config;
|
|
10737
10892
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_CALLED_INIT, {
|
|
10738
|
-
|
|
10739
|
-
host: config.thoughtSpotHost,
|
|
10893
|
+
...configToTrack,
|
|
10740
10894
|
usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
|
|
10741
10895
|
usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCSS) === null || _e === void 0 ? void 0 : _e.variables) != null,
|
|
10742
10896
|
usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customizations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCSS) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) != null,
|
|
@@ -10793,6 +10947,7 @@ const renderInQueue = (fn) => {
|
|
|
10793
10947
|
};
|
|
10794
10948
|
/**
|
|
10795
10949
|
* Imports TML representation of the metadata objects into ThoughtSpot.
|
|
10950
|
+
*
|
|
10796
10951
|
* @param data
|
|
10797
10952
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
10798
10953
|
*/
|
|
@@ -10837,7 +10992,9 @@ const executeTML = async (data) => {
|
|
|
10837
10992
|
});
|
|
10838
10993
|
};
|
|
10839
10994
|
/**
|
|
10840
|
-
* Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
|
|
10995
|
+
* Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
|
|
10996
|
+
* format.
|
|
10997
|
+
*
|
|
10841
10998
|
* @param data
|
|
10842
10999
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
10843
11000
|
*/
|
|
@@ -11099,7 +11256,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
11099
11256
|
});
|
|
11100
11257
|
}
|
|
11101
11258
|
|
|
11102
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0
|
|
11259
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"40 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
11103
11260
|
|
|
11104
11261
|
/**
|
|
11105
11262
|
* Copyright (c) 2022
|
|
@@ -11147,6 +11304,7 @@ class TsEmbed {
|
|
|
11147
11304
|
* @param responder
|
|
11148
11305
|
*/
|
|
11149
11306
|
this.appInitCb = async (_, responder) => {
|
|
11307
|
+
var _a, _b;
|
|
11150
11308
|
let authToken = '';
|
|
11151
11309
|
if (this.embedConfig.authType === AuthType.TrustedAuthTokenCookieless) {
|
|
11152
11310
|
authToken = await getAuthenticaionToken(this.embedConfig);
|
|
@@ -11157,8 +11315,14 @@ class TsEmbed {
|
|
|
11157
11315
|
data: {
|
|
11158
11316
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
11159
11317
|
authToken,
|
|
11160
|
-
runtimeFilterParams:
|
|
11318
|
+
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
11319
|
+
? getRuntimeFilters(this.viewConfig.runtimeFilters)
|
|
11320
|
+
: null,
|
|
11321
|
+
hiddenHomepageModules: this.viewConfig.hiddenHomepageModules || [],
|
|
11161
11322
|
hostConfig: this.embedConfig.hostConfig,
|
|
11323
|
+
hiddenHomeLeftNavItems: ((_a = this.viewConfig) === null || _a === void 0 ? void 0 : _a.hiddenHomeLeftNavItems)
|
|
11324
|
+
? (_b = this.viewConfig) === null || _b === void 0 ? void 0 : _b.hiddenHomeLeftNavItems
|
|
11325
|
+
: [],
|
|
11162
11326
|
},
|
|
11163
11327
|
});
|
|
11164
11328
|
};
|
|
@@ -11186,8 +11350,8 @@ class TsEmbed {
|
|
|
11186
11350
|
* Register APP_INIT event and sendback init payload
|
|
11187
11351
|
*/
|
|
11188
11352
|
this.registerAppInit = () => {
|
|
11189
|
-
this.on(EmbedEvent.APP_INIT, this.appInitCb);
|
|
11190
|
-
this.on(EmbedEvent.AuthExpire, this.updateAuthToken);
|
|
11353
|
+
this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
11354
|
+
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
11191
11355
|
};
|
|
11192
11356
|
this.el = getDOMNode(domSelector);
|
|
11193
11357
|
// TODO: handle error
|
|
@@ -11202,6 +11366,9 @@ class TsEmbed {
|
|
|
11202
11366
|
this.viewConfig = viewConfig;
|
|
11203
11367
|
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
11204
11368
|
this.registerAppInit();
|
|
11369
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
11370
|
+
...viewConfig,
|
|
11371
|
+
});
|
|
11205
11372
|
}
|
|
11206
11373
|
/**
|
|
11207
11374
|
* Throws error encountered during initialization.
|
|
@@ -11332,6 +11499,9 @@ class TsEmbed {
|
|
|
11332
11499
|
if (this.embedConfig.authType === AuthType.TrustedAuthTokenCookieless) {
|
|
11333
11500
|
queryParams[Param.cookieless] = true;
|
|
11334
11501
|
}
|
|
11502
|
+
if (this.embedConfig.pendoTrackingKey) {
|
|
11503
|
+
queryParams[Param.PendoTrackingKey] = this.embedConfig.pendoTrackingKey;
|
|
11504
|
+
}
|
|
11335
11505
|
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, } = this.viewConfig;
|
|
11336
11506
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
11337
11507
|
this.handleError('You cannot have both hidden actions and visible actions');
|
|
@@ -11484,7 +11654,6 @@ class TsEmbed {
|
|
|
11484
11654
|
this.insertIntoDOM(this.embedConfig.loginFailedMessage);
|
|
11485
11655
|
return;
|
|
11486
11656
|
}
|
|
11487
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE);
|
|
11488
11657
|
this.iFrame = this.iFrame || this.createIframeEl(url);
|
|
11489
11658
|
this.iFrame.addEventListener('load', () => {
|
|
11490
11659
|
nextInQueue();
|
|
@@ -11495,7 +11664,9 @@ class TsEmbed {
|
|
|
11495
11664
|
},
|
|
11496
11665
|
type: EmbedEvent.Load,
|
|
11497
11666
|
});
|
|
11498
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.
|
|
11667
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE, {
|
|
11668
|
+
elWidth: this.iFrame.clientWidth,
|
|
11669
|
+
elHeight: this.iFrame.clientHeight,
|
|
11499
11670
|
timeTookToLoad: loadTimestamp - initTimestamp,
|
|
11500
11671
|
});
|
|
11501
11672
|
});
|
|
@@ -11638,6 +11809,8 @@ class TsEmbed {
|
|
|
11638
11809
|
* @param messageType The message type
|
|
11639
11810
|
* @param callback A callback as a function
|
|
11640
11811
|
* @param options The message options
|
|
11812
|
+
* @param isSelf
|
|
11813
|
+
* @param isRegisteredBySDK
|
|
11641
11814
|
* @example
|
|
11642
11815
|
* ```js
|
|
11643
11816
|
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
@@ -11653,7 +11826,10 @@ class TsEmbed {
|
|
|
11653
11826
|
* });
|
|
11654
11827
|
* ```
|
|
11655
11828
|
*/
|
|
11656
|
-
on(messageType, callback, options = { start: false }) {
|
|
11829
|
+
on(messageType, callback, options = { start: false }, isRegisteredBySDK = false) {
|
|
11830
|
+
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`, {
|
|
11831
|
+
isRegisteredBySDK,
|
|
11832
|
+
});
|
|
11657
11833
|
if (this.isRendered) {
|
|
11658
11834
|
this.handleError('Please register event handlers before calling render');
|
|
11659
11835
|
}
|
|
@@ -11810,8 +11986,10 @@ class V1Embed extends TsEmbed {
|
|
|
11810
11986
|
let queryString = queryParams;
|
|
11811
11987
|
if (!this.viewConfig.excludeRuntimeFiltersfromURL) {
|
|
11812
11988
|
const runtimeFilters = this.viewConfig.runtimeFilters;
|
|
11989
|
+
const runtimeParameters = this.viewConfig.runtimeParameters;
|
|
11990
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
11813
11991
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
11814
|
-
queryString = [filterQuery, queryParams].filter(Boolean).join('&');
|
|
11992
|
+
queryString = [parameterQuery, filterQuery, queryParams].filter(Boolean).join('&');
|
|
11815
11993
|
}
|
|
11816
11994
|
return this.getV1EmbedBasePath(queryString);
|
|
11817
11995
|
}
|
|
@@ -11834,7 +12012,6 @@ class V1Embed extends TsEmbed {
|
|
|
11834
12012
|
*/
|
|
11835
12013
|
on(messageType, callback, options = { start: false }) {
|
|
11836
12014
|
const eventType = this.getCompatibleEventType(messageType);
|
|
11837
|
-
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`);
|
|
11838
12015
|
return super.on(eventType, callback, options);
|
|
11839
12016
|
}
|
|
11840
12017
|
}
|
|
@@ -11925,7 +12102,7 @@ class AppEmbed extends V1Embed {
|
|
|
11925
12102
|
* embedded Liveboard or visualization.
|
|
11926
12103
|
*/
|
|
11927
12104
|
getEmbedParams() {
|
|
11928
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, } = this.viewConfig;
|
|
12105
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideHomepageLeftNav = false, modularHomeExperience = false, } = this.viewConfig;
|
|
11929
12106
|
let params = {};
|
|
11930
12107
|
params[Param.EmbedApp] = true;
|
|
11931
12108
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
@@ -11949,6 +12126,8 @@ class AppEmbed extends V1Embed {
|
|
|
11949
12126
|
params[Param.EnableSearchAssist] = enableSearchAssist;
|
|
11950
12127
|
}
|
|
11951
12128
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
12129
|
+
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
12130
|
+
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
11952
12131
|
const queryParams = getQueryParamString(params, true);
|
|
11953
12132
|
return queryParams;
|
|
11954
12133
|
}
|
|
@@ -11958,8 +12137,8 @@ class AppEmbed extends V1Embed {
|
|
|
11958
12137
|
* @param pageId The ID of the page to be embedded.
|
|
11959
12138
|
*/
|
|
11960
12139
|
getIFrameSrc() {
|
|
11961
|
-
const { pageId, path } = this.viewConfig;
|
|
11962
|
-
const pageRoute = this.formatPath(path) || this.getPageRoute(pageId);
|
|
12140
|
+
const { pageId, path, modularHomeExperience } = this.viewConfig;
|
|
12141
|
+
const pageRoute = this.formatPath(path) || this.getPageRoute(pageId, modularHomeExperience);
|
|
11963
12142
|
let url = `${this.getRootIframeSrc()}/${pageRoute}`;
|
|
11964
12143
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
11965
12144
|
url = `${url}${tsPostHashParams}`;
|
|
@@ -11969,21 +12148,22 @@ class AppEmbed extends V1Embed {
|
|
|
11969
12148
|
* Gets the ThoughtSpot route of the page for a particular page ID.
|
|
11970
12149
|
*
|
|
11971
12150
|
* @param pageId The identifier for a page in the ThoughtSpot app.
|
|
12151
|
+
* @param modularHomeExperience
|
|
11972
12152
|
*/
|
|
11973
|
-
getPageRoute(pageId) {
|
|
12153
|
+
getPageRoute(pageId, modularHomeExperience = false) {
|
|
11974
12154
|
switch (pageId) {
|
|
11975
12155
|
case Page.Search:
|
|
11976
12156
|
return 'answer';
|
|
11977
12157
|
case Page.Answers:
|
|
11978
|
-
return 'answers';
|
|
12158
|
+
return modularHomeExperience ? 'home/answers' : 'answers';
|
|
11979
12159
|
case Page.Liveboards:
|
|
11980
|
-
return 'pinboards';
|
|
12160
|
+
return modularHomeExperience ? 'home/liveboards' : 'pinboards';
|
|
11981
12161
|
case Page.Pinboards:
|
|
11982
|
-
return 'pinboards';
|
|
12162
|
+
return modularHomeExperience ? 'home/liveboards' : 'pinboards';
|
|
11983
12163
|
case Page.Data:
|
|
11984
12164
|
return 'data/tables';
|
|
11985
12165
|
case Page.SpotIQ:
|
|
11986
|
-
return 'insights/results';
|
|
12166
|
+
return modularHomeExperience ? 'home/spotiq-analysis' : 'insights/results';
|
|
11987
12167
|
case Page.Home:
|
|
11988
12168
|
default:
|
|
11989
12169
|
return 'home';
|
|
@@ -12112,7 +12292,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
12112
12292
|
let params = {};
|
|
12113
12293
|
params[Param.EmbedApp] = true;
|
|
12114
12294
|
params = this.getBaseQueryParams(params);
|
|
12115
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, } = this.viewConfig;
|
|
12295
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, runtimeParameters, } = this.viewConfig;
|
|
12116
12296
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
12117
12297
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
12118
12298
|
if (fullHeight === true) {
|
|
@@ -12140,7 +12320,10 @@ class LiveboardEmbed extends V1Embed {
|
|
|
12140
12320
|
if (hideTabPanel) {
|
|
12141
12321
|
params[Param.HideTabPanel] = hideTabPanel;
|
|
12142
12322
|
}
|
|
12143
|
-
|
|
12323
|
+
let queryParams = getQueryParamString(params, true);
|
|
12324
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
12325
|
+
if (parameterQuery)
|
|
12326
|
+
queryParams += `&${parameterQuery}`;
|
|
12144
12327
|
return queryParams;
|
|
12145
12328
|
}
|
|
12146
12329
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
@@ -12264,7 +12447,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
12264
12447
|
}
|
|
12265
12448
|
getEmbedParams() {
|
|
12266
12449
|
var _a;
|
|
12267
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, } = this.viewConfig;
|
|
12450
|
+
const { hideResults, expandAllDataSource, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, } = this.viewConfig;
|
|
12268
12451
|
const queryParams = this.getBaseQueryParams();
|
|
12269
12452
|
queryParams[Param.HideActions] = [
|
|
12270
12453
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -12293,13 +12476,19 @@ class SearchEmbed extends TsEmbed {
|
|
|
12293
12476
|
}
|
|
12294
12477
|
queryParams[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
12295
12478
|
queryParams[Param.DataSourceMode] = this.getDataSourceMode();
|
|
12296
|
-
queryParams[Param.UseLastSelectedDataSource] =
|
|
12479
|
+
queryParams[Param.UseLastSelectedDataSource] = useLastSelectedSources;
|
|
12480
|
+
if (dataSource || dataSources) {
|
|
12481
|
+
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
12482
|
+
}
|
|
12297
12483
|
queryParams[Param.searchEmbed] = true;
|
|
12298
12484
|
let query = '';
|
|
12299
12485
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
12300
12486
|
if (queryParamsString) {
|
|
12301
12487
|
query = `?${queryParamsString}`;
|
|
12302
12488
|
}
|
|
12489
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
12490
|
+
if (parameterQuery)
|
|
12491
|
+
query += `&${parameterQuery}`;
|
|
12303
12492
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
12304
12493
|
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
12305
12494
|
query += `&${filterQuery}`;
|
|
@@ -12354,7 +12543,7 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
12354
12543
|
*/
|
|
12355
12544
|
getIFrameSrc() {
|
|
12356
12545
|
var _a;
|
|
12357
|
-
const { searchOptions, dataSource, dataSources } = this.viewConfig;
|
|
12546
|
+
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, } = this.viewConfig;
|
|
12358
12547
|
const path = 'search-bar-embed';
|
|
12359
12548
|
const queryParams = this.getBaseQueryParams();
|
|
12360
12549
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
@@ -12370,7 +12559,10 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
12370
12559
|
queryParams[Param.executeSearch] = true;
|
|
12371
12560
|
}
|
|
12372
12561
|
}
|
|
12373
|
-
queryParams[Param.UseLastSelectedDataSource] =
|
|
12562
|
+
queryParams[Param.UseLastSelectedDataSource] = useLastSelectedSources;
|
|
12563
|
+
if (dataSource || dataSources) {
|
|
12564
|
+
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
12565
|
+
}
|
|
12374
12566
|
queryParams[Param.searchEmbed] = true;
|
|
12375
12567
|
let query = '';
|
|
12376
12568
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
@@ -12480,4 +12672,4 @@ class SageEmbed extends V1Embed {
|
|
|
12480
12672
|
}
|
|
12481
12673
|
}
|
|
12482
12674
|
|
|
12483
|
-
export { Action, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, ContextMenuTriggerOptions, DataSourceVisualMode, EmbedEvent, HostEvent, LiveboardEmbed, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, executeTML, exportTML, getEmbedConfig as getInitConfig, getSessionInfo, init, logout$1 as logout, prefetch };
|
|
12675
|
+
export { Action, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, ContextMenuTriggerOptions, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, LiveboardEmbed, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, executeTML, exportTML, getEmbedConfig as getInitConfig, getSessionInfo, init, logout$1 as logout, prefetch };
|