From 8fa404e15ab7da8584938202e5b45428d65eb920 Mon Sep 17 00:00:00 2001 From: Eric Lin Date: Thu, 9 Jan 2025 09:06:09 -0500 Subject: [PATCH] add uiVersion to exportLogs action --- packages/app-utils/src/components/AppBootstrap.tsx | 6 +++++- packages/code-studio/src/index.tsx | 3 +++ packages/embed-widget/src/index.tsx | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/app-utils/src/components/AppBootstrap.tsx b/packages/app-utils/src/components/AppBootstrap.tsx index 54326646a5..b25922dfc5 100644 --- a/packages/app-utils/src/components/AppBootstrap.tsx +++ b/packages/app-utils/src/components/AppBootstrap.tsx @@ -25,6 +25,9 @@ export type AppBootstrapProps = { /** URL of the server. */ serverUrl: string; + /** Version of front-end. */ + uiVersion: string; + /** URL of the plugins to load. */ pluginsUrl: string; @@ -49,6 +52,7 @@ export function AppBootstrap({ pluginsUrl, getCorePlugins, serverUrl, + uiVersion, children, }: AppBootstrapProps): JSX.Element { const clientOptions = useMemo(() => getConnectOptions(), []); @@ -70,7 +74,7 @@ export function AppBootstrap({ exportLogs( logHistory, { - // uiVersion: todo + uiVersion, userAgent: navigator.userAgent, }, store.getState() diff --git a/packages/code-studio/src/index.tsx b/packages/code-studio/src/index.tsx index 8cfe0063c9..4ca7dbdf0e 100644 --- a/packages/code-studio/src/index.tsx +++ b/packages/code-studio/src/index.tsx @@ -34,6 +34,8 @@ const pluginsURL = new URL( document.baseURI ); +const uiVersion = import.meta.env.npm_package_version; + // Lazy load the configs because it breaks initial page loads otherwise async function getCorePlugins() { const dashboardCorePlugins = await import( @@ -69,6 +71,7 @@ ReactDOM.render( getCorePlugins={getCorePlugins} serverUrl={apiURL.origin} pluginsUrl={pluginsURL.href} + uiVersion={uiVersion} > diff --git a/packages/embed-widget/src/index.tsx b/packages/embed-widget/src/index.tsx index 0e9cf98ce7..3bcdff817a 100644 --- a/packages/embed-widget/src/index.tsx +++ b/packages/embed-widget/src/index.tsx @@ -33,6 +33,8 @@ const pluginsURL = new URL( document.baseURI ); +const uiVersion = import.meta.env.npm_package_version; + // Lazy load the configs because it breaks initial page loads otherwise async function getCorePlugins() { const dashboardCorePlugins = await import( @@ -59,6 +61,7 @@ ReactDOM.render( getCorePlugins={getCorePlugins} serverUrl={apiURL.origin} pluginsUrl={pluginsURL.href} + uiVersion={uiVersion} >