mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-10 17:30:51 +00:00
UBERF-10499: Fix team planner (#8847)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
parent
70dc3f4387
commit
b48f5e4b39
@ -75,12 +75,10 @@
|
||||
const client = getClient()
|
||||
|
||||
function group (
|
||||
txMap: Map<Ref<Person>, Tx[]>,
|
||||
persons: Ref<Person>[],
|
||||
txes: Tx[],
|
||||
from: Timestamp,
|
||||
to: Timestamp
|
||||
): { add: Map<Asset, { count: number, tx: TxCUD<Doc>[] }>, change: Map<Asset, { count: number, tx: TxCUD<Doc>[] }> } {
|
||||
const txes = persons.flatMap((it) => txMap.get(it))
|
||||
const add = new Map<Asset, { count: number, tx: TxCUD<Doc>[] }>()
|
||||
const change = new Map<Asset, { count: number, tx: TxCUD<Doc>[] }>()
|
||||
const h = client.getHierarchy()
|
||||
@ -153,8 +151,7 @@
|
||||
{@const planned = gitem?.mappings.reduce((it, val) => it + val.total, 0) ?? 0}
|
||||
{@const pevents = gitem?.events.reduce((it, val) => it + (val.dueDate - val.date), 0) ?? 0}
|
||||
{@const busy = gitem?.busy.slots.reduce((it, val) => it + (val.dueDate - val.date), 0) ?? 0}
|
||||
<!-- {@const accounts = personAccounts.filter((it) => it.person === person).map((it) => it._id)} -->
|
||||
{@const txInfo = group(txes, persons, dayFrom, dayTo)}
|
||||
{@const txInfo = group(txes.get(person) ?? [], dayFrom, dayTo)}
|
||||
<div style:overflow="auto" style:height="{height}rem" class="p-1">
|
||||
<div class="flex-row-center p-1">
|
||||
<Icon icon={time.icon.Team} size={'small'} />
|
||||
|
@ -809,7 +809,7 @@ abstract class PostgresAdapterBase implements DbAdapter {
|
||||
}
|
||||
if (query.space === acc.uuid) return // TODO: was it for private spaces? If so, need to fix it as they are not identified by acc.uuid now
|
||||
if (domain === DOMAIN_SPACE && isOwner(acc) && showArchived) return
|
||||
const key = domain === DOMAIN_SPACE ? '_id' : domain === DOMAIN_TX ? "data ->> 'objectSpace'" : 'space'
|
||||
const key = domain === DOMAIN_SPACE ? '_id' : domain === DOMAIN_TX ? '"objectSpace"' : 'space'
|
||||
const privateCheck = domain === DOMAIN_SPACE ? ' OR sec.private = false' : ''
|
||||
const archivedCheck = showArchived ? '' : ' AND sec.archived = false'
|
||||
const q = `(sec.members @> '{"${acc.uuid}"}' OR sec."_class" = '${core.class.SystemSpace}'${privateCheck})${archivedCheck}`
|
||||
|
Loading…
Reference in New Issue
Block a user