From 5165ae71f776c91edfbe590efdcebec112f1eba4 Mon Sep 17 00:00:00 2001 From: Alexey Zinoviev Date: Mon, 17 Feb 2025 15:42:01 +0400 Subject: [PATCH] UBERF-9400: Show name on login screen (#8013) Signed-off-by: Alexey Zinoviev --- packages/account-client/src/types.ts | 11 ++- .../src/components/CreateWorkspaceForm.svelte | 12 ++- .../src/components/SelectWorkspace.svelte | 7 +- plugins/login-resources/src/utils.ts | 20 ++++- server/account/src/operations.ts | 77 +++++++++++++++++-- server/account/src/types.ts | 2 + server/account/src/utils.ts | 22 +++++- 7 files changed, 137 insertions(+), 14 deletions(-) diff --git a/packages/account-client/src/types.ts b/packages/account-client/src/types.ts index 4dd45b92ad..e403cf5890 100644 --- a/packages/account-client/src/types.ts +++ b/packages/account-client/src/types.ts @@ -1,7 +1,16 @@ -import { WorkspaceDataId, WorkspaceUuid, type AccountRole, type PersonUuid, type Timestamp } from '@hcengineering/core' +import { + PersonId, + WorkspaceDataId, + WorkspaceUuid, + type AccountRole, + type PersonUuid, + type Timestamp +} from '@hcengineering/core' export interface LoginInfo { account: PersonUuid + name?: string + socialId?: PersonId token?: string } diff --git a/plugins/login-resources/src/components/CreateWorkspaceForm.svelte b/plugins/login-resources/src/components/CreateWorkspaceForm.svelte index 5a3f9046fc..ff445952b3 100644 --- a/plugins/login-resources/src/components/CreateWorkspaceForm.svelte +++ b/plugins/login-resources/src/components/CreateWorkspaceForm.svelte @@ -20,7 +20,15 @@ import { workbenchId } from '@hcengineering/workbench' import { onMount } from 'svelte' import login from '../plugin' - import { createWorkspace, getAccount, getRegionInfo, goTo, setLoginInfo, type RegionInfo } from '../utils' + import { + createWorkspace, + getAccount, + getRegionInfo, + goTo, + setLoginInfo, + getAccountDisplayName, + type RegionInfo + } from '../utils' import Form from './Form.svelte' const fields = [ @@ -77,7 +85,7 @@ {fields} {object} {action} - subtitle={loginInfo?.account} + subtitle={getAccountDisplayName(loginInfo)} bottomActions={[ { caption: login.string.HaveWorkspace, diff --git a/plugins/login-resources/src/components/SelectWorkspace.svelte b/plugins/login-resources/src/components/SelectWorkspace.svelte index 7eb549204c..60c6ed421e 100644 --- a/plugins/login-resources/src/components/SelectWorkspace.svelte +++ b/plugins/login-resources/src/components/SelectWorkspace.svelte @@ -40,7 +40,8 @@ getWorkspaces, goTo, navigateToWorkspace, - selectWorkspace + selectWorkspace, + getAccountDisplayName } from '../utils' import StatusControl from './StatusControl.svelte' @@ -129,8 +130,8 @@
- {#if account?.account} - {account.account} + {#if account != null} + {getAccountDisplayName(account)} {:else}