diff --git a/packages/theme/styles/popups.scss b/packages/theme/styles/popups.scss index 4f3a0bdf57..2263b6ceaa 100644 --- a/packages/theme/styles/popups.scss +++ b/packages/theme/styles/popups.scss @@ -194,6 +194,7 @@ .antiPopup { display: flex; flex-direction: column; + width: auto; min-height: 0; min-width: 0; max-width: 30rem; diff --git a/packages/ui/src/components/ListView.svelte b/packages/ui/src/components/ListView.svelte index ba43a85615..e2674606b5 100644 --- a/packages/ui/src/components/ListView.svelte +++ b/packages/ui/src/components/ListView.svelte @@ -13,7 +13,7 @@ // limitations under the License. --> {#if count} diff --git a/packages/ui/src/components/Menu.svelte b/packages/ui/src/components/Menu.svelte index 8aeac0b21f..dd165be8c9 100644 --- a/packages/ui/src/components/Menu.svelte +++ b/packages/ui/src/components/Menu.svelte @@ -21,6 +21,7 @@ import Icon from './Icon.svelte' import Label from './Label.svelte' import MouseSpeedTracker from './MouseSpeedTracker.svelte' + import { resizeObserver } from '../resize' export let actions: Action[] = [] export let ctx: any = undefined @@ -66,7 +67,7 @@ } afterUpdate(() => { - dispatch('update', Date.now()) + dispatch('changeContent', true) }) onMount(() => { if (btns[0]) { @@ -110,7 +111,13 @@ $: popup?.focus() -
+
{ + dispatch('changeContent', true) + }} + on:keydown={keyDown} +>
diff --git a/packages/ui/src/components/PopupInstance.svelte b/packages/ui/src/components/PopupInstance.svelte index 13ffdbfc2c..e904ffca14 100644 --- a/packages/ui/src/components/PopupInstance.svelte +++ b/packages/ui/src/components/PopupInstance.svelte @@ -124,7 +124,9 @@ on:fullsize={() => { fullSize = !fullSize }} - on:changeContent={fitPopup} + on:changeContent={() => { + fitPopup() + }} />
diff --git a/packages/ui/src/components/SelectPopup.svelte b/packages/ui/src/components/SelectPopup.svelte index 3011848ebd..fafe95655c 100644 --- a/packages/ui/src/components/SelectPopup.svelte +++ b/packages/ui/src/components/SelectPopup.svelte @@ -14,7 +14,7 @@ --> @@ -83,6 +90,9 @@ class="selectPopup" class:full-width={width === 'full'} class:max-width-40={width === 'large'} + use:resizeObserver={() => { + dispatch('changeContent', true) + }} on:keydown={onKeydown} > {#if searchable} @@ -100,7 +110,12 @@ {/if}
- + dispatch('changeContent', true)} + > {@const item = filteredObjects[itemId]}
diff --git a/plugins/contact-resources/src/components/CreateContact.svelte b/plugins/contact-resources/src/components/CreateContact.svelte index d75879b605..cd6c23a021 100644 --- a/plugins/contact-resources/src/components/CreateContact.svelte +++ b/plugins/contact-resources/src/components/CreateContact.svelte @@ -1,11 +1,12 @@ - + dispatch('changeContent', true)} /> diff --git a/plugins/tracker-resources/src/components/icons/StatusIcon.svelte b/plugins/tracker-resources/src/components/icons/StatusIcon.svelte index 0552674e7e..0f5de9ab5b 100644 --- a/plugins/tracker-resources/src/components/icons/StatusIcon.svelte +++ b/plugins/tracker-resources/src/components/icons/StatusIcon.svelte @@ -1,45 +1,53 @@ - {#if status === 'backlog'} + {#if category._id === tracker.issueStatusCategory.Backlog} - {:else if status === 'unstarted'} + {:else if category._id === tracker.issueStatusCategory.Unstarted} - {:else if status === 'started'} + {:else if category._id === tracker.issueStatusCategory.Started} - - {:else if status === 'completed'} + {#if statusIcon.count && statusIcon.index} + + {:else} + + {/if} + {:else if category._id === tracker.issueStatusCategory.Completed} - {:else if status === 'canceled'} + {:else if category._id === tracker.issueStatusCategory.Canceled} -{#if icon !== undefined} - +{#if icon !== undefined && color !== undefined && category !== undefined} + {/if} diff --git a/plugins/tracker-resources/src/components/issues/KanbanView.svelte b/plugins/tracker-resources/src/components/issues/KanbanView.svelte index 2e3fd48195..5526749a7c 100644 --- a/plugins/tracker-resources/src/components/issues/KanbanView.svelte +++ b/plugins/tracker-resources/src/components/issues/KanbanView.svelte @@ -19,17 +19,7 @@ import notification from '@anticrm/notification' import { createQuery } from '@anticrm/presentation' import { Issue, IssuesGrouping, IssuesOrdering, IssueStatus, Team, ViewOptions } from '@anticrm/tracker' - import { - Button, - Component, - Icon, - IconAdd, - showPanel, - showPopup, - Loading, - tooltip, - getPlatformColor - } from '@anticrm/ui' + import { Button, Component, IconAdd, showPanel, showPopup, Loading, tooltip } from '@anticrm/ui' import { focusStore, ListSelectionProvider, SelectDirection, selectionStore } from '@anticrm/view-resources' import ActionContext from '@anticrm/view-resources/src/components/ActionContext.svelte' import Menu from '@anticrm/view-resources/src/components/Menu.svelte' @@ -40,8 +30,7 @@ getKanbanStatuses, getPriorityStates, issuesGroupBySorting, - issuesSortOrderMap, - UNSET_COLOR + issuesSortOrderMap } from '../../utils' import CreateIssue from '../CreateIssue.svelte' import ProjectEditor from '../projects/ProjectEditor.svelte' @@ -52,6 +41,7 @@ import PriorityEditor from './PriorityEditor.svelte' import StatusEditor from './StatusEditor.svelte' import tags from '@anticrm/tags' + import IssueStatusIcon from './IssueStatusIcon.svelte' export let currentSpace: Ref = tracker.team.DefaultTeam export let baseMenuClass: Ref> | undefined = undefined @@ -160,6 +150,9 @@ $: states = getIssueStates(groupBy, shouldShowEmptyGroups, issueStates, issueStatusStates, priorityStates) const fullFilled: { [key: string]: boolean } = {} + const getState = (state: any): WithLookup | undefined => { + return issueStatuses?.filter((is) => is._id === state._id)[0] + } {#if !states?.length} @@ -193,16 +186,11 @@ on:contextmenu={(evt) => showMenu(evt.detail.evt, evt.detail.objects)} > + {@const stateWLU = getState(state)}
- {#if state.icon} - - {/if} + {#if stateWLU !== undefined}{/if} {state.title} {count}
diff --git a/plugins/tracker-resources/src/components/issues/StatusEditor.svelte b/plugins/tracker-resources/src/components/issues/StatusEditor.svelte index c08162fd1a..cb14e97297 100644 --- a/plugins/tracker-resources/src/components/issues/StatusEditor.svelte +++ b/plugins/tracker-resources/src/components/issues/StatusEditor.svelte @@ -17,9 +17,10 @@ import { AttachedData, Ref, SortingOrder, WithLookup } from '@anticrm/core' import { Issue, IssueStatus } from '@anticrm/tracker' import { createQuery, getClient } from '@anticrm/presentation' - import { Button, showPopup, SelectPopup, TooltipAlignment, eventToHTMLElement, getPlatformColor } from '@anticrm/ui' + import { Button, showPopup, SelectPopup, TooltipAlignment, eventToHTMLElement } from '@anticrm/ui' import type { ButtonKind, ButtonSize } from '@anticrm/ui' import tracker from '../../plugin' + import StatusPresenter from './StatusPresenter.svelte' import IssueStatusIcon from './IssueStatusIcon.svelte' export let value: Issue | AttachedData @@ -64,14 +65,12 @@ $: selectedStatus = statuses?.find((status) => status._id === value.status) ?? statuses?.[0] $: selectedStatusLabel = shouldShowLabel ? selectedStatus?.name : undefined - $: statusesInfo = statuses?.map((s) => { - const color = s.color ?? s.$lookup?.category?.color - + $: statusesInfo = statuses?.map((s, i) => { return { id: s._id, - text: s.name, - icon: s.$lookup?.category?.icon, - ...(color !== undefined ? { iconColor: getPlatformColor(color) } : undefined) + component: StatusPresenter, + props: { value: s, size: 'small' }, + isSelected: selectedStatus?._id === s._id ?? false } }) $: if (!statuses) { @@ -112,12 +111,12 @@ {width} on:click={handleStatusEditorOpened} > - + {#if selectedStatus} {/if} {#if selectedStatusLabel} - {selectedStatusLabel} + {selectedStatusLabel} {/if} diff --git a/plugins/tracker-resources/src/components/issues/StatusPresenter.svelte b/plugins/tracker-resources/src/components/issues/StatusPresenter.svelte index 3cd8e56221..3955c7a16b 100644 --- a/plugins/tracker-resources/src/components/issues/StatusPresenter.svelte +++ b/plugins/tracker-resources/src/components/issues/StatusPresenter.svelte @@ -18,12 +18,13 @@ import IssueStatusIcon from './IssueStatusIcon.svelte' export let value: WithLookup | undefined + export let size: 'small' | 'medium' = 'medium' {#if value}
{#if value.$lookup?.category?.icon} - + {/if} {value.name} diff --git a/plugins/view-resources/src/components/Menu.svelte b/plugins/view-resources/src/components/Menu.svelte index bdf14df774..469f57b353 100644 --- a/plugins/view-resources/src/components/Menu.svelte +++ b/plugins/view-resources/src/components/Menu.svelte @@ -61,5 +61,5 @@ {#if loaded} - + dispatch('changeContent', true)} /> {/if}