@truedat/core 4.54.7 → 4.54.9
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/CHANGELOG.md +6 -0
- package/package.json +3 -3
- package/src/api/queries.js +12 -0
- package/src/hooks/index.js +1 -0
- package/src/hooks/useTemplate.js +18 -0
- package/src/routes.js +2 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/core",
|
|
3
|
-
"version": "4.54.
|
|
3
|
+
"version": "4.54.9",
|
|
4
4
|
"description": "Truedat Web Core",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@testing-library/jest-dom": "^5.16.4",
|
|
36
36
|
"@testing-library/react": "^12.0.0",
|
|
37
37
|
"@testing-library/user-event": "^13.2.1",
|
|
38
|
-
"@truedat/test": "4.54.
|
|
38
|
+
"@truedat/test": "4.54.9",
|
|
39
39
|
"babel-jest": "^28.1.0",
|
|
40
40
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
41
41
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"react-dom": ">= 16.8.6 < 17",
|
|
113
113
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "27f711249723050708a6f6f4de3ab5029069c4d7"
|
|
116
116
|
}
|
package/src/api/queries.js
CHANGED
|
@@ -33,6 +33,18 @@ export const TEMPLATES_QUERY = gql`
|
|
|
33
33
|
}
|
|
34
34
|
`;
|
|
35
35
|
|
|
36
|
+
export const TEMPLATE_QUERY = gql`
|
|
37
|
+
query Template($name: String!, $domainIds: [ID]) {
|
|
38
|
+
template(name: $name, domainIds: $domainIds) {
|
|
39
|
+
id
|
|
40
|
+
name
|
|
41
|
+
label
|
|
42
|
+
scope
|
|
43
|
+
content
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
|
|
36
48
|
export const FUNCTIONS_QUERY = gql`
|
|
37
49
|
query Functions {
|
|
38
50
|
functions {
|
package/src/hooks/index.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
import { useQuery } from "@apollo/client";
|
|
3
|
+
import { TEMPLATE_QUERY } from "../api/queries";
|
|
4
|
+
|
|
5
|
+
export const useTemplate = ({ name, onLoad, domainIds }) =>
|
|
6
|
+
useQuery(TEMPLATE_QUERY, {
|
|
7
|
+
fetchPolicy: "cache-and-network",
|
|
8
|
+
variables: { name, domainIds },
|
|
9
|
+
onCompleted: onLoad,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
useTemplate.propTypes = {
|
|
13
|
+
domainIds: PropTypes.array,
|
|
14
|
+
name: PropTypes.string.isRequired,
|
|
15
|
+
onLoad: PropTypes.func,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default useTemplate;
|
package/src/routes.js
CHANGED
|
@@ -37,6 +37,7 @@ export const DOMAINS_ACTIONS = "/domains/:action";
|
|
|
37
37
|
export const DOMAINS_NEW = "/domains/new";
|
|
38
38
|
export const DOMAINS_SEARCH = "/domains/search";
|
|
39
39
|
export const DOMAIN_CONCEPTS = "/domains/:id/concepts";
|
|
40
|
+
export const DOMAIN_IMPLEMENTATIONS = "/domains/:id/implementations";
|
|
40
41
|
export const DOMAIN_EDIT = "/domains/:id/edit";
|
|
41
42
|
export const DOMAIN_MEMBERS = "/domains/:id/members";
|
|
42
43
|
export const DOMAIN_MEMBERS_NEW = "/domains/:id/members/new";
|
|
@@ -225,6 +226,7 @@ const routes = {
|
|
|
225
226
|
DOMAINS_SEARCH,
|
|
226
227
|
DOMAIN_CONCEPTS,
|
|
227
228
|
DOMAIN_EDIT,
|
|
229
|
+
DOMAIN_IMPLEMENTATIONS,
|
|
228
230
|
DOMAIN_MEMBERS,
|
|
229
231
|
DOMAIN_MEMBERS_NEW,
|
|
230
232
|
DOMAIN_NEW,
|