From a5a464a11267eeba305324282222ebca965eac0d Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Wed, 17 May 2023 02:47:21 -0700 Subject: [PATCH] USER-79: fixed the sidebar in the Panel. Update IssuePreview layout. (#3201) Signed-off-by: Alexander Platov --- packages/panel/src/components/Panel.svelte | 8 +- .../src/components/AttributesBar.svelte | 2 +- .../src/components/icons/Forward.svelte | 2 +- packages/presentation/src/index.ts | 1 + packages/theme/styles/_layouts.scss | 3 + packages/theme/styles/dialogs.scss | 2 +- packages/theme/styles/panel.scss | 76 +++++++--- packages/ui/src/components/Panel.svelte | 2 +- packages/ui/src/components/Scroller.svelte | 9 +- .../components/calendar/DatePresenter.svelte | 10 +- .../src/components/AttachmentList.svelte | 9 +- .../src/components/schedule/MonthView.svelte | 3 +- .../src/components/EditVacancy.svelte | 26 ++-- .../src/components/DueDateEditor.svelte | 12 +- .../components/ComponentBrowser.svelte | 13 +- .../components/EditComponent.svelte | 8 +- .../src/components/issues/Duration.svelte | 2 +- .../src/components/issues/IssuePreview.svelte | 137 ++++++++++-------- .../issues/IssueStatusActivity.svelte | 29 ++-- .../src/components/issues/IssuesView.svelte | 4 +- .../components/issues/edit/EditIssue.svelte | 20 +-- .../milestones/EditMilestone.svelte | 14 +- .../milestones/MilestoneBrowser.svelte | 20 ++- .../src/components/ActionHandler.svelte | 6 +- .../src/components/ClassAttributeBar.svelte | 2 +- .../src/components/EditDoc.svelte | 25 ++-- tests/sanity/tests/tracker.spec.ts | 2 +- tests/sanity/tests/tracker.utils.ts | 6 +- 28 files changed, 234 insertions(+), 219 deletions(-) diff --git a/packages/panel/src/components/Panel.svelte b/packages/panel/src/components/Panel.svelte index 15133f50ae..0e82bffe1f 100644 --- a/packages/panel/src/components/Panel.svelte +++ b/packages/panel/src/components/Panel.svelte @@ -165,9 +165,11 @@ {#if $$slots.actions}
{#if $$slots['actions-label']} - + + {:else if $$slots.actions} + {/if} -
+
@@ -177,7 +179,7 @@ {:else if $$slots.attributes}{/if} {#if $$slots.aside}{/if} -
+
diff --git a/packages/presentation/src/components/AttributesBar.svelte b/packages/presentation/src/components/AttributesBar.svelte index a48fad230a..71edbe4809 100644 --- a/packages/presentation/src/components/AttributesBar.svelte +++ b/packages/presentation/src/components/AttributesBar.svelte @@ -32,7 +32,7 @@ export let justify: 'left' | 'center' = 'left' -
+
{#each keys as key (typeof key === 'string' ? key : key.key)} {/each} diff --git a/packages/presentation/src/components/icons/Forward.svelte b/packages/presentation/src/components/icons/Forward.svelte index c027007dd1..a20f8a695b 100644 --- a/packages/presentation/src/components/icons/Forward.svelte +++ b/packages/presentation/src/components/icons/Forward.svelte @@ -13,7 +13,7 @@ // limitations under the License. --> diff --git a/packages/presentation/src/index.ts b/packages/presentation/src/index.ts index c3dea9eef1..dd48d8b1a9 100644 --- a/packages/presentation/src/index.ts +++ b/packages/presentation/src/index.ts @@ -38,6 +38,7 @@ export { default as IndexedDocumentPreview } from './components/IndexedDocumentP export { default as IndexedDocumentCompare } from './components/IndexedDocumentCompare.svelte' export { default as DraggableList } from './components/DraggableList.svelte' export { default as NavLink } from './components/NavLink.svelte' +export { default as IconForward } from './components/icons/Forward.svelte' export { default } from './plugin' export * from './types' export * from './utils' diff --git a/packages/theme/styles/_layouts.scss b/packages/theme/styles/_layouts.scss index b611674674..fc12825853 100644 --- a/packages/theme/styles/_layouts.scss +++ b/packages/theme/styles/_layouts.scss @@ -496,7 +496,9 @@ input.search { .pl-2 { padding-left: .5rem; } .pl-3 { padding-left: .75rem; } .pl-4 { padding-left: 1rem; } +.pl-7 { padding-left: 1.75rem; } .pl-8 { padding-left: 2rem; } +.pl-9 { padding-left: 2.25rem; } .pl-10 { padding-left: 2.5rem; } .pr-1 { padding-right: .25rem; } .pr-2 { padding-right: .5rem; } @@ -602,6 +604,7 @@ input.search { .h-7 { height: 1.75rem; } .h-8 { height: 2rem; } .h-9 { height: 2.25rem; } +.h-12 { height: 3rem; } .h-14 { height: 3.5rem; } .h-16 { height: 4rem; } .h-18 { height: 4.5rem; } diff --git a/packages/theme/styles/dialogs.scss b/packages/theme/styles/dialogs.scss index 0e3ce109ba..d55e7436d1 100644 --- a/packages/theme/styles/dialogs.scss +++ b/packages/theme/styles/dialogs.scss @@ -31,7 +31,7 @@ min-height: 0; background: var(--theme-popup-color); border-radius: .5rem; - box-shadow: var(--card-shadow); + box-shadow: var(--theme-popup-shadow); .antiCard-header { position: relative; diff --git a/packages/theme/styles/panel.scss b/packages/theme/styles/panel.scss index 6d72037178..eceac107ab 100644 --- a/packages/theme/styles/panel.scss +++ b/packages/theme/styles/panel.scss @@ -18,18 +18,38 @@ overflow: hidden; min-width: 400px; - background: var(--body-accent); - border: 1px solid var(--divider-color); + background-color: var(--theme-popup-color); + border: 1px solid var(--theme-popup-divider); border-radius: .5rem; flex-direction: row; - box-shadow: var(--popup-shadow); + box-shadow: var(--theme-popup-shadow); // left: 1rem; + &.float { + position: fixed; + display: flex; + flex-direction: column; + top: 5rem; + right: .5rem; + width: 42rem; + height: fit-content; + min-height: 0; + max-height: 32rem; + z-index: 500; + + .ap-header { + flex-shrink: 0; + padding: 1.5rem 1.75rem .5rem; + width: 100%; + min-width: 0; + min-height: 0; + } + } + .ac-header { &.highlight { background-color: var(--accent-bg-color); } &.divide { border-bottom: 1px solid var(--divider-color); } } - .ad-section-50 { display: flex; flex-direction: column; @@ -39,7 +59,6 @@ &.divide { border-right: 1px solid var(--divider-color); } } - .ad-tools { position: absolute; display: flex; @@ -58,18 +77,16 @@ .popupPanel { overflow: hidden; display: flex; - flex-direction: column; min-height: 0; height: 100%; - - &.embedded { + + &.rowContent { width: 100%; + min-width: 0; } - - &:not(.embedded) { - border-radius: .5rem; - // box-shadow: var(--popup-panel-shadow); - } + &:not(.rowContent) { flex-direction: column; } + &.embedded { width: 100%; } + &:not(.embedded) { border-radius: .5rem; } .popupPanel-title { display: flex; @@ -258,27 +275,29 @@ display: flex; align-items: center; flex-shrink: 0; - padding: .75rem 2rem; height: 3.5rem; min-height: 3.5rem; border-bottom: 1px solid var(--theme-divider-color); } - &-tabsheader { - padding: 0 2rem; + &-tabsheader { padding: 0 2rem; } + &-header { + justify-content: space-between; + padding: .75rem .75rem .75rem 2rem; } &-grid { display: grid; grid-template-columns: 1fr 1.5fr; - grid-auto-flow: row; + grid-auto-rows: minmax(2rem, max-content); justify-content: start; align-items: center; row-gap: .25rem; column-gap: 1rem; - margin: .5rem 2rem; + margin: .25rem 2rem 0; width: calc(100% - 4rem); height: min-content; + &.inCollapsed { margin: 1rem 2rem; } .divider { grid-column: 1 / 3; margin: .75rem -2rem; @@ -289,9 +308,24 @@ .labelTop { color: var(--theme-dark-color); } .labelTop { align-self: start; - margin-top: 0.385rem; - } - } + margin-top: 0.625rem; + } + .textPadding { margin-left: .875rem; } + } + &-content { + display: flex; + flex-direction: column; + width: 100%; + min-width: 0; + min-height: 0; + padding: 1.25rem 2rem; + } + .space-divider { + flex-shrink: 0; + height: .75rem; + + &.bottom { height: 1.25rem; } + } } // &.asideShown .popupPanel-body__main { diff --git a/packages/ui/src/components/Panel.svelte b/packages/ui/src/components/Panel.svelte index 270f7b6532..6df500c962 100644 --- a/packages/ui/src/components/Panel.svelte +++ b/packages/ui/src/components/Panel.svelte @@ -79,7 +79,7 @@
{ panelWidth = element.clientWidth diff --git a/packages/ui/src/components/Scroller.svelte b/packages/ui/src/components/Scroller.svelte index 4115ba7307..8b4285043c 100644 --- a/packages/ui/src/components/Scroller.svelte +++ b/packages/ui/src/components/Scroller.svelte @@ -32,6 +32,7 @@ export let invertScroll: boolean = false export let horizontal: boolean = false export let contentDirection: 'vertical' | 'vertical-reverse' | 'horizontal' = 'vertical' + export let gap: 'gap-1' | 'gap-1-5' | 'gap-2' | 'gap-3' | 'gap-around-2' | 'gap-around-4' | undefined = undefined export let noStretch: boolean = autoscroll export let buttons: 'normal' | 'union' | false = false export let shrink: boolean = false @@ -497,7 +498,7 @@ >
import { Attachment } from '@hcengineering/attachment' import { Ref } from '@hcengineering/core' + import { Scroller } from '@hcengineering/ui' import AttachmentPreview from './AttachmentPreview.svelte' export let attachments: Attachment[] = [] @@ -22,11 +23,9 @@ {#if attachments.length} -
+ {#each attachments as attachment} -
- -
+ {/each} -
+ {/if} diff --git a/plugins/hr-resources/src/components/schedule/MonthView.svelte b/plugins/hr-resources/src/components/schedule/MonthView.svelte index 93d23b3b34..bf9ac4f6ef 100644 --- a/plugins/hr-resources/src/components/schedule/MonthView.svelte +++ b/plugins/hr-resources/src/components/schedule/MonthView.svelte @@ -379,7 +379,8 @@ } tbody tr:not(:last-child), - thead th:first-child .fullfill { + thead th:first-child .fullfill, + tfoot tr { border-bottom: 1px solid var(--theme-bg-divider-color); } tfoot tr, diff --git a/plugins/recruit-resources/src/components/EditVacancy.svelte b/plugins/recruit-resources/src/components/EditVacancy.svelte index 5e9c6fe8d6..358323bd7c 100644 --- a/plugins/recruit-resources/src/components/EditVacancy.svelte +++ b/plugins/recruit-resources/src/components/EditVacancy.svelte @@ -120,21 +120,19 @@
{/if} + + + -
{#if dir === 'column'} import { getClient } from '@hcengineering/presentation' - import { DueDatePresenter } from '@hcengineering/ui' + import { DueDatePresenter, ButtonSize, ButtonKind } from '@hcengineering/ui' import { WithLookup } from '@hcengineering/core' import { Task } from '@hcengineering/task' export let object: WithLookup + export let width: string | undefined = undefined + export let size: ButtonSize = 'medium' + export let kind: ButtonKind = 'link' + export let editable: boolean = true const client = getClient() $: shouldIgnoreOverdue = object.doneState != null @@ -28,9 +32,11 @@ {#if object} handleDueDateChanged(e)} {shouldIgnoreOverdue} /> diff --git a/plugins/tracker-resources/src/components/components/ComponentBrowser.svelte b/plugins/tracker-resources/src/components/components/ComponentBrowser.svelte index 56424d2518..5a5c80e1da 100644 --- a/plugins/tracker-resources/src/components/components/ComponentBrowser.svelte +++ b/plugins/tracker-resources/src/components/components/ComponentBrowser.svelte @@ -114,7 +114,7 @@
- +
@@ -146,15 +146,8 @@ {/if}
-
-
- detail?.action?.()} - /> -
+
+ detail?.action?.()} />
-
-
- change('label', component.label)} /> -
+
+ change('label', component.label)} />
change('description', evt.detail)} />
-
+ diff --git a/plugins/tracker-resources/src/components/issues/Duration.svelte b/plugins/tracker-resources/src/components/issues/Duration.svelte index f534645477..8744006bac 100644 --- a/plugins/tracker-resources/src/components/issues/Duration.svelte +++ b/plugins/tracker-resources/src/components/issues/Duration.svelte @@ -47,6 +47,6 @@ $: formatTime(value) - + {time} diff --git a/plugins/tracker-resources/src/components/issues/IssuePreview.svelte b/plugins/tracker-resources/src/components/issues/IssuePreview.svelte index d68b58713c..1cc9aa7964 100644 --- a/plugins/tracker-resources/src/components/issues/IssuePreview.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuePreview.svelte @@ -18,9 +18,9 @@ import chunter from '@hcengineering/chunter' import { CommentPopup } from '@hcengineering/chunter-resources' import { Ref } from '@hcengineering/core' - import { createQuery, getClient, MessageViewer } from '@hcengineering/presentation' + import { createQuery, getClient, MessageViewer, IconForward } from '@hcengineering/presentation' import { Issue, Project } from '@hcengineering/tracker' - import { Label, resizeObserver, Scroller } from '@hcengineering/ui' + import { Label, Scroller, resizeObserver } from '@hcengineering/ui' import tracker from '../../plugin' import AssigneeEditor from './AssigneeEditor.svelte' import IssueStatusActivity from './IssueStatusActivity.svelte' @@ -50,8 +50,7 @@ $: issueName = currentProject && issue && `${currentProject.identifier}-${issue.number}` const limit: number = 350 - - let cHeight: number + let cHeight: number = 0 let parent: Issue | undefined @@ -66,73 +65,87 @@ $: getParent(issue?.attachedTo as Ref) -
- -
- {#if parent} -
{parent.title}
- {/if} - {#if issue} -
{issueName} {issue.title}
-
- - - {#if issue.assignee} - - {/if} -
- - -
-
- {#if issue.description} -
= limit} - use:resizeObserver={(element) => { - cHeight = element.clientHeight - }} - > - -
- {:else} -
-
- {/if} - {#if issue.attachments} -
-
-
- -
- {/if} - {#if issue.comments} -
-
-
- -
+{#if issue} +
+
+
+ {#if parent} + {parent.title} + {/if} + {issueName} +
+ {issue.title} +
+
+ +
+ + + {#if issue.assignee} + {/if}
+ +
+ +
+ +
+
+ {#if issue.description} +
limit} style:max-height={`${limit}px`}> +
(cHeight = element.clientHeight)}> + +
+
+ {:else} +
+
+ {/if} + {#if issue.attachments} +
+
+ + {/if} + {#if issue.comments} +
+
+ + {/if} +
-
+
+{/if} diff --git a/plugins/tracker-resources/src/components/issues/IssueStatusActivity.svelte b/plugins/tracker-resources/src/components/issues/IssueStatusActivity.svelte index 8453b8d310..795e9a054e 100644 --- a/plugins/tracker-resources/src/components/issues/IssueStatusActivity.svelte +++ b/plugins/tracker-resources/src/components/issues/IssueStatusActivity.svelte @@ -2,13 +2,14 @@ import core, { Ref, Timestamp, Tx, TxCollectionCUD, TxCreateDoc, TxUpdateDoc, WithLookup } from '@hcengineering/core' import { createQuery } from '@hcengineering/presentation' import { Issue, IssueStatus } from '@hcengineering/tracker' - import { Label, ticker } from '@hcengineering/ui' + import { Label, ticker, Row } from '@hcengineering/ui' import tracker from '../../plugin' import { statusStore } from '@hcengineering/presentation' import Duration from './Duration.svelte' import StatusPresenter from './StatusPresenter.svelte' export let issue: Issue + export let accentHeader: boolean = false const query = createQuery() @@ -86,20 +87,12 @@ $: updateStatus(txes, $statusStore.byId, $ticker) -
- - - {#each displaySt as st} - - - - - {/each} -
- - -
- -
-
-
+ + + + +{#each displaySt as st} + + +{/each} diff --git a/plugins/tracker-resources/src/components/issues/IssuesView.svelte b/plugins/tracker-resources/src/components/issues/IssuesView.svelte index 44301c1980..1debd5991d 100644 --- a/plugins/tracker-resources/src/components/issues/IssuesView.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuesView.svelte @@ -114,12 +114,12 @@ (resultQuery = e.detail)} /> -
+
{#if viewlet} {/if} {#if $$slots.aside !== undefined && asideShown} -
+
{/if} diff --git a/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte b/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte index ea31980170..61846bd39e 100644 --- a/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte +++ b/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte @@ -289,28 +289,14 @@ {#if issue && currentProject} +
{/if} -
-
+
+
{/if} - - diff --git a/plugins/tracker-resources/src/components/milestones/EditMilestone.svelte b/plugins/tracker-resources/src/components/milestones/EditMilestone.svelte index 1852463c27..675f361949 100644 --- a/plugins/tracker-resources/src/components/milestones/EditMilestone.svelte +++ b/plugins/tracker-resources/src/components/milestones/EditMilestone.svelte @@ -61,10 +61,8 @@
-
-
- -
+
+
{#if milestone?.capacity}
-
-
- change('label', milestone.label)} /> -
+
+ change('label', milestone.label)} />
change('description', evt.detail)} />
-
+ diff --git a/plugins/tracker-resources/src/components/milestones/MilestoneBrowser.svelte b/plugins/tracker-resources/src/components/milestones/MilestoneBrowser.svelte index 4bdfbfd36a..c6aa9e3662 100644 --- a/plugins/tracker-resources/src/components/milestones/MilestoneBrowser.svelte +++ b/plugins/tracker-resources/src/components/milestones/MilestoneBrowser.svelte @@ -147,17 +147,15 @@ {/if}
-
-
- { - if (result.detail !== undefined && result.detail.action) result.detail.action() - }} - /> -
+
+ { + if (result.detail !== undefined && result.detail.action) result.detail.action() + }} + />
{#if $previewDocument !== undefined && presenter} -
-
- -
+
+
{/if} diff --git a/plugins/view-resources/src/components/ClassAttributeBar.svelte b/plugins/view-resources/src/components/ClassAttributeBar.svelte index 87de89337f..31e0560eb6 100644 --- a/plugins/view-resources/src/components/ClassAttributeBar.svelte +++ b/plugins/view-resources/src/components/ClassAttributeBar.svelte @@ -104,7 +104,7 @@ display: flex; justify-content: space-between; align-items: center; - padding: 0 0.75rem; + padding: 0 0.125rem 0 0.75rem; font-weight: 600; color: var(--theme-dark-color); border-top: 1px solid var(--theme-divider-color); diff --git a/plugins/view-resources/src/components/EditDoc.svelte b/plugins/view-resources/src/components/EditDoc.svelte index 74326cf317..0eb175ecf9 100644 --- a/plugins/view-resources/src/components/EditDoc.svelte +++ b/plugins/view-resources/src/components/EditDoc.svelte @@ -300,21 +300,16 @@
- -
- -
+ +