From d7400dc03a76a6d59ff5ac16f95e90dc419710b0 Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Fri, 2 Jun 2023 10:05:43 +0300 Subject: [PATCH] UBER-338: added AppSwitcher popup. (#3329) Signed-off-by: Alexander Platov --- packages/theme/styles/_layouts.scss | 1 + .../src/components/App.svelte | 72 +------------- .../src/components/AppSwitcher.svelte | 99 +++++++++++++++++++ .../src/components/Applications.svelte | 33 +++---- .../src/components/Workbench.svelte | 20 ++-- 5 files changed, 120 insertions(+), 105 deletions(-) create mode 100644 plugins/workbench-resources/src/components/AppSwitcher.svelte diff --git a/packages/theme/styles/_layouts.scss b/packages/theme/styles/_layouts.scss index f8c81bc590..b9b67d8831 100644 --- a/packages/theme/styles/_layouts.scss +++ b/packages/theme/styles/_layouts.scss @@ -648,6 +648,7 @@ input.search { .min-w-4 { min-width: 1rem; } .min-w-8 { min-width: 2rem; } .min-w-9 { min-width: 2.25rem; } +.min-w-60 { min-width: 15rem; } .min-w-80 { min-width: 20rem; } .min-w-100 { min-width: 25rem; } .min-w-168 { min-width: 42rem; } diff --git a/plugins/workbench-resources/src/components/App.svelte b/plugins/workbench-resources/src/components/App.svelte index b21490a4dc..594965107b 100644 --- a/plugins/workbench-resources/src/components/App.svelte +++ b/plugins/workbench-resources/src/components/App.svelte @@ -15,49 +15,19 @@ - diff --git a/plugins/workbench-resources/src/components/AppSwitcher.svelte b/plugins/workbench-resources/src/components/AppSwitcher.svelte new file mode 100644 index 0000000000..58a03f6e9d --- /dev/null +++ b/plugins/workbench-resources/src/components/AppSwitcher.svelte @@ -0,0 +1,99 @@ + + + +
+
+
+
+ {#if loaded} + {#each apps as app, i} + + {/each} + {:else} +
+ +
+ {/if} +
+
+
+
diff --git a/plugins/workbench-resources/src/components/Applications.svelte b/plugins/workbench-resources/src/components/Applications.svelte index 44b4e81955..3934a7c7c1 100644 --- a/plugins/workbench-resources/src/components/Applications.svelte +++ b/plugins/workbench-resources/src/components/Applications.svelte @@ -14,24 +14,24 @@ -->
@@ -44,20 +44,9 @@ contentDirection={direction} buttons={'union'} > - {#each apps.filter((it) => (shown ? true : !hiddenAppsIds.includes(it._id))) as app} + {#each apps.filter((it) => !hiddenAppsIds.includes(it._id)) as app} - {/each}
diff --git a/plugins/workbench-resources/src/components/Workbench.svelte b/plugins/workbench-resources/src/components/Workbench.svelte index 07827d7b57..180b1a2b5d 100644 --- a/plugins/workbench-resources/src/components/Workbench.svelte +++ b/plugins/workbench-resources/src/components/Workbench.svelte @@ -19,6 +19,7 @@ import notification, { notificationId } from '@hcengineering/notification' import { BrowserNotificatator, NotificationClientImpl } from '@hcengineering/notification-resources' import { IntlString, getMetadata, getResource } from '@hcengineering/platform' + import setting from '@hcengineering/setting' import { ActionContext, createQuery, getClient } from '@hcengineering/presentation' import { AnyComponent, @@ -71,9 +72,10 @@ import SelectWorkspaceMenu from './SelectWorkspaceMenu.svelte' import SpaceView from './SpaceView.svelte' import TopMenu from './icons/TopMenu.svelte' + import IconSettings from './icons/Settings.svelte' + import AppSwitcher from './AppSwitcher.svelte' let contentPanel: HTMLElement - let shownMenu: boolean = false const { setTheme } = getContext('theme') as any @@ -604,21 +606,15 @@ />
- +
- + on:click={() => showPopup(AppSwitcher, { apps: getApps(apps) }, popupPosition)} + />