From f5682c1f73148f225d55c2118e01e1e526841981 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Fri, 4 Mar 2022 17:47:14 +0700 Subject: [PATCH] Allow to select workspace (#1094) Allow to select workspace --- plugins/setting-assets/assets/icons.svg | 10 ++++++++-- plugins/setting-assets/lang/en.json | 1 + plugins/setting-assets/lang/ru.json | 1 + plugins/setting-assets/src/index.ts | 3 ++- .../setting-resources/src/components/Settings.svelte | 4 ++++ plugins/setting/src/index.ts | 6 ++++-- .../src/components/AccountPopup.svelte | 10 ++++++++++ 7 files changed, 30 insertions(+), 5 deletions(-) diff --git a/plugins/setting-assets/assets/icons.svg b/plugins/setting-assets/assets/icons.svg index 921fb16069..02f57e9477 100644 --- a/plugins/setting-assets/assets/icons.svg +++ b/plugins/setting-assets/assets/icons.svg @@ -27,7 +27,13 @@ - - + + + + + + + + diff --git a/plugins/setting-assets/lang/en.json b/plugins/setting-assets/lang/en.json index 00404b3c0e..280b658cc6 100644 --- a/plugins/setting-assets/lang/en.json +++ b/plugins/setting-assets/lang/en.json @@ -23,6 +23,7 @@ "RepeatNewPassword": "Repeat new password", "Signout": "Sign out", "Settings": "Settings", + "SelectWorkspace": "Select workspace", "DeleteStatus": "Delete status", "DeleteStatusConfirm": "Do you want to delete this status?" } diff --git a/plugins/setting-assets/lang/ru.json b/plugins/setting-assets/lang/ru.json index 2d7601f830..6a170052b2 100644 --- a/plugins/setting-assets/lang/ru.json +++ b/plugins/setting-assets/lang/ru.json @@ -23,6 +23,7 @@ "RepeatNewPassword": "Повторите новый пароль", "Signout": "Выйти", "Settings": "Настройки", + "SelectWorkspace": "Выбрать пространство", "DeleteStatus": "Удаление статуса", "DeleteStatusConfirm": "Вы действительно хотите удалить этот статус?" } diff --git a/plugins/setting-assets/src/index.ts b/plugins/setting-assets/src/index.ts index d464ad5620..a9c9e9bc87 100644 --- a/plugins/setting-assets/src/index.ts +++ b/plugins/setting-assets/src/index.ts @@ -25,7 +25,8 @@ loadMetadata(setting.icon, { Support: `${icons}#support`, Privacy: `${icons}#privacy`, Terms: `${icons}#terms`, - Signout: `${icons}#signout` + Signout: `${icons}#signout`, + SelectWorkspace: `${icons}#selectWorkspace` }) addStringsLoader(settingId, async (lang: string) => await import(`../lang/${lang}.json`)) diff --git a/plugins/setting-resources/src/components/Settings.svelte b/plugins/setting-resources/src/components/Settings.svelte index 599fc6f423..a6773196fe 100644 --- a/plugins/setting-resources/src/components/Settings.svelte +++ b/plugins/setting-resources/src/components/Settings.svelte @@ -39,6 +39,9 @@ setMetadataLocalStorage(login.metadata.LoginEmail, null) navigate({ path: [login.component.LoginApp] }) } + function selectWorkspace (): void { + navigate({ path: [login.component.LoginApp, 'selectWorkspace'] }) + }
@@ -53,6 +56,7 @@ {/each}
+
diff --git a/plugins/setting/src/index.ts b/plugins/setting/src/index.ts index 309b00107c..d071761404 100644 --- a/plugins/setting/src/index.ts +++ b/plugins/setting/src/index.ts @@ -111,7 +111,8 @@ export default plugin(settingId, { EnterCurrentPassword: '' as IntlString, EnterNewPassword: '' as IntlString, RepeatNewPassword: '' as IntlString, - Signout: '' as IntlString + Signout: '' as IntlString, + SelectWorkspace: '' as IntlString }, icon: { EditProfile: '' as Asset, @@ -121,6 +122,7 @@ export default plugin(settingId, { Support: '' as Asset, Privacy: '' as Asset, Terms: '' as Asset, - Signout: '' as Asset + Signout: '' as Asset, + SelectWorkspace: '' as Asset } }) diff --git a/plugins/workbench-resources/src/components/AccountPopup.svelte b/plugins/workbench-resources/src/components/AccountPopup.svelte index f929c82c75..1e5aff669f 100644 --- a/plugins/workbench-resources/src/components/AccountPopup.svelte +++ b/plugins/workbench-resources/src/components/AccountPopup.svelte @@ -59,6 +59,10 @@ navigate({ path: [login.component.LoginApp] }) } + function selectWorkspace (): void { + navigate({ path: [login.component.LoginApp, 'selectWorkspace'] }) + } + function filterItems (items: SettingsCategory[]): SettingsCategory[] { return items?.filter((p) => p.name !== 'profile' && p.name !== 'password') } @@ -95,6 +99,12 @@ {/each} {/if} +