From f2a92ac913b90517806dfbd5bc173a0c9556d174 Mon Sep 17 00:00:00 2001 From: Artyom Grigorovich Date: Wed, 13 Apr 2022 21:24:50 +0700 Subject: [PATCH 01/10] Fix typo Signed-off-by: Artyom Grigorovich --- packages/presentation/src/components/UserBox.svelte | 4 ++-- packages/ui/src/components/ActionIcon.svelte | 4 ++-- packages/ui/src/components/Dropdown.svelte | 4 ++-- packages/ui/src/components/Tooltip.svelte | 4 ++-- packages/ui/src/components/TooltipInstance.svelte | 4 ++-- packages/ui/src/index.ts | 5 ++++- packages/ui/src/tooltips.ts | 4 ++-- packages/ui/src/types.ts | 4 ++-- .../src/components/OrganizationSelector.svelte | 4 ++-- 9 files changed, 20 insertions(+), 17 deletions(-) diff --git a/packages/presentation/src/components/UserBox.svelte b/packages/presentation/src/components/UserBox.svelte index fa079d085d..2a7c31d231 100644 --- a/packages/presentation/src/components/UserBox.svelte +++ b/packages/presentation/src/components/UserBox.svelte @@ -18,7 +18,7 @@ import contact, { Contact, formatName } from '@anticrm/contact' import type { Class, Ref } from '@anticrm/core' import type { IntlString } from '@anticrm/platform' - import type { TooltipAligment } from '@anticrm/ui' + import type { TooltipAlignment } from '@anticrm/ui' import { Button, Label, showPopup, Tooltip } from '@anticrm/ui' import { createEventDispatcher } from 'svelte' import presentation from '..' @@ -39,7 +39,7 @@ export let size: 'small' | 'medium' | 'large' | 'x-large' = 'small' export let justify: 'left' | 'center' = 'center' export let width: string | undefined = undefined - export let labelDirection: TooltipAligment | undefined = undefined + export let labelDirection: TooltipAlignment | undefined = undefined const dispatch = createEventDispatcher() diff --git a/packages/ui/src/components/ActionIcon.svelte b/packages/ui/src/components/ActionIcon.svelte index caa25bebbf..26afab2509 100644 --- a/packages/ui/src/components/ActionIcon.svelte +++ b/packages/ui/src/components/ActionIcon.svelte @@ -15,14 +15,14 @@ + +{#if formattedDate} +
+
+ +
+
+
+
+
+
+
+
+{/if} + + From 5cc8f02f929d2f8f6403613061a63319d4aced34 Mon Sep 17 00:00:00 2001 From: Artyom Grigorovich Date: Wed, 13 Apr 2022 21:27:59 +0700 Subject: [PATCH 06/10] Add DueDatePresenter Signed-off-by: Artyom Grigorovich --- .../components/issues/DueDatePresenter.svelte | 89 +++++++++++++++++++ plugins/tracker-resources/src/index.ts | 2 + 2 files changed, 91 insertions(+) create mode 100644 plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte diff --git a/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte b/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte new file mode 100644 index 0000000000..ab4ff560fe --- /dev/null +++ b/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte @@ -0,0 +1,89 @@ + + + +{#if shouldRenderPresenter} + + + +{/if} diff --git a/plugins/tracker-resources/src/index.ts b/plugins/tracker-resources/src/index.ts index 5fa780183f..7541089a4c 100644 --- a/plugins/tracker-resources/src/index.ts +++ b/plugins/tracker-resources/src/index.ts @@ -29,6 +29,7 @@ import IssuePresenter from './components/issues/IssuePresenter.svelte' import TitlePresenter from './components/issues/TitlePresenter.svelte' import PriorityPresenter from './components/issues/PriorityPresenter.svelte' import StatusPresenter from './components/issues/StatusPresenter.svelte' +import DueDatePresenter from './components/issues/DueDatePresenter.svelte' import AssigneePresenter from './components/issues/AssigneePresenter.svelte' import ModificationDatePresenter from './components/issues/ModificationDatePresenter.svelte' @@ -52,6 +53,7 @@ export default async (): Promise => ({ PriorityPresenter, StatusPresenter, AssigneePresenter, + DueDatePresenter, EditIssue, NewIssueHeader } From 3b4d33b7031dfaa2196e496f38439fe65b51a0b7 Mon Sep 17 00:00:00 2001 From: Artyom Grigorovich Date: Wed, 13 Apr 2022 21:28:25 +0700 Subject: [PATCH 07/10] Refactor IssuesList Signed-off-by: Artyom Grigorovich --- .../issues/CategoryPresenter.svelte | 7 +- .../src/components/issues/IssuesList.svelte | 145 ++++++++++-------- 2 files changed, 88 insertions(+), 64 deletions(-) diff --git a/plugins/tracker-resources/src/components/issues/CategoryPresenter.svelte b/plugins/tracker-resources/src/components/issues/CategoryPresenter.svelte index 431e7b5e2c..0d01079163 100644 --- a/plugins/tracker-resources/src/components/issues/CategoryPresenter.svelte +++ b/plugins/tracker-resources/src/components/issues/CategoryPresenter.svelte @@ -49,11 +49,14 @@ > export let baseMenuClass: Ref> | undefined = undefined - export let config: (BuildModelKey | string)[] + export let leftItemsConfig: (BuildModelKey | string)[] + export let rightItemsConfig: (BuildModelKey | string)[] | undefined = undefined export let options: FindOptions | undefined = undefined export let query: DocumentQuery @@ -92,13 +94,20 @@ return props.length } + + const buildItemModels = async () => { + const leftModels = await buildModel({ client, _class, keys: leftItemsConfig, options }) + const rightModels = rightItemsConfig && (await buildModel({ client, _class, keys: rightItemsConfig, options })) + + return { leftModels, rightModels } + } -{#await buildModel({ client, _class, keys: config, options })} +{#await buildItemModels()} {#if !isLoading} {/if} -{:then attributeModels} +{:then itemModels}
{#if docObjects} {#each docObjects as docObject, rowIndex (docObject._id)} @@ -107,65 +116,80 @@ class:mListGridChecked={selectedIssueIds.has(docObject._id)} class:mListGridFixed={rowIndex === selectedRowIndex} > - {#each attributeModels as attributeModel, attributeModelIndex} - {#if attributeModelIndex === 0} -
-
- { - handleIssueSelected(docObject._id, event) - }} +
+ {#each itemModels.leftModels as attributeModel, attributeModelIndex} + {#if attributeModelIndex === 0} +
+ +
+ { + handleIssueSelected(docObject._id, event) + }} + /> +
+
+
+ +
+
+ {:else if attributeModelIndex === 1} +
+ +
showMenu(event, docObject, rowIndex)} + > + +
-
+ {:else} +
-
- {:else if attributeModelIndex === 1} -
- -
showMenu(event, docObject, rowIndex)} - > - + {/if} + {/each} +
+ {#if itemModels.rightModels} +
+ {#each itemModels.rightModels as attributeModel} +
+
-
- {:else} -
- -
- {/if} - {/each} + {/each} +
+ {/if}
{/each} {:else if loadingProps !== undefined} {#each Array(getLoadingElementsLength(loadingProps, options)) as _, rowIndex}
- {#each attributeModels as _, attributeModelIndex} - {#if attributeModelIndex === 0} -
- -
- -
+
+
+ +
+
- {/if} - {/each} +
+
{/each} {/if} @@ -182,8 +206,9 @@ } .listGrid { - display: grid; - grid-template-columns: 4rem 5rem 2rem auto 4rem 2rem; + display: flex; + align-items: center; + justify-content: space-between; height: 3.25rem; color: var(--theme-caption-color); border-bottom: 1px solid var(--theme-button-border-hovered); @@ -203,7 +228,7 @@ } &.mListGridIsLoading { - grid-template-columns: auto; + justify-content: flex-start; } &:hover { @@ -225,24 +250,20 @@ } } - .checkBox { + .modelsContainer { display: flex; align-items: center; - justify-content: center; - padding: 0.03rem; - border-radius: 0.25rem; - background-color: rgba(247, 248, 248, 0.5); - opacity: 0; - - &:hover { - opacity: 1; - } } .gridElement { display: flex; align-items: center; justify-content: start; + margin-left: 0.5rem; + + &:first-child { + margin-left: 0; + } } .priorityPresenter { @@ -252,7 +273,7 @@ .issuePresenter { display: flex; align-items: center; - padding-right: 1rem; + margin-left: 0.5rem; .eIssuePresenterContextMenu { visibility: hidden; From 903debe77914e70f3ae1aa8fff0362a77b04e230 Mon Sep 17 00:00:00 2001 From: Artyom Grigorovich Date: Wed, 13 Apr 2022 21:28:47 +0700 Subject: [PATCH 08/10] Add date value binding Signed-off-by: Artyom Grigorovich --- plugins/tracker-resources/src/components/CreateIssue.svelte | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/tracker-resources/src/components/CreateIssue.svelte b/plugins/tracker-resources/src/components/CreateIssue.svelte index 2538126653..36f1915d26 100644 --- a/plugins/tracker-resources/src/components/CreateIssue.svelte +++ b/plugins/tracker-resources/src/components/CreateIssue.svelte @@ -92,8 +92,6 @@ { icon: tracker.icon.Parent, label: tracker.string.Parent } ] - let issueDate: number | null = null - const handlePriorityChanged = (newPriority: IssuePriority | undefined) => { if (newPriority === undefined) { return @@ -167,7 +165,7 @@ size="small" kind="no-border" /> - +