From 033a1ce5372431d046ab93ab93df7aebc9bcc7cc Mon Sep 17 00:00:00 2001 From: Alexey Zinoviev Date: Mon, 22 Sep 2025 14:24:02 +0400 Subject: [PATCH] eqms-1618: fix server branding (#9907) Signed-off-by: Alexey Zinoviev --- .vscode/launch.json | 3 ++- packages/account-client/src/types.ts | 1 + server/account/src/operations.ts | 3 ++- server/account/src/types.ts | 1 + server/server/src/sessionManager.ts | 8 ++++++-- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index bd56c0509c..79811a1ecf 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -106,7 +106,8 @@ "STATS_URL": "http://huly.local:4900", "QUEUE_CONFIG": "localhost:19092", "FILES_URL": "http://huly.local:4030/blob/:workspace/:blobId/:filename", - "OTEL_EXPORTER_OTLP_ENDPOINT": "http://huly.local:4318/v1/traces" + "OTEL_EXPORTER_OTLP_ENDPOINT": "http://huly.local:4318/v1/traces", + "BRANDING_PATH": "${workspaceRoot}/dev/branding.json" }, "runtimeArgs": ["--nolazy", "-r", "ts-node/register"], "runtimeVersion": "20", diff --git a/packages/account-client/src/types.ts b/packages/account-client/src/types.ts index 41ef820273..73a1584e45 100644 --- a/packages/account-client/src/types.ts +++ b/packages/account-client/src/types.ts @@ -40,6 +40,7 @@ export interface LoginInfoWorkspace { endpoint: EndpointInfo role: AccountRole | null progress?: number + branding?: string } export interface LoginInfoWithWorkspaces extends LoginInfo { diff --git a/server/account/src/operations.ts b/server/account/src/operations.ts index 65f4ef5f8f..36c4874d4a 100644 --- a/server/account/src/operations.ts +++ b/server/account/src/operations.ts @@ -1883,7 +1883,8 @@ export async function getLoginWithWorkspaceInfo ( versionMinor: it.status.versionMinor, versionPatch: it.status.versionPatch }, - progress: it.status.processingProgress + progress: it.status.processingProgress, + branding: it.branding } ]) ), diff --git a/server/account/src/types.ts b/server/account/src/types.ts index ee659c422b..fe58632d98 100644 --- a/server/account/src/types.ts +++ b/server/account/src/types.ts @@ -322,6 +322,7 @@ export interface LoginInfoWorkspace { role: AccountRole | null progress?: number + branding?: string } export interface LoginInfoWithWorkspaces extends LoginInfo { diff --git a/server/server/src/sessionManager.ts b/server/server/src/sessionManager.ts index 1ea17c2322..e20c5d6533 100644 --- a/server/server/src/sessionManager.ts +++ b/server/server/src/sessionManager.ts @@ -595,7 +595,10 @@ export class TSessionManager implements SessionManager { workspace = this.workspaces.get(workspaceUuid) - const branding = null + const branding = + (workspaceInfo.branding !== undefined + ? Object.values(this.brandingMap).find((b) => b.key === workspaceInfo?.branding) + : null) ?? null if (workspace === undefined) { ctx.warn('open workspace', { @@ -698,7 +701,8 @@ export class TSessionManager implements SessionManager { }, role: AccountRole.Owner, endpoint: { externalUrl: '', internalUrl: '', region: workspaceInfo.region ?? '' }, - progress: workspaceInfo.processingProgress + progress: workspaceInfo.processingProgress, + branding: workspaceInfo.branding } } else { this.workspaceInfoCache.delete(token.workspace)