@molgenis/vip-report-template 7.1.1 → 7.1.2
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/.travis.yml +2 -0
- package/package.json +23 -23
- package/src/components/SearchBox.tsx +2 -1
- package/src/components/form/Input.tsx +4 -1
- package/src/mocks/GRCh38/decisionTreeStr.json +8 -15
- package/src/mocks/GRCh38/sampleTree.json +2 -2
- package/src/utils/utils.ts +12 -0
- package/tests/utils/utils.test.ts +11 -0
package/.travis.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molgenis/vip-report-template",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.2",
|
|
4
4
|
"description": "Report Template for Variant Call Format (VCF) Report Generator",
|
|
5
5
|
"license": "LGPL-3.0",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@molgenis/vite-plugin-inline": "^1.0.
|
|
7
|
+
"@molgenis/vite-plugin-inline": "^1.0.29",
|
|
8
8
|
"@types/async-lock": "^1.4.2",
|
|
9
|
-
"@types/node": "^22.
|
|
10
|
-
"@vitest/coverage-v8": "^
|
|
9
|
+
"@types/node": "^22.13.4",
|
|
10
|
+
"@vitest/coverage-v8": "^3.0.5",
|
|
11
11
|
"async-lock": "^1.4.1",
|
|
12
|
-
"bulma": "^1.0.
|
|
13
|
-
"eslint": "^9.
|
|
14
|
-
"eslint-config-prettier": "^
|
|
15
|
-
"eslint-plugin-solid": "^0.14.
|
|
12
|
+
"bulma": "^1.0.3",
|
|
13
|
+
"eslint": "^9.20.1",
|
|
14
|
+
"eslint-config-prettier": "^10.0.1",
|
|
15
|
+
"eslint-plugin-solid": "^0.14.5",
|
|
16
16
|
"husky": "^9.1.7",
|
|
17
|
-
"jsdom": "^
|
|
18
|
-
"prettier": "^3.
|
|
19
|
-
"sass": "^1.
|
|
20
|
-
"typescript": "^5.
|
|
21
|
-
"typescript-eslint": "^8.
|
|
22
|
-
"vite": "^
|
|
23
|
-
"vite-plugin-solid": "^2.
|
|
24
|
-
"vitest": "^
|
|
17
|
+
"jsdom": "^26.0.0",
|
|
18
|
+
"prettier": "^3.5.1",
|
|
19
|
+
"sass": "^1.85.0",
|
|
20
|
+
"typescript": "^5.7.3",
|
|
21
|
+
"typescript-eslint": "^8.24.0",
|
|
22
|
+
"vite": "^6.1.0",
|
|
23
|
+
"vite-plugin-solid": "^2.11.1",
|
|
24
|
+
"vitest": "^3.0.5"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@fortawesome/fontawesome-svg-core": "^6.7.
|
|
28
|
-
"@fortawesome/free-solid-svg-icons": "^6.7.
|
|
29
|
-
"@molgenis/vip-report-api": "^6.2.
|
|
30
|
-
"@molgenis/vip-report-vcf": "^3.1.
|
|
31
|
-
"@solidjs/router": "^0.15.
|
|
27
|
+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
28
|
+
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
29
|
+
"@molgenis/vip-report-api": "^6.2.3",
|
|
30
|
+
"@molgenis/vip-report-vcf": "^3.1.1",
|
|
31
|
+
"@solidjs/router": "^0.15.3",
|
|
32
32
|
"ajv": "^8.17.1",
|
|
33
33
|
"base64-js": "^1.5.1",
|
|
34
|
-
"igv": "^3.1.
|
|
35
|
-
"solid-js": "^1.9.
|
|
34
|
+
"igv": "^3.1.4",
|
|
35
|
+
"solid-js": "^1.9.4"
|
|
36
36
|
},
|
|
37
37
|
"lint-staged": {
|
|
38
38
|
"src/**/*.{tsx,ts}": [
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component, createEffect, createSignal } from "solid-js";
|
|
2
|
+
import { removeZeroWidthAndTrim } from "../utils/utils.ts";
|
|
2
3
|
|
|
3
4
|
export const SearchBox: Component<{ value?: string | null; onInput: (value: string) => void }> = (props) => {
|
|
4
5
|
const [value, setValue] = createSignal("");
|
|
@@ -16,7 +17,7 @@ export const SearchBox: Component<{ value?: string | null; onInput: (value: stri
|
|
|
16
17
|
class="input"
|
|
17
18
|
type="text"
|
|
18
19
|
value={value()}
|
|
19
|
-
onInput={(e) => setValue((e.target as HTMLInputElement).value)}
|
|
20
|
+
onInput={(e) => setValue(removeZeroWidthAndTrim((e.target as HTMLInputElement).value))}
|
|
20
21
|
onKeyUp={(e) => {
|
|
21
22
|
if (e.code === "Enter") {
|
|
22
23
|
props.onInput(value());
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component } from "solid-js";
|
|
2
|
+
import { removeZeroWidthAndTrim } from "../../utils/utils.ts";
|
|
2
3
|
|
|
3
4
|
export type InputValue = string;
|
|
4
5
|
export type InputChangeEvent = { value: InputValue };
|
|
@@ -13,7 +14,9 @@ export const Input: Component<InputProps> = (props) => {
|
|
|
13
14
|
type="text"
|
|
14
15
|
{...(props.value ? { value: props.value } : {})}
|
|
15
16
|
placeholder={props.placeholder}
|
|
16
|
-
onInput={(event) =>
|
|
17
|
+
onInput={(event) =>
|
|
18
|
+
props.onValueChange({ value: removeZeroWidthAndTrim((event.target as HTMLInputElement).value) })
|
|
19
|
+
}
|
|
17
20
|
/>
|
|
18
21
|
);
|
|
19
22
|
};
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"query": {
|
|
59
59
|
"field": "INFO/CSQ/Consequence",
|
|
60
60
|
"operator": "contains_any",
|
|
61
|
-
"value": ["upstream_gene_variant","downstream_gene_variant"]
|
|
61
|
+
"value": ["upstream_gene_variant", "downstream_gene_variant"]
|
|
62
62
|
},
|
|
63
63
|
"outcomeTrue": {
|
|
64
64
|
"nextNode": "exit_rm"
|
|
@@ -119,9 +119,7 @@
|
|
|
119
119
|
"query": {
|
|
120
120
|
"field": "FILTER",
|
|
121
121
|
"operator": "==",
|
|
122
|
-
"value": [
|
|
123
|
-
"PASS"
|
|
124
|
-
]
|
|
122
|
+
"value": ["PASS"]
|
|
125
123
|
},
|
|
126
124
|
"outcomeTrue": {
|
|
127
125
|
"nextNode": "vkgl"
|
|
@@ -166,9 +164,7 @@
|
|
|
166
164
|
"label": "ClinVar",
|
|
167
165
|
"description": "ClinVar classification",
|
|
168
166
|
"type": "BOOL_MULTI",
|
|
169
|
-
"fields": [
|
|
170
|
-
"INFO/CSQ/clinVar_CLNSIG"
|
|
171
|
-
],
|
|
167
|
+
"fields": ["INFO/CSQ/clinVar_CLNSIG"],
|
|
172
168
|
"outcomes": [
|
|
173
169
|
{
|
|
174
170
|
"description": "Conflict",
|
|
@@ -176,7 +172,7 @@
|
|
|
176
172
|
{
|
|
177
173
|
"field": "INFO/CSQ/clinVar_CLNSIG",
|
|
178
174
|
"operator": "contains_any",
|
|
179
|
-
"value": [
|
|
175
|
+
"value": ["Conflicting_interpretations_of_pathogenicity"]
|
|
180
176
|
}
|
|
181
177
|
],
|
|
182
178
|
"outcomeTrue": {
|
|
@@ -189,7 +185,7 @@
|
|
|
189
185
|
{
|
|
190
186
|
"field": "INFO/CSQ/clinVar_CLNSIG",
|
|
191
187
|
"operator": "contains_any",
|
|
192
|
-
"value": [
|
|
188
|
+
"value": ["Likely_pathogenic", "Pathogenic"]
|
|
193
189
|
}
|
|
194
190
|
],
|
|
195
191
|
"outcomeTrue": {
|
|
@@ -202,7 +198,7 @@
|
|
|
202
198
|
{
|
|
203
199
|
"field": "INFO/CSQ/clinVar_CLNSIG",
|
|
204
200
|
"operator": "contains_any",
|
|
205
|
-
"value": [
|
|
201
|
+
"value": ["Uncertain_significance"]
|
|
206
202
|
}
|
|
207
203
|
],
|
|
208
204
|
"outcomeTrue": {
|
|
@@ -215,7 +211,7 @@
|
|
|
215
211
|
{
|
|
216
212
|
"field": "INFO/CSQ/clinVar_CLNSIG",
|
|
217
213
|
"operator": "contains_any",
|
|
218
|
-
"value": [
|
|
214
|
+
"value": ["Likely_benign", "Benign"]
|
|
219
215
|
}
|
|
220
216
|
],
|
|
221
217
|
"outcomeTrue": {
|
|
@@ -357,10 +353,7 @@
|
|
|
357
353
|
"label": "",
|
|
358
354
|
"description": "gnomAD",
|
|
359
355
|
"type": "BOOL_MULTI",
|
|
360
|
-
"fields": [
|
|
361
|
-
"INFO/CSQ/gnomAD_FAF99",
|
|
362
|
-
"INFO/CSQ/gnomAD_HN"
|
|
363
|
-
],
|
|
356
|
+
"fields": ["INFO/CSQ/gnomAD_FAF99", "INFO/CSQ/gnomAD_HN"],
|
|
364
357
|
"outcomes": [
|
|
365
358
|
{
|
|
366
359
|
"description": "Filtering allele Frequency (99% confidence) >= 0.02 or Number of Homozygotes > 5",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"query": {
|
|
60
60
|
"field": "FORMAT/VI",
|
|
61
61
|
"operator": "contains_none",
|
|
62
|
-
"value": ["AR","AD","XLR","XLD","YL","MT","AR_C"]
|
|
62
|
+
"value": ["AR", "AD", "XLR", "XLD", "YL", "MT", "AR_C"]
|
|
63
63
|
},
|
|
64
64
|
"outcomeTrue": {
|
|
65
65
|
"nextNode": "vid_IP"
|
|
@@ -172,4 +172,4 @@
|
|
|
172
172
|
"class": "U4"
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
}
|
|
175
|
+
}
|
package/src/utils/utils.ts
CHANGED
|
@@ -65,3 +65,15 @@ export function validateIntervalInput(
|
|
|
65
65
|
return `Input 'to' (${right}) for filter '${id}' should have a higher value than the 'from' input (${left}).`;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Remove zero-width space Unicode characters from a string and trim
|
|
71
|
+
*
|
|
72
|
+
* U+200B zero-width space.
|
|
73
|
+
* U+200C zero-width non-joiner.
|
|
74
|
+
* U+200D zero-width joiner.
|
|
75
|
+
* U+FEFF zero-width non-breaking space.
|
|
76
|
+
*/
|
|
77
|
+
export function removeZeroWidthAndTrim(stringToTrim: string): string {
|
|
78
|
+
return stringToTrim.replace(/[\u200B-\u200D\uFEFF]/g, "").trim();
|
|
79
|
+
}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
href,
|
|
8
8
|
isPositiveInteger,
|
|
9
9
|
parseId,
|
|
10
|
+
removeZeroWidthAndTrim,
|
|
10
11
|
validateIntervalInput,
|
|
11
12
|
} from "../../src/utils/utils.ts";
|
|
12
13
|
|
|
@@ -117,4 +118,14 @@ describe("utils", () => {
|
|
|
117
118
|
);
|
|
118
119
|
});
|
|
119
120
|
});
|
|
121
|
+
|
|
122
|
+
describe("zeroWidthTrim", () => {
|
|
123
|
+
test("string with zero-width unicode characters and space", () => {
|
|
124
|
+
expect(removeZeroWidthAndTrim("\u200Bb\u200Cc\u200Dd\uFEFF ")).toStrictEqual("bcd");
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test("string without zero-width unicode characters", () => {
|
|
128
|
+
expect(removeZeroWidthAndTrim("bcd")).toStrictEqual("bcd");
|
|
129
|
+
});
|
|
130
|
+
});
|
|
120
131
|
});
|