Skip to content

Commit

Permalink
add uiVersion to exportLogs action
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlln committed Jan 9, 2025
1 parent 275d16e commit 8fa404e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/app-utils/src/components/AppBootstrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -49,6 +52,7 @@ export function AppBootstrap({
pluginsUrl,
getCorePlugins,
serverUrl,
uiVersion,
children,
}: AppBootstrapProps): JSX.Element {
const clientOptions = useMemo(() => getConnectOptions(), []);
Expand All @@ -70,7 +74,7 @@ export function AppBootstrap({
exportLogs(
logHistory,
{
// uiVersion: todo
uiVersion,
userAgent: navigator.userAgent,
},
store.getState()
Expand Down
3 changes: 3 additions & 0 deletions packages/code-studio/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -69,6 +71,7 @@ ReactDOM.render(
getCorePlugins={getCorePlugins}
serverUrl={apiURL.origin}
pluginsUrl={pluginsURL.href}
uiVersion={uiVersion}
>
<AppRoot />
</AppBootstrap>
Expand Down
3 changes: 3 additions & 0 deletions packages/embed-widget/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -59,6 +61,7 @@ ReactDOM.render(
getCorePlugins={getCorePlugins}
serverUrl={apiURL.origin}
pluginsUrl={pluginsURL.href}
uiVersion={uiVersion}
>
<App />
</AppBootstrap>
Expand Down

0 comments on commit 8fa404e

Please sign in to comment.