@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.
- package/index.js +5 -0
- package/package.json +43 -67
- package/src/components/ConceptImplementationLink.js +1 -2
- package/src/components/ConceptLink.js +2 -3
- package/src/components/ConceptLinkTags.js +0 -1
- package/src/components/ConceptStructureLinkForm.js +3 -3
- package/src/components/ConfirmDeleteRelation.js +0 -1
- package/src/components/ImplementationLinkRow.js +0 -1
- package/src/components/ImplementationLinks.js +1 -2
- package/src/components/ImplementationRelationForm.js +5 -8
- package/src/components/LinksPane.js +0 -1
- package/src/components/NewRelationTag.js +0 -1
- package/src/components/RelationActions.js +3 -4
- package/src/components/RelationGraph.js +17 -104
- package/src/components/RelationGraphDepth.js +0 -1
- package/src/components/RelationRoutes.js +16 -25
- package/src/components/RelationRow.js +6 -7
- package/src/components/RelationTagCards.js +3 -4
- package/src/components/RelationTagForm.js +0 -2
- package/src/components/RelationTags.js +1 -2
- package/src/components/RelationTagsLoader.js +2 -2
- package/src/components/Relations.js +0 -1
- package/src/components/RelationsGraphLoader.js +0 -1
- package/src/components/StructureLinkRow.js +0 -1
- package/src/components/StructureLinks.js +1 -2
- package/src/components/StructureRelationForm.js +5 -9
- package/src/components/TagTypeDropdownSelector.js +1 -1
- package/src/components/TagTypeSelector.js +0 -2
- package/src/components/__tests__/ConceptImplementationLink.spec.js +0 -1
- package/src/components/__tests__/ConceptLinkTags.spec.js +7 -9
- package/src/components/__tests__/ConceptStructureLinkForm.spec.js +68 -20
- package/src/components/__tests__/ConfirmDeleteRelation.spec.js +0 -1
- package/src/components/__tests__/ImplementationLinkRow.spec.js +0 -1
- package/src/components/__tests__/ImplementationLinks.spec.js +0 -1
- package/src/components/__tests__/ImplementationRelationForm.spec.js +45 -73
- package/src/components/__tests__/LinksPane.spec.js +0 -1
- package/src/components/__tests__/NewRelationTag.spec.js +0 -1
- package/src/components/__tests__/RelationActions.spec.js +14 -15
- package/src/components/__tests__/RelationRoutes.spec.js +59 -7
- package/src/components/__tests__/RelationRow.spec.js +46 -23
- package/src/components/__tests__/RelationTagCards.spec.js +0 -1
- package/src/components/__tests__/RelationTagForm.spec.js +26 -37
- package/src/components/__tests__/RelationTags.spec.js +0 -1
- package/src/components/__tests__/RelationTagsLoader.spec.js +6 -6
- package/src/components/__tests__/Relations.spec.js +19 -17
- package/src/components/__tests__/RelationsGraphLoader.spec.js +32 -26
- package/src/components/__tests__/RelationsLoader.spec.js +19 -19
- package/src/components/__tests__/StructureRelationForm.spec.js +41 -42
- package/src/components/__tests__/TagTypeSelector.spec.js +7 -13
- package/src/components/__tests__/__snapshots__/ConceptImplementationLink.spec.js.snap +1 -0
- package/src/components/__tests__/__snapshots__/ConceptLinkTags.spec.js.snap +12 -20
- package/src/components/__tests__/__snapshots__/ConceptStructureLinkForm.spec.js.snap +170 -19
- package/src/components/__tests__/__snapshots__/ImplementationLinks.spec.js.snap +4 -0
- package/src/components/__tests__/__snapshots__/ImplementationRelationForm.spec.js.snap +13 -13
- package/src/components/__tests__/__snapshots__/NewRelationTag.spec.js.snap +12 -11
- package/src/components/__tests__/__snapshots__/RelationActions.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/RelationRoutes.spec.js.snap +21 -5
- package/src/components/__tests__/__snapshots__/RelationRow.spec.js.snap +7 -1
- package/src/components/__tests__/__snapshots__/RelationTagCards.spec.js.snap +0 -1
- package/src/components/__tests__/__snapshots__/RelationTagForm.spec.js.snap +11 -10
- package/src/components/__tests__/__snapshots__/RelationTags.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/RelationTagsLoader.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/Relations.spec.js.snap +36 -27
- package/src/components/__tests__/__snapshots__/RelationsGraphLoader.spec.js.snap +1 -25
- package/src/components/__tests__/__snapshots__/StructureRelationForm.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/TagTypeSelector.spec.js.snap +11 -14
- package/src/hooks/useTags.js +1 -1
- package/src/sagas/__tests__/fetchRelationsGraph.spec.js +2 -2
- package/src/sagas/deleteRelation.js +1 -1
- package/src/sagas/fetchRelationsGraph.js +1 -1
- package/src/sagas/updateRelationTag.js +1 -1
- package/src/selectors/getStructureLinks.js +1 -1
- 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
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
`;
|
package/src/hooks/useTags.js
CHANGED
|
@@ -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(
|
|
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));
|
|
@@ -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 {
|
|
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 =
|
|
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 =
|
|
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);
|