mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-25 09:13:07 +03:00
Fix a bulk of sentry errors (#6399)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
7324f2ef54
commit
c8357246b1
@ -33,7 +33,9 @@ function $push (document: Doc, keyval: Record<string, PropertyType>): void {
|
|||||||
const arr = doc[key] as Array<any>
|
const arr = doc[key] as Array<any>
|
||||||
const desc = val as Position<PropertyType>
|
const desc = val as Position<PropertyType>
|
||||||
if ('$each' in desc) {
|
if ('$each' in desc) {
|
||||||
arr.splice(desc.$position ?? 0, 0, ...desc.$each)
|
if (arr != null) {
|
||||||
|
arr.splice(desc.$position ?? 0, 0, ...desc.$each)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
arr.push(val)
|
arr.push(val)
|
||||||
}
|
}
|
||||||
|
@ -367,6 +367,7 @@
|
|||||||
name="file"
|
name="file"
|
||||||
id="file"
|
id="file"
|
||||||
style="display: none"
|
style="display: none"
|
||||||
|
disabled={inputFile == null}
|
||||||
on:change={fileSelected}
|
on:change={fileSelected}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@
|
|||||||
|
|
||||||
async function handleSelection (evt: Event | undefined, selection: number): Promise<void> {
|
async function handleSelection (evt: Event | undefined, selection: number): Promise<void> {
|
||||||
const person = contacts[selection]
|
const person = contacts[selection]
|
||||||
selected = allowDeselect && person._id === selected ? undefined : person._id
|
selected = allowDeselect && person?._id === selected ? undefined : person?._id
|
||||||
dispatch('close', selected !== undefined ? person : undefined)
|
dispatch('close', selected !== undefined ? person : undefined)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,9 +63,11 @@ const $documentAllVersions = createStore<ControlledDocument[]>([])
|
|||||||
.on(documentAllVersionsUpdated, (_, payload) => payload)
|
.on(documentAllVersionsUpdated, (_, payload) => payload)
|
||||||
.reset(controlledDocumentClosed)
|
.reset(controlledDocumentClosed)
|
||||||
|
|
||||||
export const $documentAllVersionsDescSorted = $documentAllVersions.map((docs) =>
|
export const $documentAllVersionsDescSorted = $documentAllVersions.map((docs) => {
|
||||||
docs.toSorted((a, b) => documentCompareFn(a, b) * -1)
|
const result = [...docs]
|
||||||
)
|
result.sort((a, b) => documentCompareFn(a, b) * -1)
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
export const $documentSnapshots = createStore<ControlledDocumentSnapshot[]>([])
|
export const $documentSnapshots = createStore<ControlledDocumentSnapshot[]>([])
|
||||||
.on(documentSnapshotsUpdated, (_, payload) => payload)
|
.on(documentSnapshotsUpdated, (_, payload) => payload)
|
||||||
|
@ -216,11 +216,13 @@
|
|||||||
tasks: new Map()
|
tasks: new Map()
|
||||||
}
|
}
|
||||||
const tsk = r.$lookup?.attachedTo as Issue
|
const tsk = r.$lookup?.attachedTo as Issue
|
||||||
newMap.set(r.employee, {
|
if (tsk !== undefined) {
|
||||||
value: or.value + r.value,
|
newMap.set(r.employee, {
|
||||||
reports: [...or.reports, r],
|
value: or.value + r.value,
|
||||||
tasks: or.tasks.set(tsk._id, tsk)
|
reports: [...or.reports, r],
|
||||||
})
|
tasks: or.tasks.set(tsk._id, tsk)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
timeReports = newMap
|
timeReports = newMap
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
let loading2: boolean = false
|
let loading2: boolean = false
|
||||||
$: {
|
$: {
|
||||||
loading1 = true
|
loading1 = true
|
||||||
getClient()
|
void getClient()
|
||||||
.findAll(tags.class.TagCategory, { targetClass })
|
.findAll(tags.class.TagCategory, { targetClass })
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
categories = result
|
categories = result
|
||||||
@ -52,14 +52,15 @@
|
|||||||
|
|
||||||
$: {
|
$: {
|
||||||
loading2 = true
|
loading2 = true
|
||||||
getClient()
|
void getClient()
|
||||||
.findAll(
|
.findAll(
|
||||||
tags.class.TagElement,
|
tags.class.TagElement,
|
||||||
{ category: { $in: Array.from(categories.map((it) => it._id)) } },
|
{ category: { $in: Array.from(categories.map((it) => it._id)) } },
|
||||||
{ sort: { title: 1 } }
|
{ sort: { title: 1 } }
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
elements = res.toSorted((a, b) => prepareTitle(a.title).localeCompare(prepareTitle(b.title)))
|
res.sort((a, b) => prepareTitle(a.title).localeCompare(prepareTitle(b.title)))
|
||||||
|
elements = res
|
||||||
loading2 = false
|
loading2 = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -157,7 +158,7 @@
|
|||||||
|
|
||||||
let titles: string[] = []
|
let titles: string[] = []
|
||||||
const titlesStates = new Map<string, boolean>()
|
const titlesStates = new Map<string, boolean>()
|
||||||
$: getClient()
|
$: void getClient()
|
||||||
.findAll(
|
.findAll(
|
||||||
tags.class.TagReference,
|
tags.class.TagReference,
|
||||||
{
|
{
|
||||||
@ -427,7 +428,7 @@
|
|||||||
doProcessing = true
|
doProcessing = true
|
||||||
if (elements.length > 0 && expertRefs.length > 0) {
|
if (elements.length > 0 && expertRefs.length > 0) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
updateTagsList(
|
void updateTagsList(
|
||||||
elements,
|
elements,
|
||||||
expertRefs.filter((it) => titlesStates.get(prepareTitle(it.title.toLowerCase())) ?? true)
|
expertRefs.filter((it) => titlesStates.get(prepareTitle(it.title.toLowerCase())) ?? true)
|
||||||
).then(() => {
|
).then(() => {
|
||||||
|
@ -120,8 +120,10 @@
|
|||||||
}
|
}
|
||||||
const handleSelect = async (event: CustomEvent): Promise<void> => {
|
const handleSelect = async (event: CustomEvent): Promise<void> => {
|
||||||
selected = event.detail as AnyAttribute
|
selected = event.detail as AnyAttribute
|
||||||
const exist = (await client.findOne(selected.attributeOf, { [selected.name]: { $exists: true } })) !== undefined
|
if (selected != null) {
|
||||||
$settingsStore = { id: selected._id, component: EditAttribute, props: { attribute: selected, exist, disabled } }
|
const exist = (await client.findOne(selected.attributeOf, { [selected.name]: { $exists: true } })) !== undefined
|
||||||
|
$settingsStore = { id: selected._id, component: EditAttribute, props: { attribute: selected, exist, disabled } }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
if (selected !== undefined) clearSettingsStore()
|
if (selected !== undefined) clearSettingsStore()
|
||||||
|
@ -15,7 +15,8 @@
|
|||||||
tracker.class.RelatedIssueTarget,
|
tracker.class.RelatedIssueTarget,
|
||||||
{},
|
{},
|
||||||
(res) => {
|
(res) => {
|
||||||
targets = res.toSorted((a, b) => a.rule.kind.localeCompare(b.rule.kind))
|
res.sort((a, b) => a.rule.kind.localeCompare(b.rule.kind))
|
||||||
|
targets = res
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
lookup: {
|
lookup: {
|
||||||
|
@ -69,7 +69,9 @@
|
|||||||
{ _id },
|
{ _id },
|
||||||
async (result) => {
|
async (result) => {
|
||||||
;[template] = result
|
;[template] = result
|
||||||
title = template.title
|
if (template != null) {
|
||||||
|
title = template.title
|
||||||
|
}
|
||||||
currentProject = template.$lookup?.space
|
currentProject = template.$lookup?.space
|
||||||
},
|
},
|
||||||
{ lookup: { space: tracker.class.Project, labels: tags.class.TagElement } }
|
{ lookup: { space: tracker.class.Project, labels: tags.class.TagElement } }
|
||||||
|
Loading…
Reference in New Issue
Block a user