@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.54.9] 2022-10-28
4
+
5
+ ### Added
6
+
7
+ - [TD-4977] Route `/domains/:id/implementations`
8
+
3
9
  ## [4.54.2] 2022-10-25
4
10
 
5
11
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/core",
3
- "version": "4.54.7",
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.7",
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": "5fc1e696a1449d9e0b68531f109cc7a8a2dd9543"
115
+ "gitHead": "27f711249723050708a6f6f4de3ab5029069c4d7"
116
116
  }
@@ -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 {
@@ -4,3 +4,4 @@ export * from "./useAuthorized";
4
4
  export * from "./usePath";
5
5
  export * from "./useOnScreen";
6
6
  export * from "./useOperators";
7
+ export * from "./useTemplate";
@@ -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,