File tree Expand file tree Collapse file tree 4 files changed +27
-39
lines changed
rest-api/typescript-sdk/react-rest-api/src Expand file tree Collapse file tree 4 files changed +27
-39
lines changed Original file line number Diff line number Diff line change 165165 -webkit-box-orient : vertical;
166166}
167167
168- .copy-button {
169- background : linear-gradient (45deg , # 667eea, # 764ba2 );
170- color : white;
171- border : none;
172- padding : 8px 12px ;
173- border-radius : 8px ;
174- cursor : pointer;
175- font-size : 0.9rem ;
176- transition : all 0.2s ease;
177- flex-shrink : 0 ;
178- }
179-
180- .copy-button : hover {
181- transform : scale (1.05 );
182- box-shadow : 0 2px 8px rgba (0 , 0 , 0 , 0.2 );
183- }
184-
185168.liveboard-id {
186169 display : flex;
187170 flex-direction : row;
251234 flex-direction : column;
252235 align-items : stretch;
253236 }
254-
255- .copy-button {
256- align-self : flex-end;
257- margin-top : 8px ;
258- }
259237}
260238
261239@media (max-width : 480px ) {
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ let cachedTokenResponse: Token | null = null;
55
66export const getCachedAuthToken = async ( ) => {
77 // if token has 30s remaining, return cached token
8- if ( cachedTokenResponse && cachedTokenResponse . expiration_time_in_millis - Date . now ( ) > 30 * 1000 ) {
8+ if (
9+ cachedTokenResponse &&
10+ cachedTokenResponse . expiration_time_in_millis - Date . now ( ) > 30 * 1000
11+ ) {
912 return cachedTokenResponse . token ;
1013 }
1114 // fetch new token
@@ -20,4 +23,4 @@ export const getCachedAuthToken = async () => {
2023 const data = await response . json ( ) ;
2124 cachedTokenResponse = data ;
2225 return data . token ;
23- }
26+ } ;
Original file line number Diff line number Diff line change 1- import { StrictMode } from ' react'
2- import { createRoot } from ' react-dom/client'
3- import ' ./index.css'
4- import App from ' ./App.tsx'
1+ import { StrictMode } from " react" ;
2+ import { createRoot } from " react-dom/client" ;
3+ import " ./index.css" ;
4+ import App from " ./App.tsx" ;
55
6- createRoot ( document . getElementById ( ' root' ) ! ) . render (
6+ createRoot ( document . getElementById ( " root" ) ! ) . render (
77 < StrictMode >
88 < App />
9- </ StrictMode > ,
10- )
9+ </ StrictMode >
10+ ) ;
Original file line number Diff line number Diff line change 1- import { ThoughtSpotRestApi , createBearerAuthenticationConfig } from "@thoughtspot/rest-api-sdk" ;
1+ import {
2+ ThoughtSpotRestApi ,
3+ createBearerAuthenticationConfig ,
4+ } from "@thoughtspot/rest-api-sdk" ;
25import { THOUGHTSPOT_HOST } from "../constants" ;
36import { getCachedAuthToken } from "../get-auth-token" ;
47
58/**
69 * This will create a bearer authenticated client to connect to thoughtspot server
7- *
10+ *
811 * @returns ThoughtSpotRestApi
912 */
1013let thoughtSpotClient : ThoughtSpotRestApi ;
1114export const getThoughtSpotClient = ( ) => {
1215 if ( ! thoughtSpotClient ) {
13- const bearerConfig = createBearerAuthenticationConfig ( THOUGHTSPOT_HOST , getCachedAuthToken , {
14- additionalHeaders : {
15- "Accept-Language" : "ThoughtSpot-SDK" ,
16- } ,
17- } ) ;
16+ const bearerConfig = createBearerAuthenticationConfig (
17+ THOUGHTSPOT_HOST ,
18+ getCachedAuthToken ,
19+ {
20+ additionalHeaders : {
21+ "Accept-Language" : "ThoughtSpot-SDK" ,
22+ } ,
23+ }
24+ ) ;
1825 thoughtSpotClient = new ThoughtSpotRestApi ( bearerConfig ) ;
1926 }
2027 return thoughtSpotClient ;
21- }
28+ } ;
You can’t perform that action at this time.
0 commit comments