@truedat/dd 7.11.1 → 7.11.3

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 (51) hide show
  1. package/package.json +3 -3
  2. package/src/api/queries.js +278 -8
  3. package/src/components/ImplementationStructuresLoader.js +6 -6
  4. package/src/components/StructureGrants.js +50 -7
  5. package/src/components/StructureSelectorInputField.js +7 -5
  6. package/src/components/StructureVersions.js +15 -2
  7. package/src/components/__tests__/ImplementationStructuresLoader.spec.js +5 -5
  8. package/src/components/__tests__/ProfileExecutionLoader.spec.js +1 -1
  9. package/src/components/__tests__/ProfileGroupLoader.spec.js +1 -1
  10. package/src/components/__tests__/StructureGrants.spec.js +26 -0
  11. package/src/components/__tests__/StructureVersions.spec.js +26 -0
  12. package/src/reducers/__tests__/graph.spec.js +3 -3
  13. package/src/reducers/__tests__/graphLoading.spec.js +3 -3
  14. package/src/reducers/__tests__/graphRedirect.spec.js +3 -3
  15. package/src/reducers/__tests__/structureFields.spec.js +7 -7
  16. package/src/reducers/__tests__/structureImpactGraph.spec.js +3 -3
  17. package/src/reducers/__tests__/structureImpactId.spec.js +3 -3
  18. package/src/reducers/__tests__/structureLineageGraph.spec.js +3 -3
  19. package/src/reducers/__tests__/structureLineageId.spec.js +3 -3
  20. package/src/reducers/__tests__/structureLinks.spec.js +5 -5
  21. package/src/reducers/__tests__/structureRedirect.spec.js +1 -1
  22. package/src/reducers/__tests__/structureRelations.spec.js +3 -3
  23. package/src/reducers/__tests__/structureSystem.spec.js +3 -3
  24. package/src/reducers/__tests__/structureVersions.spec.js +3 -3
  25. package/src/reducers/graph.js +2 -2
  26. package/src/reducers/graphLoading.js +2 -2
  27. package/src/reducers/graphRedirect.js +2 -2
  28. package/src/reducers/structure.js +3 -1
  29. package/src/reducers/structureFields.js +4 -4
  30. package/src/reducers/structureImpactGraph.js +2 -2
  31. package/src/reducers/structureImpactId.js +2 -2
  32. package/src/reducers/structureLineageGraph.js +2 -2
  33. package/src/reducers/structureLineageId.js +2 -2
  34. package/src/reducers/structureLinks.js +3 -3
  35. package/src/reducers/structureRelations.js +4 -4
  36. package/src/reducers/structureSiblings.js +7 -1
  37. package/src/reducers/structureSystem.js +2 -2
  38. package/src/reducers/structureVersions.js +3 -3
  39. package/src/routines.js +4 -0
  40. package/src/sagas/__tests__/legacyFetchStructure.spec.js +148 -0
  41. package/src/sagas/__tests__/requestGrantRemoval.spec.js +132 -0
  42. package/src/sagas/createGrantRequestStatus.js +1 -0
  43. package/src/sagas/fetchStructureChildrens.js +48 -0
  44. package/src/sagas/fetchStructureParents.js +48 -0
  45. package/src/sagas/fetchStructureVersions.js +46 -0
  46. package/src/sagas/index.js +3 -0
  47. package/src/sagas/legacyFetchStructure.js +55 -0
  48. package/src/sagas/requestGrantRemoval.js +2 -2
  49. package/src/selectors/__tests__/getTabVisibility.spec.js +6 -6
  50. package/src/selectors/getStructuresFields.js +3 -2
  51. package/src/selectors/getTabVisibility.js +8 -5
@@ -1,6 +1,6 @@
1
1
  import { clearRedirect } from "@truedat/core/routines";
2
2
  import { graphRedirect, initialState } from "../graphRedirect";
3
- import { clearStructure, fetchStructure, createGraph } from "../../routines";
3
+ import { clearStructure, legacyFetchStructure, createGraph } from "../../routines";
4
4
 
5
5
  const fooState = { foo: "bar" };
6
6
 
@@ -21,8 +21,8 @@ describe("reducers: graphRedirect", () => {
21
21
  );
22
22
  });
23
23
 
24
- it("should be the initial state after receiving the fetchStructure.TRIGGER action", () => {
25
- expect(graphRedirect(fooState, { type: fetchStructure.TRIGGER })).toBe(
24
+ it("should be the initial state after receiving the legacyFetchStructure.TRIGGER action", () => {
25
+ expect(graphRedirect(fooState, { type: legacyFetchStructure.TRIGGER })).toBe(
26
26
  initialState
27
27
  );
28
28
  });
@@ -1,4 +1,4 @@
1
- import { clearStructure, fetchStructure } from "../../routines";
1
+ import { clearStructure, legacyFetchStructure } from "../../routines";
2
2
  import { structureFields, structuresFields } from "..";
3
3
 
4
4
  const fooState = { foo: "bar" };
@@ -17,9 +17,9 @@ describe("reducers: structureFields", () => {
17
17
  });
18
18
 
19
19
  it("should handle the fetchStructure.TRIGGER action", () => {
20
- expect(structureFields(fooState, { type: fetchStructure.TRIGGER })).toEqual(
21
- initialState
22
- );
20
+ expect(
21
+ structureFields(fooState, { type: legacyFetchStructure.TRIGGER })
22
+ ).toEqual(initialState);
23
23
  });
24
24
 
25
25
  it("should handle the fetchStructure.SUCCESS action", () => {
@@ -28,7 +28,7 @@ describe("reducers: structureFields", () => {
28
28
 
29
29
  expect(
30
30
  structureFields(fooState, {
31
- type: fetchStructure.SUCCESS,
31
+ type: legacyFetchStructure.SUCCESS,
32
32
  payload: { data },
33
33
  })
34
34
  ).toMatchObject(data_fields);
@@ -52,14 +52,14 @@ describe("reducers: structuresFields", () => {
52
52
  ).toEqual(initialState);
53
53
  });
54
54
 
55
- it("should handle the fetchStructure.SUCCESS action", () => {
55
+ it("should handle the legacyFetchStructure.SUCCESS action", () => {
56
56
  const data_fields = [{ id: 1, name: "Field 1" }];
57
57
  const data_structure = { id: 2 };
58
58
  const data = { data_fields, data_structure };
59
59
 
60
60
  expect(
61
61
  structuresFields(fooState, {
62
- type: fetchStructure.SUCCESS,
62
+ type: legacyFetchStructure.SUCCESS,
63
63
  payload: { data },
64
64
  })
65
65
  ).toMatchObject({ 2: data_fields });
@@ -1,7 +1,7 @@
1
1
  import { initialState, structureImpactGraph } from "../structureImpactGraph";
2
2
  import {
3
3
  clearStructure,
4
- fetchStructure,
4
+ legacyFetchStructure,
5
5
  fetchStructureGraph,
6
6
  createGraph,
7
7
  } from "../../routines";
@@ -19,9 +19,9 @@ describe("reducers: structureImpactGraph", () => {
19
19
  ).toBe(initialState);
20
20
  });
21
21
 
22
- it("should return the initial state after receiving the fetchStructure.TRIGGER action", () => {
22
+ it("should return the initial state after receiving the legacyFetchStructure.TRIGGER action", () => {
23
23
  expect(
24
- structureImpactGraph(fooState, { type: fetchStructure.TRIGGER })
24
+ structureImpactGraph(fooState, { type: legacyFetchStructure.TRIGGER })
25
25
  ).toBe(initialState);
26
26
  });
27
27
 
@@ -1,5 +1,5 @@
1
1
  import { initialState, structureImpactId } from "../structureImpactId";
2
- import { fetchStructure, createStructureGraph } from "../../routines";
2
+ import { legacyFetchStructure, createStructureGraph } from "../../routines";
3
3
 
4
4
  const fooState = { foo: "bar" };
5
5
 
@@ -8,8 +8,8 @@ describe("reducers: structureImpactId", () => {
8
8
  expect(structureImpactId(undefined, {})).toBe(initialState);
9
9
  });
10
10
 
11
- it("should return the initial state after receiving the fetchStructure.TRIGGER action", () => {
12
- expect(structureImpactId(fooState, { type: fetchStructure.TRIGGER })).toBe(
11
+ it("should return the initial state after receiving the legacyFetchStructure.TRIGGER action", () => {
12
+ expect(structureImpactId(fooState, { type: legacyFetchStructure.TRIGGER })).toBe(
13
13
  initialState
14
14
  );
15
15
  });
@@ -1,7 +1,7 @@
1
1
  import { initialState, structureLineageGraph } from "../structureLineageGraph";
2
2
  import {
3
3
  clearStructure,
4
- fetchStructure,
4
+ legacyFetchStructure,
5
5
  fetchStructureGraph,
6
6
  createGraph,
7
7
  } from "../../routines";
@@ -19,9 +19,9 @@ describe("reducers: structureLineageGraph", () => {
19
19
  ).toBe(initialState);
20
20
  });
21
21
 
22
- it("should return the initial state after receiving the fetchStructure.TRIGGER action", () => {
22
+ it("should return the initial state after receiving the legacyFetchStructure.TRIGGER action", () => {
23
23
  expect(
24
- structureLineageGraph(fooState, { type: fetchStructure.TRIGGER })
24
+ structureLineageGraph(fooState, { type: legacyFetchStructure.TRIGGER })
25
25
  ).toBe(initialState);
26
26
  });
27
27
 
@@ -1,5 +1,5 @@
1
1
  import { initialState, structureLineageId } from "../structureLineageId";
2
- import { fetchStructure, createStructureGraph } from "../../routines";
2
+ import { legacyFetchStructure, createStructureGraph } from "../../routines";
3
3
 
4
4
  const fooState = { foo: "bar" };
5
5
 
@@ -8,8 +8,8 @@ describe("reducers: structureLineageId", () => {
8
8
  expect(structureLineageId(undefined, {})).toBe(initialState);
9
9
  });
10
10
 
11
- it("should return the initial state after receiving the fetchStructure.TRIGGER action", () => {
12
- expect(structureLineageId(fooState, { type: fetchStructure.TRIGGER })).toBe(
11
+ it("should return the initial state after receiving the legacyFetchStructure.TRIGGER action", () => {
12
+ expect(structureLineageId(fooState, { type: legacyFetchStructure.TRIGGER })).toBe(
13
13
  initialState
14
14
  );
15
15
  });
@@ -1,4 +1,4 @@
1
- import { clearStructure, fetchStructure } from "../../routines";
1
+ import { clearStructure, legacyFetchStructure } from "../../routines";
2
2
  import { structureLinks } from "..";
3
3
 
4
4
  const fooState = { foo: "bar" };
@@ -16,19 +16,19 @@ describe("reducers: structureLinks", () => {
16
16
  );
17
17
  });
18
18
 
19
- it("should handle the fetchStructure.TRIGGER action", () => {
20
- expect(structureLinks(fooState, { type: fetchStructure.TRIGGER })).toEqual(
19
+ it("should handle the legacyFetchStructure.TRIGGER action", () => {
20
+ expect(structureLinks(fooState, { type: legacyFetchStructure.TRIGGER })).toEqual(
21
21
  initialState
22
22
  );
23
23
  });
24
24
 
25
- it("should handle the fetchStructure.SUCCESS action", () => {
25
+ it("should handle the legacyFetchStructure.SUCCESS action", () => {
26
26
  const links = [{ id: 1, name: "Field 1" }];
27
27
  const data = { links };
28
28
 
29
29
  expect(
30
30
  structureLinks(fooState, {
31
- type: fetchStructure.SUCCESS,
31
+ type: legacyFetchStructure.SUCCESS,
32
32
  payload: { data }
33
33
  })
34
34
  ).toMatchObject(links);
@@ -16,7 +16,7 @@ describe("reducers: structureRedirect", () => {
16
16
  expect(structureRedirect(undefined, {})).toBe(initialState);
17
17
  });
18
18
 
19
- it("should be initial state after receiving the fetchStructure.TRIGGER action", () => {
19
+ it("should be initial state after receiving the clearRedirect.TRIGGER action", () => {
20
20
  expect(structureRedirect(fooState, { type: clearRedirect.TRIGGER })).toBe(
21
21
  initialState
22
22
  );
@@ -1,4 +1,4 @@
1
- import { clearStructure, fetchStructure } from "../../routines";
1
+ import { clearStructure, fetchStructureChildrens, fetchStructureParents } from "../../routines";
2
2
  import { childrenRelations, parentRelations } from "..";
3
3
 
4
4
  const fooState = { foo: "bar" };
@@ -48,7 +48,7 @@ describe("reducers: childrenRelations", () => {
48
48
  it("should handle the fetchStructures.SUCCESS action", () => {
49
49
  expect(
50
50
  childrenRelations(fooState, {
51
- type: fetchStructure.SUCCESS,
51
+ type: fetchStructureChildrens.SUCCESS,
52
52
  payload: { data }
53
53
  })
54
54
  ).toMatchObject(children);
@@ -77,7 +77,7 @@ describe("reducers: parentRelations", () => {
77
77
  it("should handle the fetchStructures.SUCCESS action", () => {
78
78
  expect(
79
79
  parentRelations(fooState, {
80
- type: fetchStructure.SUCCESS,
80
+ type: fetchStructureParents.SUCCESS,
81
81
  payload: { data }
82
82
  })
83
83
  ).toMatchObject(parents);
@@ -1,4 +1,4 @@
1
- import { clearStructure, fetchStructure } from "../../routines";
1
+ import { clearStructure, legacyFetchStructure } from "../../routines";
2
2
  import { structureSystem } from "..";
3
3
 
4
4
  const fooState = { foo: "bar" };
@@ -16,13 +16,13 @@ describe("reducers: structureSystem", () => {
16
16
  );
17
17
  });
18
18
 
19
- it("should handle the fetchStructure.SUCCESS action", () => {
19
+ it("should handle the legacyFetchStructure.SUCCESS action", () => {
20
20
  const system = "foo";
21
21
  const data = { system };
22
22
 
23
23
  expect(
24
24
  structureSystem(fooState, {
25
- type: fetchStructure.SUCCESS,
25
+ type: legacyFetchStructure.SUCCESS,
26
26
  payload: { data }
27
27
  })
28
28
  ).toEqual(system);
@@ -1,4 +1,4 @@
1
- import { clearStructure, fetchStructure } from "../../routines";
1
+ import { clearStructure, fetchStructure, fetchStructureVersions } from "../../routines";
2
2
  import { structureVersions } from "..";
3
3
 
4
4
  const fooState = { foo: "bar" };
@@ -19,7 +19,7 @@ describe("reducers: structureVersions", () => {
19
19
  it("should handle the fetchStructure.TRIGGER action", () => {
20
20
  expect(
21
21
  structureVersions(fooState, { type: fetchStructure.TRIGGER })
22
- ).toEqual(initialState);
22
+ ).toEqual(fooState);
23
23
  });
24
24
 
25
25
  it("should handle the fetchStructure.SUCCESS action", () => {
@@ -28,7 +28,7 @@ describe("reducers: structureVersions", () => {
28
28
 
29
29
  expect(
30
30
  structureVersions(fooState, {
31
- type: fetchStructure.SUCCESS,
31
+ type: fetchStructureVersions.SUCCESS,
32
32
  payload: { data }
33
33
  })
34
34
  ).toMatchObject(versions);
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
2
2
  import {
3
3
  clearGraph,
4
4
  fetchGraph,
5
- fetchStructure,
5
+ legacyFetchStructure,
6
6
  createGraph,
7
7
  } from "../routines";
8
8
 
@@ -10,7 +10,7 @@ export const initialState = {};
10
10
 
11
11
  export const graph = (state = initialState, { type, payload }) => {
12
12
  switch (type) {
13
- case fetchStructure.TRIGGER:
13
+ case legacyFetchStructure.TRIGGER:
14
14
  return initialState;
15
15
  case clearGraph.TRIGGER:
16
16
  return initialState;
@@ -4,7 +4,7 @@ import {
4
4
  createGraph,
5
5
  createStructureGraph,
6
6
  fetchGraph,
7
- fetchStructure,
7
+ legacyFetchStructure,
8
8
  fetchStructureGraph,
9
9
  } from "../routines";
10
10
 
@@ -30,7 +30,7 @@ export const graphLoading = (state = false, { type, payload }) => {
30
30
  return payload || true;
31
31
  case fetchGraph.FAILURE:
32
32
  return payload;
33
- case fetchStructure.TRIGGER:
33
+ case legacyFetchStructure.TRIGGER:
34
34
  return false;
35
35
  case fetchStructureGraph.FULFILL:
36
36
  return false;
@@ -1,6 +1,6 @@
1
1
  import { clearRedirect } from "@truedat/core/routines";
2
2
  import { linkTo } from "@truedat/core/routes";
3
- import { createGraph, clearStructure, fetchStructure } from "../routines";
3
+ import { createGraph, clearStructure, legacyFetchStructure } from "../routines";
4
4
 
5
5
  export const initialState = "";
6
6
 
@@ -8,7 +8,7 @@ export const graphRedirect = (state = initialState, { type, payload }) => {
8
8
  switch (type) {
9
9
  case clearStructure.TRIGGER:
10
10
  return initialState;
11
- case fetchStructure.TRIGGER:
11
+ case legacyFetchStructure.TRIGGER:
12
12
  return initialState;
13
13
  case clearRedirect.TRIGGER:
14
14
  return initialState;
@@ -29,9 +29,10 @@ const structureVersionFields = _.pick([
29
29
  "deleted_at",
30
30
  "description",
31
31
  "grant",
32
- "grants",
32
+ "grants_count",
33
33
  "group",
34
34
  "implementation_count",
35
+ "data_fields_count",
35
36
  "metadata",
36
37
  "name",
37
38
  "note",
@@ -42,6 +43,7 @@ const structureVersionFields = _.pick([
42
43
  "system",
43
44
  "type",
44
45
  "_actions",
46
+ "version_count",
45
47
  ]);
46
48
 
47
49
  const structure = (state = initialState, { type, payload }) => {
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import { clearStructure, fetchStructure } from "../routines";
2
+ import { clearStructure, legacyFetchStructure } from "../routines";
3
3
 
4
4
  const initialState = [];
5
5
 
@@ -7,9 +7,9 @@ const structureFields = (state = initialState, { type, payload }) => {
7
7
  switch (type) {
8
8
  case clearStructure.TRIGGER:
9
9
  return initialState;
10
- case fetchStructure.TRIGGER:
10
+ case legacyFetchStructure.TRIGGER:
11
11
  return initialState;
12
- case fetchStructure.SUCCESS:
12
+ case legacyFetchStructure.SUCCESS:
13
13
  return _.pathOr([], "data.data_fields")(payload);
14
14
  default:
15
15
  return state;
@@ -22,7 +22,7 @@ const structuresFields = (state = structures, { type, payload }) => {
22
22
  switch (type) {
23
23
  case clearStructure.TRIGGER:
24
24
  return structures;
25
- case fetchStructure.SUCCESS:
25
+ case legacyFetchStructure.SUCCESS:
26
26
  const id = _.path("data.data_structure.id")(payload);
27
27
  const data_fields = _.pathOr([], "data.data_fields")(payload);
28
28
  return _.set(id, data_fields)(state);
@@ -1,7 +1,7 @@
1
1
  import _ from "lodash/fp";
2
2
  import {
3
3
  clearStructure,
4
- fetchStructure,
4
+ legacyFetchStructure,
5
5
  fetchStructureGraph,
6
6
  createGraph,
7
7
  } from "../routines";
@@ -15,7 +15,7 @@ export const structureImpactGraph = (
15
15
  switch (type) {
16
16
  case clearStructure.TRIGGER:
17
17
  return initialState;
18
- case fetchStructure.TRIGGER:
18
+ case legacyFetchStructure.TRIGGER:
19
19
  return initialState;
20
20
  case createGraph.SUCCESS:
21
21
  case fetchStructureGraph.SUCCESS:
@@ -1,12 +1,12 @@
1
1
  import _ from "lodash/fp";
2
2
  import { createStructureGraph } from "../routines";
3
- import { fetchStructure } from "../../../dd/src/routines";
3
+ import { legacyFetchStructure } from "../../../dd/src/routines";
4
4
 
5
5
  export const initialState = null;
6
6
 
7
7
  export const structureImpactId = (state = initialState, { type, payload }) => {
8
8
  switch (type) {
9
- case fetchStructure.TRIGGER:
9
+ case legacyFetchStructure.TRIGGER:
10
10
  return initialState;
11
11
  case createStructureGraph.SUCCESS:
12
12
  return _.pathEq("data.type", "impact")(payload)
@@ -1,7 +1,7 @@
1
1
  import _ from "lodash/fp";
2
2
  import {
3
3
  clearStructure,
4
- fetchStructure,
4
+ legacyFetchStructure,
5
5
  fetchStructureGraph,
6
6
  createGraph,
7
7
  } from "../routines";
@@ -15,7 +15,7 @@ export const structureLineageGraph = (
15
15
  switch (type) {
16
16
  case clearStructure.TRIGGER:
17
17
  return initialState;
18
- case fetchStructure.TRIGGER:
18
+ case legacyFetchStructure.TRIGGER:
19
19
  return initialState;
20
20
  case createGraph.SUCCESS:
21
21
  case fetchStructureGraph.SUCCESS:
@@ -1,12 +1,12 @@
1
1
  import _ from "lodash/fp";
2
2
  import { createStructureGraph } from "../routines";
3
- import { fetchStructure } from "../../../dd/src/routines";
3
+ import { legacyFetchStructure } from "../../../dd/src/routines";
4
4
 
5
5
  export const initialState = null;
6
6
 
7
7
  export const structureLineageId = (state = initialState, { type, payload }) => {
8
8
  switch (type) {
9
- case fetchStructure.TRIGGER:
9
+ case legacyFetchStructure.TRIGGER:
10
10
  return initialState;
11
11
  case createStructureGraph.SUCCESS:
12
12
  return _.pathEq("data.type", "lineage")(payload)
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import { clearStructure, fetchStructure } from "../routines";
2
+ import { clearStructure, legacyFetchStructure } from "../routines";
3
3
 
4
4
  const initialState = [];
5
5
 
@@ -7,9 +7,9 @@ const structureLinks = (state = initialState, { type, payload }) => {
7
7
  switch (type) {
8
8
  case clearStructure.TRIGGER:
9
9
  return initialState;
10
- case fetchStructure.TRIGGER:
10
+ case legacyFetchStructure.TRIGGER:
11
11
  return initialState;
12
- case fetchStructure.SUCCESS:
12
+ case legacyFetchStructure.SUCCESS:
13
13
  return _.pathOr([], "data.links")(payload);
14
14
  default:
15
15
  return state;
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import { clearStructure, fetchStructure } from "../routines";
2
+ import { clearStructure, fetchStructureChildrens, fetchStructureParents } from "../routines";
3
3
 
4
4
  export const initialState = [];
5
5
 
@@ -7,9 +7,9 @@ export const childrenRelations = (state = initialState, { type, payload }) => {
7
7
  switch (type) {
8
8
  case clearStructure.TRIGGER:
9
9
  return initialState;
10
- case fetchStructure.TRIGGER:
10
+ case fetchStructureChildrens.TRIGGER:
11
11
  return initialState;
12
- case fetchStructure.SUCCESS:
12
+ case fetchStructureChildrens.SUCCESS:
13
13
  return _.pathOr([], "data.relations.children")(payload);
14
14
  default:
15
15
  return state;
@@ -20,7 +20,7 @@ export const parentRelations = (state = initialState, { type, payload }) => {
20
20
  switch (type) {
21
21
  case clearStructure.TRIGGER:
22
22
  return initialState;
23
- case fetchStructure.SUCCESS:
23
+ case fetchStructureParents.SUCCESS:
24
24
  return _.pathOr([], "data.relations.parents")(payload);
25
25
  default:
26
26
  return state;
@@ -1,5 +1,9 @@
1
1
  import _ from "lodash/fp";
2
- import { clearStructure, fetchStructure } from "../routines";
2
+ import {
3
+ clearStructure,
4
+ fetchStructure,
5
+ legacyFetchStructure,
6
+ } from "../routines";
3
7
 
4
8
  const initialState = [];
5
9
 
@@ -8,6 +12,7 @@ const structureSiblings = (state = initialState, { type, payload }) => {
8
12
  case clearStructure.TRIGGER:
9
13
  return initialState;
10
14
  case fetchStructure.SUCCESS:
15
+ case legacyFetchStructure.SUCCESS:
11
16
  return _.pathOr([], "data.siblings")(payload);
12
17
  default:
13
18
  return state;
@@ -19,6 +24,7 @@ const structuresSiblings = (state = {}, { type, payload }) => {
19
24
  case clearStructure.TRIGGER:
20
25
  return {};
21
26
  case fetchStructure.SUCCESS:
27
+ case legacyFetchStructure.SUCCESS:
22
28
  const id = _.path("data.data_structure.id")(payload);
23
29
  const siblings = _.pathOr([], "data.siblings")(payload);
24
30
  return _.set(id, siblings)(state);
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import { clearStructure, fetchStructure } from "../routines";
2
+ import { clearStructure, legacyFetchStructure } from "../routines";
3
3
 
4
4
  const initialState = null;
5
5
 
@@ -7,7 +7,7 @@ const structureSystem = (state = initialState, { type, payload }) => {
7
7
  switch (type) {
8
8
  case clearStructure.TRIGGER:
9
9
  return initialState;
10
- case fetchStructure.SUCCESS:
10
+ case legacyFetchStructure.SUCCESS:
11
11
  return _.propOr(initialState, "system")(payload.data);
12
12
  default:
13
13
  return state;
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import { clearStructure, fetchStructure } from "../routines";
2
+ import { clearStructure, fetchStructureVersions } from "../routines";
3
3
 
4
4
  const initialState = [];
5
5
 
@@ -7,9 +7,9 @@ const structureVersions = (state = initialState, { type, payload }) => {
7
7
  switch (type) {
8
8
  case clearStructure.TRIGGER:
9
9
  return initialState;
10
- case fetchStructure.TRIGGER:
10
+ case fetchStructureVersions.TRIGGER:
11
11
  return initialState;
12
- case fetchStructure.SUCCESS:
12
+ case fetchStructureVersions.SUCCESS:
13
13
  return _.pathOr([], "data.versions")(payload);
14
14
  default:
15
15
  return state;
package/src/routines.js CHANGED
@@ -89,6 +89,10 @@ export const fetchNodes = createRoutine("FETCH_NODES");
89
89
  export const fetchProfileExecution = createRoutine("FETCH_EXECUTION_PROFILE");
90
90
  export const fetchProfileGroup = createRoutine("FETCH_PROFILE_GROUP");
91
91
  export const fetchStructure = createRoutine("FETCH_STRUCTURE");
92
+ export const legacyFetchStructure = createRoutine("LEGACY_FETCH_STRUCTURE");
93
+ export const fetchStructureParents = createRoutine("FETCH_STRUCTURE_PARENTS");
94
+ export const fetchStructureChildrens = createRoutine("FETCH_STRUCTURE_CHILDREN");
95
+ export const fetchStructureVersions = createRoutine("FETCH_STRUCTURE_VERSIONS");
92
96
  export const fetchStructureGraph = createRoutine("FETCH_STRUCTURE_GRAPH");
93
97
  export const fetchStructureNotes = createRoutine("FETCH_STRUCTURE_NOTES");
94
98
  export const fetchStructures = createRoutine("FETCH_STRUCTURES");