@gen-epix/ui-client-casedb 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/AddCasesToEventDialog.js.map +1 -1
- package/dist/_chunks/CaseDbDownloadUtil.js +1 -1
- package/dist/_chunks/CaseDbDownloadUtil.js.map +1 -1
- package/dist/_chunks/CaseInfoDialog.js +4 -4
- package/dist/_chunks/CaseInfoDialog.js.map +1 -1
- package/dist/_chunks/CaseSetInfoDialog.js +4 -4
- package/dist/_chunks/CaseSetInfoDialog.js.map +1 -1
- package/dist/_chunks/CasesAlreadyInCaseSetWarning.js.map +1 -1
- package/dist/_chunks/Dashboard.js +3 -2
- package/dist/_chunks/Dashboard.js.map +1 -1
- package/dist/_chunks/FindSimilarCasesDialog.js +6 -6
- package/dist/_chunks/FindSimilarCasesDialog.js.map +1 -1
- package/dist/_chunks/HomePageTrends.js.map +1 -1
- package/dist/_chunks/LineListWidget.js +46 -45
- package/dist/_chunks/LineListWidget.js.map +1 -1
- package/dist/_chunks/Upload.js +308 -304
- package/dist/_chunks/Upload.js.map +1 -1
- package/dist/_chunks/UploadUtil.js +44 -40
- package/dist/_chunks/UploadUtil.js.map +1 -1
- package/dist/_chunks/dashboardStore.js.map +1 -1
- package/dist/classes/services/EventBusService/EventBusService.d.ts +9 -2
- package/dist/classes/services/EventBusService/index.js.map +1 -1
- package/dist/components/ui/MapWidget/index.js.map +1 -1
- package/dist/components/ui/RemoveCasesFromEventDialog/index.js.map +1 -1
- package/dist/components/ui/SequenceDownloadDialog/index.js +53 -40
- package/dist/components/ui/SequenceDownloadDialog/index.js.map +1 -1
- package/dist/components/ui/TreeWidget/index.js +8 -2
- package/dist/components/ui/TreeWidget/index.js.map +1 -1
- package/dist/locale/en.json +0 -11
- package/dist/locale/nl.json +0 -11
- package/dist/models/config.d.ts +2 -0
- package/dist/utils/UploadUtil/UploadUtil.d.ts +1 -0
- package/package.json +23 -23
- package/dist/components/ui/FileSelector/FileSelector.d.ts +0 -7
- package/dist/components/ui/FileSelector/index.d.ts +0 -1
- package/dist/components/ui/FileSelector/index.js +0 -206
- package/dist/components/ui/FileSelector/index.js.map +0 -1
- package/dist/utils/FileUtil/FileUtil.d.ts +0 -5
- package/dist/utils/FileUtil/index.d.ts +0 -1
- package/dist/utils/FileUtil/index.js +0 -15
- package/dist/utils/FileUtil/index.js.map +0 -1
|
@@ -4,11 +4,10 @@ import { t as i } from "./format.js";
|
|
|
4
4
|
import { CaseTypeUtil as a, t as o } from "../utils/CaseTypeUtil/index.js";
|
|
5
5
|
import { CASEDB_QUERY_KEY as s } from "../constants/query.js";
|
|
6
6
|
import { CaseUtil as c, t as l } from "../utils/CaseUtil/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { CaseDbCaseApi as g, CaseDbColType as _, CaseDbEtlStatus as v, CaseDbReadsFileFormat as y, CaseDbSeqFileFormat as b, CaseDbUploadAction as x } from "@gen-epix/api-casedb";
|
|
7
|
+
import { UploadError as u } from "../classes/errors/index.js";
|
|
8
|
+
import { lazy as d, object as f, string as p } from "yup";
|
|
9
|
+
import { t as m } from "i18next";
|
|
10
|
+
import { CaseDbCaseApi as h, CaseDbColType as g, CaseDbEtlStatus as _, CaseDbFileCompression as v, CaseDbReadsFileFormat as y, CaseDbSeqFileFormat as b, CaseDbUploadAction as x } from "@gen-epix/api-casedb";
|
|
12
11
|
import { QueryClientService as S } from "@gen-epix/ui-client-common/classes/services/QueryClientService";
|
|
13
12
|
import { ValidationUtil as C } from "@gen-epix/ui-core/utils/ValidationUtil";
|
|
14
13
|
import { ObjectUtil as w } from "@gen-epix/ui-core/utils/ObjectUtil";
|
|
@@ -2660,11 +2659,12 @@ function ui(e, t, n) {
|
|
|
2660
2659
|
//#region src/utils/UploadUtil/UploadUtil.ts
|
|
2661
2660
|
var di = /* @__PURE__ */ e(l(), 1), fi = /* @__PURE__ */ e(o(), 1), pi = class e {
|
|
2662
2661
|
static caseDateColumnAliases = [
|
|
2663
|
-
"
|
|
2664
|
-
"
|
|
2665
|
-
"
|
|
2666
|
-
"
|
|
2667
|
-
"case.
|
|
2662
|
+
"_timed_at",
|
|
2663
|
+
"timed at",
|
|
2664
|
+
"timed_at",
|
|
2665
|
+
"timedat",
|
|
2666
|
+
"case.timed_at",
|
|
2667
|
+
"timed_at_date"
|
|
2668
2668
|
];
|
|
2669
2669
|
static caseIdColumnAliases = [
|
|
2670
2670
|
"_case_id",
|
|
@@ -2688,7 +2688,7 @@ var di = /* @__PURE__ */ e(l(), 1), fi = /* @__PURE__ */ e(o(), 1), pi = class e
|
|
|
2688
2688
|
}
|
|
2689
2689
|
static async createCases(e) {
|
|
2690
2690
|
let { assemblyProtocolId: t, casesForVerificationFromSourceData: n, completeCaseType: r, createdInDataCollectionId: i, mappedColumns: a, sampleIdColId: o, selectedValidatedCases: s, sequenceMapping: l, sequencingProtocolId: u, signal: d } = e, { col: f, sampleIdentifierIssuerId: p } = a.find((e) => e.col?.id === o) ?? {};
|
|
2691
|
-
return (await
|
|
2691
|
+
return (await h.getInstance().uploadCases({
|
|
2692
2692
|
case_batch: { cases: s.map((e) => {
|
|
2693
2693
|
let a = e.id, o = [], s = [], d = f ? c.getRowValue(e.validated_content, f, r)?.raw : null, m = n.find((t) => t.id === e.id);
|
|
2694
2694
|
return d && (l[e.id]?.sequenceFileNames && Object.entries(l[e.id].sequenceFileNames).forEach(([e, n]) => {
|
|
@@ -2730,15 +2730,15 @@ var di = /* @__PURE__ */ e(l(), 1), fi = /* @__PURE__ */ e(o(), 1), pi = class e
|
|
|
2730
2730
|
static async createCasesAndUploadFiles(t) {
|
|
2731
2731
|
let { onComplete: n, onError: r, onProgress: i } = t;
|
|
2732
2732
|
try {
|
|
2733
|
-
i(0,
|
|
2733
|
+
i(0, m("Creating cases..."));
|
|
2734
2734
|
let r = await e.createCases(t);
|
|
2735
|
-
if (r.status ===
|
|
2735
|
+
if (r.status === _.FAILED) throw new u(m("Failed to create cases during upload."), r);
|
|
2736
2736
|
return await e.uploadFilesForCases({
|
|
2737
2737
|
...t,
|
|
2738
2738
|
caseBatchUploadResult: r,
|
|
2739
2739
|
endPercentage: 99,
|
|
2740
2740
|
startPercentage: 1
|
|
2741
|
-
}), i(100,
|
|
2741
|
+
}), i(100, m("Upload complete.")), await S.getInstance().invalidateQueryKeys(S.getInstance().getQueryKeyDependencies([s.CASES], !0)), n(), r;
|
|
2742
2742
|
} catch (e) {
|
|
2743
2743
|
throw r(e instanceof Error ? e : /* @__PURE__ */ Error("Unknown error occurred during upload")), e;
|
|
2744
2744
|
}
|
|
@@ -2805,16 +2805,16 @@ var di = /* @__PURE__ */ e(l(), 1), fi = /* @__PURE__ */ e(o(), 1), pi = class e
|
|
|
2805
2805
|
static getColumnMappingSchema(t, n) {
|
|
2806
2806
|
let r = {}, i = t[0].map((e, t) => t.toString());
|
|
2807
2807
|
return e.getSampleIdColIds(n).forEach((e) => {
|
|
2808
|
-
r[e] =
|
|
2808
|
+
r[e] = d(() => p().nullable().when(i, (t, n) => n.test("needs-identifier-issuer", m("An identifier issuer must be selected."), (n) => ![...t, n].includes(e) || !!n)));
|
|
2809
2809
|
}), i.forEach((e, n) => {
|
|
2810
2810
|
let a = i.filter((t) => t !== e);
|
|
2811
|
-
r[e] =
|
|
2812
|
-
}),
|
|
2811
|
+
r[e] = d(() => p().nullable().when(a, (e, r) => r.test("unique", m("This column has already been mapped to another field."), (t) => !t || !e.includes(t)).test("valid-case-id-values", m("The column mapped to the case id field must contain valid UUID's."), (e) => e !== "case_id" || t.slice(1).map((e) => e[n]).every((e) => !e || C.validate("UUID4", e)))));
|
|
2812
|
+
}), f().shape(r);
|
|
2813
2813
|
}
|
|
2814
2814
|
static getCompleteCaseTypeColStats(e) {
|
|
2815
|
-
let t = a.getColsByType(e, [
|
|
2815
|
+
let t = a.getColsByType(e, [g.ID_SAMPLE]), n = a.getColsByType(e, [g.GENETIC_SEQUENCE]);
|
|
2816
2816
|
return {
|
|
2817
|
-
readsColumns: a.getColsByType(e, [
|
|
2817
|
+
readsColumns: a.getColsByType(e, [g.GENETIC_READS]),
|
|
2818
2818
|
sampleIdColumns: t,
|
|
2819
2819
|
sequenceColumns: n,
|
|
2820
2820
|
writableColumns: Object.values(e.cols).filter((t) => a.getWritableColIds(e).includes(t.id))
|
|
@@ -2895,7 +2895,7 @@ var di = /* @__PURE__ */ e(l(), 1), fi = /* @__PURE__ */ e(o(), 1), pi = class e
|
|
|
2895
2895
|
let t = [];
|
|
2896
2896
|
return Object.values(Object.keys(e.cols)).forEach((n) => {
|
|
2897
2897
|
let r = e.cols[n];
|
|
2898
|
-
e.ref_cols[r.ref_col_id]?.col_type ===
|
|
2898
|
+
e.ref_cols[r.ref_col_id]?.col_type === g.ID_SAMPLE && t.push(r.id);
|
|
2899
2899
|
}), t;
|
|
2900
2900
|
}
|
|
2901
2901
|
static getSequenceMappingStats(t, n) {
|
|
@@ -3004,7 +3004,7 @@ var di = /* @__PURE__ */ e(l(), 1), fi = /* @__PURE__ */ e(o(), 1), pi = class e
|
|
|
3004
3004
|
i(a + s * c + n * c, r);
|
|
3005
3005
|
}
|
|
3006
3006
|
static async uploadFilesForCases(t) {
|
|
3007
|
-
let { caseBatchUploadResult: n, endPercentage: r, onProgress: i, sequenceFilesDataTransfer: a, sequenceMapping: o, signal: s, startPercentage: c } = t, l = [],
|
|
3007
|
+
let { caseBatchUploadResult: n, endPercentage: r, onProgress: i, sequenceFilesDataTransfer: a, sequenceMapping: o, signal: s, startPercentage: c } = t, l = [], u = [], d = 0;
|
|
3008
3008
|
for (let [e, r] of n.cases.entries()) {
|
|
3009
3009
|
let { id: n } = t.selectedValidatedCases[e];
|
|
3010
3010
|
if (o[n]) {
|
|
@@ -3015,80 +3015,84 @@ var di = /* @__PURE__ */ e(l(), 1), fi = /* @__PURE__ */ e(o(), 1), pi = class e
|
|
|
3015
3015
|
caseId: e,
|
|
3016
3016
|
colId: t,
|
|
3017
3017
|
fileName: r
|
|
3018
|
-
}),
|
|
3018
|
+
}), d += n?.size || 0);
|
|
3019
3019
|
}
|
|
3020
3020
|
for (let [t, r] of Object.entries(o[n].readsFileNames)) {
|
|
3021
3021
|
if (r.fwd) {
|
|
3022
3022
|
let n = Array.from(a.files).find((e) => e.name === r.fwd);
|
|
3023
|
-
n && (
|
|
3023
|
+
n && (u.push({
|
|
3024
3024
|
caseId: e,
|
|
3025
3025
|
colId: t,
|
|
3026
3026
|
fileName: r.fwd,
|
|
3027
3027
|
is_fwd: !0
|
|
3028
|
-
}),
|
|
3028
|
+
}), d += n?.size || 0);
|
|
3029
3029
|
}
|
|
3030
3030
|
if (r.rev) {
|
|
3031
3031
|
let n = Array.from(a.files).find((e) => e.name === r.rev);
|
|
3032
|
-
n && (
|
|
3032
|
+
n && (u.push({
|
|
3033
3033
|
caseId: e,
|
|
3034
3034
|
colId: t,
|
|
3035
3035
|
fileName: r.rev,
|
|
3036
3036
|
is_fwd: !1
|
|
3037
|
-
}),
|
|
3037
|
+
}), d += n?.size || 0);
|
|
3038
3038
|
}
|
|
3039
3039
|
}
|
|
3040
3040
|
}
|
|
3041
3041
|
}
|
|
3042
|
-
let
|
|
3042
|
+
let f = 0;
|
|
3043
3043
|
for (let t of n.cases) {
|
|
3044
|
-
let n = l.find((e) => e.caseId === t.id), o =
|
|
3044
|
+
let n = l.find((e) => e.caseId === t.id), o = u.filter((e) => e.caseId === t.id);
|
|
3045
3045
|
if (n) {
|
|
3046
3046
|
let t = Array.from(a.files).find((e) => e.name === n.fileName);
|
|
3047
3047
|
if (t) {
|
|
3048
3048
|
let a = t.size, o = await e.readFileAsBase64(t);
|
|
3049
|
-
await
|
|
3050
|
-
file_compression:
|
|
3049
|
+
await h.getInstance().createFileForSeq(n.caseId, n.colId, {
|
|
3050
|
+
file_compression: e.getFileCompressionFromFileName(n.fileName),
|
|
3051
3051
|
file_content: o,
|
|
3052
3052
|
file_format: b.FASTA
|
|
3053
3053
|
}, { signal: s }), e.reportFileUploadProgress({
|
|
3054
3054
|
endPercentage: r,
|
|
3055
3055
|
fileSize: a,
|
|
3056
|
-
message:
|
|
3056
|
+
message: m("Uploading sequence file \"{{fileName}}\" for case ID \"{{caseId}}\"...", {
|
|
3057
3057
|
caseId: n.caseId,
|
|
3058
3058
|
fileName: n.fileName
|
|
3059
3059
|
}),
|
|
3060
3060
|
onProgress: i,
|
|
3061
3061
|
startPercentage: c,
|
|
3062
|
-
totalFileSizeToUpload:
|
|
3063
|
-
uploadedFileSize:
|
|
3064
|
-
}),
|
|
3062
|
+
totalFileSizeToUpload: d,
|
|
3063
|
+
uploadedFileSize: f
|
|
3064
|
+
}), f += a;
|
|
3065
3065
|
}
|
|
3066
3066
|
}
|
|
3067
3067
|
for (let t of o) {
|
|
3068
3068
|
let n = Array.from(a.files).find((e) => e.name === t.fileName);
|
|
3069
3069
|
if (n) {
|
|
3070
3070
|
let a = n.size, o = await e.readFileAsBase64(n);
|
|
3071
|
-
await
|
|
3072
|
-
file_compression:
|
|
3071
|
+
await h.getInstance().createFileForReadSet(t.caseId, t.colId, {
|
|
3072
|
+
file_compression: e.getFileCompressionFromFileName(t.fileName),
|
|
3073
3073
|
file_content: o,
|
|
3074
3074
|
file_format: y.FASTQ,
|
|
3075
3075
|
is_fwd: t.is_fwd
|
|
3076
3076
|
}, { signal: s }), e.reportFileUploadProgress({
|
|
3077
3077
|
endPercentage: r,
|
|
3078
3078
|
fileSize: a,
|
|
3079
|
-
message:
|
|
3079
|
+
message: m("Uploading read set file \"{{fileName}}\" for case ID \"{{caseId}}\"...", {
|
|
3080
3080
|
caseId: t.caseId,
|
|
3081
3081
|
fileName: t.fileName
|
|
3082
3082
|
}),
|
|
3083
3083
|
onProgress: i,
|
|
3084
3084
|
startPercentage: c,
|
|
3085
|
-
totalFileSizeToUpload:
|
|
3086
|
-
uploadedFileSize:
|
|
3087
|
-
}),
|
|
3085
|
+
totalFileSizeToUpload: d,
|
|
3086
|
+
uploadedFileSize: f
|
|
3087
|
+
}), f += a;
|
|
3088
3088
|
}
|
|
3089
3089
|
}
|
|
3090
3090
|
}
|
|
3091
3091
|
}
|
|
3092
|
+
static getFileCompressionFromFileName(e) {
|
|
3093
|
+
let t = e.toLowerCase();
|
|
3094
|
+
return t.endsWith(".gz") || t.endsWith(".gzip") ? v.GZIP : v.NONE;
|
|
3095
|
+
}
|
|
3092
3096
|
static idToRegex(e) {
|
|
3093
3097
|
return new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"));
|
|
3094
3098
|
}
|