@truedat/dd 4.44.3 → 4.45.0
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 +10 -0
- package/package.json +24 -20
- package/src/api/mutations.js +27 -0
- package/src/api/queries.js +24 -0
- package/src/api.js +2 -0
- package/src/components/DictionaryRoutes.js +7 -5
- package/src/components/EditDomainPopup.js +1 -1
- package/src/components/FilteredNav.js +9 -9
- package/src/components/GrantFilters.js +1 -5
- package/src/components/GrantRequestApprovalPopup.js +0 -1
- package/src/components/PendingStructureNotes.js +1 -1
- package/src/components/ReferenceDataset.js +23 -0
- package/src/components/ReferenceDatasetActions.js +88 -0
- package/src/components/ReferenceDatasetBreadcrumbs.js +22 -0
- package/src/components/ReferenceDatasetCreate.js +36 -0
- package/src/components/ReferenceDatasetDetail.js +42 -0
- package/src/components/ReferenceDatasetForm.js +109 -0
- package/src/components/ReferenceDatasetHeader.js +32 -0
- package/src/components/ReferenceDatasetRoutes.js +56 -0
- package/src/components/ReferenceDatasetTable.js +42 -0
- package/src/components/ReferenceDatasets.js +61 -0
- package/src/components/ReferenceDatasetsTable.js +105 -0
- package/src/components/StructureConfidentialButton.js +1 -1
- package/src/components/StructureFilters.js +1 -5
- package/src/components/StructureNotesEdit.js +6 -6
- package/src/components/StructureProperties.js +4 -1
- package/src/components/StructureTabPane.js +4 -2
- package/src/components/StructureTagsRoutes.js +0 -1
- package/src/components/StructureTypesCrumbs.js +0 -1
- package/src/components/StructureVersionListItem.js +2 -2
- package/src/components/StructureView.js +1 -3
- package/src/components/SystemForm.js +1 -1
- package/src/components/__tests__/LineageRoutes.spec.js +4 -4
- package/src/components/__tests__/ReferenceDataset.spec.js +64 -0
- package/src/components/__tests__/ReferenceDatasetActions.spec.js +17 -0
- package/src/components/__tests__/ReferenceDatasetBreadcrumbs.spec.js +12 -0
- package/src/components/__tests__/ReferenceDatasetCreate.spec.js +12 -0
- package/src/components/__tests__/ReferenceDatasetDetail.spec.js +37 -0
- package/src/components/__tests__/ReferenceDatasetForm.spec.js +51 -0
- package/src/components/__tests__/ReferenceDatasetHeader.spec.js +17 -0
- package/src/components/__tests__/ReferenceDatasetRoutes.spec.js +74 -0
- package/src/components/__tests__/ReferenceDatasetTable.spec.js +18 -0
- package/src/components/__tests__/ReferenceDatasets.spec.js +32 -0
- package/src/components/__tests__/ReferenceDatasetsTable.spec.js +22 -0
- package/src/components/__tests__/StructureConfidentialButton.spec.js +26 -30
- package/src/components/__tests__/StructureNotesEdit.spec.js +2 -9
- package/src/components/__tests__/StructureProperties.spec.js +6 -8
- package/src/components/__tests__/StructureVersionListItem.spec.js +4 -4
- package/src/components/__tests__/__snapshots__/DictionaryRoutes.spec.js.snap +4 -0
- package/src/components/__tests__/__snapshots__/LineageRoutes.spec.js.snap +1 -20
- package/src/components/__tests__/__snapshots__/ProfileExecution.spec.js.snap +2 -1
- package/src/components/__tests__/__snapshots__/ReferenceDataset.spec.js.snap +365 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetActions.spec.js.snap +65 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetBreadcrumbs.spec.js.snap +25 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetCreate.spec.js.snap +98 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetDetail.spec.js.snap +135 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetForm.spec.js.snap +61 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetHeader.spec.js.snap +95 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetRoutes.spec.js.snap +414 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetTable.spec.js.snap +75 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasets.spec.js.snap +128 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetsTable.spec.js.snap +86 -0
- package/src/components/__tests__/__snapshots__/StructureConfidentialButton.spec.js.snap +13 -33
- package/src/components/__tests__/__snapshots__/StructureProperties.spec.js.snap +76 -71
- package/src/components/__tests__/__snapshots__/StructureTabPane.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/StructureVersionListItem.spec.js.snap +31 -64
- package/src/components/index.js +0 -6
- package/src/messages/en.js +18 -0
- package/src/messages/es.js +20 -0
- package/src/reducers/__tests__/ddMessage.spec.js +26 -5
- package/src/reducers/__tests__/graph.spec.js +1 -6
- package/src/reducers/__tests__/referenceDatasetSaving.spec.js +44 -0
- package/src/reducers/__tests__/structureRedirect.spec.js +37 -13
- package/src/reducers/ddMessage.js +26 -1
- package/src/reducers/index.js +2 -0
- package/src/reducers/referenceDatasetSaving.js +16 -0
- package/src/reducers/structureRedirect.js +36 -15
- package/src/reducers/structuresUploadEvents.js +0 -1
- package/src/routines.js +35 -74
- package/src/sagas/__tests__/createReferenceDataset.spec.js +90 -0
- package/src/sagas/__tests__/deleteReferenceDataset.spec.js +81 -0
- package/src/sagas/__tests__/updateReferenceDataset.spec.js +116 -0
- package/src/sagas/createReferenceDataset.js +34 -0
- package/src/sagas/deleteReferenceDataset.js +29 -0
- package/src/sagas/downloadReferenceDataset.js +44 -0
- package/src/sagas/index.js +31 -22
- package/src/sagas/updateReferenceDataset.js +35 -0
- package/src/selectors/getRelationSortingCriteria.js +3 -5
- package/src/selectors/getTabVisibility.js +1 -4
- package/src/components/ProfilingElements.js +0 -89
- package/src/components/ProfilingGraph.js +0 -89
- package/src/components/ProfilingPatterns.js +0 -57
- package/src/components/StructureProfiling.js +0 -124
- package/src/components/__tests__/StructureProfiling.spec.js +0 -45
- package/src/components/__tests__/__snapshots__/StructureProfiling.spec.js.snap +0 -444
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import ReferenceDatasetRoutes from "../ReferenceDatasetRoutes";
|
|
4
|
+
import {
|
|
5
|
+
REFERENCE_DATASET_QUERY,
|
|
6
|
+
REFERENCE_DATASETS_QUERY,
|
|
7
|
+
} from "../../api/queries";
|
|
8
|
+
|
|
9
|
+
jest.mock("@truedat/core/hooks", () => ({
|
|
10
|
+
useAuthorized: jest.fn(() => true),
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
const dataset = {
|
|
14
|
+
__typename: "ReferenceDataset",
|
|
15
|
+
id: "123",
|
|
16
|
+
name: "foo",
|
|
17
|
+
headers: ["foo", "bar", "baz"],
|
|
18
|
+
rowCount: 2,
|
|
19
|
+
rows: [
|
|
20
|
+
["foo1", "bar1", "baz1"],
|
|
21
|
+
["foo2", "bar2", "baz2"],
|
|
22
|
+
],
|
|
23
|
+
updatedAt: "2020-01-01T00:00:00.000Z",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const datasetsMock = {
|
|
27
|
+
request: { query: REFERENCE_DATASETS_QUERY },
|
|
28
|
+
result: { data: { referenceDatasets: [dataset] } },
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const datasetMock = {
|
|
32
|
+
request: { query: REFERENCE_DATASET_QUERY, variables: { id: "123" } },
|
|
33
|
+
result: { data: { referenceDataset: dataset } },
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
describe("<ReferenceDatasetRoutes />", () => {
|
|
37
|
+
const props = { dataset };
|
|
38
|
+
|
|
39
|
+
it("matches the latest snapshot (list route)", async () => {
|
|
40
|
+
const renderOpts = {
|
|
41
|
+
routes: ["/referenceDatasets"],
|
|
42
|
+
mocks: [datasetsMock],
|
|
43
|
+
};
|
|
44
|
+
const { container, findByText } = render(
|
|
45
|
+
<ReferenceDatasetRoutes {...props} />,
|
|
46
|
+
renderOpts
|
|
47
|
+
);
|
|
48
|
+
await findByText("foo");
|
|
49
|
+
expect(container).toMatchSnapshot();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("matches the latest snapshot (create route)", async () => {
|
|
53
|
+
const renderOpts = { routes: ["/referenceDatasets/new"] };
|
|
54
|
+
const { container, findByRole } = render(
|
|
55
|
+
<ReferenceDatasetRoutes {...props} />,
|
|
56
|
+
renderOpts
|
|
57
|
+
);
|
|
58
|
+
await findByRole("button", { name: "Save" });
|
|
59
|
+
expect(container).toMatchSnapshot();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("matches the latest snapshot (view route)", async () => {
|
|
63
|
+
const renderOpts = {
|
|
64
|
+
routes: ["/referenceDatasets/123"],
|
|
65
|
+
mocks: [datasetMock],
|
|
66
|
+
};
|
|
67
|
+
const { container, findByText } = render(
|
|
68
|
+
<ReferenceDatasetRoutes {...props} />,
|
|
69
|
+
renderOpts
|
|
70
|
+
);
|
|
71
|
+
await findByText("baz2");
|
|
72
|
+
expect(container).toMatchSnapshot();
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import ReferenceDatasetTable from "../ReferenceDatasetTable";
|
|
4
|
+
|
|
5
|
+
const props = {
|
|
6
|
+
headers: ["foo", "bar", "baz"],
|
|
7
|
+
rows: [
|
|
8
|
+
["foo1", "bar1", "baz1"],
|
|
9
|
+
["foo2", "bar2", "baz2"],
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
describe("<ReferenceDatasetTable />", () => {
|
|
14
|
+
it("matches the latest snapshot", () => {
|
|
15
|
+
const { container } = render(<ReferenceDatasetTable {...props} />);
|
|
16
|
+
expect(container).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import ReferenceDatasets from "../ReferenceDatasets";
|
|
4
|
+
import { REFERENCE_DATASETS_QUERY } from "../../api/queries";
|
|
5
|
+
|
|
6
|
+
const dataset = {
|
|
7
|
+
__typename: "ReferenceDataset",
|
|
8
|
+
id: "123",
|
|
9
|
+
name: "foo",
|
|
10
|
+
headers: ["foo", "bar", "baz"],
|
|
11
|
+
rowCount: 2,
|
|
12
|
+
rows: [
|
|
13
|
+
["foo1", "bar1", "baz1"],
|
|
14
|
+
["foo2", "bar2", "baz2"],
|
|
15
|
+
],
|
|
16
|
+
updatedAt: "2020-01-01T00:00:00.000Z",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const datasetsMock = {
|
|
20
|
+
request: { query: REFERENCE_DATASETS_QUERY },
|
|
21
|
+
result: { data: { referenceDatasets: [dataset] } },
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const renderOpts = { mocks: [datasetsMock] };
|
|
25
|
+
|
|
26
|
+
describe("<ReferenceDatasets />", () => {
|
|
27
|
+
it("matches the latest snapshot", async () => {
|
|
28
|
+
const { container, findByText } = render(<ReferenceDatasets />, renderOpts);
|
|
29
|
+
await findByText("One dataset found");
|
|
30
|
+
expect(container).toMatchSnapshot();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import ReferenceDatasetsTable from "../ReferenceDatasetsTable";
|
|
4
|
+
|
|
5
|
+
const props = {
|
|
6
|
+
datasets: [
|
|
7
|
+
{
|
|
8
|
+
id: "123",
|
|
9
|
+
name: "foo",
|
|
10
|
+
headers: ["foo", "bar", "baz"],
|
|
11
|
+
rowCount: 2,
|
|
12
|
+
updatedAt: "2020-01-01T00:00:00.000Z",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
describe("<ReferenceDatasetsTable />", () => {
|
|
18
|
+
it("matches the latest snapshot", () => {
|
|
19
|
+
const { container } = render(<ReferenceDatasetsTable {...props} />);
|
|
20
|
+
expect(container).toMatchSnapshot();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -1,45 +1,41 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import StructureConfidentialButton from "../StructureConfidentialButton";
|
|
4
4
|
|
|
5
5
|
describe("<StructureConfidentialButton />", () => {
|
|
6
|
-
const
|
|
7
|
-
const props = {
|
|
6
|
+
const state = {
|
|
8
7
|
structure: { id: 1, confidential: false },
|
|
9
8
|
structureUpdating: false,
|
|
10
|
-
updateStructure: updateStructure,
|
|
11
9
|
userPermissions: {
|
|
12
10
|
update: true,
|
|
13
|
-
confidential: true
|
|
14
|
-
}
|
|
11
|
+
confidential: true,
|
|
12
|
+
},
|
|
15
13
|
};
|
|
14
|
+
|
|
16
15
|
it("matches the latest snapshot", () => {
|
|
17
|
-
const
|
|
18
|
-
expect(
|
|
16
|
+
const { container } = render(<StructureConfidentialButton />, { state });
|
|
17
|
+
expect(container).toMatchSnapshot();
|
|
19
18
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
confidential: true
|
|
26
|
-
}
|
|
19
|
+
|
|
20
|
+
it("matches snapshot without update permission", () => {
|
|
21
|
+
const userPermissions = {
|
|
22
|
+
update: false,
|
|
23
|
+
confidential: true,
|
|
27
24
|
};
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
);
|
|
31
|
-
expect(
|
|
25
|
+
const { container } = render(<StructureConfidentialButton />, {
|
|
26
|
+
state: { ...state, userPermissions },
|
|
27
|
+
});
|
|
28
|
+
expect(container).toMatchSnapshot();
|
|
29
|
+
});
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
confidential: false
|
|
38
|
-
}
|
|
31
|
+
it("matches snapshot without confidential permission", () => {
|
|
32
|
+
const userPermissions = {
|
|
33
|
+
update: true,
|
|
34
|
+
confidential: false,
|
|
39
35
|
};
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
);
|
|
43
|
-
expect(
|
|
36
|
+
const { container } = render(<StructureConfidentialButton />, {
|
|
37
|
+
state: { ...state, userPermissions },
|
|
38
|
+
});
|
|
39
|
+
expect(container).toMatchSnapshot();
|
|
44
40
|
});
|
|
45
41
|
});
|
|
@@ -5,15 +5,6 @@ import { render } from "@truedat/test/render";
|
|
|
5
5
|
import { applyTemplate } from "@truedat/df/utils";
|
|
6
6
|
import { StructureNotesEdit } from "../StructureNotesEdit";
|
|
7
7
|
|
|
8
|
-
const DynamicForm = () => <div>DynamicForm</div>;
|
|
9
|
-
const TemplateLoader = () => <div>TemplateLoader</div>;
|
|
10
|
-
|
|
11
|
-
jest.mock("@truedat/df/components/DynamicForm", () => DynamicForm);
|
|
12
|
-
jest.mock(
|
|
13
|
-
"@truedat/df/templates/components/TemplateLoader",
|
|
14
|
-
() => TemplateLoader
|
|
15
|
-
);
|
|
16
|
-
|
|
17
8
|
describe("<StructureNotesEdit />", () => {
|
|
18
9
|
it("matches the latest snapshot", () => {
|
|
19
10
|
const props = {
|
|
@@ -27,6 +18,7 @@ describe("<StructureNotesEdit />", () => {
|
|
|
27
18
|
},
|
|
28
19
|
latestDfContent: { foo: "bar" },
|
|
29
20
|
applyTemplate: applyTemplate({ id: 2 }),
|
|
21
|
+
selectDomains: jest.fn(),
|
|
30
22
|
};
|
|
31
23
|
const { container } = render(
|
|
32
24
|
<Suspense fallback={null}>
|
|
@@ -65,6 +57,7 @@ describe("<StructureNotesEdit />", () => {
|
|
|
65
57
|
},
|
|
66
58
|
latestDfContent: { foo: "bar" },
|
|
67
59
|
applyTemplate: applyTemplate(template),
|
|
60
|
+
selectDomains: jest.fn(),
|
|
68
61
|
};
|
|
69
62
|
|
|
70
63
|
const { findByText } = render(
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import StructureProperties from "../StructureProperties";
|
|
4
4
|
|
|
5
5
|
describe("<StructureProperties />", () => {
|
|
6
6
|
it("matches the latest snapshot", () => {
|
|
7
7
|
const structure = { description: "dd", group: "gp" };
|
|
8
8
|
const state = { structure };
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
expect(wrapper).toMatchSnapshot();
|
|
9
|
+
const { container } = render(<StructureProperties />, { state });
|
|
10
|
+
expect(container).toMatchSnapshot();
|
|
12
11
|
});
|
|
13
12
|
|
|
14
13
|
it("matches the latest snapshot (custom structureProperties)", () => {
|
|
15
14
|
const structure = { metadata: { foo: "bar" } };
|
|
16
15
|
const structureProperties = [{ name: "metadata.foo" }];
|
|
17
16
|
const state = { structure, structureProperties };
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
expect(wrapper).toMatchSnapshot();
|
|
17
|
+
const { container } = render(<StructureProperties />, { state });
|
|
18
|
+
expect(container).toMatchSnapshot();
|
|
21
19
|
});
|
|
22
20
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import StructureVersionListItem from "../StructureVersionListItem";
|
|
4
4
|
|
|
5
5
|
describe("<StructureVersionListItem />", () => {
|
|
6
6
|
it("matches the latest snapshot", () => {
|
|
@@ -11,7 +11,7 @@ describe("<StructureVersionListItem />", () => {
|
|
|
11
11
|
const inserted_at = "2018-01-01T01:01:01.123456Z";
|
|
12
12
|
const props = { id, version, inserted_at, history };
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
expect(
|
|
14
|
+
const { container } = render(<StructureVersionListItem {...props} />);
|
|
15
|
+
expect(container).toMatchSnapshot();
|
|
16
16
|
});
|
|
17
17
|
});
|
|
@@ -1,22 +1,3 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<LineageRoutes /> matches the latest snapshot 1`] =
|
|
4
|
-
<Fragment>
|
|
5
|
-
<Route
|
|
6
|
-
path="/graphs"
|
|
7
|
-
render={[Function]}
|
|
8
|
-
/>
|
|
9
|
-
<Route
|
|
10
|
-
path="/graphs/:id"
|
|
11
|
-
render={[Function]}
|
|
12
|
-
/>
|
|
13
|
-
<Route
|
|
14
|
-
path="/lineage_events"
|
|
15
|
-
render={[Function]}
|
|
16
|
-
/>
|
|
17
|
-
<Route
|
|
18
|
-
path="/sample"
|
|
19
|
-
render={[Function]}
|
|
20
|
-
/>
|
|
21
|
-
</Fragment>
|
|
22
|
-
`;
|
|
3
|
+
exports[`<LineageRoutes /> matches the latest snapshot 1`] = `<div />`;
|
|
@@ -12,7 +12,7 @@ exports[`<Event /> matches the latest snapshot 1`] = `
|
|
|
12
12
|
/>
|
|
13
13
|
<FeedContent
|
|
14
14
|
date={
|
|
15
|
-
<
|
|
15
|
+
<n
|
|
16
16
|
ago={false}
|
|
17
17
|
calendar={false}
|
|
18
18
|
date="2019-09-20 17:01:00"
|
|
@@ -27,6 +27,7 @@ exports[`<Event /> matches the latest snapshot 1`] = `
|
|
|
27
27
|
onChange={[Function]}
|
|
28
28
|
titleFormat=""
|
|
29
29
|
toNow={false}
|
|
30
|
+
trim={false}
|
|
30
31
|
unit={null}
|
|
31
32
|
unix={false}
|
|
32
33
|
utc={false}
|