Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions visual-embed/pre-rendering/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
VITE_THOUGHTSPOT_HOST=https://training.thoughtspot.cloud
VITE_THOUGHTSPOT_USERNAME=code-sandbox
VITE_THOUGHTSPOT_PASSWORD="3mbed+#3xplz"
VITE_THOUGHTSPOT_HOST=https://172.32.118.78:8443
VITE_THOUGHTSPOT_USERNAME=tsadmin
VITE_THOUGHTSPOT_PASSWORD=4Xyc1f%[H^3L
VITE_THOUGHTSPOT_LIVEBOARD_ID_1="9bd202f5-d431-44bf-9a07-b4f7be372125"
VITE_THOUGHTSPOT_LIVEBOARD_ID_2="e0836cad-4fdf-42d4-bd97-567a6b2a6058"
VITE_THOUGHTSPOT_AUTH_TYPE='none'
212 changes: 4 additions & 208 deletions visual-embed/pre-rendering/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions visual-embed/pre-rendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --port=3000",
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@thoughtspot/visual-embed-sdk": "latest",
"@thoughtspot/visual-embed-sdk": "1.41.0-pre-render-1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router": "^7.3.0"
Expand Down
21 changes: 18 additions & 3 deletions visual-embed/pre-rendering/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import "./App.css";
import { BrowserRouter, Link, Outlet, Route, Routes } from "react-router";
import {
MovingLiveboardEmbed,
NormalEmbed,
NormalLiveboardEmbed,
PreRenderEmbed,
Expand All @@ -16,6 +17,7 @@ import {
AuthStatus,
useInit,
PreRenderedLiveboardEmbed,
Action,
} from "@thoughtspot/visual-embed-sdk/react";

const routesData = [
Expand Down Expand Up @@ -68,14 +70,24 @@ const routesData = [
"Normal Render is the default behavior of the ThoughtSpot SDK. Loads the ThoughtSpot app when the component is rendered.",
element: <NormalLiveboardEmbed />,
},
{
path: "/moving-liveboard",
title: "Moving Liveboard",
description:
"Moving Liveboard is a liveboard that moves around the screen.",
element: <MovingLiveboardEmbed />,
},
];

const EmbedInit = ({ children }: { children: React.ReactNode }) => {
const [loading, setLoading] = useState(true);

const authType: AuthType =
import.meta.env.VITE_THOUGHTSPOT_AUTH_TYPE || AuthType.Basic;

const authEERef = useInit({
thoughtSpotHost: import.meta.env.VITE_THOUGHTSPOT_HOST,
authType: AuthType.Basic,
authType: authType,
username: import.meta.env.VITE_THOUGHTSPOT_USERNAME,
password: import.meta.env.VITE_THOUGHTSPOT_PASSWORD,
});
Expand All @@ -93,9 +105,12 @@ const EmbedInit = ({ children }: { children: React.ReactNode }) => {
return (
<div className="embed-init">
<PreRenderedAppEmbed preRenderId="pre-render" />
<PreRenderedLiveboardEmbed preRenderId="pre-render-without-liveboard-id" />
<PreRenderedLiveboardEmbed
liveboardId="e40c0727-01e6-49db-bb2f-5aa19661477b"
preRenderId="pre-render-without-liveboard-id"
visibleActions={[Action.Edit, Action.MakeACopy]}
/>
<PreRenderedLiveboardEmbed
liveboardId={import.meta.env.VITE_THOUGHTSPOT_LIVEBOARD_ID_1}
preRenderId="pre-render-with-liveboard-id"
/>
{children}
Expand Down
Loading