{#each Array.from(Array(24).keys()) as hour}
{@const _slots = slots
.filter((it) => new Date(it.date).getHours() === hour)
- .toSorted((a, b) => a.date - b.date)}
+ .sort((a, b) => a.date - b.date)}
{@const cwidth = hourWidths[hour]}
{#each _slots as m, i}
diff --git a/plugins/training-resources/package.json b/plugins/training-resources/package.json
index 6d851b1da0..727af338fc 100644
--- a/plugins/training-resources/package.json
+++ b/plugins/training-resources/package.json
@@ -7,6 +7,7 @@
"build": "compile ui",
"build:watch": "compile ui",
"format": "format src",
+ "svelte-check": "do-svelte-check",
"_phase:build": "compile ui",
"_phase:format": "format src",
"_phase:validate": "compile validate"
diff --git a/plugins/training-resources/src/components/SentRequestCompletionPopup.svelte b/plugins/training-resources/src/components/SentRequestCompletionPopup.svelte
index 736716eb1f..ed157c2ced 100644
--- a/plugins/training-resources/src/components/SentRequestCompletionPopup.svelte
+++ b/plugins/training-resources/src/components/SentRequestCompletionPopup.svelte
@@ -43,7 +43,7 @@
_id: employee._id as Ref
- ,
completion: completionMap.get(employee._id) as CompletionMapValue
}))
- .toSorted((item1, item2) => compareCompletionMapValueState(item1.completion.state, item2.completion.state))
+ .sort((item1, item2) => compareCompletionMapValueState(item1.completion.state, item2.completion.state))
},
{
sort: {
diff --git a/plugins/training-resources/src/functions/trainingAttemptStateSort.ts b/plugins/training-resources/src/functions/trainingAttemptStateSort.ts
index 4a67a36802..0ad9eb7aed 100644
--- a/plugins/training-resources/src/functions/trainingAttemptStateSort.ts
+++ b/plugins/training-resources/src/functions/trainingAttemptStateSort.ts
@@ -9,7 +9,7 @@ export async function trainingAttemptStateSort (
_: TxOperations,
states: TrainingAttemptState[]
): Promise {
- return states.toSorted(
- (state1, state2) => trainingAttemptStateOrder.indexOf(state2) - trainingAttemptStateOrder.indexOf(state1)
- )
+ return states
+ .slice()
+ .sort((state1, state2) => trainingAttemptStateOrder.indexOf(state2) - trainingAttemptStateOrder.indexOf(state1))
}
diff --git a/plugins/training-resources/src/functions/trainingStateSort.ts b/plugins/training-resources/src/functions/trainingStateSort.ts
index e08898a44e..4c2f0fb14a 100644
--- a/plugins/training-resources/src/functions/trainingStateSort.ts
+++ b/plugins/training-resources/src/functions/trainingStateSort.ts
@@ -17,5 +17,7 @@ import type { TxOperations } from '@hcengineering/core'
import { type TrainingState, trainingStateOrder } from '@hcengineering/training'
export async function trainingStateSort (_: TxOperations, states: TrainingState[]): Promise {
- return states.toSorted((state1, state2) => trainingStateOrder.indexOf(state1) - trainingStateOrder.indexOf(state2))
+ return states
+ .slice()
+ .sort((state1, state2) => trainingStateOrder.indexOf(state1) - trainingStateOrder.indexOf(state2))
}
diff --git a/plugins/workbench-resources/package.json b/plugins/workbench-resources/package.json
index 4e371ccab9..0291371717 100644
--- a/plugins/workbench-resources/package.json
+++ b/plugins/workbench-resources/package.json
@@ -8,6 +8,7 @@
"build": "compile ui",
"build:docs": "api-extractor run --local",
"format": "format src",
+ "svelte-check": "do-svelte-check",
"build:watch": "compile ui",
"_phase:build": "compile ui",
"_phase:format": "format src",
diff --git a/plugins/workbench-resources/src/components/statistics/MetricsInfo.svelte b/plugins/workbench-resources/src/components/statistics/MetricsInfo.svelte
index 714b0fe849..f862aa7c32 100644
--- a/plugins/workbench-resources/src/components/statistics/MetricsInfo.svelte
+++ b/plugins/workbench-resources/src/components/statistics/MetricsInfo.svelte
@@ -98,7 +98,7 @@
{/each}
{#each Object.entries(metrics.params) as [k, v], i}
- {#each Object.entries(v).toSorted((a, b) => b[1].value / (b[1].operations + 1) - a[1].value / (a[1].operations + 1)) as [kk, vv]}
+ {#each Object.entries(v).sort((a, b) => b[1].value / (b[1].operations + 1) - a[1].value / (a[1].operations + 1)) as [kk, vv]}
{@const childExpandable =
vv.topResult !== undefined &&
vv.topResult.length > 0 &&