UBERF-6000: fix statuses filtering and icons (#4966)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2024-03-14 19:33:47 +05:00 committed by GitHub
parent 0b89fac214
commit ca208fc324
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 8 deletions

View File

@ -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)

View File

@ -107,7 +107,7 @@
<SearchEdit bind:value={search} />
<!-- <ActionIcon icon={IconMoreH} size={'small'} /> -->
<div class="buttons-divider" />
<FilterButton {_class} />
<FilterButton {_class} {space} />
</div>
<div class="ac-header-full medium-gap">
<ViewletSettingButton bind:viewOptions bind:viewlet />

View File

@ -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<Project> | undefined = undefined
export let projectType: Ref<ProjectType> | undefined = undefined
export let projectType: Ref<ProjectType> | undefined = $selectedTypeStore
export let taskType: Ref<TaskType> | 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