Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/core/src/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ function $push (document: Doc, keyval: Record<string, PropertyType>): void {
const arr = doc[key] as Array<any>
const desc = val as Position<PropertyType>
if ('$each' in desc) {
arr.splice(desc.$position ?? 0, 0, ...desc.$each)
if (arr != null) {
arr.splice(desc.$position ?? 0, 0, ...desc.$each)
}
} else {
arr.push(val)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
name="file"
id="file"
style="display: none"
disabled={inputFile == null}
on:change={fileSelected}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@

async function handleSelection (evt: Event | undefined, selection: number): Promise<void> {
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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ const $documentAllVersions = createStore<ControlledDocument[]>([])
.on(documentAllVersionsUpdated, (_, payload) => payload)
.reset(controlledDocumentClosed)

export const $documentAllVersionsDescSorted = $documentAllVersions.map((docs) =>
docs.toSorted((a, b) => documentCompareFn(a, b) * -1)
)
export const $documentAllVersionsDescSorted = $documentAllVersions.map((docs) => {
const result = [...docs]
result.sort((a, b) => documentCompareFn(a, b) * -1)
return result
})

export const $documentSnapshots = createStore<ControlledDocumentSnapshot[]>([])
.on(documentSnapshotsUpdated, (_, payload) => payload)
Expand Down
12 changes: 7 additions & 5 deletions plugins/hr-resources/src/components/ScheduleView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,13 @@
tasks: new Map()
}
const tsk = r.$lookup?.attachedTo as Issue
newMap.set(r.employee, {
value: or.value + r.value,
reports: [...or.reports, r],
tasks: or.tasks.set(tsk._id, tsk)
})
if (tsk !== undefined) {
newMap.set(r.employee, {
value: or.value + r.value,
reports: [...or.reports, r],
tasks: or.tasks.set(tsk._id, tsk)
})
}
}
}
timeReports = newMap
Expand Down
11 changes: 6 additions & 5 deletions plugins/recruit-resources/src/components/OptimizeSkills.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
let loading2: boolean = false
$: {
loading1 = true
getClient()
void getClient()
.findAll(tags.class.TagCategory, { targetClass })
.then((result) => {
categories = result
Expand All @@ -52,14 +52,15 @@

$: {
loading2 = true
getClient()
void getClient()
.findAll(
tags.class.TagElement,
{ category: { $in: Array.from(categories.map((it) => it._id)) } },
{ sort: { title: 1 } }
)
.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
})
}
Expand Down Expand Up @@ -157,7 +158,7 @@

let titles: string[] = []
const titlesStates = new Map<string, boolean>()
$: getClient()
$: void getClient()
.findAll(
tags.class.TagReference,
{
Expand Down Expand Up @@ -427,7 +428,7 @@
doProcessing = true
if (elements.length > 0 && expertRefs.length > 0) {
setTimeout(() => {
updateTagsList(
void updateTagsList(
elements,
expertRefs.filter((it) => titlesStates.get(prepareTitle(it.title.toLowerCase())) ?? true)
).then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@
}
const handleSelect = async (event: CustomEvent): Promise<void> => {
selected = event.detail as AnyAttribute
const exist = (await client.findOne(selected.attributeOf, { [selected.name]: { $exists: true } })) !== undefined
$settingsStore = { id: selected._id, component: EditAttribute, props: { attribute: selected, exist, disabled } }
if (selected != null) {
const exist = (await client.findOne(selected.attributeOf, { [selected.name]: { $exists: true } })) !== undefined
$settingsStore = { id: selected._id, component: EditAttribute, props: { attribute: selected, exist, disabled } }
}
}
onDestroy(() => {
if (selected !== undefined) clearSettingsStore()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
tracker.class.RelatedIssueTarget,
{},
(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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
{ _id },
async (result) => {
;[template] = result
title = template.title
if (template != null) {
title = template.title
}
currentProject = template.$lookup?.space
},
{ lookup: { space: tracker.class.Project, labels: tags.class.TagElement } }
Expand Down