@truedat/dd 6.3.3 → 6.3.4
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.4",
|
|
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": "6.3.
|
|
37
|
+
"@truedat/test": "6.3.4",
|
|
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": "6.3.
|
|
92
|
-
"@truedat/core": "6.3.
|
|
93
|
-
"@truedat/df": "6.3.
|
|
91
|
+
"@truedat/auth": "6.3.4",
|
|
92
|
+
"@truedat/core": "6.3.4",
|
|
93
|
+
"@truedat/df": "6.3.4",
|
|
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": "e7d4c50cf2989fde79b5d1a46c83e6c6ce34f54d"
|
|
119
119
|
}
|
|
@@ -27,9 +27,6 @@ import StructuresView from "./StructuresView";
|
|
|
27
27
|
const EventsLoader = React.lazy(() =>
|
|
28
28
|
import("@truedat/audit/components/EventsLoader")
|
|
29
29
|
);
|
|
30
|
-
const ConceptsLoader = React.lazy(() =>
|
|
31
|
-
import("@truedat/bg/concepts/components/ConceptsLoader")
|
|
32
|
-
);
|
|
33
30
|
|
|
34
31
|
const RuleImplementationsLoader = React.lazy(() =>
|
|
35
32
|
import("@truedat/dq/components/RuleImplementationsLoader")
|
|
@@ -39,17 +36,6 @@ const RolesLoader = React.lazy(() =>
|
|
|
39
36
|
import("@truedat/auth/roles/components/RolesLoader")
|
|
40
37
|
);
|
|
41
38
|
|
|
42
|
-
const ConceptSelectorConceptsLoader = () => (
|
|
43
|
-
<ConceptsLoader
|
|
44
|
-
pageSize={7}
|
|
45
|
-
linkable
|
|
46
|
-
defaultFilters={{
|
|
47
|
-
current: [true],
|
|
48
|
-
status: ["draft", "pending_approval", "rejected", "published"],
|
|
49
|
-
}}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
|
|
53
39
|
const StructureImplementationsLoader = () => {
|
|
54
40
|
const match = useRouteMatch();
|
|
55
41
|
const id = _.path("params.id")(match);
|
|
@@ -108,11 +94,7 @@ const AuthorizedRoutes = () => {
|
|
|
108
94
|
)}
|
|
109
95
|
/>
|
|
110
96
|
</Switch>
|
|
111
|
-
<Route
|
|
112
|
-
exact
|
|
113
|
-
path={[STRUCTURE_EVENTS, STRUCTURE_VERSION, STRUCTURE]}
|
|
114
|
-
component={ConceptSelectorConceptsLoader}
|
|
115
|
-
/>
|
|
97
|
+
<Route exact path={[STRUCTURE_EVENTS, STRUCTURE_VERSION, STRUCTURE]} />
|
|
116
98
|
<Route path={STRUCTURE_EVENTS} component={StructureEventsLoader} />
|
|
117
99
|
<Route
|
|
118
100
|
path={[STRUCTURE_VERSION, STRUCTURE]}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import { compile } from "path-to-regexp";
|
|
3
3
|
import useSWR from "swr";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import useSWRMutations from "swr/mutation";
|
|
5
|
+
import { apiJson, apiJsonPost } from "@truedat/core/services/api";
|
|
6
|
+
import {
|
|
7
|
+
API_SYSTEM_STRUCTURES,
|
|
8
|
+
API_DATA_STRUCTURES_SEARCH,
|
|
9
|
+
API_DATA_STRUCTURE_FILTERS_SEARCH,
|
|
10
|
+
} from "../api";
|
|
6
11
|
|
|
7
12
|
const toApiPath = compile(API_SYSTEM_STRUCTURES);
|
|
8
13
|
|
|
@@ -38,3 +43,15 @@ export const useStructures = (args) => {
|
|
|
38
43
|
count: parseInt(data?.headers["x-total-count"]),
|
|
39
44
|
};
|
|
40
45
|
};
|
|
46
|
+
|
|
47
|
+
export const useDataStructureFilters = () => {
|
|
48
|
+
return useSWRMutations(API_DATA_STRUCTURE_FILTERS_SEARCH, (url, { arg }) =>
|
|
49
|
+
apiJsonPost(url, arg)
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const useDataStructureSearch = () => {
|
|
54
|
+
return useSWRMutations(API_DATA_STRUCTURES_SEARCH, (url, { arg }) =>
|
|
55
|
+
apiJsonPost(url, arg)
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -64,13 +64,7 @@ describe("selectors: getTabVisibility", () => {
|
|
|
64
64
|
).toMatchObject({ profile: true });
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
it("should include links iff
|
|
68
|
-
expect(getTabVisibility({ conceptCount: 1 })).toMatchObject({
|
|
69
|
-
links: true,
|
|
70
|
-
});
|
|
71
|
-
expect(getTabVisibility({ conceptCount: 0 })).toMatchObject({
|
|
72
|
-
links: false,
|
|
73
|
-
});
|
|
67
|
+
it("should include links iff structure has links", () => {
|
|
74
68
|
expect(
|
|
75
69
|
getTabVisibility({ structureLinks: [{ resource_type: "concept" }] })
|
|
76
70
|
).toMatchObject({
|
|
@@ -19,9 +19,8 @@ const profileTabVisible = ({
|
|
|
19
19
|
notEmpty(structureProfile?.patterns));
|
|
20
20
|
|
|
21
21
|
const linksTabVisible = (state) => {
|
|
22
|
-
const { conceptCount } = state;
|
|
23
22
|
const structureLinks = getStructureToConceptLinks(state);
|
|
24
|
-
return
|
|
23
|
+
return !_.isEmpty(structureLinks);
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
const notesTabVisible = ({ templatesLoading, templates, structure }) =>
|