@truedat/lm 7.5.9 → 7.5.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.
Files changed (73) hide show
  1. package/index.js +5 -0
  2. package/package.json +43 -67
  3. package/src/components/ConceptImplementationLink.js +1 -2
  4. package/src/components/ConceptLink.js +2 -3
  5. package/src/components/ConceptLinkTags.js +0 -1
  6. package/src/components/ConceptStructureLinkForm.js +3 -3
  7. package/src/components/ConfirmDeleteRelation.js +0 -1
  8. package/src/components/ImplementationLinkRow.js +0 -1
  9. package/src/components/ImplementationLinks.js +1 -2
  10. package/src/components/ImplementationRelationForm.js +5 -8
  11. package/src/components/LinksPane.js +0 -1
  12. package/src/components/NewRelationTag.js +0 -1
  13. package/src/components/RelationActions.js +3 -4
  14. package/src/components/RelationGraph.js +17 -104
  15. package/src/components/RelationGraphDepth.js +0 -1
  16. package/src/components/RelationRoutes.js +16 -25
  17. package/src/components/RelationRow.js +6 -7
  18. package/src/components/RelationTagCards.js +3 -4
  19. package/src/components/RelationTagForm.js +0 -2
  20. package/src/components/RelationTags.js +1 -2
  21. package/src/components/RelationTagsLoader.js +2 -2
  22. package/src/components/Relations.js +0 -1
  23. package/src/components/RelationsGraphLoader.js +0 -1
  24. package/src/components/StructureLinkRow.js +0 -1
  25. package/src/components/StructureLinks.js +1 -2
  26. package/src/components/StructureRelationForm.js +5 -9
  27. package/src/components/TagTypeDropdownSelector.js +1 -1
  28. package/src/components/TagTypeSelector.js +0 -2
  29. package/src/components/__tests__/ConceptImplementationLink.spec.js +0 -1
  30. package/src/components/__tests__/ConceptLinkTags.spec.js +7 -9
  31. package/src/components/__tests__/ConceptStructureLinkForm.spec.js +68 -20
  32. package/src/components/__tests__/ConfirmDeleteRelation.spec.js +0 -1
  33. package/src/components/__tests__/ImplementationLinkRow.spec.js +0 -1
  34. package/src/components/__tests__/ImplementationLinks.spec.js +0 -1
  35. package/src/components/__tests__/ImplementationRelationForm.spec.js +45 -73
  36. package/src/components/__tests__/LinksPane.spec.js +0 -1
  37. package/src/components/__tests__/NewRelationTag.spec.js +0 -1
  38. package/src/components/__tests__/RelationActions.spec.js +14 -15
  39. package/src/components/__tests__/RelationRoutes.spec.js +59 -7
  40. package/src/components/__tests__/RelationRow.spec.js +46 -23
  41. package/src/components/__tests__/RelationTagCards.spec.js +0 -1
  42. package/src/components/__tests__/RelationTagForm.spec.js +26 -37
  43. package/src/components/__tests__/RelationTags.spec.js +0 -1
  44. package/src/components/__tests__/RelationTagsLoader.spec.js +6 -6
  45. package/src/components/__tests__/Relations.spec.js +19 -17
  46. package/src/components/__tests__/RelationsGraphLoader.spec.js +32 -26
  47. package/src/components/__tests__/RelationsLoader.spec.js +19 -19
  48. package/src/components/__tests__/StructureRelationForm.spec.js +41 -42
  49. package/src/components/__tests__/TagTypeSelector.spec.js +7 -13
  50. package/src/components/__tests__/__snapshots__/ConceptImplementationLink.spec.js.snap +1 -0
  51. package/src/components/__tests__/__snapshots__/ConceptLinkTags.spec.js.snap +12 -20
  52. package/src/components/__tests__/__snapshots__/ConceptStructureLinkForm.spec.js.snap +170 -19
  53. package/src/components/__tests__/__snapshots__/ImplementationLinks.spec.js.snap +4 -0
  54. package/src/components/__tests__/__snapshots__/ImplementationRelationForm.spec.js.snap +13 -13
  55. package/src/components/__tests__/__snapshots__/NewRelationTag.spec.js.snap +12 -11
  56. package/src/components/__tests__/__snapshots__/RelationActions.spec.js.snap +1 -1
  57. package/src/components/__tests__/__snapshots__/RelationRoutes.spec.js.snap +21 -5
  58. package/src/components/__tests__/__snapshots__/RelationRow.spec.js.snap +7 -1
  59. package/src/components/__tests__/__snapshots__/RelationTagCards.spec.js.snap +0 -1
  60. package/src/components/__tests__/__snapshots__/RelationTagForm.spec.js.snap +11 -10
  61. package/src/components/__tests__/__snapshots__/RelationTags.spec.js.snap +1 -1
  62. package/src/components/__tests__/__snapshots__/RelationTagsLoader.spec.js.snap +1 -1
  63. package/src/components/__tests__/__snapshots__/Relations.spec.js.snap +36 -27
  64. package/src/components/__tests__/__snapshots__/RelationsGraphLoader.spec.js.snap +1 -25
  65. package/src/components/__tests__/__snapshots__/StructureRelationForm.spec.js.snap +1 -1
  66. package/src/components/__tests__/__snapshots__/TagTypeSelector.spec.js.snap +11 -14
  67. package/src/hooks/useTags.js +1 -1
  68. package/src/sagas/__tests__/fetchRelationsGraph.spec.js +2 -2
  69. package/src/sagas/deleteRelation.js +1 -1
  70. package/src/sagas/fetchRelationsGraph.js +1 -1
  71. package/src/sagas/updateRelationTag.js +1 -1
  72. package/src/selectors/getStructureLinks.js +1 -1
  73. package/src/services/relationGraphTraversal.js +3 -3
@@ -1,27 +1,3 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`<RelationsGraphLoader /> matches the latest snapshot 1`] = `
4
- <RelationsGraphLoader
5
- clearRelationsGraph={[MockFunction]}
6
- fetchRelationsGraph={
7
- [MockFunction] {
8
- "calls": [
9
- [
10
- {
11
- "id": 1,
12
- "type": "business_concept",
13
- },
14
- ],
15
- ],
16
- "results": [
17
- {
18
- "type": "return",
19
- "value": undefined,
20
- },
21
- ],
22
- }
23
- }
24
- relationsGraphLoading={false}
25
- resource_id={1}
26
- />
27
- `;
3
+ exports[`<RelationsGraphLoader /> matches the latest snapshot 1`] = `<div />`;
@@ -4,7 +4,6 @@ exports[`<StructureRelationForm /> matches the latest snapshot 1`] = `
4
4
  <div>
5
5
  <div
6
6
  class="ui grid"
7
- style=""
8
7
  >
9
8
  <div
10
9
  class="sixteen wide column"
@@ -225,6 +224,7 @@ exports[`<StructureRelationForm /> matches the latest snapshot 1`] = `
225
224
  </button>
226
225
  <a
227
226
  class="ui secondary button"
227
+ data-discover="true"
228
228
  href="/"
229
229
  role="button"
230
230
  >
@@ -1,17 +1,14 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`<TagTypeSelector /> matches last snapshot 1`] = `
4
- <FormField
5
- style={
6
- {
7
- "marginBottom": "10px",
8
- }
9
- }
10
- >
11
- <label>
12
- <MemoizedFormattedMessage
13
- id="relations.relationType"
14
- />
15
- </label>
16
- </FormField>
3
+ exports[`<TagTypeSelector /> matches the latest snapshot 1`] = `
4
+ <div>
5
+ <div
6
+ class="field"
7
+ style="margin-bottom: 10px;"
8
+ >
9
+ <label>
10
+ relations.relationType
11
+ </label>
12
+ </div>
13
+ </div>
17
14
  `;
@@ -5,6 +5,6 @@ import { apiJsonPatch } from "@truedat/core/services/api";
5
5
  import { API_TAG } from "../api";
6
6
 
7
7
  export const useTagUpdate = (id) => {
8
- const url = compile(API_TAG)({ id });
8
+ const url = compile(API_TAG)({ id: `${id}` });
9
9
  return useSWRMutations(url, (url, { arg }) => apiJsonPatch(url, arg));
10
10
  };
@@ -87,10 +87,10 @@ describe("sagas: fetchRelationsGraphRequestSaga", () => {
87
87
  });
88
88
 
89
89
  describe("sagas: fetchRelationsGraphSaga", () => {
90
- const id = 1;
90
+ const id = "1";
91
91
 
92
92
  const type = "business_concept";
93
- const url = toApiPath({ id }) + `?type=${type}`;
93
+ const url = toApiPath({ id: `${id}` }) + `?type=${type}`;
94
94
  const data = { nodes, edges };
95
95
 
96
96
  it("should put a success action when a response is returned", () => {
@@ -10,7 +10,7 @@ export function* deleteRelationSaga({ payload }) {
10
10
  try {
11
11
  const { id } = payload;
12
12
  const meta = { id };
13
- const url = toApiPath(payload);
13
+ const url = toApiPath({ id: `${id}` });
14
14
  yield put({ meta, ...deleteRelation.request() });
15
15
  yield call(apiJsonDelete, url, JSON_OPTS);
16
16
  yield put({ meta, ...deleteRelation.success(payload) });
@@ -9,7 +9,7 @@ const toApiPath = compile(API_RELATIONS_GRAPH);
9
9
  export function* fetchRelationsGraphSaga({ payload }) {
10
10
  try {
11
11
  const { id, type } = payload;
12
- const url = toApiPath({ id }) + `?type=${type}`;
12
+ const url = toApiPath({ id: `${id}` }) + `?type=${type}`;
13
13
  yield put(fetchRelationsGraph.request());
14
14
  const { data } = yield call(apiJson, url, JSON_OPTS);
15
15
  yield put(fetchRelationsGraph.success(data));
@@ -11,7 +11,7 @@ export function* updateRelationTagSaga({ payload }) {
11
11
  payload.value
12
12
  );
13
13
 
14
- const url = compile(API_TAG)(payload);
14
+ const url = compile(API_TAG)({ id: `${payload.id}` });
15
15
 
16
16
  const requestData = {
17
17
  tag: { value: relationTagValue },
@@ -1,7 +1,7 @@
1
1
  import _ from "lodash/fp";
2
2
  import { createSelector } from "reselect";
3
3
 
4
- const getStructureLinks = state => state.structureLinks;
4
+ const getStructureLinks = (state) => state.structureLinks;
5
5
 
6
6
  export const getStructureToConceptLinks = createSelector(
7
7
  getStructureLinks,
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable fp/no-mutation */
2
2
  /* eslint-disable fp/no-let */
3
3
  import _ from "lodash/fp";
4
- import { defaultMemoize } from "reselect";
4
+ import { lruMemoize } from "reselect";
5
5
 
6
6
  export const EMPTY = "_EMPTY";
7
7
 
@@ -13,7 +13,7 @@ const equalityCheck = (previousVal, currentVal) =>
13
13
  ? _.isEqual(previousVal.sort(), currentVal.sort())
14
14
  : previousVal === currentVal;
15
15
 
16
- export const findMaxDepth = defaultMemoize(
16
+ export const findMaxDepth = lruMemoize(
17
17
  (graph, currentId, traversalTags) => {
18
18
  const start = currentIdToNode(graph, currentId);
19
19
  return bfsMaxDepth(graph, start, traversalTags);
@@ -21,7 +21,7 @@ export const findMaxDepth = defaultMemoize(
21
21
  { maxSize: 10, equalityCheck }
22
22
  );
23
23
 
24
- export const pruneGraph = defaultMemoize(
24
+ export const pruneGraph = lruMemoize(
25
25
  (graph, currentId, depth, traversalTags) => {
26
26
  const start = currentIdToNode(graph, currentId);
27
27
  const maxDepth = findMaxDepth(graph, currentId, traversalTags);