mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-23 03:49:49 +00:00
Minor states fixes (#3693)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
c7fe158dfd
commit
243befe81d
@ -15,10 +15,13 @@
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Ref, Status, StatusValue } from '@hcengineering/core'
|
||||
import { DoneState, SpaceWithStates } from '@hcengineering/task'
|
||||
import { Label } from '@hcengineering/ui'
|
||||
import { statusStore } from '@hcengineering/view-resources'
|
||||
import type { DoneState, SpaceWithStates } from '@hcengineering/task'
|
||||
import DoneStatePresenter from './DoneStatePresenter.svelte'
|
||||
import task from '../../plugin'
|
||||
import Unknown from '../icons/Unknown.svelte'
|
||||
import DoneStateEditor from './DoneStateEditor.svelte'
|
||||
import DoneStatePresenter from './DoneStatePresenter.svelte'
|
||||
|
||||
export let value: Ref<DoneState> | StatusValue
|
||||
export let space: Ref<SpaceWithStates> | undefined
|
||||
@ -34,4 +37,9 @@
|
||||
{:else}
|
||||
<DoneStatePresenter value={state} {showTitle} />
|
||||
{/if}
|
||||
{:else}
|
||||
<div class="flex-row-center pointer-events-none">
|
||||
<div class="content-dark-color mr-2"><Unknown size={'small'} /></div>
|
||||
<span class="overflow-label"><Label label={task.string.NoDoneState} /></span>
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -74,12 +74,12 @@
|
||||
for (const object of filter.value) {
|
||||
targets.add(object)
|
||||
}
|
||||
const isDone = hierarchy.isDerived(targetClass, task.class.DoneState)
|
||||
|
||||
if (space !== undefined) {
|
||||
const _space = await client.findOne(task.class.SpaceWithStates, { _id: space as Ref<SpaceWithStates> })
|
||||
if (_space) {
|
||||
const targetClass = (filter.key.attribute.type as RefTo<Status>).to
|
||||
const key = hierarchy.isDerived(targetClass, task.class.DoneState) ? 'doneStates' : 'states'
|
||||
const key = isDone ? 'doneStates' : 'states'
|
||||
values = (_space as any)[key].map((p: Ref<Status>) => statusStore.get(p)).filter((p: Status) => p !== undefined)
|
||||
for (const value of values) {
|
||||
targets.add(value?._id)
|
||||
@ -98,7 +98,7 @@
|
||||
}
|
||||
values = await sort(statuses)
|
||||
}
|
||||
if (targets.has(undefined)) {
|
||||
if (targets.has(undefined) || isDone) {
|
||||
values.unshift(undefined)
|
||||
}
|
||||
if (values.length !== targets.size) {
|
||||
|
@ -33,7 +33,7 @@
|
||||
if (attribute.attribute?.type._class === core.class.EnumOf) {
|
||||
return { ...clearAttributeProps, type: attribute.attribute.type, ...props }
|
||||
}
|
||||
return { object, ...clearAttributeProps, ...props }
|
||||
return { object, ...clearAttributeProps, space: object.space, ...props }
|
||||
}
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user