@molgenis/vip-report-template 8.0.3 → 8.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/package.json +17 -17
- package/src/components/VariantFilters.tsx +13 -13
- package/src/components/VariantsContainer.tsx +1 -0
- package/src/components/filter/Filter.tsx +4 -0
- package/src/components/filter/composed/FilterAllelicImbalance.tsx +1 -0
- package/src/components/filter/composed/FilterComposed.tsx +7 -0
- package/src/components/filter/composed/FilterDeNovo.tsx +1 -0
- package/src/components/filter/composed/FilterHpo.tsx +1 -0
- package/src/components/filter/composed/FilterInheritance.tsx +1 -0
- package/src/components/filter/composed/FilterPick.tsx +1 -0
- package/src/components/filter/composed/FilterVipC.tsx +1 -0
- package/src/components/filter/composed/FilterVipCS.tsx +1 -0
- package/src/components/filter/fixed/FilterFixed.tsx +7 -0
- package/src/components/filter/typed/FilterCategorical.tsx +1 -1
- package/src/components/filter/typed/FilterFlag.tsx +1 -0
- package/src/components/filter/typed/FilterInterval.tsx +1 -1
- package/src/components/filter/typed/FilterString.tsx +1 -1
- package/src/components/filter/typed/FilterTyped.tsx +4 -0
- package/src/store/variants.ts +21 -4
- package/src/types/configFilter.d.ts +1 -1
- package/src/types/filter.d.ts +2 -0
- package/src/types/store.d.ts +2 -1
- package/src/utils/config/config.ts +1 -1
- package/tests/utils/config/config.test.ts +2 -3
- package/vite.config.mts +5 -6
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molgenis/vip-report-template",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.1.0",
|
|
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": "^
|
|
7
|
+
"@molgenis/vite-plugin-inline": "^2.0.0",
|
|
8
8
|
"@types/async-lock": "^1.4.2",
|
|
9
|
-
"@types/node": "^22.19.
|
|
10
|
-
"@vitest/coverage-v8": "^
|
|
9
|
+
"@types/node": "^22.19.3",
|
|
10
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
11
11
|
"async-lock": "^1.4.1",
|
|
12
12
|
"bulma": "^1.0.4",
|
|
13
|
-
"eslint": "^9.39.
|
|
13
|
+
"eslint": "^9.39.2",
|
|
14
14
|
"eslint-config-prettier": "^10.1.8",
|
|
15
|
-
"eslint-plugin-solid": "^0.14.
|
|
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.
|
|
17
|
+
"jsdom": "^27.3.0",
|
|
18
|
+
"prettier": "^3.7.4",
|
|
19
|
+
"sass": "^1.97.0",
|
|
20
|
+
"typescript": "^5.9.3",
|
|
21
|
+
"typescript-eslint": "^8.49.0",
|
|
22
22
|
"vite": "^6.4.1",
|
|
23
|
-
"vite-plugin-solid": "^2.11.
|
|
24
|
-
"vitest": "^
|
|
23
|
+
"vite-plugin-solid": "^2.11.10",
|
|
24
|
+
"vitest": "^4.0.15"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@fortawesome/fontawesome-svg-core": "^
|
|
28
|
-
"@fortawesome/free-solid-svg-icons": "^
|
|
29
|
-
"@molgenis/vip-report-api": "7.0.
|
|
30
|
-
"@molgenis/vip-report-vcf": "^4.0.
|
|
27
|
+
"@fortawesome/fontawesome-svg-core": "^7.1.0",
|
|
28
|
+
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
|
29
|
+
"@molgenis/vip-report-api": "7.0.5",
|
|
30
|
+
"@molgenis/vip-report-vcf": "^4.0.5",
|
|
31
31
|
"@solidjs/router": "^0.15.4",
|
|
32
32
|
"ajv": "^8.17.1",
|
|
33
33
|
"base64-js": "^1.5.1",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component, For } from "solid-js";
|
|
2
2
|
import { FilterValueField } from "../types/configFilter";
|
|
3
3
|
import { ConfigFilters } from "../types/config";
|
|
4
|
-
import { FilterChangeCallback, FilterClearCallback, FilterValueMap } from "../types/filter";
|
|
4
|
+
import { FilterChangeCallback, FilterClearCallback, FilterInitedList, FilterValueMap } from "../types/filter";
|
|
5
5
|
import { Filter } from "./filter/Filter";
|
|
6
6
|
|
|
7
7
|
export const VariantFilters: Component<{
|
|
@@ -9,19 +9,19 @@ export const VariantFilters: Component<{
|
|
|
9
9
|
filterValues: FilterValueMap;
|
|
10
10
|
onFilterChange: FilterChangeCallback;
|
|
11
11
|
onFilterClear: FilterClearCallback;
|
|
12
|
+
filtersInited: FilterInitedList;
|
|
12
13
|
}> = (props) => {
|
|
13
14
|
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</>
|
|
15
|
+
<For each={props.filterConfigs}>
|
|
16
|
+
{(filter) => (
|
|
17
|
+
<Filter
|
|
18
|
+
config={filter}
|
|
19
|
+
value={props.filterValues[filter.id] as FilterValueField | undefined}
|
|
20
|
+
onValueChange={(event) => props.onFilterChange({ id: filter.id, ...event })}
|
|
21
|
+
onValueClear={() => props.onFilterClear({ id: filter.id })}
|
|
22
|
+
isInited={props.filtersInited.includes(filter.id)}
|
|
23
|
+
/>
|
|
24
|
+
)}
|
|
25
|
+
</For>
|
|
26
26
|
);
|
|
27
27
|
};
|
|
@@ -27,6 +27,7 @@ export interface FilterProps<C extends ConfigFilterBase, FilterValueType> {
|
|
|
27
27
|
defaultValue?: string;
|
|
28
28
|
onValueChange: FilterValueChangeCallback<FilterValueType>;
|
|
29
29
|
onValueClear: FilterValueClearCallback;
|
|
30
|
+
isInited: boolean;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
export const Filter: Component<FilterProps<ConfigFilter, FilterValue>> = (props) => {
|
|
@@ -40,6 +41,7 @@ export const Filter: Component<FilterProps<ConfigFilter, FilterValue>> = (props)
|
|
|
40
41
|
value={props.value as FilterValueFixed}
|
|
41
42
|
onValueChange={props.onValueChange}
|
|
42
43
|
onValueClear={props.onValueClear}
|
|
44
|
+
isInited={props.isInited}
|
|
43
45
|
/>
|
|
44
46
|
</Match>
|
|
45
47
|
<Match when={type() === "info" || type() === "genotype"}>
|
|
@@ -48,6 +50,7 @@ export const Filter: Component<FilterProps<ConfigFilter, FilterValue>> = (props)
|
|
|
48
50
|
value={props.value as FilterValueField}
|
|
49
51
|
onValueChange={props.onValueChange}
|
|
50
52
|
onValueClear={props.onValueClear}
|
|
53
|
+
isInited={props.isInited}
|
|
51
54
|
/>
|
|
52
55
|
</Match>
|
|
53
56
|
<Match when={type() === "composed"}>
|
|
@@ -56,6 +59,7 @@ export const Filter: Component<FilterProps<ConfigFilter, FilterValue>> = (props)
|
|
|
56
59
|
value={props.value as FilterValueComposed}
|
|
57
60
|
onValueChange={props.onValueChange}
|
|
58
61
|
onValueClear={props.onValueClear}
|
|
62
|
+
isInited={props.isInited}
|
|
59
63
|
/>
|
|
60
64
|
</Match>
|
|
61
65
|
</Switch>
|
|
@@ -38,6 +38,7 @@ export const FilterComposed: Component<FilterProps<ConfigFilterComposed, FilterV
|
|
|
38
38
|
defaultValue={props.defaultValue}
|
|
39
39
|
onValueChange={props.onValueChange}
|
|
40
40
|
onValueClear={props.onValueClear}
|
|
41
|
+
isInited={props.isInited}
|
|
41
42
|
/>
|
|
42
43
|
</Match>
|
|
43
44
|
<Match when={id() === "composed/locus"}>
|
|
@@ -47,6 +48,7 @@ export const FilterComposed: Component<FilterProps<ConfigFilterComposed, FilterV
|
|
|
47
48
|
defaultValue={props.defaultValue}
|
|
48
49
|
onValueChange={props.onValueChange}
|
|
49
50
|
onValueClear={props.onValueClear}
|
|
51
|
+
isInited={props.isInited}
|
|
50
52
|
/>
|
|
51
53
|
</Match>
|
|
52
54
|
<Match when={id() === "composed/allelicImbalance"}>
|
|
@@ -56,6 +58,7 @@ export const FilterComposed: Component<FilterProps<ConfigFilterComposed, FilterV
|
|
|
56
58
|
defaultValue={props.defaultValue}
|
|
57
59
|
onValueChange={props.onValueChange}
|
|
58
60
|
onValueClear={props.onValueClear}
|
|
61
|
+
isInited={props.isInited}
|
|
59
62
|
/>
|
|
60
63
|
</Match>
|
|
61
64
|
<Match when={id() === "composed/inheritanceMatch"}>
|
|
@@ -65,6 +68,7 @@ export const FilterComposed: Component<FilterProps<ConfigFilterComposed, FilterV
|
|
|
65
68
|
defaultValue={props.defaultValue}
|
|
66
69
|
onValueChange={props.onValueChange}
|
|
67
70
|
onValueClear={props.onValueClear}
|
|
71
|
+
isInited={props.isInited}
|
|
68
72
|
/>
|
|
69
73
|
</Match>
|
|
70
74
|
<Match when={id() === "composed/deNovo"}>
|
|
@@ -74,6 +78,7 @@ export const FilterComposed: Component<FilterProps<ConfigFilterComposed, FilterV
|
|
|
74
78
|
defaultValue={props.defaultValue}
|
|
75
79
|
onValueChange={props.onValueChange}
|
|
76
80
|
onValueClear={props.onValueClear}
|
|
81
|
+
isInited={props.isInited}
|
|
77
82
|
/>
|
|
78
83
|
</Match>
|
|
79
84
|
<Match when={id() === "composed/vipC"}>
|
|
@@ -83,6 +88,7 @@ export const FilterComposed: Component<FilterProps<ConfigFilterComposed, FilterV
|
|
|
83
88
|
defaultValue={props.defaultValue}
|
|
84
89
|
onValueChange={props.onValueChange}
|
|
85
90
|
onValueClear={props.onValueClear}
|
|
91
|
+
isInited={props.isInited}
|
|
86
92
|
/>
|
|
87
93
|
</Match>
|
|
88
94
|
<Match when={id() === "composed/vipCS"}>
|
|
@@ -92,6 +98,7 @@ export const FilterComposed: Component<FilterProps<ConfigFilterComposed, FilterV
|
|
|
92
98
|
defaultValue={props.defaultValue}
|
|
93
99
|
onValueChange={props.onValueChange}
|
|
94
100
|
onValueClear={props.onValueClear}
|
|
101
|
+
isInited={props.isInited}
|
|
95
102
|
/>
|
|
96
103
|
</Match>
|
|
97
104
|
</Switch>
|
|
@@ -12,6 +12,7 @@ export const FilterHpo: Component<FilterProps<ConfigFilterHpo, FilterValueHpo>>
|
|
|
12
12
|
defaultValue={props.defaultValue}
|
|
13
13
|
onValueChange={props.onValueChange as FilterValueChangeCallback<FilterValueField>}
|
|
14
14
|
onValueClear={props.onValueClear}
|
|
15
|
+
isInited={props.isInited}
|
|
15
16
|
/>
|
|
16
17
|
);
|
|
17
18
|
};
|
|
@@ -12,6 +12,7 @@ export const FilterVipC: Component<FilterProps<ConfigFilterVipC, FilterValueVipC
|
|
|
12
12
|
defaultValue={props.defaultValue}
|
|
13
13
|
onValueChange={props.onValueChange as FilterValueChangeCallback<FilterValueField>}
|
|
14
14
|
onValueClear={props.onValueClear}
|
|
15
|
+
isInited={props.isInited}
|
|
15
16
|
/>
|
|
16
17
|
);
|
|
17
18
|
};
|
|
@@ -12,6 +12,7 @@ export const FilterVipCS: Component<FilterProps<ConfigFilterVipCS, FilterValueVi
|
|
|
12
12
|
defaultValue={props.defaultValue}
|
|
13
13
|
onValueChange={props.onValueChange as FilterValueChangeCallback<FilterValueField>}
|
|
14
14
|
onValueClear={props.onValueClear}
|
|
15
|
+
isInited={props.isInited}
|
|
15
16
|
/>
|
|
16
17
|
);
|
|
17
18
|
};
|
|
@@ -42,6 +42,7 @@ export const FilterFixed: Component<FilterProps<ConfigFilterFixed, FilterValue>>
|
|
|
42
42
|
defaultValue={props.defaultValue}
|
|
43
43
|
onValueChange={props.onValueChange}
|
|
44
44
|
onValueClear={props.onValueClear}
|
|
45
|
+
isInited={props.isInited}
|
|
45
46
|
/>
|
|
46
47
|
</Match>
|
|
47
48
|
<Match when={id() === "fixed/pos"}>
|
|
@@ -51,6 +52,7 @@ export const FilterFixed: Component<FilterProps<ConfigFilterFixed, FilterValue>>
|
|
|
51
52
|
defaultValue={props.defaultValue}
|
|
52
53
|
onValueChange={props.onValueChange}
|
|
53
54
|
onValueClear={props.onValueClear}
|
|
55
|
+
isInited={props.isInited}
|
|
54
56
|
/>
|
|
55
57
|
</Match>
|
|
56
58
|
<Match when={id() === "fixed/id"}>
|
|
@@ -60,6 +62,7 @@ export const FilterFixed: Component<FilterProps<ConfigFilterFixed, FilterValue>>
|
|
|
60
62
|
defaultValue={props.defaultValue}
|
|
61
63
|
onValueChange={props.onValueChange}
|
|
62
64
|
onValueClear={props.onValueClear}
|
|
65
|
+
isInited={props.isInited}
|
|
63
66
|
/>
|
|
64
67
|
</Match>
|
|
65
68
|
<Match when={id() === "fixed/ref"}>
|
|
@@ -69,6 +72,7 @@ export const FilterFixed: Component<FilterProps<ConfigFilterFixed, FilterValue>>
|
|
|
69
72
|
defaultValue={props.defaultValue}
|
|
70
73
|
onValueChange={props.onValueChange}
|
|
71
74
|
onValueClear={props.onValueClear}
|
|
75
|
+
isInited={props.isInited}
|
|
72
76
|
/>
|
|
73
77
|
</Match>
|
|
74
78
|
<Match when={id() === "fixed/alt"}>
|
|
@@ -78,6 +82,7 @@ export const FilterFixed: Component<FilterProps<ConfigFilterFixed, FilterValue>>
|
|
|
78
82
|
defaultValue={props.defaultValue}
|
|
79
83
|
onValueChange={props.onValueChange}
|
|
80
84
|
onValueClear={props.onValueClear}
|
|
85
|
+
isInited={props.isInited}
|
|
81
86
|
/>
|
|
82
87
|
</Match>
|
|
83
88
|
<Match when={id() === "fixed/qual"}>
|
|
@@ -87,6 +92,7 @@ export const FilterFixed: Component<FilterProps<ConfigFilterFixed, FilterValue>>
|
|
|
87
92
|
defaultValue={props.defaultValue}
|
|
88
93
|
onValueChange={props.onValueChange}
|
|
89
94
|
onValueClear={props.onValueClear}
|
|
95
|
+
isInited={props.isInited}
|
|
90
96
|
/>
|
|
91
97
|
</Match>
|
|
92
98
|
<Match when={id() === "fixed/filter"}>
|
|
@@ -96,6 +102,7 @@ export const FilterFixed: Component<FilterProps<ConfigFilterFixed, FilterValue>>
|
|
|
96
102
|
defaultValue={props.defaultValue}
|
|
97
103
|
onValueChange={props.onValueChange}
|
|
98
104
|
onValueClear={props.onValueClear}
|
|
105
|
+
isInited={props.isInited}
|
|
99
106
|
/>
|
|
100
107
|
</Match>
|
|
101
108
|
</Switch>
|
|
@@ -98,7 +98,7 @@ export const FilterCategorical: Component<FilterProps<ConfigFilterField, FilterV
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
onMount(() => {
|
|
101
|
-
if (props.config.defaultValue !== undefined) {
|
|
101
|
+
if (props.config.defaultValue !== undefined && !props.isInited) {
|
|
102
102
|
const values = props.config.defaultValue.split(",");
|
|
103
103
|
validateValues(values, categories());
|
|
104
104
|
props.onValueChange({ value: values as FilterValueCategorical });
|
|
@@ -25,7 +25,7 @@ export const FilterInterval: Component<FilterProps<ConfigFilterField, FilterValu
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
onMount(() => {
|
|
28
|
-
if (props.config.defaultValue !== undefined) {
|
|
28
|
+
if (props.config.defaultValue !== undefined && !props.isInited) {
|
|
29
29
|
const split = props.config.defaultValue.split(",");
|
|
30
30
|
if (split.length >= 1) {
|
|
31
31
|
if (split[0] !== undefined && split[0] !== "") {
|
|
@@ -24,7 +24,7 @@ export const FilterString: Component<FilterProps<ConfigFilterField, FilterValueS
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
onMount(() => {
|
|
27
|
-
if (props.config.defaultValue !== undefined) {
|
|
27
|
+
if (props.config.defaultValue !== undefined && !props.isInited) {
|
|
28
28
|
setInputValue(props.config.defaultValue);
|
|
29
29
|
onApply();
|
|
30
30
|
}
|
|
@@ -25,6 +25,7 @@ export const FilterTyped: Component<FilterProps<ConfigFilterField, FilterValueFi
|
|
|
25
25
|
value={props.value as FilterValueCategorical}
|
|
26
26
|
onValueChange={props.onValueChange}
|
|
27
27
|
onValueClear={props.onValueClear}
|
|
28
|
+
isInited={props.isInited}
|
|
28
29
|
/>
|
|
29
30
|
</Match>
|
|
30
31
|
<Match when={type() === "CHARACTER" || type() === "STRING"}>
|
|
@@ -34,6 +35,7 @@ export const FilterTyped: Component<FilterProps<ConfigFilterField, FilterValueFi
|
|
|
34
35
|
defaultValue={props.defaultValue}
|
|
35
36
|
onValueChange={props.onValueChange}
|
|
36
37
|
onValueClear={props.onValueClear}
|
|
38
|
+
isInited={props.isInited}
|
|
37
39
|
/>
|
|
38
40
|
</Match>
|
|
39
41
|
<Match when={type() === "INTEGER" || type() === "FLOAT"}>
|
|
@@ -42,6 +44,7 @@ export const FilterTyped: Component<FilterProps<ConfigFilterField, FilterValueFi
|
|
|
42
44
|
value={props.value as FilterValueInterval}
|
|
43
45
|
onValueChange={props.onValueChange}
|
|
44
46
|
onValueClear={props.onValueClear}
|
|
47
|
+
isInited={props.isInited}
|
|
45
48
|
/>
|
|
46
49
|
</Match>
|
|
47
50
|
<Match when={type() === "FLAG"}>
|
|
@@ -50,6 +53,7 @@ export const FilterTyped: Component<FilterProps<ConfigFilterField, FilterValueFi
|
|
|
50
53
|
value={props.value as FilterValueFlag}
|
|
51
54
|
onValueChange={props.onValueChange}
|
|
52
55
|
onValueClear={props.onValueClear}
|
|
56
|
+
isInited={props.isInited}
|
|
53
57
|
/>
|
|
54
58
|
</Match>
|
|
55
59
|
</Switch>
|
package/src/store/variants.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VariantType } from "../utils/variantType.ts";
|
|
2
2
|
import { SampleContainer } from "../utils/api.ts";
|
|
3
|
-
import { FilterValueMap } from "../types/filter";
|
|
3
|
+
import { FilterInitedList, FilterValueMap } from "../types/filter";
|
|
4
4
|
import { FilterId, FilterValue } from "../types/configFilter";
|
|
5
5
|
import { produce } from "solid-js/store";
|
|
6
6
|
import { AppState, AppStateVariantType, AppStateVariantTypes, AppStore, Page, Sort } from "../types/store";
|
|
@@ -20,6 +20,7 @@ export type VariantStore = {
|
|
|
20
20
|
getSort(): Sort | null | undefined;
|
|
21
21
|
setSort(sort: Sort): void;
|
|
22
22
|
clearSort(): void;
|
|
23
|
+
getFiltersInited(): FilterInitedList;
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
export function wrapStore(store: AppStore, sample: SampleContainer | null, variantType: VariantType) {
|
|
@@ -48,7 +49,7 @@ export function wrapStore(store: AppStore, sample: SampleContainer | null, varia
|
|
|
48
49
|
if (variantTypeKey in stateVariantTypes) {
|
|
49
50
|
stateVariantType = stateVariantTypes[variantTypeKey]!;
|
|
50
51
|
} else {
|
|
51
|
-
stateVariantType = {};
|
|
52
|
+
stateVariantType = { initedFilters: [] };
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
return stateVariantType;
|
|
@@ -78,7 +79,7 @@ export function wrapStore(store: AppStore, sample: SampleContainer | null, varia
|
|
|
78
79
|
if (variantTypeKey in stateVariantTypes) {
|
|
79
80
|
stateVariantType = stateVariantTypes[variantTypeKey]!;
|
|
80
81
|
} else {
|
|
81
|
-
stateVariantType = {};
|
|
82
|
+
stateVariantType = { initedFilters: [] };
|
|
82
83
|
stateVariantTypes[variantTypeKey] = stateVariantType;
|
|
83
84
|
}
|
|
84
85
|
|
|
@@ -95,6 +96,18 @@ export function wrapStore(store: AppStore, sample: SampleContainer | null, varia
|
|
|
95
96
|
return page;
|
|
96
97
|
}
|
|
97
98
|
|
|
99
|
+
function setVariantsStateFiltersInited(state: AppState, filterId: string): void {
|
|
100
|
+
const stateVariantType: AppStateVariantType = getCreateVariantsState(state);
|
|
101
|
+
if (!stateVariantType.initedFilters.includes(filterId)) {
|
|
102
|
+
stateVariantType.initedFilters.push(filterId);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function getVariantsStateFiltersInited(state: AppState): FilterInitedList {
|
|
107
|
+
const stateVariantType: AppStateVariantType = getCreateVariantsState(state);
|
|
108
|
+
return stateVariantType.initedFilters;
|
|
109
|
+
}
|
|
110
|
+
|
|
98
111
|
function getCreateVariantsStateFilterValues(state: AppState): FilterValueMap {
|
|
99
112
|
const stateVariantType: AppStateVariantType = getCreateVariantsState(state);
|
|
100
113
|
let filterValues = stateVariantType.filterValues;
|
|
@@ -112,6 +125,7 @@ export function wrapStore(store: AppStore, sample: SampleContainer | null, varia
|
|
|
112
125
|
setFilterValue(id: FilterId, value: FilterValue) {
|
|
113
126
|
setState(
|
|
114
127
|
produce((state) => {
|
|
128
|
+
setVariantsStateFiltersInited(state, id);
|
|
115
129
|
const filterValueMap = getCreateVariantsStateFilterValues(state);
|
|
116
130
|
filterValueMap[id] = value;
|
|
117
131
|
|
|
@@ -124,9 +138,9 @@ export function wrapStore(store: AppStore, sample: SampleContainer | null, varia
|
|
|
124
138
|
clearFilter(id: FilterId) {
|
|
125
139
|
setState(
|
|
126
140
|
produce((state) => {
|
|
141
|
+
setVariantsStateFiltersInited(state, id);
|
|
127
142
|
const filterValueMap = getCreateVariantsStateFilterValues(state);
|
|
128
143
|
delete filterValueMap[id];
|
|
129
|
-
|
|
130
144
|
const page = getCreateVariantsStatePage(state);
|
|
131
145
|
page.number = 0;
|
|
132
146
|
}),
|
|
@@ -178,5 +192,8 @@ export function wrapStore(store: AppStore, sample: SampleContainer | null, varia
|
|
|
178
192
|
}),
|
|
179
193
|
);
|
|
180
194
|
},
|
|
195
|
+
getFiltersInited(): FilterInitedList {
|
|
196
|
+
return getVariantsStateFiltersInited(state);
|
|
197
|
+
},
|
|
181
198
|
};
|
|
182
199
|
}
|
|
@@ -37,7 +37,7 @@ export type FilterValueFixed =
|
|
|
37
37
|
export type FilterValueField = FilterValueCategorical | FilterValueString | FilterValueInterval;
|
|
38
38
|
|
|
39
39
|
export type FilterValue = FilterValueFixed | FilterValueField | FilterValueComposed;
|
|
40
|
-
export type FilterValueMap = { [key: FilterId]: FilterValue };
|
|
40
|
+
export type FilterValueMap = { [key: FilterId]: FilterValue | undefined };
|
|
41
41
|
|
|
42
42
|
export type ConfigFilterFixed =
|
|
43
43
|
| ConfigFilterChrom
|
package/src/types/filter.d.ts
CHANGED
package/src/types/store.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SetStoreFunction } from "solid-js/store";
|
|
2
2
|
import { VariantTypeId } from "../utils/variantType.ts";
|
|
3
3
|
import { SortOrder } from "@molgenis/vip-report-api";
|
|
4
|
-
import { FilterValueMap } from "./filter";
|
|
4
|
+
import { FilterInitedList, FilterValueMap } from "./filter";
|
|
5
5
|
|
|
6
6
|
export type Page = { number: number; size?: number };
|
|
7
7
|
export type Sort = SortOrder | SortOrder[];
|
|
@@ -13,6 +13,7 @@ export type AppStateVariantType = {
|
|
|
13
13
|
* undefined: sort behavior is undefined, the caller of this function could fall back to a default sort
|
|
14
14
|
*/
|
|
15
15
|
sort?: Sort | null;
|
|
16
|
+
initedFilters: FilterInitedList;
|
|
16
17
|
};
|
|
17
18
|
export type AppStateVariantTypes = Partial<Record<VariantTypeId, AppStateVariantType>>;
|
|
18
19
|
type AppStateSamples = {
|
|
@@ -166,7 +166,7 @@ function initConfigVariantsRecordsPerPage(
|
|
|
166
166
|
variantType: VariantType,
|
|
167
167
|
): ConfigRecordsPerPage {
|
|
168
168
|
const configValue = config && (config[variantType.id] || config["all"]);
|
|
169
|
-
return configValue || [{ number: 10
|
|
169
|
+
return configValue || [{ number: 10 }, { number: 20, selected: true }, { number: 50 }, { number: 100 }];
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
export function getLabel(config: Describable, defaultLabel: string): string {
|
package/vite.config.mts
CHANGED
|
@@ -10,12 +10,12 @@ export default defineConfig(({ command }) => ({
|
|
|
10
10
|
pure: command === "build" ? ["console.log"] : [],
|
|
11
11
|
},
|
|
12
12
|
build: {
|
|
13
|
-
target:
|
|
13
|
+
target: "es2022",
|
|
14
14
|
modulePreload: false,
|
|
15
15
|
reportCompressedSize: false,
|
|
16
16
|
// inline plugin build options
|
|
17
17
|
rollupOptions: {
|
|
18
|
-
input: ["./index.html", "./node_modules/@molgenis/vite-plugin-inline/dist/loader.
|
|
18
|
+
input: ["./index.html", "./node_modules/@molgenis/vite-plugin-inline/dist/loader/loader.js"],
|
|
19
19
|
output: {
|
|
20
20
|
manualChunks: undefined,
|
|
21
21
|
},
|
|
@@ -24,12 +24,11 @@ export default defineConfig(({ command }) => ({
|
|
|
24
24
|
assetsInclude: "**/*.blob",
|
|
25
25
|
test: {
|
|
26
26
|
coverage: {
|
|
27
|
-
|
|
27
|
+
// TODO remove /*.ts postfix once component tests are added
|
|
28
|
+
include: ["src/**/*.ts"],
|
|
28
29
|
exclude: [...coverageConfigDefaults.exclude, "src/mocks/**", "**/*.precompiled.ts"],
|
|
29
|
-
// TODO add .tsx once component tests are added
|
|
30
|
-
extension: [".ts"],
|
|
31
30
|
thresholds: {
|
|
32
|
-
branches:
|
|
31
|
+
branches: 70,
|
|
33
32
|
lines: 80,
|
|
34
33
|
functions: 80,
|
|
35
34
|
statements: 80,
|