From 4e44e6b76b03f6f11ec65c523faa38e9a65cf6e8 Mon Sep 17 00:00:00 2001 From: Sergei Ogorelkov Date: Wed, 25 May 2022 13:09:58 +0700 Subject: [PATCH] Tracker: Add "Parent Issue" control to the "Edit Issue" dialog (#1857) Signed-off-by: Sergei Ogorelkov --- packages/theme/styles/popups.scss | 3 + packages/ui/src/components/SelectPopup.svelte | 16 +- packages/ui/src/components/Tooltip.svelte | 3 + plugins/tracker-assets/lang/en.json | 4 +- .../src/components/issues/ParentIssue.svelte | 16 +- .../components/issues/edit/EditIssue.svelte | 50 ++++-- .../issues/edit/SubIssueSelector.svelte | 167 ++++++++++++++++++ plugins/tracker-resources/src/plugin.ts | 2 + 8 files changed, 241 insertions(+), 20 deletions(-) create mode 100644 plugins/tracker-resources/src/components/issues/edit/SubIssueSelector.svelte diff --git a/packages/theme/styles/popups.scss b/packages/theme/styles/popups.scss index 2ea81c08b5..de5275828b 100644 --- a/packages/theme/styles/popups.scss +++ b/packages/theme/styles/popups.scss @@ -36,6 +36,9 @@ max-width: 40rem !important; width: 40rem !important; } + &.max-width-40 { + max-width: 40rem !important; + } .header { border-bottom: 1px solid var(--popup-divider); diff --git a/packages/ui/src/components/SelectPopup.svelte b/packages/ui/src/components/SelectPopup.svelte index 7ec91032e6..f6b899bb51 100644 --- a/packages/ui/src/components/SelectPopup.svelte +++ b/packages/ui/src/components/SelectPopup.svelte @@ -16,12 +16,13 @@ import type { Asset, IntlString } from '@anticrm/platform' import { translate } from '@anticrm/platform' import { createEventDispatcher } from 'svelte' - import { Icon, Label } from '..' + import { Icon, Label, IconCheck } from '..' export let placeholder: IntlString | undefined = undefined export let placeholderParam: any | undefined = undefined export let searchable: boolean = false - export let value: Array<{ id: number | string; icon: Asset; label?: IntlString; text?: string }> + export let value: Array<{ id: number | string; icon: Asset; label?: IntlString; text?: string; isSelected?: boolean }> + export let width: 'medium' | 'large' = 'medium' let search: string = '' @@ -33,9 +34,11 @@ } const dispatch = createEventDispatcher() + + $: hasSelected = value.some((v) => v.isSelected) -
+
{#if searchable}
{}} on:change /> @@ -50,6 +53,13 @@ dispatch('close', item.id) }} > + {#if hasSelected} +
+ {#if item.isSelected} + + {/if} +
+ {/if}
{#if item.label} diff --git a/packages/ui/src/components/Tooltip.svelte b/packages/ui/src/components/Tooltip.svelte index 18dfd71ee2..8847111cfa 100644 --- a/packages/ui/src/components/Tooltip.svelte +++ b/packages/ui/src/components/Tooltip.svelte @@ -14,6 +14,7 @@ -->
import { createQuery } from '@anticrm/presentation' import { Team, Issue } from '@anticrm/tracker' - import { Spinner, IconClose } from '@anticrm/ui' + import { Spinner, IconClose, Tooltip } from '@anticrm/ui' import { createEventDispatcher } from 'svelte' import tracker from '../../plugin' @@ -37,9 +37,11 @@ {/if} {issue.title} -
dispatch('close')}> - -
+ +
dispatch('close')}> + +
+
diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts index 7efd2f120a..a8ceab2344 100644 --- a/plugins/tracker-resources/src/plugin.ts +++ b/plugins/tracker-resources/src/plugin.ts @@ -90,6 +90,8 @@ export default mergeIds(trackerId, tracker, { SetParent: '' as IntlString, ChangeParent: '' as IntlString, RemoveParent: '' as IntlString, + OpenParent: '' as IntlString, + OpenSub: '' as IntlString, BlockedBy: '' as IntlString, RelatedTo: '' as IntlString, Comments: '' as IntlString,