mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 11:31:57 +03:00
TSK-1274: Fix Kanban live updates (#3024)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
fbb54dfe80
commit
e5e9b69365
@ -20,7 +20,7 @@ export function findProperty (objects: Doc[], propertyKey: string, value: any):
|
|||||||
const result: Doc[] = []
|
const result: Doc[] = []
|
||||||
for (const object of objects) {
|
for (const object of objects) {
|
||||||
const val = getObjectValue(propertyKey, object)
|
const val = getObjectValue(propertyKey, object)
|
||||||
if (val === value || isArrayValueCheck(val, value)) {
|
if (val === value || (val == null && value == null) || isArrayValueCheck(val, value)) {
|
||||||
result.push(object)
|
result.push(object)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,8 @@ import core, {
|
|||||||
Status,
|
Status,
|
||||||
StatusManager,
|
StatusManager,
|
||||||
StatusValue,
|
StatusValue,
|
||||||
TxOperations
|
TxOperations,
|
||||||
|
WithLookup
|
||||||
} from '@hcengineering/core'
|
} from '@hcengineering/core'
|
||||||
import type { IntlString } from '@hcengineering/platform'
|
import type { IntlString } from '@hcengineering/platform'
|
||||||
import { getResource } from '@hcengineering/platform'
|
import { getResource } from '@hcengineering/platform'
|
||||||
@ -622,8 +623,17 @@ export async function groupByStatusCategories (
|
|||||||
const existingCategories: StatusValue[] = []
|
const existingCategories: StatusValue[] = []
|
||||||
const statusMap = new Map<string, StatusValue>()
|
const statusMap = new Map<string, StatusValue>()
|
||||||
|
|
||||||
|
const usedSpaces = new Set<Ref<Space>>()
|
||||||
|
const statusesList: Array<WithLookup<Status>> = []
|
||||||
for (const v of categories) {
|
for (const v of categories) {
|
||||||
const status = mgr.byId.get(v)
|
const status = mgr.byId.get(v)
|
||||||
|
if (status !== undefined) {
|
||||||
|
statusesList.push(status)
|
||||||
|
usedSpaces.add(status.space)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const status of statusesList) {
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
let fst = statusMap.get(status.name.toLowerCase().trim())
|
let fst = statusMap.get(status.name.toLowerCase().trim())
|
||||||
if (fst === undefined) {
|
if (fst === undefined) {
|
||||||
@ -632,7 +642,7 @@ export async function groupByStatusCategories (
|
|||||||
(it) =>
|
(it) =>
|
||||||
it.ofAttribute === status.ofAttribute &&
|
it.ofAttribute === status.ofAttribute &&
|
||||||
it.name.toLowerCase().trim() === status.name.toLowerCase().trim() &&
|
it.name.toLowerCase().trim() === status.name.toLowerCase().trim() &&
|
||||||
(categories.includes(it._id) || it.space === status.space)
|
(categories.includes(it._id) || usedSpaces.has(it.space))
|
||||||
)
|
)
|
||||||
.sort((a, b) => a.rank.localeCompare(b.rank))
|
.sort((a, b) => a.rank.localeCompare(b.rank))
|
||||||
fst = new StatusValue(status.name, status.color, statuses)
|
fst = new StatusValue(status.name, status.color, statuses)
|
||||||
|
Loading…
Reference in New Issue
Block a user