diff --git a/packages/analytics/src/index.ts b/packages/analytics/src/index.ts index f90fb6e16e..739e3c9b03 100644 --- a/packages/analytics/src/index.ts +++ b/packages/analytics/src/index.ts @@ -13,6 +13,7 @@ export interface AnalyticProvider { setWorkspace: (ws: string) => void handleEvent: (event: string) => void handleError: (error: Error) => void + navigate: (path: string) => void } export const Analytics = { @@ -51,6 +52,12 @@ export const Analytics = { providers.forEach((provider) => { provider.handleError(error) }) + }, + + navigate (path: string): void { + providers.forEach((provider) => { + provider.navigate(path) + }) } } diff --git a/packages/ui/src/location.ts b/packages/ui/src/location.ts index 85d0a2d50a..ab7ddc5366 100644 --- a/packages/ui/src/location.ts +++ b/packages/ui/src/location.ts @@ -13,6 +13,7 @@ // limitations under the License. // +import { Analytics } from '@hcengineering/analytics' import { clone } from '@hcengineering/core' import { derived, get, writable } from 'svelte/store' import { closePopup } from './popups' @@ -177,6 +178,7 @@ export function navigate (location: PlatformLocation, replace = false): boolean if (cur !== url) { const data = !embeddedPlatform ? null : { location } const _url = !embeddedPlatform ? url : undefined + Analytics.navigate(url) if (replace) { history.replaceState(data, '', _url) } else { diff --git a/server/front/src/index.ts b/server/front/src/index.ts index 4c9617d733..af1e7ad7a5 100644 --- a/server/front/src/index.ts +++ b/server/front/src/index.ts @@ -250,7 +250,7 @@ export function start ( lastNameFirst?: string }, port: number, - extraConfig?: Record + extraConfig?: Record ): () => void { const app = express() diff --git a/server/front/src/starter.ts b/server/front/src/starter.ts index 515d3a8b0f..8c62f44e18 100644 --- a/server/front/src/starter.ts +++ b/server/front/src/starter.ts @@ -21,7 +21,7 @@ import { StorageConfiguration } from '@hcengineering/server-core' import serverToken from '@hcengineering/server-token' import { start } from '.' -export function startFront (ctx: MeasureContext, extraConfig?: Record): void { +export function startFront (ctx: MeasureContext, extraConfig?: Record): void { const defaultLanguage = process.env.DEFAULT_LANGUAGE ?? 'en' const languages = process.env.LANGUAGES ?? 'en,ru' const SERVER_PORT = parseInt(process.env.SERVER_PORT ?? '8080')