From 3ce4ea076cd266c820bec530b556233387915712 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Wed, 9 Mar 2022 16:40:20 +0700 Subject: [PATCH] Fix login issue (#1112) Signed-off-by: Andrey Sobolev --- dev/prod/src/platform.ts | 3 +++ packages/ui/src/components/internal/Root.svelte | 14 ++++++++++++-- packages/ui/src/plugin.ts | 6 +++++- .../login-resources/src/components/LoginApp.svelte | 8 ++++++-- .../src/components/LoginForm.svelte | 5 +++++ .../src/components/SelectWorkspace.svelte | 14 +++++++++----- .../src/components/WorkbenchApp.svelte | 6 +++--- 7 files changed, 43 insertions(+), 13 deletions(-) diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 38dcd3c363..2439971c32 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -17,6 +17,7 @@ import { addLocation } from '@anticrm/platform' import login, { loginId } from '@anticrm/login' import workbench, { workbenchId } from '@anticrm/workbench' +import uiPlugin from '@anticrm/ui' import { viewId } from '@anticrm/view' import { taskId } from '@anticrm/task' import { contactId } from '@anticrm/contact' @@ -73,6 +74,8 @@ export async function configurePlatform() { setMetadata(rekoni.metadata.RekoniUrl, process.env.REKONI_URL) + setMetadata(uiPlugin.metadata.DefaultApplication, workbench.component.WorkbenchApp ) + addLocation(clientId, () => import(/* webpackChunkName: "client" */ '@anticrm/client-resources')) addLocation(loginId, () => import(/* webpackChunkName: "login" */ '@anticrm/login-resources')) addLocation(workbenchId, () => import(/* webpackChunkName: "workbench" */ '@anticrm/workbench-resources')) diff --git a/packages/ui/src/components/internal/Root.svelte b/packages/ui/src/components/internal/Root.svelte index 3d399ecf36..60c25b7ff3 100644 --- a/packages/ui/src/components/internal/Root.svelte +++ b/packages/ui/src/components/internal/Root.svelte @@ -1,10 +1,10 @@ @@ -38,13 +42,13 @@
{#if page === 'login'} - + {:else if page === 'signup'} {:else if page === 'createWorkspace'} {:else if page === 'selectWorkspace'} - + {:else if page === 'join'} {/if} diff --git a/plugins/login-resources/src/components/LoginForm.svelte b/plugins/login-resources/src/components/LoginForm.svelte index 231de7e09c..ec9673fc07 100644 --- a/plugins/login-resources/src/components/LoginForm.svelte +++ b/plugins/login-resources/src/components/LoginForm.svelte @@ -22,6 +22,8 @@ import login from '../plugin' + export let navigateUrl: string | undefined = undefined + const fields = [ { id: 'email', name: 'username', i18n: login.string.Email }, { @@ -54,6 +56,9 @@ const loc = getCurrentLocation() loc.path[1] = 'selectWorkspace' loc.path.length = 2 + if (navigateUrl !== undefined) { + loc.query = { ...loc.query, navigateUrl } + } navigate(loc) } } diff --git a/plugins/login-resources/src/components/SelectWorkspace.svelte b/plugins/login-resources/src/components/SelectWorkspace.svelte index 0274ca6e37..83a59f4e82 100644 --- a/plugins/login-resources/src/components/SelectWorkspace.svelte +++ b/plugins/login-resources/src/components/SelectWorkspace.svelte @@ -14,15 +14,15 @@ // limitations under the License. -->