From 44ae8f2e813189cbd06c6e15f0311bf5ce564ada Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Wed, 18 Jan 2023 23:54:27 +0600 Subject: [PATCH] Invite exp fix (#2520) Signed-off-by: Denis Bykhov --- .../src/components/PDFViewer.svelte | 4 +- .../ui/src/components/PanelInstance.svelte | 2 +- .../ui/src/components/PopupInstance.svelte | 2 +- .../src/components/ChannelEditor.svelte | 6 +- plugins/login-assets/lang/en.json | 5 +- plugins/login-assets/lang/ru.json | 5 +- .../src/components/CreateWorkspaceForm.svelte | 2 +- .../src/components/InviteLink.svelte | 70 ++++++++++++++----- plugins/login-resources/src/plugin.ts | 5 +- plugins/login-resources/src/utils.ts | 4 +- .../src/components/BooleanPresenter.svelte | 1 - 11 files changed, 71 insertions(+), 35 deletions(-) diff --git a/packages/presentation/src/components/PDFViewer.svelte b/packages/presentation/src/components/PDFViewer.svelte index 7aad7c97f5..b448e2a9a5 100644 --- a/packages/presentation/src/components/PDFViewer.svelte +++ b/packages/presentation/src/components/PDFViewer.svelte @@ -28,7 +28,7 @@ export let file: string export let name: string export let contentType: string | undefined - export let options: PopupOptions + export let popupOptions: PopupOptions export let value: Attachment const dispatch = createEventDispatcher() @@ -47,7 +47,7 @@ { diff --git a/packages/ui/src/components/PanelInstance.svelte b/packages/ui/src/components/PanelInstance.svelte index 3e3d98e7f4..26d0673f45 100644 --- a/packages/ui/src/components/PanelInstance.svelte +++ b/packages/ui/src/components/PanelInstance.svelte @@ -136,7 +136,7 @@ _class={props._class} rightSection={props.rightSection} position={props.element} - bind:options + bind:popupOptions={options} on:close={_close} on:update={_update} /> diff --git a/packages/ui/src/components/PopupInstance.svelte b/packages/ui/src/components/PopupInstance.svelte index 7064b9f277..7c4bbf02c4 100644 --- a/packages/ui/src/components/PopupInstance.svelte +++ b/packages/ui/src/components/PopupInstance.svelte @@ -137,7 +137,7 @@ this={is} bind:this={componentInstance} {...props} - bind:options + bind:popupOptions={options} on:update={(ev) => { _update(ev.detail) }} diff --git a/plugins/contact-resources/src/components/ChannelEditor.svelte b/plugins/contact-resources/src/components/ChannelEditor.svelte index ca00a07a03..9899267a52 100644 --- a/plugins/contact-resources/src/components/ChannelEditor.svelte +++ b/plugins/contact-resources/src/components/ChannelEditor.svelte @@ -35,7 +35,7 @@ export let placeholder: IntlString export let editable: boolean | undefined = undefined export let openable: boolean = false - export let options: PopupOptions + export let popupOptions: PopupOptions const dispatch = createEventDispatcher() let input: HTMLInputElement @@ -79,9 +79,9 @@ let dir: string = 'bottom' const vDir = (d: string): string => d.split('|')[0] const fitEditor = (): void => { - if (options) dir = vDir(options.direction) + if (popupOptions) dir = vDir(popupOptions.direction) } - $: if (options) dir = vDir(options.direction) + $: if (popupOptions) dir = vDir(popupOptions.direction) afterUpdate(() => { fitEditor() }) diff --git a/plugins/login-assets/lang/en.json b/plugins/login-assets/lang/en.json index e441c37390..ab8fa4d11b 100644 --- a/plugins/login-assets/lang/en.json +++ b/plugins/login-assets/lang/en.json @@ -24,10 +24,11 @@ "Copied": "Copied", "Close": "Close", "InviteDescription": "Share this link to invite other users", - "InviteNote": "Link is valid for 1 hour", "WantAnotherWorkspace": "Want to create another workspace?", "ChangeAccount": "Change account", "NotSeeingWorkspace": "Not seeing your workspace?", - "WorksaceNameRule": "The workspace name can contains lowercase letters, numbers, and symbols !@#%&^-" + "WorkspaceNameRule": "The workspace name can contains lowercase letters, numbers, and symbols !@#%&^-", + "LinkValidHours": "Link valid (hours):", + "GetLink": "Get invite link" } } \ No newline at end of file diff --git a/plugins/login-assets/lang/ru.json b/plugins/login-assets/lang/ru.json index ba5bfd9f97..a02085bf21 100644 --- a/plugins/login-assets/lang/ru.json +++ b/plugins/login-assets/lang/ru.json @@ -24,10 +24,11 @@ "Copied": "Скопировано", "Close": "Закрыть", "InviteDescription": "Поделитесь ссылкой чтобы пригласить других участников", - "InviteNote": "Ссылка действительна 1 час", "WantAnotherWorkspace": "Хотите создать другое рабочее пространство?", "ChangeAccount": "Сменить пользователя", "NotSeeingWorkspace": "Не видите ваше рабочее пространство?", - "WorksaceNameRule": "Название рабочего пространства должно состояить из строчных латинских букв, цифр и символов !@#%&^-" + "WorkspaceNameRule": "Название рабочего пространства должно состояить из строчных латинских букв, цифр и символов !@#%&^-", + "LinkValidHours": "Ссылка действительна (часов):", + "GetLink": "Получить ссылку" } } \ No newline at end of file diff --git a/plugins/login-resources/src/components/CreateWorkspaceForm.svelte b/plugins/login-resources/src/components/CreateWorkspaceForm.svelte index e7b4f177d8..b7beefbd9c 100644 --- a/plugins/login-resources/src/components/CreateWorkspaceForm.svelte +++ b/plugins/login-resources/src/components/CreateWorkspaceForm.svelte @@ -34,7 +34,7 @@ name: 'workspace', i18n: login.string.Workspace, rule: /^[0-9a-z#%&^\-!)(]{3,63}$/, - ruleDescr: login.string.WorksaceNameRule + ruleDescr: login.string.WorkspaceNameRule } ] diff --git a/plugins/login-resources/src/components/InviteLink.svelte b/plugins/login-resources/src/components/InviteLink.svelte index f4fc4070b4..0bfb2fcd66 100644 --- a/plugins/login-resources/src/components/InviteLink.svelte +++ b/plugins/login-resources/src/components/InviteLink.svelte @@ -15,17 +15,18 @@
-
- {#await getLink() then link} - + {#if loading} + + {:else if link !== undefined} + +
-
- {/await} + {:else} +
+
+ {/if}