From 41650925c0288021cb06204218447e8816fe883c Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Thu, 31 Aug 2023 08:46:04 +0300 Subject: [PATCH] UBER-795: updated layout of pop-ups. There is always a Back in the Panel. (#3644) Signed-off-by: Alexander Platov --- .../presentation/src/components/Card.svelte | 131 ++++++--- .../components/IndexedDocumentCompare.svelte | 52 +--- .../components/IndexedDocumentContent.svelte | 8 +- .../components/IndexedDocumentPreview.svelte | 40 +-- .../src/components/PDFViewer.svelte | 18 +- .../src/components/SpaceSelect.svelte | 3 + .../src/components/SpaceSelector.svelte | 4 +- packages/theme/styles/_colors.scss | 2 + packages/theme/styles/_layouts.scss | 7 + packages/theme/styles/dialogs.scss | 31 +- packages/theme/styles/panel.scss | 5 +- packages/ui/src/components/Dialog.svelte | 173 ++++++----- packages/ui/src/components/Panel.svelte | 27 +- .../ui/src/components/icons/ArrowRight.svelte | 2 +- .../ui/src/components/icons/Circles.svelte | 51 +++- packages/ui/src/popups.ts | 2 +- .../src/components/MatchVacancy.svelte | 2 +- .../src/components/EditEnum.svelte | 14 +- .../src/components/EnumValues.svelte | 3 +- .../src/components/EnumValuesList.svelte | 46 +-- .../src/components/state/StatesEditor.svelte | 14 +- plugins/tracker-assets/lang/en.json | 1 + plugins/tracker-assets/lang/ru.json | 1 + .../components/issues/IssuePresenter.svelte | 5 +- .../src/components/issues/Move.svelte | 275 +++++++----------- .../components/issues/PriorityEditor.svelte | 3 +- .../components/issues/TitlePresenter.svelte | 6 +- .../issues/move/ComponentMovePresenter.svelte | 15 +- .../issues/move/SelectReplacement.svelte | 197 ++++++------- .../issues/move/StatusMovePresenter.svelte | 28 +- .../templates/DraftIssueChildList.svelte | 25 +- .../templates/IssueTemplateChildList.svelte | 25 +- .../components/workflow/StatusEditor.svelte | 109 ++++--- .../components/workflow/StatusInput.svelte | 4 +- .../workflow/StatusPresenter.svelte | 100 ++++--- .../src/components/workflow/Statuses.svelte | 116 ++++---- plugins/tracker-resources/src/index.ts | 4 +- plugins/tracker-resources/src/plugin.ts | 1 + .../src/components/DocNavLink.svelte | 2 +- .../src/components/PopupDialog.svelte | 18 +- .../inference/SourcePresenter.svelte | 2 +- .../src/components/list/ListItem.svelte | 12 +- .../components/list/SortableListItem.svelte | 4 +- tests/sanity/tests/tracker.spec.ts | 2 +- tools/apm/apm.js | 22 +- 45 files changed, 804 insertions(+), 808 deletions(-) diff --git a/packages/presentation/src/components/Card.svelte b/packages/presentation/src/components/Card.svelte index 6bbd3a0aef..86d741b9c0 100644 --- a/packages/presentation/src/components/Card.svelte +++ b/packages/presentation/src/components/Card.svelte @@ -18,7 +18,7 @@ import { Button, IconClose, Label, Scroller } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' import presentation from '..' - import { deviceOptionsStore as deviceInfo, resizeObserver } from '@hcengineering/ui' + import { deviceOptionsStore as deviceInfo, resizeObserver, IconBack } from '@hcengineering/ui' import IconForward from './icons/Forward.svelte' export let label: IntlString @@ -27,10 +27,16 @@ export let canSave: boolean = false export let okLabel: IntlString = presentation.string.Create export let onCancel: Function | undefined = undefined + export let backAction: () => Promise | void = () => {} + export let isBack: boolean = false export let fullSize: boolean = false - export let hideAttachments: boolean = false - export let hideSubheader: boolean = false + export let numberOfBlocks: number = 0 + export let thinHeader: boolean = false export let accentHeader: boolean = false + export let hideSubheader: boolean = false + export let hideContent: boolean = false + export let hideAttachments: boolean = false + export let hideFooter: boolean = false export let gap: string | undefined = undefined export let width: 'large' | 'medium' | 'small' | 'x-small' | 'menu' = 'large' export let noFade = false @@ -38,30 +44,40 @@ const dispatch = createEventDispatcher() let okProcessing = false + $: headerDivide = hideContent && numberOfBlocks > 1
{}} use:resizeObserver={() => { dispatch('changeContent') }} > -
+
{#if $$slots.header} {/if} - + {#if isBack} +
{/if} -
- - - -
+ {#if !hideContent} +
+ + + +
+ {/if} {#if $$slots.pool}
{/if} + {#if $$slots.blocks && numberOfBlocks} + {#if numberOfBlocks === 1} +
+ +
+ {:else} + + {#each [...Array(numberOfBlocks).keys()] as block} +
+ +
+ {/each} +
+ {/if} + {/if} {#if $$slots.attachments && !hideAttachments}
- +
{/if} - -
- - {#if $$slots.error} - - {/if} -
-
+ {/if} diff --git a/packages/presentation/src/components/IndexedDocumentCompare.svelte b/packages/presentation/src/components/IndexedDocumentCompare.svelte index e999d35816..4156e88be9 100644 --- a/packages/presentation/src/components/IndexedDocumentCompare.svelte +++ b/packages/presentation/src/components/IndexedDocumentCompare.svelte @@ -1,7 +1,6 @@ - - -
-
-
-
- -
- {#if right !== undefined} -
- -
- {/if} -
+ + +
+
+
+ {#if right !== undefined} +
+ +
+ {/if}
- +
diff --git a/packages/presentation/src/components/IndexedDocumentContent.svelte b/packages/presentation/src/components/IndexedDocumentContent.svelte index 904ead2d79..982085f059 100644 --- a/packages/presentation/src/components/IndexedDocumentContent.svelte +++ b/packages/presentation/src/components/IndexedDocumentContent.svelte @@ -45,7 +45,7 @@ {#if summary} {#if search.length > 0} - Result: + Result: {#each summary.split('\n').filter((line, idx, arr) => { return line.toLowerCase().includes(search.toLowerCase()) || arr[idx - 1] ?.toLowerCase() @@ -55,7 +55,7 @@ {/each}
{/if} - Summary: + Summary: {#each summary.split('\n') as line} {@const hl = search.length > 0 && line.toLowerCase().includes(search.toLowerCase())} {line} @@ -75,7 +75,7 @@ {#each attr[1] as doc}
1}> {#if search.length > 0} - Result: + Result: {#each doc.filter((line) => line.toLowerCase().includes(search.toLowerCase())) as line} {line} {/each} @@ -93,6 +93,6 @@ diff --git a/packages/presentation/src/components/IndexedDocumentPreview.svelte b/packages/presentation/src/components/IndexedDocumentPreview.svelte index ec74fbcc40..25c160eb22 100644 --- a/packages/presentation/src/components/IndexedDocumentPreview.svelte +++ b/packages/presentation/src/components/IndexedDocumentPreview.svelte @@ -1,7 +1,7 @@ - { @@ -76,19 +74,13 @@ {#if contentType && contentType.startsWith('image/')} -
+
-
{:else} -