@truedat/dd 5.9.1 → 5.9.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.
- package/package.json +6 -6
- package/src/api/mutations.js +28 -0
- package/src/api/queries.js +20 -0
- package/src/api.js +4 -0
- package/src/components/BucketView.js +92 -0
- package/src/components/CatalogCustomViewCards.js +89 -0
- package/src/components/CatalogViewConfigForm.js +130 -0
- package/src/components/CatalogViewConfigs.js +124 -0
- package/src/components/DictionaryRoutes.js +40 -9
- package/src/components/FilteredNav.js +47 -5
- package/src/components/StructureCrumbs.js +43 -15
- package/src/components/StructureItem.js +24 -2
- package/src/components/StructureItemRoot.js +34 -5
- package/src/components/StructureItems.js +3 -2
- package/src/components/StructureNav.js +1 -1
- package/src/components/StructureTabs.js +104 -102
- package/src/components/StructureTags.js +2 -2
- package/src/components/StructureView.js +56 -37
- package/src/components/StructuresRoutes.js +57 -49
- package/src/components/StructuresView.js +5 -0
- package/src/components/SystemCards.js +1 -0
- package/src/components/SystemFilteredNav.js +1 -1
- package/src/components/SystemStructures.js +40 -22
- package/src/components/SystemsRoutes.js +3 -3
- package/src/components/__tests__/BucketView.spec.js +49 -0
- package/src/components/__tests__/CatalogCustomViewCards.spec.js +56 -0
- package/src/components/__tests__/CatalogViewConfigForm.spec.js +75 -0
- package/src/components/__tests__/CatalogViewConfigs.spec.js +75 -0
- package/src/components/__tests__/FilteredNav.spec.js +73 -22
- package/src/components/__tests__/GrantApprovalRuleDeleteButton.spec.js +2 -2
- package/src/components/__tests__/StructureItemRoot.spec.js +5 -4
- package/src/components/__tests__/StructureNav.spec.js +3 -0
- package/src/components/__tests__/StructureStructureLinks.spec.js +1 -1
- package/src/components/__tests__/StructureView.spec.js +60 -12
- package/src/components/__tests__/StructuresView.spec.js +60 -15
- package/src/components/__tests__/SystemFilteredNav.spec.js +7 -1
- package/src/components/__tests__/SystemStructures.spec.js +5 -0
- package/src/components/__tests__/__snapshots__/DictionaryRoutes.spec.js.snap +21 -1
- package/src/components/__tests__/__snapshots__/StructureCrumbs.spec.js.snap +4 -4
- package/src/components/__tests__/__snapshots__/StructuresRoutes.spec.js.snap +7 -1
- package/src/components/__tests__/__snapshots__/SystemStructures.spec.js.snap +1 -3
- package/src/components/index.js +2 -0
- package/src/hooks/useBucketStructures.js +10 -0
- package/src/messages/en.js +3 -0
- package/src/messages/es.js +3 -0
- package/src/reducers/bucketFilter.js +15 -0
- package/src/reducers/index.js +4 -1
- package/src/reducers/navFilter.js +14 -0
- package/src/reducers/structure.js +24 -1
- package/src/reducers/structureRedirect.js +7 -0
- package/src/routines.js +4 -0
- package/src/sagas/deleteCatalogViewConfig.js +37 -0
- package/src/sagas/index.js +6 -0
- package/src/sagas/upsertCatalogViewConfig.js +45 -0
- package/src/selectors/getStructureParent.js +17 -5
- package/src/components/__tests__/__snapshots__/FilteredNav.spec.js.snap +0 -23
- package/src/components/__tests__/__snapshots__/StructureView.spec.js.snap +0 -37
- package/src/components/__tests__/__snapshots__/StructuresView.spec.js.snap +0 -70
|
@@ -1,55 +1,106 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import userEvent from "@testing-library/user-event";
|
|
3
|
+
import { render } from "@truedat/test/render";
|
|
4
|
+
|
|
5
|
+
import FilteredNavLoader, { FilteredNav } from "../FilteredNav";
|
|
6
|
+
|
|
7
|
+
jest.mock("../../hooks/useBucketStructures", () => {
|
|
8
|
+
const originalModule = jest.requireActual("../../hooks/useBucketStructures");
|
|
9
|
+
|
|
10
|
+
const data = [
|
|
11
|
+
{ id: 1, name: "bank_capital" },
|
|
12
|
+
{ id: 2, name: "consumorenovables" },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
__esModule: true,
|
|
17
|
+
...originalModule,
|
|
18
|
+
useBucketStructures: jest.fn(() => ({
|
|
19
|
+
data: { data: { data }, headers: { "x-total-count": 2 } },
|
|
20
|
+
error: false,
|
|
21
|
+
trigger: jest.fn(),
|
|
22
|
+
})),
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const renderOpts = {
|
|
27
|
+
state: {
|
|
28
|
+
navFilter: {},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
4
31
|
|
|
5
32
|
describe("<FilteredNav />", () => {
|
|
6
33
|
it("matches the latest snapshot", () => {
|
|
7
34
|
const childStructures = [
|
|
8
35
|
{ id: 1, name: "bank_capital" },
|
|
9
|
-
{ id: 2, name: "consumorenovables" }
|
|
36
|
+
{ id: 2, name: "consumorenovables" },
|
|
10
37
|
];
|
|
11
38
|
const parentStructures = [];
|
|
12
39
|
const props = { childStructures, parentStructures };
|
|
13
40
|
|
|
14
|
-
const
|
|
15
|
-
expect(
|
|
41
|
+
const { getByText } = render(<FilteredNav {...props} />, renderOpts);
|
|
42
|
+
expect(getByText("bank_capital")).toBeInTheDocument();
|
|
43
|
+
expect(getByText("consumorenovables")).toBeInTheDocument();
|
|
16
44
|
});
|
|
17
45
|
|
|
18
46
|
it("ChildStructures prop in StructureNav component should rendered with one item when inputSearch value change", () => {
|
|
19
47
|
const childStructures = [
|
|
20
48
|
{ id: 1, name: "bank_capital" },
|
|
21
|
-
{ id: 2, name: "consumorenovables" }
|
|
49
|
+
{ id: 2, name: "consumorenovables" },
|
|
22
50
|
];
|
|
23
51
|
const parentStructures = [];
|
|
24
52
|
const props = { childStructures, parentStructures };
|
|
25
53
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
);
|
|
30
|
-
const inputSearch = wrapper.find("StructureSearch");
|
|
31
|
-
inputSearch.prop("onChange")("bank");
|
|
32
|
-
expect(wrapper.find("StructureNav").prop("childStructures").length).toEqual(
|
|
33
|
-
1
|
|
54
|
+
const { getByRole, getByText, queryByText } = render(
|
|
55
|
+
<FilteredNav {...props} />,
|
|
56
|
+
renderOpts
|
|
34
57
|
);
|
|
58
|
+
expect(getByText("bank_capital")).toBeInTheDocument();
|
|
59
|
+
expect(getByText("consumorenovables")).toBeInTheDocument();
|
|
60
|
+
|
|
61
|
+
const inputSearch = getByRole("textbox");
|
|
62
|
+
userEvent.type(inputSearch, "bank");
|
|
63
|
+
expect(getByText("bank_capital")).toBeInTheDocument();
|
|
64
|
+
expect(queryByText("consumorenovables")).not.toBeInTheDocument();
|
|
35
65
|
});
|
|
36
66
|
|
|
37
67
|
it("ChildStructures prop in StructureNav component should rendered without items when inputSearch value change", () => {
|
|
38
68
|
const childStructures = [
|
|
39
69
|
{ id: 1, name: "bank_capital" },
|
|
40
|
-
{ id: 2, name: "consumorenovables" }
|
|
70
|
+
{ id: 2, name: "consumorenovables" },
|
|
41
71
|
];
|
|
42
72
|
const parentStructures = [];
|
|
43
73
|
const props = { childStructures, parentStructures };
|
|
44
74
|
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
75
|
+
const { getByRole, getByText, queryByText } = render(
|
|
76
|
+
<FilteredNav {...props} />,
|
|
77
|
+
renderOpts
|
|
48
78
|
);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
79
|
+
expect(getByText("bank_capital")).toBeInTheDocument();
|
|
80
|
+
expect(getByText("consumorenovables")).toBeInTheDocument();
|
|
81
|
+
|
|
82
|
+
const inputSearch = getByRole("textbox");
|
|
83
|
+
userEvent.type(inputSearch, "renovabless");
|
|
84
|
+
|
|
85
|
+
expect(queryByText("bank_capital")).not.toBeInTheDocument();
|
|
86
|
+
expect(queryByText("consumorenovables")).not.toBeInTheDocument();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("FilterNavLoader loads from useBucketStructures and shows structures", () => {
|
|
90
|
+
const { getByText } = render(<FilteredNavLoader />, renderOpts);
|
|
91
|
+
expect(getByText("bank_capital")).toBeInTheDocument();
|
|
92
|
+
expect(getByText("consumorenovables")).toBeInTheDocument();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it("FilterNavLoader shows displayed/total structures message", () => {
|
|
96
|
+
const { queryByText, getByText, getByRole } = render(
|
|
97
|
+
<FilteredNavLoader />,
|
|
98
|
+
renderOpts
|
|
53
99
|
);
|
|
100
|
+
|
|
101
|
+
const inputSearch = getByRole("textbox");
|
|
102
|
+
expect(queryByText("1 from a total of 2")).not.toBeInTheDocument();
|
|
103
|
+
userEvent.type(inputSearch, "bank");
|
|
104
|
+
expect(getByText("1 from a total of 2")).toBeInTheDocument();
|
|
54
105
|
});
|
|
55
106
|
});
|
|
@@ -33,7 +33,7 @@ describe("<GrantApprovalRuleDeleteButton />", () => {
|
|
|
33
33
|
dispatch,
|
|
34
34
|
});
|
|
35
35
|
userEvent.click(getByRole("button", { name: /delete/i }));
|
|
36
|
-
userEvent.click(getByRole("button", { name:
|
|
36
|
+
userEvent.click(getByRole("button", { name: "modal-affirmative-action" }));
|
|
37
37
|
|
|
38
38
|
expect(dispatch).toHaveBeenLastCalledWith({
|
|
39
39
|
...deleteGrantApprovalRule(),
|
|
@@ -49,7 +49,7 @@ describe("<GrantApprovalRuleDeleteButton />", () => {
|
|
|
49
49
|
dispatch,
|
|
50
50
|
});
|
|
51
51
|
userEvent.click(getByRole("button", { name: /delete/i }));
|
|
52
|
-
userEvent.click(getByRole("button", { name:
|
|
52
|
+
userEvent.click(getByRole("button", { name: "modal-negative-action" }));
|
|
53
53
|
|
|
54
54
|
expect(dispatch).toHaveBeenCalledTimes(0);
|
|
55
55
|
});
|
|
@@ -3,27 +3,28 @@ import { shallow } from "enzyme";
|
|
|
3
3
|
import { StructureItemRoot } from "../StructureItemRoot";
|
|
4
4
|
|
|
5
5
|
const mockHistory = {
|
|
6
|
-
push: jest.fn()
|
|
6
|
+
push: jest.fn(),
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
jest.mock("react-router-dom", () => ({
|
|
10
10
|
...jest.requireActual("react-router-dom"),
|
|
11
|
-
useHistory: () => mockHistory
|
|
11
|
+
useHistory: () => mockHistory,
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
14
|
describe("<StructureItemRoot />", () => {
|
|
15
15
|
const id = 1;
|
|
16
16
|
const name = "foo";
|
|
17
|
+
const navFilter = {};
|
|
17
18
|
|
|
18
19
|
it("matches the latest snapshot", () => {
|
|
19
|
-
const props = { id, name };
|
|
20
|
+
const props = { id, name, navFilter };
|
|
20
21
|
|
|
21
22
|
const wrapper = shallow(<StructureItemRoot {...props} />);
|
|
22
23
|
expect(wrapper).toMatchSnapshot();
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
it("clicking the item will push to history", () => {
|
|
26
|
-
const wrapper = shallow(<StructureItemRoot />);
|
|
27
|
+
const wrapper = shallow(<StructureItemRoot navFilter={{}} />);
|
|
27
28
|
wrapper.find("ListItem").simulate("click");
|
|
28
29
|
expect(mockHistory.push.mock.calls.length).toBe(1);
|
|
29
30
|
expect(mockHistory.push.mock.calls[0][0]).toEqual("/structures");
|
|
@@ -220,7 +220,7 @@ describe("<StructureStructureLinks />", () => {
|
|
|
220
220
|
const deleteButton = document.getElementById("delete-link-60217-60218");
|
|
221
221
|
userEvent.click(deleteButton);
|
|
222
222
|
expect(getByText("Delete link")).toBeInTheDocument();
|
|
223
|
-
const yesButton = getByRole("button", { name:
|
|
223
|
+
const yesButton = getByRole("button", { name: "modal-affirmative-action" });
|
|
224
224
|
userEvent.click(yesButton);
|
|
225
225
|
|
|
226
226
|
expect(dispatch).toHaveBeenCalledWith({
|
|
@@ -1,19 +1,67 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import { waitFor } from "@testing-library/react";
|
|
4
|
+
import StructureView from "../StructureView";
|
|
5
|
+
|
|
6
|
+
jest.mock("react-router-dom", () => ({
|
|
7
|
+
...jest.requireActual("react-router-dom"),
|
|
8
|
+
useParams: () => ({ id: 1 }),
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
const commonState = {
|
|
12
|
+
authentication: { role: "admin" },
|
|
13
|
+
userPermissions: {
|
|
14
|
+
confidential: true,
|
|
15
|
+
create_foreign_grant_request: true,
|
|
16
|
+
profile_permission: false,
|
|
17
|
+
request_grant: true,
|
|
18
|
+
update: true,
|
|
19
|
+
update_domain: true,
|
|
20
|
+
update_grant_removal: true,
|
|
21
|
+
view_profiling_permission: true,
|
|
22
|
+
},
|
|
23
|
+
navFilter: {},
|
|
24
|
+
grantRequestsCart: {
|
|
25
|
+
structures: [],
|
|
26
|
+
template: null,
|
|
27
|
+
templateContent: {},
|
|
28
|
+
modificationGrant: null,
|
|
29
|
+
user: {
|
|
30
|
+
id: null,
|
|
31
|
+
valid: true,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
4
35
|
|
|
5
36
|
describe("<StructureView />", () => {
|
|
6
|
-
it("
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
37
|
+
it("Some inner component shows the structure name", () => {
|
|
38
|
+
const renderOpts = {
|
|
39
|
+
state: {
|
|
40
|
+
...commonState,
|
|
41
|
+
structureLoading: false,
|
|
42
|
+
structure: {
|
|
43
|
+
id: 1,
|
|
44
|
+
name: "some_db",
|
|
45
|
+
type: "Database",
|
|
46
|
+
description: "some description",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const { getAllByText } = render(<StructureView />, renderOpts);
|
|
52
|
+
expect(getAllByText("some_db")[0]).toBeInTheDocument();
|
|
11
53
|
});
|
|
12
54
|
|
|
13
|
-
it("
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
55
|
+
it("Inner components are not rendered if structure is loading, so structure name is not shown", async () => {
|
|
56
|
+
const renderOpts = {
|
|
57
|
+
state: {
|
|
58
|
+
...commonState,
|
|
59
|
+
structureLoading: true,
|
|
60
|
+
structure: {},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const { queryByText } = render(<StructureView />, renderOpts);
|
|
65
|
+
await waitFor(() => expect(queryByText("some_db")).not.toBeInTheDocument());
|
|
18
66
|
});
|
|
19
67
|
});
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { shallow } from "enzyme";
|
|
4
|
-
import {
|
|
3
|
+
//import { shallow } from "enzyme";
|
|
4
|
+
import { render } from "@truedat/test/render";
|
|
5
|
+
import { within } from "@testing-library/react";
|
|
6
|
+
|
|
7
|
+
import { StructuresView } from "../StructuresView";
|
|
8
|
+
import en from "../../messages/en";
|
|
5
9
|
|
|
6
10
|
const mockHistory = {
|
|
7
11
|
goBack: jest.fn(),
|
|
@@ -10,36 +14,77 @@ const mockHistory = {
|
|
|
10
14
|
jest.mock("react-router-dom", () => ({
|
|
11
15
|
...jest.requireActual("react-router-dom"),
|
|
12
16
|
useHistory: () => mockHistory,
|
|
17
|
+
useParams: () => ({ propertyPath: "metadata.database" }),
|
|
13
18
|
}));
|
|
14
19
|
|
|
20
|
+
const messages = {
|
|
21
|
+
en: {
|
|
22
|
+
...en,
|
|
23
|
+
missingBucket: "_missing",
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
15
27
|
describe("<StructuresView />", () => {
|
|
16
|
-
it("
|
|
28
|
+
it("shows structures table if hasFilterAplied", () => {
|
|
17
29
|
const structures = [
|
|
18
30
|
{
|
|
19
31
|
id: 1,
|
|
20
32
|
domain: { name: "org" },
|
|
21
|
-
name: "
|
|
33
|
+
name: "structure1",
|
|
22
34
|
description: "dd",
|
|
23
35
|
group: "gp",
|
|
24
36
|
system: "sys",
|
|
37
|
+
type: "Table",
|
|
25
38
|
},
|
|
26
39
|
];
|
|
27
|
-
const columns = [
|
|
28
|
-
{ name: "name" },
|
|
29
|
-
{ name: "domain", fieldSelector: _.path("domain.name") },
|
|
30
|
-
{ name: "system" },
|
|
31
|
-
{ name: "group" },
|
|
32
|
-
];
|
|
33
40
|
|
|
34
41
|
const actions = {
|
|
35
42
|
bulkUpdate: {},
|
|
36
43
|
};
|
|
37
44
|
|
|
38
|
-
const props = { structures,
|
|
39
|
-
const
|
|
40
|
-
|
|
45
|
+
const props = { structures, actions, hasFilterApplied: true };
|
|
46
|
+
const { getByRole } = render(<StructuresView {...props} />);
|
|
47
|
+
|
|
48
|
+
expect(getByRole("heading")).toBeInTheDocument();
|
|
49
|
+
|
|
50
|
+
const table = getByRole("table");
|
|
51
|
+
const rows = within(table).getAllByRole("row");
|
|
52
|
+
const tableHeaderRow = rows[0];
|
|
53
|
+
const tableDataRow = rows[1];
|
|
54
|
+
|
|
55
|
+
expect(
|
|
56
|
+
within(tableHeaderRow).getByRole("columnheader", { name: "Structure" })
|
|
57
|
+
).toBeInTheDocument();
|
|
58
|
+
expect(
|
|
59
|
+
within(tableDataRow).getByRole("cell", { name: "structure1" })
|
|
60
|
+
).toBeInTheDocument();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("shows CatalogCustomViewCards if customView", () => {
|
|
64
|
+
const structureFilters = {
|
|
65
|
+
"metadata.database": {
|
|
66
|
+
buckets: [
|
|
67
|
+
{
|
|
68
|
+
doc_count: 11234,
|
|
69
|
+
key: "_missing",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
doc_count: 2345,
|
|
73
|
+
key: "database_1",
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
values: ["_missing", "database_1"],
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const { getByRole } = render(<StructuresView customView />, {
|
|
81
|
+
state: { structureFilters },
|
|
82
|
+
messages,
|
|
83
|
+
});
|
|
41
84
|
|
|
42
|
-
const
|
|
43
|
-
expect(
|
|
85
|
+
const missingCard = getByRole("link", { name: /_missing/ });
|
|
86
|
+
expect(missingCard).toBeInTheDocument();
|
|
87
|
+
const databaseOneCard = getByRole("link", { name: /database_1/ });
|
|
88
|
+
expect(databaseOneCard).toBeInTheDocument();
|
|
44
89
|
});
|
|
45
90
|
});
|
|
@@ -18,9 +18,15 @@ jest.mock("../../hooks/useStructures.js", () => {
|
|
|
18
18
|
};
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
+
const renderOpts = {
|
|
22
|
+
state: {
|
|
23
|
+
navFilter: {},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
21
27
|
describe("<SystemFilteredNav />", () => {
|
|
22
28
|
it("matches the latest snapshot", () => {
|
|
23
|
-
const { container } = render(<SystemFilteredNav />,
|
|
29
|
+
const { container } = render(<SystemFilteredNav />, renderOpts);
|
|
24
30
|
expect(container).toMatchSnapshot();
|
|
25
31
|
});
|
|
26
32
|
});
|
|
@@ -2,6 +2,11 @@ import React from "react";
|
|
|
2
2
|
import { shallow } from "enzyme";
|
|
3
3
|
import { SystemStructures } from "../SystemStructures";
|
|
4
4
|
|
|
5
|
+
jest.mock("react-router-dom", () => ({
|
|
6
|
+
...jest.requireActual("react-router-dom"),
|
|
7
|
+
useParams: () => ({ id: 1 }),
|
|
8
|
+
}));
|
|
9
|
+
|
|
5
10
|
describe("<SystemStructures />", () => {
|
|
6
11
|
it("matches the latest snapshot", () => {
|
|
7
12
|
const wrapper = shallow(<SystemStructures />);
|
|
@@ -5,8 +5,28 @@ exports[`<DictionaryRoutes /> matches the latest snapshot 1`] = `
|
|
|
5
5
|
<Route
|
|
6
6
|
render={[Function]}
|
|
7
7
|
/>
|
|
8
|
+
<Switch>
|
|
9
|
+
<Route
|
|
10
|
+
path="/bucketViewConfigs/:id/edit"
|
|
11
|
+
render={[Function]}
|
|
12
|
+
/>
|
|
13
|
+
<Route
|
|
14
|
+
path="/bucketViewConfigs/new"
|
|
15
|
+
render={[Function]}
|
|
16
|
+
/>
|
|
17
|
+
<Route
|
|
18
|
+
path="/bucketViewConfigs"
|
|
19
|
+
render={[Function]}
|
|
20
|
+
/>
|
|
21
|
+
</Switch>
|
|
8
22
|
<Route
|
|
9
|
-
path=
|
|
23
|
+
path={
|
|
24
|
+
[
|
|
25
|
+
"/structures",
|
|
26
|
+
"/buckets/:propertyPath",
|
|
27
|
+
"/bucketStructures",
|
|
28
|
+
]
|
|
29
|
+
}
|
|
10
30
|
render={[Function]}
|
|
11
31
|
/>
|
|
12
32
|
<Route
|
|
@@ -5,7 +5,7 @@ exports[`<StructureCrumbs /> matches the latest snapshot (empty) 1`] = `""`;
|
|
|
5
5
|
exports[`<StructureCrumbs /> matches the latest snapshot (system, ancestry and structure) 1`] = `
|
|
6
6
|
<Breadcrumb>
|
|
7
7
|
<StructuresCrumb />
|
|
8
|
-
<SystemCrumb
|
|
8
|
+
<Connect(SystemCrumb)
|
|
9
9
|
id={42}
|
|
10
10
|
name="system1"
|
|
11
11
|
/>
|
|
@@ -29,7 +29,7 @@ exports[`<StructureCrumbs /> matches the latest snapshot (system, ancestry and s
|
|
|
29
29
|
exports[`<StructureCrumbs /> matches the latest snapshot (system, ancestry, structure and field) 1`] = `
|
|
30
30
|
<Breadcrumb>
|
|
31
31
|
<StructuresCrumb />
|
|
32
|
-
<SystemCrumb
|
|
32
|
+
<Connect(SystemCrumb)
|
|
33
33
|
id={42}
|
|
34
34
|
name="system1"
|
|
35
35
|
/>
|
|
@@ -53,7 +53,7 @@ exports[`<StructureCrumbs /> matches the latest snapshot (system, ancestry, stru
|
|
|
53
53
|
exports[`<StructureCrumbs /> matches the latest snapshot (system, ancestry, structure and version) 1`] = `
|
|
54
54
|
<Breadcrumb>
|
|
55
55
|
<StructuresCrumb />
|
|
56
|
-
<SystemCrumb
|
|
56
|
+
<Connect(SystemCrumb)
|
|
57
57
|
id={42}
|
|
58
58
|
name="system1"
|
|
59
59
|
/>
|
|
@@ -83,7 +83,7 @@ exports[`<StructureCrumbs /> matches the latest snapshot (system, ancestry, stru
|
|
|
83
83
|
exports[`<StructureCrumbs /> matches the latest snapshot (system. ancestry, structure, version and field) 1`] = `
|
|
84
84
|
<Breadcrumb>
|
|
85
85
|
<StructuresCrumb />
|
|
86
|
-
<SystemCrumb
|
|
86
|
+
<Connect(SystemCrumb)
|
|
87
87
|
id={42}
|
|
88
88
|
name="system1"
|
|
89
89
|
/>
|
package/src/components/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import CatalogCustomViewCards from "./CatalogCustomViewCards";
|
|
1
2
|
import DictionaryRoutes from "./DictionaryRoutes";
|
|
2
3
|
import FilteredNav from "./FilteredNav";
|
|
3
4
|
import GrantRoutes from "./GrantRoutes";
|
|
@@ -52,6 +53,7 @@ import StructureMetadata from "./StructureMetadata";
|
|
|
52
53
|
import ValueConditionStructure from "./ValueConditionStructure";
|
|
53
54
|
|
|
54
55
|
export {
|
|
56
|
+
CatalogCustomViewCards,
|
|
55
57
|
DictionaryRoutes,
|
|
56
58
|
FilteredNav,
|
|
57
59
|
GrantRoutes,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import useSWRMutations from "swr/mutation";
|
|
2
|
+
import { apiJsonPost } from "@truedat/core/services/api";
|
|
3
|
+
import { API_BUCKET_STRUCTURES } from "../api";
|
|
4
|
+
|
|
5
|
+
export const useBucketStructures = () => {
|
|
6
|
+
const mutation = useSWRMutations(API_BUCKET_STRUCTURES, (url, { arg }) =>
|
|
7
|
+
apiJsonPost(url, arg)
|
|
8
|
+
);
|
|
9
|
+
return mutation;
|
|
10
|
+
};
|
package/src/messages/en.js
CHANGED
|
@@ -212,6 +212,7 @@ export default {
|
|
|
212
212
|
"lineage.group.placeholder": "Select Top Level Structure",
|
|
213
213
|
"lineage.resources.placeholder": "Select Child Structures",
|
|
214
214
|
"lineage.subgroup.placeholder": "Select Child Structure",
|
|
215
|
+
metadata: "Metadata",
|
|
215
216
|
"metadataView.fields": "Available metadata fields",
|
|
216
217
|
"metadataView.fields.placeholder":
|
|
217
218
|
"By default all available metadata will be visible",
|
|
@@ -228,6 +229,7 @@ export default {
|
|
|
228
229
|
"navigation.lineage.view": "View in Data Catalog",
|
|
229
230
|
"navigation.profile.executions": "Executions",
|
|
230
231
|
"navigation.profile.executions.detail": "Detail",
|
|
232
|
+
note: "Note",
|
|
231
233
|
"pendingStructureNotes.header": "Pending Notes",
|
|
232
234
|
"pendingStructureNotes.subheader": "Structure notes pending some action",
|
|
233
235
|
"pendingStructureNotes.props.structure": "Data Structure",
|
|
@@ -378,6 +380,7 @@ export default {
|
|
|
378
380
|
"structure.system.name": "Name",
|
|
379
381
|
"structure.type": "Type",
|
|
380
382
|
"structure.type.Attribute": "Attribute",
|
|
383
|
+
"structure.type.bucket.icon": "bitbucket",
|
|
381
384
|
"structure.type.File.icon": "file",
|
|
382
385
|
"structure.type.Metric": "Metric",
|
|
383
386
|
"structure.type.WORKFLOW.icon": "network-wired",
|
package/src/messages/es.js
CHANGED
|
@@ -219,6 +219,7 @@ export default {
|
|
|
219
219
|
"lineage.group.placeholder": "Seleccionar Estructura Padre",
|
|
220
220
|
"lineage.resources.placeholder": "Seleccionar Estructuras Hijos",
|
|
221
221
|
"lineage.subgroup.placeholder": "Seleccionar Estructura Hijo",
|
|
222
|
+
metadata: "Metadata",
|
|
222
223
|
"metadataView.fields": "Campos",
|
|
223
224
|
"metadataView.fields.placeholder":
|
|
224
225
|
"Por defecto, se incluirán todos los campos de metadata",
|
|
@@ -235,6 +236,7 @@ export default {
|
|
|
235
236
|
"navigation.lineage.view": "Ver detalle",
|
|
236
237
|
"navigation.profile.executions": "Ejecuciones",
|
|
237
238
|
"navigation.profile.executions.detail": "Detalle",
|
|
239
|
+
note: "Nota",
|
|
238
240
|
"pendingStructureNotes.header": "Notas pendientes",
|
|
239
241
|
"pendingStructureNotes.subheader":
|
|
240
242
|
"Notas de estructuras pendientes de acción",
|
|
@@ -387,6 +389,7 @@ export default {
|
|
|
387
389
|
"structure.system.name": "Nombre",
|
|
388
390
|
"structure.type": "Tipo",
|
|
389
391
|
"structure.type.Attribute": "Atributo",
|
|
392
|
+
"structure.type.bucket.icon": "bitbucket",
|
|
390
393
|
"structure.type.File.icon": "file",
|
|
391
394
|
"structure.type.Metric": "Métrica",
|
|
392
395
|
"structure.type.WORKFLOW.icon": "network-wired",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import { clearNavFilter, saveNavFilter } from "../routines";
|
|
3
|
+
|
|
4
|
+
export const initialState = {};
|
|
5
|
+
|
|
6
|
+
export const navFilter = (state = initialState, { type, payload }) => {
|
|
7
|
+
switch (type) {
|
|
8
|
+
case clearNavFilter.TRIGGER:
|
|
9
|
+
return initialState;
|
|
10
|
+
case saveNavFilter.TRIGGER:
|
|
11
|
+
return payload;
|
|
12
|
+
default:
|
|
13
|
+
return state;
|
|
14
|
+
}
|
|
15
|
+
};
|
package/src/reducers/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { navFilter } from "./navFilter";
|
|
1
2
|
import { bulkUpdateStructuresLoading } from "./bulkUpdateStructuresLoading";
|
|
2
3
|
import { childrenRelations, parentRelations } from "./structureRelations";
|
|
3
4
|
import { creatingGrantRequestApproval } from "./creatingGrantRequestApproval";
|
|
@@ -38,7 +39,7 @@ import { selectedGroups } from "./selectedGroups";
|
|
|
38
39
|
import { selectedNode } from "./selectedNode";
|
|
39
40
|
import { selectedResources } from "./selectedResources";
|
|
40
41
|
import { selectedUserSearchFilter } from "./selectedUserSearchFilter";
|
|
41
|
-
import { structure } from "./structure";
|
|
42
|
+
import { structure, structureSticky } from "./structure";
|
|
42
43
|
import { structureActions } from "./structureActions";
|
|
43
44
|
import { structureActiveFilters } from "./structureActiveFilters";
|
|
44
45
|
import { structureAncestry } from "./structureAncestry";
|
|
@@ -92,6 +93,7 @@ import { userSearchFilters } from "./userSearchFilters";
|
|
|
92
93
|
|
|
93
94
|
export {
|
|
94
95
|
bulkUpdateStructuresLoading,
|
|
96
|
+
navFilter,
|
|
95
97
|
childrenRelations,
|
|
96
98
|
creatingGrantRequestApproval,
|
|
97
99
|
csvGraphDownloading,
|
|
@@ -133,6 +135,7 @@ export {
|
|
|
133
135
|
selectedResources,
|
|
134
136
|
selectedUserSearchFilter,
|
|
135
137
|
structure,
|
|
138
|
+
structureSticky,
|
|
136
139
|
structureActions,
|
|
137
140
|
structureActiveFilters,
|
|
138
141
|
structureAncestry,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { clearNavFilter, saveNavFilter } from "../routines";
|
|
2
|
+
|
|
3
|
+
export const initialState = {};
|
|
4
|
+
|
|
5
|
+
export const navFilter = (state = initialState, { type, payload }) => {
|
|
6
|
+
switch (type) {
|
|
7
|
+
case clearNavFilter.TRIGGER:
|
|
8
|
+
return initialState;
|
|
9
|
+
case saveNavFilter.TRIGGER:
|
|
10
|
+
return payload;
|
|
11
|
+
default:
|
|
12
|
+
return state;
|
|
13
|
+
}
|
|
14
|
+
};
|