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
16 changes: 16 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const React = require('react');
const { FloatingAssistantProvider } = require('./src/contexts/FloatingAssistantContext');
const FloatingAssistant = require('./src/components/FloatingAssistant').default;

exports.wrapRootElement = ({ element }) => (
<FloatingAssistantProvider>
{element}
<FloatingAssistant />
</FloatingAssistantProvider>
);

exports.onRouteUpdate = ({ location }) => {
window.dispatchEvent(
new CustomEvent('gatsby-route-update', { detail: { location } })
);
};
8 changes: 8 additions & 0 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const React = require('react');
const { FloatingAssistantProvider } = require('./src/contexts/FloatingAssistantContext');

exports.wrapRootElement = ({ element }) => (
<FloatingAssistantProvider>
{element}
</FloatingAssistantProvider>
);
3,515 changes: 2,040 additions & 1,475 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@
"react-dom": "> 16.8.0"
},
"dependencies": {
"@types/dompurify": "^3.0.5",
"@vercel/analytics": "^1.0.2",
"algoliasearch": "^4.10.5",
"cheerio": "^1.2.0",
"classnames": "^2.3.1",
"dompurify": "^3.3.3",
"eventemitter3": "^4.0.7",
"gatsby-plugin-vercel": "^1.0.3",
"gatsby-source-git": "^1.1.0",
"html-react-parser": "^1.4.12",
"lodash": "^4.17.21",
"marked": "^18.0.0",
"mixpanel-browser": "^2.45.0",
"react-helmet": "^6.1.0",
"turndown": "^7.2.4",
Expand Down
6 changes: 3 additions & 3 deletions src/components/DevDocTemplate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,9 @@ if (isVersionedIframe) {
return (
<>
<Seo title={docTitle} description={docDescription} />
<Analytics />
{shouldShowAnnouncementBanner() && (
<AnnouncementBanner
<Analytics />
{shouldShowAnnouncementBanner() && (
<AnnouncementBanner
enabled={HOME_ANNOUNCEMENT_BANNER?.enabled}
variant="release"
dismissKey={bannerDismissKey}
Expand Down
46 changes: 46 additions & 0 deletions src/components/DevDocTemplate/playGround/VisualEmbed.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React, { useState, useEffect, FC } from 'react';

import { DEFAULT_HOST } from '../../../configs/doc-configs';
import BackButton from '../../BackButton';

const VisualEmbedPlayGround: FC<VisualEmbedPlayGroundProps> = (props) => {
const isBrowser = () => typeof window !== 'undefined';
const { isPublisSiteOpen, location, backLink } = props;

const getParentURL = () => {
let parentUrl = location?.origin;
if (isBrowser()) {
const { ancestorOrigins } = window?.location;
parentUrl =
ancestorOrigins?.length > 0
? ancestorOrigins[ancestorOrigins?.length - 1]
: document.referrer || window?.origin;
}
return parentUrl;
};
const baseUrl = isPublisSiteOpen ? DEFAULT_HOST : getParentURL();
const playgroundUrl = "https://try-everywhere.thoughtspot.cloud/v2/#/develop/playground/search"
console.log(playgroundUrl)

return (
<div className="restApiWrapper">
<BackButton title="Back" backLink={backLink} internalRedirect />
<iframe
ref={null}
src={playgroundUrl}
height="100%"
width="100%"
id="restAPIPlayGround"
/>
</div>
);
};

export default VisualEmbedPlayGround;

type VisualEmbedPlayGroundProps = {
location: Location;
isPublisSiteOpen: boolean;
backLink: string;
params: Object;
};
Loading
Loading