diff --git a/plugins/task-resources/src/components/StatusFilter.svelte b/plugins/task-resources/src/components/StatusFilter.svelte index d75df2bc7a..d556fd5cca 100644 --- a/plugins/task-resources/src/components/StatusFilter.svelte +++ b/plugins/task-resources/src/components/StatusFilter.svelte @@ -94,12 +94,19 @@ ).map((p) => [p._id, p]) ) for (const status of statusStore.values()) { - if (hierarchy.isDerived(status._class, targetClass) && status.ofAttribute === filter.key.attribute._id) { - if (prjStatuses.size > 0 && !prjStatuses.has(status._id)) { - continue + if (prjStatuses.size > 0 && !prjStatuses.has(status._id)) { + continue + } + if (hierarchy.isDerived(status._class, targetClass)) { + if (selectedProjectType === undefined) { + if (status.ofAttribute === filter.key.attribute._id) { + statuses.push(status) + targets.add(status._id) + } + } else { + statuses.push(status) + targets.add(status._id) } - statuses.push(status) - targets.add(status._id) } } statuses = statuses.filter((it, idx, arr) => arr.findIndex((q) => q._id === it._id) === idx) diff --git a/plugins/task-resources/src/components/TypesView.svelte b/plugins/task-resources/src/components/TypesView.svelte index d1c273a916..29646fe35b 100644 --- a/plugins/task-resources/src/components/TypesView.svelte +++ b/plugins/task-resources/src/components/TypesView.svelte @@ -107,7 +107,7 @@
- +
diff --git a/plugins/task-resources/src/components/state/StatePresenter.svelte b/plugins/task-resources/src/components/state/StatePresenter.svelte index 98b28607c5..e199150fac 100644 --- a/plugins/task-resources/src/components/state/StatePresenter.svelte +++ b/plugins/task-resources/src/components/state/StatePresenter.svelte @@ -30,7 +30,7 @@ import view from '@hcengineering/view' import { statusStore } from '@hcengineering/view-resources' import { createEventDispatcher, onMount } from 'svelte' - import { typeStore } from '../..' + import { selectedTypeStore, typeStore } from '../..' import IconBacklog from '../icons/IconBacklog.svelte' import IconCanceled from '../icons/IconCanceled.svelte' import IconCompleted from '../icons/IconCompleted.svelte' @@ -48,7 +48,7 @@ export let accent: boolean = false export let shrink: number = 0 export let space: Ref | undefined = undefined - export let projectType: Ref | undefined = undefined + export let projectType: Ref | undefined = $selectedTypeStore export let taskType: Ref | undefined = undefined export let size: IconSize = 'small' export let kind: 'table-attrs' | undefined = undefined @@ -71,6 +71,10 @@ type = types.get(projectType) return } + if (space === undefined) { + type = undefined + return + } const _space = await client.findOne(task.class.Project, { _id: space }) if (_space === undefined) { type = undefined