From 7ea1707bc67a4b6d4f8e3d052decae75bad6ce39 Mon Sep 17 00:00:00 2001 From: Sergei Ogorelkov Date: Fri, 3 Jun 2022 19:12:19 +0700 Subject: [PATCH 1/4] Add "Create Sub-issue" component Signed-off-by: Sergei Ogorelkov --- .../src/components/CreateIssue.svelte | 43 +++--- .../components/issues/AssigneeEditor.svelte | 32 +++-- .../src/components/issues/StatusEditor.svelte | 23 ++- .../issues/edit/CreateSubIssue.svelte | 131 ++++++++++++++++++ .../components/issues/edit/EditIssue.svelte | 4 +- .../components/issues/edit/SubIssues.svelte | 50 ++++--- 6 files changed, 215 insertions(+), 68 deletions(-) create mode 100644 plugins/tracker-resources/src/components/issues/edit/CreateSubIssue.svelte diff --git a/plugins/tracker-resources/src/components/CreateIssue.svelte b/plugins/tracker-resources/src/components/CreateIssue.svelte index 78280eb0c82..df2f3faa7dc 100644 --- a/plugins/tracker-resources/src/components/CreateIssue.svelte +++ b/plugins/tracker-resources/src/components/CreateIssue.svelte @@ -13,9 +13,9 @@ // limitations under the License. --> {#if value} - + handleAssigneeChanged(detail)} diff --git a/plugins/tracker-resources/src/components/issues/StatusEditor.svelte b/plugins/tracker-resources/src/components/issues/StatusEditor.svelte index 6b1b8844967..46c88979c06 100644 --- a/plugins/tracker-resources/src/components/issues/StatusEditor.svelte +++ b/plugins/tracker-resources/src/components/issues/StatusEditor.svelte @@ -13,7 +13,8 @@ // limitations under the License. --> {#if value} {#if isEditable} - + + + +
+
+ (issue.status = detail)} + /> +
+ +
+ +
+
+
+
+
+ + (issue.assignee = detail)} + /> +
+
+
+
+
+ + diff --git a/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte b/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte index b802047404c..0c1d382bef2 100644 --- a/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte +++ b/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte @@ -241,7 +241,9 @@ {/if}
- + {#key issue._id} + + {/key}
{/if} diff --git a/plugins/tracker-resources/src/components/issues/edit/SubIssues.svelte b/plugins/tracker-resources/src/components/issues/edit/SubIssues.svelte index ae7037fd696..00bcf49acb1 100644 --- a/plugins/tracker-resources/src/components/issues/edit/SubIssues.svelte +++ b/plugins/tracker-resources/src/components/issues/edit/SubIssues.svelte @@ -16,10 +16,11 @@ import { SortingOrder, WithLookup } from '@anticrm/core' import { createQuery, getClient } from '@anticrm/presentation' import { calcRank, Issue, IssueStatus } from '@anticrm/tracker' - import { Button, Spinner, ExpandCollapse } from '@anticrm/ui' + import { Button, Spinner, ExpandCollapse, Tooltip, closeTooltip, IconAdd } from '@anticrm/ui' import tracker from '../../../plugin' import Collapsed from '../../icons/Collapsed.svelte' import Expanded from '../../icons/Expanded.svelte' + import CreateSubIssue from './CreateSubIssue.svelte' import SubIssueList from './SubIssueList.svelte' export let issue: Issue @@ -30,7 +31,7 @@ let subIssues: Issue[] | undefined let isCollapsed = false - // let isCreating = false + let isCreating = false async function handleIssueSwap (ev: CustomEvent<{ fromIndex: number; toIndex: number }>) { if (subIssues) { @@ -60,11 +61,14 @@ kind="transparent" label={tracker.string.SubIssues} labelParams={{ subIssues: issue.subIssues }} - on:click={() => (isCollapsed = !isCollapsed)} + on:click={() => { + isCollapsed = !isCollapsed + isCreating = false + }} /> {/if} - +
-{#if hasSubIssues} -
- {#if subIssues && issueStatuses} -
- +
+ {#if subIssues && issueStatuses} + + {#if hasSubIssues} +
- -
- {:else} -
- -
- {/if} -
-{/if} +
+ {/if} + + + {#if isCreating} +
+ (isCreating = false)} /> +
+ {/if} +
+ {:else} +
+ +
+ {/if} +