@truedat/dd 7.2.9 → 7.2.11
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 +6 -6
- package/src/components/StructuresDownloadOption.js +1 -3
- package/src/components/StructuresEditableDownloadOption.js +1 -3
- package/src/components/__tests__/StructuresDownloadOption.spec.js +2 -1
- package/src/components/__tests__/__snapshots__/StructuresDownloadOption.spec.js.snap +2 -7
- package/src/reducers/__tests__/grantQuery.spec.js +2 -5
- package/src/reducers/__tests__/structureQuery.spec.js +1 -1
- package/src/reducers/grantQuery.js +5 -8
- package/src/reducers/structureQuery.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.11",
|
|
4
4
|
"description": "Truedat Web Data Dictionary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@testing-library/jest-dom": "^5.16.5",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "7.2.
|
|
37
|
+
"@truedat/test": "7.2.11",
|
|
38
38
|
"babel-jest": "^28.1.0",
|
|
39
39
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
40
40
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@apollo/client": "^3.7.1",
|
|
91
|
-
"@truedat/auth": "7.2.
|
|
92
|
-
"@truedat/core": "7.2.
|
|
93
|
-
"@truedat/df": "7.2.
|
|
91
|
+
"@truedat/auth": "7.2.11",
|
|
92
|
+
"@truedat/core": "7.2.11",
|
|
93
|
+
"@truedat/df": "7.2.11",
|
|
94
94
|
"lodash": "^4.17.21",
|
|
95
95
|
"moment": "^2.29.4",
|
|
96
96
|
"path-to-regexp": "^1.7.0",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"react-dom": ">= 16.8.6 < 17",
|
|
116
116
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "74eb04f81dd49275229cf3050b56b897ff78410e"
|
|
119
119
|
}
|
|
@@ -30,7 +30,6 @@ export const StructuresDownloadOption = ({ setDownloading }) => {
|
|
|
30
30
|
searchData,
|
|
31
31
|
loading: structuresLoading,
|
|
32
32
|
filterParams: searchParams,
|
|
33
|
-
allActiveFilters: allActiveFilters,
|
|
34
33
|
} = useSearchContext();
|
|
35
34
|
const { trigger: triggerDownload, isMutating: structuresDownloading } =
|
|
36
35
|
useDataStructureDownload();
|
|
@@ -46,8 +45,7 @@ export const StructuresDownloadOption = ({ setDownloading }) => {
|
|
|
46
45
|
_.fromPairs
|
|
47
46
|
)(staticLabels);
|
|
48
47
|
|
|
49
|
-
const isDisabled =
|
|
50
|
-
_.isEmpty(structures) || _.isEmpty(_.path("type.raw")(allActiveFilters));
|
|
48
|
+
const isDisabled = _.isEmpty(structures);
|
|
51
49
|
|
|
52
50
|
return !structuresLoading ? (
|
|
53
51
|
<Dropdown.Item
|
|
@@ -13,7 +13,6 @@ export const StructuresEditableDownloadOption = ({ setDownloading }) => {
|
|
|
13
13
|
searchData,
|
|
14
14
|
loading: structuresLoading,
|
|
15
15
|
filterParams: searchParams,
|
|
16
|
-
allActiveFilters: allActiveFilters,
|
|
17
16
|
} = useSearchContext();
|
|
18
17
|
const { trigger: triggerDownload, isMutating: structuresDownloading } =
|
|
19
18
|
useDataStructureDownload();
|
|
@@ -24,8 +23,7 @@ export const StructuresEditableDownloadOption = ({ setDownloading }) => {
|
|
|
24
23
|
|
|
25
24
|
const structures = searchData?.data;
|
|
26
25
|
|
|
27
|
-
const isDisabled =
|
|
28
|
-
_.isEmpty(structures) || _.isEmpty(_.path("type.raw")(allActiveFilters));
|
|
26
|
+
const isDisabled = _.isEmpty(structures);
|
|
29
27
|
|
|
30
28
|
return (
|
|
31
29
|
!structuresLoading && (
|
|
@@ -30,7 +30,8 @@ describe("<StructuresDownloadOption />", () => {
|
|
|
30
30
|
</SearchContextWrapper>,
|
|
31
31
|
renderOpts
|
|
32
32
|
);
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
expect(getByRole("option")).toHaveAttribute("aria-disabled", "false");
|
|
34
35
|
expect(container).toMatchSnapshot();
|
|
35
36
|
});
|
|
36
37
|
|
|
@@ -21,8 +21,8 @@ exports[`<StructuresDownloadOption /> has type filter applied 1`] = `
|
|
|
21
21
|
exports[`<StructuresDownloadOption /> matches the latest snapshot 1`] = `
|
|
22
22
|
<div>
|
|
23
23
|
<div
|
|
24
|
-
aria-disabled="
|
|
25
|
-
class="
|
|
24
|
+
aria-disabled="false"
|
|
25
|
+
class="item"
|
|
26
26
|
role="option"
|
|
27
27
|
>
|
|
28
28
|
<i
|
|
@@ -32,11 +32,6 @@ exports[`<StructuresDownloadOption /> matches the latest snapshot 1`] = `
|
|
|
32
32
|
<span>
|
|
33
33
|
tooltip
|
|
34
34
|
</span>
|
|
35
|
-
<p
|
|
36
|
-
class="menu-item-description"
|
|
37
|
-
>
|
|
38
|
-
popup
|
|
39
|
-
</p>
|
|
40
35
|
</div>
|
|
41
36
|
</div>
|
|
42
37
|
`;
|
|
@@ -74,16 +74,13 @@ describe("reducers: grantQuery", () => {
|
|
|
74
74
|
).toMatchObject({ query });
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
it("when query is not empty it should order by relevance
|
|
77
|
+
it("when query is not empty it should order by relevance", () => {
|
|
78
78
|
const payload = { query };
|
|
79
79
|
expect(
|
|
80
80
|
grantQuery(fooState, { type: searchGrants.TRIGGER, payload })
|
|
81
81
|
).toMatchObject({
|
|
82
82
|
query,
|
|
83
|
-
sort: [
|
|
84
|
-
{ _score: "desc" },
|
|
85
|
-
{ "data_structure_version.name.raw": "asc" },
|
|
86
|
-
],
|
|
83
|
+
sort: [{ _score: "desc" }],
|
|
87
84
|
});
|
|
88
85
|
});
|
|
89
86
|
|
|
@@ -11,17 +11,14 @@ import {
|
|
|
11
11
|
|
|
12
12
|
const defaultPage = 1;
|
|
13
13
|
const defaultSize = 20;
|
|
14
|
-
const defaultSearchSort = [
|
|
15
|
-
|
|
16
|
-
{ "data_structure_version.name.raw": "asc" },
|
|
17
|
-
];
|
|
18
|
-
const byNameSort = [{ "data_structure_version.name.raw": "asc" }];
|
|
14
|
+
const defaultSearchSort = [{ "data_structure_version.name.raw": "asc" }];
|
|
15
|
+
const scoreSort = [{ _score: "desc" }];
|
|
19
16
|
|
|
20
17
|
export const initialState = {
|
|
21
18
|
query: "",
|
|
22
19
|
page: defaultPage,
|
|
23
20
|
size: defaultSize,
|
|
24
|
-
sort:
|
|
21
|
+
sort: defaultSearchSort,
|
|
25
22
|
};
|
|
26
23
|
|
|
27
24
|
const grantQuery = (state = initialState, { type, payload }) => {
|
|
@@ -40,7 +37,7 @@ const grantQuery = (state = initialState, { type, payload }) => {
|
|
|
40
37
|
case searchGrants.TRIGGER: {
|
|
41
38
|
const page = defaultPage;
|
|
42
39
|
const query = _.propOr("", "query")(payload);
|
|
43
|
-
const sort = query != "" ?
|
|
40
|
+
const sort = query != "" ? scoreSort : defaultSearchSort;
|
|
44
41
|
return { ...state, query, page, sort };
|
|
45
42
|
}
|
|
46
43
|
case selectGrantPage.TRIGGER: {
|
|
@@ -52,7 +49,7 @@ const grantQuery = (state = initialState, { type, payload }) => {
|
|
|
52
49
|
return { ...state, sort, page: defaultPage };
|
|
53
50
|
}
|
|
54
51
|
case clearGrantsSort.TRIGGER: {
|
|
55
|
-
return { ...state, sort:
|
|
52
|
+
return { ...state, sort: defaultSearchSort };
|
|
56
53
|
}
|
|
57
54
|
default:
|
|
58
55
|
return state;
|
|
@@ -3,14 +3,14 @@ import { clearStructureFilters, searchStructures } from "../routines";
|
|
|
3
3
|
|
|
4
4
|
const defaultPage = 1;
|
|
5
5
|
const defaultSize = 20;
|
|
6
|
-
const defaultSearchSort = [{
|
|
7
|
-
const
|
|
6
|
+
const defaultSearchSort = [{ "name.raw": "asc" }];
|
|
7
|
+
const scoreSort = [{ _score: "desc" }];
|
|
8
8
|
|
|
9
9
|
export const initialState = {
|
|
10
10
|
query: "",
|
|
11
11
|
page: defaultPage,
|
|
12
12
|
size: defaultSize,
|
|
13
|
-
sort:
|
|
13
|
+
sort: defaultSearchSort,
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const structureQuery = (state = initialState, { type, payload }) => {
|
|
@@ -21,7 +21,7 @@ const structureQuery = (state = initialState, { type, payload }) => {
|
|
|
21
21
|
case searchStructures.TRIGGER: {
|
|
22
22
|
const page = defaultPage;
|
|
23
23
|
const query = _.propOr("", "query")(payload);
|
|
24
|
-
const sort = query != "" ?
|
|
24
|
+
const sort = query != "" ? scoreSort : defaultSearchSort;
|
|
25
25
|
return { ...state, query, page, sort };
|
|
26
26
|
}
|
|
27
27
|
default:
|