From cf71e49e5372478b0722b37cd6a6a9efbee9ea6b Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Fri, 14 Jun 2024 15:12:01 +0300 Subject: [PATCH] Replacing the Panel and fixed SelectPopup (#5821) Signed-off-by: Alexander Platov --- .../components/breadcrumbs/Breadcrumbs.svelte | 2 +- packages/ui/src/components/SelectPopup.svelte | 5 +- .../src/components/DriveHeader.svelte | 53 ------------------- .../src/components/DrivePanel.svelte | 48 +++++++++-------- .../src/components/FolderHeader.svelte | 35 ++---------- .../src/components/FolderPanel.svelte | 46 ++++++++-------- 6 files changed, 60 insertions(+), 129 deletions(-) delete mode 100644 plugins/drive-resources/src/components/DriveHeader.svelte diff --git a/packages/presentation/src/components/breadcrumbs/Breadcrumbs.svelte b/packages/presentation/src/components/breadcrumbs/Breadcrumbs.svelte index 08377f5d78..f139f158b7 100644 --- a/packages/presentation/src/components/breadcrumbs/Breadcrumbs.svelte +++ b/packages/presentation/src/components/breadcrumbs/Breadcrumbs.svelte @@ -36,7 +36,7 @@ return { id: i, text: title } } }) - showPopup(SelectPopup, { value: items }, event.currentTarget) + showPopup(SelectPopup, { value: items, componentLink: true }, event.currentTarget) } diff --git a/packages/ui/src/components/SelectPopup.svelte b/packages/ui/src/components/SelectPopup.svelte index 64a031498f..1a60130ca1 100644 --- a/packages/ui/src/components/SelectPopup.svelte +++ b/packages/ui/src/components/SelectPopup.svelte @@ -36,7 +36,8 @@ export let onSelect: ((value: SelectPopupValueType['id'], event?: Event) => void) | undefined = undefined export let showShadow: boolean = true export let embedded: boolean = false - export let loading = false + export let componentLink: boolean = false + export let loading: boolean = false let popupElement: HTMLDivElement | undefined = undefined let search: string = '' @@ -147,7 +148,7 @@ }} disabled={loading} > -
+
{#if item.component}
{:else} diff --git a/plugins/drive-resources/src/components/DriveHeader.svelte b/plugins/drive-resources/src/components/DriveHeader.svelte deleted file mode 100644 index 203266a000..0000000000 --- a/plugins/drive-resources/src/components/DriveHeader.svelte +++ /dev/null @@ -1,53 +0,0 @@ - - - -
-
-
- -
-
-
-
-
diff --git a/plugins/drive-resources/src/components/DrivePanel.svelte b/plugins/drive-resources/src/components/DrivePanel.svelte index 3ee16e12be..f96ca8ace0 100644 --- a/plugins/drive-resources/src/components/DrivePanel.svelte +++ b/plugins/drive-resources/src/components/DrivePanel.svelte @@ -16,10 +16,10 @@ import { type Ref } from '@hcengineering/core' import drive, { type Drive } from '@hcengineering/drive' import { createQuery } from '@hcengineering/presentation' - import { Separator } from '@hcengineering/ui' - import { DocAttributeBar } from '@hcengineering/view-resources' + import { Panel, Scroller, Button, IconMoreH } from '@hcengineering/ui' + import { DocAttributeBar, showMenu } from '@hcengineering/view-resources' - import DriveHeader from './DriveHeader.svelte' + import DrivePresenter from './DrivePresenter.svelte' import FolderBrowser from './FolderBrowser.svelte' export let _id: Ref @@ -32,7 +32,6 @@ } let object: Drive | undefined = undefined - let asideShown = false const query = createQuery() $: query.query(drive.class.Drive, { _id }, (res) => { @@ -41,23 +40,30 @@ {#if object} -
- - -
-
- + + +
+
+
+ +
+ +
+
diff --git a/plugins/drive-resources/src/components/FolderPanel.svelte b/plugins/drive-resources/src/components/FolderPanel.svelte index 79182d1e38..45cb80e2b8 100644 --- a/plugins/drive-resources/src/components/FolderPanel.svelte +++ b/plugins/drive-resources/src/components/FolderPanel.svelte @@ -16,8 +16,8 @@ import { type Ref } from '@hcengineering/core' import drive, { type Folder } from '@hcengineering/drive' import { createQuery } from '@hcengineering/presentation' - import { Separator } from '@hcengineering/ui' - import { DocAttributeBar } from '@hcengineering/view-resources' + import { Panel, Button, Scroller, IconMoreH } from '@hcengineering/ui' + import { DocAttributeBar, showMenu } from '@hcengineering/view-resources' import FolderHeader from './FolderHeader.svelte' import FolderBrowser from './FolderBrowser.svelte' @@ -32,7 +32,6 @@ } let object: Folder | undefined = undefined - let asideShown = false const query = createQuery() $: query.query(drive.class.Folder, { _id }, (res) => { @@ -41,23 +40,28 @@ {#if object} -
- + + + + + +