diff --git a/packages/ui/src/components/SelectPopup.svelte b/packages/ui/src/components/SelectPopup.svelte index e97f7e9918..3011848ebd 100644 --- a/packages/ui/src/components/SelectPopup.svelte +++ b/packages/ui/src/components/SelectPopup.svelte @@ -26,6 +26,7 @@ interface ValueType { id: number | string icon?: Asset + iconColor?: string label?: IntlString text?: string isSelected?: boolean @@ -118,7 +119,7 @@ {/if} {#if item.icon}
- +
{/if} diff --git a/plugins/tracker-assets/assets/icons.svg b/plugins/tracker-assets/assets/icons.svg index ffb94f33fa..5ce87ed628 100644 --- a/plugins/tracker-assets/assets/icons.svg +++ b/plugins/tracker-assets/assets/icons.svg @@ -52,21 +52,21 @@ - + - + - + - + - + diff --git a/plugins/tracker-resources/src/components/SelectIssuePopup.svelte b/plugins/tracker-resources/src/components/SelectIssuePopup.svelte index bdbfd396a9..0811a67bc1 100644 --- a/plugins/tracker-resources/src/components/SelectIssuePopup.svelte +++ b/plugins/tracker-resources/src/components/SelectIssuePopup.svelte @@ -3,9 +3,9 @@ import { IntlString } from '@anticrm/platform' import { ObjectPopup } from '@anticrm/presentation' import { Issue } from '@anticrm/tracker' - import { Icon } from '@anticrm/ui' import { getIssueId } from '../issues' import tracker from '../plugin' + import IssueStatusIcon from './issues/IssueStatusIcon.svelte' export let docQuery: DocumentQuery | undefined = undefined export let ignoreObjects: Ref[] | undefined = undefined @@ -34,13 +34,14 @@ on:close > - {@const { icon } = issue.$lookup?.status.$lookup?.category ?? {}} {@const issueId = getIssueId(issue.$lookup.space, issue)} - {#if issueId && icon} + {#if issueId}
-
- -
+ {#if issue?.$lookup?.status} +
+ +
+ {/if} {issueId} {issue.title}
diff --git a/plugins/tracker-resources/src/components/SetParentIssueActionPopup.svelte b/plugins/tracker-resources/src/components/SetParentIssueActionPopup.svelte index 44899bcb81..0e96819db1 100644 --- a/plugins/tracker-resources/src/components/SetParentIssueActionPopup.svelte +++ b/plugins/tracker-resources/src/components/SetParentIssueActionPopup.svelte @@ -15,11 +15,11 @@ - {@const { icon } = statusCategoryById?.get(issue.$lookup?.status.category) ?? {}} {@const issueId = getIssueId(issue.$lookup.space, issue)} - {#if issueId && icon} + {#if issueId}
-
- -
+ {#if issue?.$lookup?.status} +
+ +
+ {/if} {issueId} {issue.title}
diff --git a/plugins/tracker-resources/src/components/issues/Board.svelte b/plugins/tracker-resources/src/components/issues/Board.svelte index 407bf1237e..22bd185a19 100644 --- a/plugins/tracker-resources/src/components/issues/Board.svelte +++ b/plugins/tracker-resources/src/components/issues/Board.svelte @@ -18,7 +18,7 @@ import { Kanban, TypeState } from '@anticrm/kanban' import { createQuery } from '@anticrm/presentation' import type { Issue, IssueStatus, Team } from '@anticrm/tracker' - import { Button, Icon, IconAdd, showPopup, showPanel, Component } from '@anticrm/ui' + import { Button, Icon, IconAdd, showPopup, showPanel, Component, getPlatformColor } 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' @@ -110,7 +110,6 @@
- + {state.title} {count}
diff --git a/plugins/tracker-resources/src/components/issues/IssueStatusIcon.svelte b/plugins/tracker-resources/src/components/issues/IssueStatusIcon.svelte new file mode 100644 index 0000000000..fd981ee223 --- /dev/null +++ b/plugins/tracker-resources/src/components/issues/IssueStatusIcon.svelte @@ -0,0 +1,48 @@ + + + +{#if icon !== undefined && color !== undefined} + +{/if} diff --git a/plugins/tracker-resources/src/components/issues/KanbanView.svelte b/plugins/tracker-resources/src/components/issues/KanbanView.svelte index bcc84815ac..a345de6c3b 100644 --- a/plugins/tracker-resources/src/components/issues/KanbanView.svelte +++ b/plugins/tracker-resources/src/components/issues/KanbanView.svelte @@ -19,7 +19,7 @@ import notification from '@anticrm/notification' import { createQuery, getClient } from '@anticrm/presentation' import { Issue, IssuesGrouping, IssuesOrdering, IssueStatus, Team, ViewOptions } from '@anticrm/tracker' - import { Button, Component, Icon, IconAdd, showPanel, showPopup } from '@anticrm/ui' + import { Button, Component, Icon, IconAdd, showPanel, showPopup, getPlatformColor } 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' @@ -139,7 +139,7 @@
- + {state.title} {count}
diff --git a/plugins/tracker-resources/src/components/issues/StatusEditor.svelte b/plugins/tracker-resources/src/components/issues/StatusEditor.svelte index 2461189be4..c08162fd1a 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, Icon } from '@anticrm/ui' + import { Button, showPopup, SelectPopup, TooltipAlignment, eventToHTMLElement, getPlatformColor } from '@anticrm/ui' import type { ButtonKind, ButtonSize } from '@anticrm/ui' import tracker from '../../plugin' + import IssueStatusIcon from './IssueStatusIcon.svelte' export let value: Issue | AttachedData export let statuses: WithLookup[] | undefined = undefined @@ -62,9 +63,17 @@ } $: selectedStatus = statuses?.find((status) => status._id === value.status) ?? statuses?.[0] - $: selectedStatusIcon = selectedStatus?.$lookup?.category?.icon $: selectedStatusLabel = shouldShowLabel ? selectedStatus?.name : undefined - $: statusesInfo = statuses?.map((s) => ({ id: s._id, text: s.name, color: s.color, icon: s.$lookup?.category?.icon })) + $: statusesInfo = statuses?.map((s) => { + const color = s.color ?? s.$lookup?.category?.color + + return { + id: s._id, + text: s.name, + icon: s.$lookup?.category?.icon, + ...(color !== undefined ? { iconColor: getPlatformColor(color) } : undefined) + } + }) $: if (!statuses) { const query = '_id' in value ? { attachedTo: value.space } : {} statusesQuery.query( @@ -85,7 +94,7 @@ {#if kind === 'list'}
- {#if selectedStatusIcon}{/if} + {#if selectedStatus}{/if}
{#if selectedStatusLabel} @@ -93,10 +102,9 @@ {/if}
- {:else if selectedStatusLabel} + {:else} - {:else} -