@truedat/ie 7.5.9 → 7.5.10
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 +42 -67
- package/src/ingests/components/EventRow.js +1 -2
- package/src/ingests/components/Events.js +3 -4
- package/src/ingests/components/FieldGroupTable.js +1 -2
- package/src/ingests/components/Ingest.js +1 -2
- package/src/ingests/components/IngestActions.js +1 -2
- package/src/ingests/components/IngestArchive.js +2 -3
- package/src/ingests/components/IngestArchiveLoader.js +16 -38
- package/src/ingests/components/IngestArchiveRow.js +5 -6
- package/src/ingests/components/IngestCompleteness.js +0 -1
- package/src/ingests/components/IngestCrumbs.js +2 -4
- package/src/ingests/components/IngestDetails.js +3 -3
- package/src/ingests/components/IngestDuplicate.js +5 -8
- package/src/ingests/components/IngestEdit.js +5 -8
- package/src/ingests/components/IngestExecutions.js +7 -7
- package/src/ingests/components/IngestExecutionsLoader.js +2 -2
- package/src/ingests/components/IngestFilters.js +5 -6
- package/src/ingests/components/IngestForm.js +4 -5
- package/src/ingests/components/IngestHeader.js +0 -1
- package/src/ingests/components/IngestLoader.js +16 -58
- package/src/ingests/components/IngestRoutes.js +272 -231
- package/src/ingests/components/IngestRow.js +4 -5
- package/src/ingests/components/IngestSelectedFilters.js +10 -10
- package/src/ingests/components/IngestSummary.js +0 -2
- package/src/ingests/components/IngestTabs.js +13 -13
- package/src/ingests/components/Ingests.js +0 -1
- package/src/ingests/components/IngestsActions.js +1 -2
- package/src/ingests/components/IngestsLabelResults.js +1 -2
- package/src/ingests/components/IngestsLoader.js +1 -1
- package/src/ingests/components/IngestsSearch.js +0 -1
- package/src/ingests/components/IngestsSelector.js +0 -1
- package/src/ingests/components/IngestsTable.js +85 -94
- package/src/ingests/components/IngestsTabs.js +2 -3
- package/src/ingests/components/__tests__/Events.spec.js +10 -10
- package/src/ingests/components/__tests__/Ingest.spec.js +16 -5
- package/src/ingests/components/__tests__/IngestActions.spec.js +7 -7
- package/src/ingests/components/__tests__/IngestArchive.spec.js +7 -7
- package/src/ingests/components/__tests__/IngestArchiveLoader.spec.js +70 -69
- package/src/ingests/components/__tests__/IngestArchiveRow.spec.js +10 -12
- package/src/ingests/components/__tests__/IngestCompleteness.spec.js +0 -1
- package/src/ingests/components/__tests__/IngestDetails.spec.js +10 -10
- package/src/ingests/components/__tests__/IngestExecutions.spec.js +7 -7
- package/src/ingests/components/__tests__/IngestExecutionsLoader.spec.js +38 -47
- package/src/ingests/components/__tests__/IngestFilters.spec.js +0 -1
- package/src/ingests/components/__tests__/IngestForm.spec.js +18 -40
- package/src/ingests/components/__tests__/IngestHeader.spec.js +9 -9
- package/src/ingests/components/__tests__/IngestLabelResults.spec.js +0 -1
- package/src/ingests/components/__tests__/IngestLoader.spec.js +70 -41
- package/src/ingests/components/__tests__/IngestRoutes.spec.js +176 -0
- package/src/ingests/components/__tests__/IngestSelectedFilters.spec.js +33 -5
- package/src/ingests/components/__tests__/Ingests.spec.js +32 -6
- package/src/ingests/components/__tests__/IngestsActions.spec.js +5 -5
- package/src/ingests/components/__tests__/IngestsLoader.spec.js +65 -36
- package/src/ingests/components/__tests__/IngestsTable.spec.js +16 -7
- package/src/ingests/components/__tests__/__snapshots__/Events.spec.js.snap +83 -43
- package/src/ingests/components/__tests__/__snapshots__/Ingest.spec.js.snap +27 -14
- package/src/ingests/components/__tests__/__snapshots__/IngestActions.spec.js.snap +19 -20
- package/src/ingests/components/__tests__/__snapshots__/IngestArchive.spec.js.snap +79 -65
- package/src/ingests/components/__tests__/__snapshots__/IngestArchiveLoader.spec.js.snap +1 -1
- package/src/ingests/components/__tests__/__snapshots__/IngestArchiveRow.spec.js.snap +30 -30
- package/src/ingests/components/__tests__/__snapshots__/IngestDetails.spec.js.snap +30 -13
- package/src/ingests/components/__tests__/__snapshots__/IngestExecutions.spec.js.snap +121 -101
- package/src/ingests/components/__tests__/__snapshots__/IngestExecutionsLoader.spec.js.snap +1 -1
- package/src/ingests/components/__tests__/__snapshots__/IngestFilters.spec.js.snap +1 -1
- package/src/ingests/components/__tests__/__snapshots__/IngestForm.spec.js.snap +28 -27
- package/src/ingests/components/__tests__/__snapshots__/IngestHeader.spec.js.snap +21 -19
- package/src/ingests/components/__tests__/__snapshots__/IngestLabelResults.spec.js.snap +1 -1
- package/src/ingests/components/__tests__/__snapshots__/IngestLoader.spec.js.snap +1 -15
- package/src/ingests/components/__tests__/__snapshots__/IngestRoutes.spec.js.snap +243 -0
- package/src/ingests/components/__tests__/__snapshots__/IngestSelectedFilters.spec.js.snap +22 -16
- package/src/ingests/components/__tests__/__snapshots__/Ingests.spec.js.snap +50 -33
- package/src/ingests/components/__tests__/__snapshots__/IngestsActions.spec.js.snap +17 -50
- package/src/ingests/components/__tests__/__snapshots__/IngestsLoader.spec.js.snap +1 -21
- package/src/ingests/components/__tests__/__snapshots__/IngestsTable.spec.js.snap +15 -24
- package/src/ingests/components/index.js +1 -1
- package/src/ingests/constants/mappings.js +6 -6
- package/src/ingests/relations/components/IngestLinkActions.js +0 -1
- package/src/ingests/relations/components/IngestLinksActions.js +1 -2
- package/src/ingests/relations/components/IngestRelationsRoutes.js +67 -69
- package/src/ingests/relations/components/IngestToDataStructureRelations.js +2 -2
- package/src/ingests/relations/components/IngestToIngestForm.js +4 -4
- package/src/ingests/relations/components/IngestToIngestRelations.js +4 -4
- package/src/ingests/relations/components/IngestToStructureForm.js +6 -6
- package/src/ingests/relations/components/__tests__/IngestRelationsRoutes.spec.js +80 -4
- package/src/ingests/relations/components/__tests__/IngestToIngestForm.spec.js +24 -25
- package/src/ingests/relations/components/__tests__/IngestToStructureForm.spec.js +42 -23
- package/src/ingests/relations/components/__tests__/__snapshots__/IngestRelationsRoutes.spec.js.snap +49 -23
- package/src/ingests/relations/components/__tests__/__snapshots__/IngestToIngestForm.spec.js.snap +85 -27
- package/src/ingests/relations/components/__tests__/__snapshots__/IngestToStructureForm.spec.js.snap +30 -35
- package/src/ingests/relations/selectors/__tests__/getIngestLinks.spec.js +20 -20
- package/src/ingests/relations/selectors/__tests__/getRelations.spec.js +17 -17
- package/src/ingests/relations/selectors/getIngestLinks.js +1 -2
- package/src/ingests/relations/selectors/getRelations.js +6 -6
- package/src/ingests/sagas/fetchIngest.js +1 -1
- package/src/ingests/sagas/fetchIngestArchive.js +1 -1
- package/src/ingests/sagas/fetchIngestExecutions.js +1 -1
- package/src/ingests/selectors/getIngestColumns.js +12 -13
- package/src/ingests/selectors/getIngestTemplate.js +1 -1
- package/src/ingests/selectors/getParsedEvents.js +15 -15
- package/src/ingests/selectors/getTemplateFields.js +3 -3
- package/src/ingests/selectors/getTemplateGroups.js +1 -1
- package/src/ingests/utils/filterOptions.js +3 -2
- package/src/ingests/components/__tests__/IngestDuplicate.spec.js +0 -67
- package/src/ingests/components/__tests__/IngestEdit.spec.js +0 -79
- package/src/ingests/components/__tests__/__snapshots__/IngestDuplicate.spec.js.snap +0 -85
- package/src/ingests/components/__tests__/__snapshots__/IngestEdit.spec.js.snap +0 -80
|
@@ -1,35 +1,54 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { shallow } from "enzyme";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
2
|
import { IngestToStructureForm } from "../IngestToStructureForm";
|
|
4
3
|
|
|
4
|
+
// Mock StructureSelector component
|
|
5
|
+
jest.mock("@truedat/dd/components/StructureSelector", () => {
|
|
6
|
+
const StructureSelector = ({ onSelect }) => (
|
|
7
|
+
<div data-testid="structure-selector">
|
|
8
|
+
<button
|
|
9
|
+
onClick={() =>
|
|
10
|
+
onSelect({ id: "123", name: "Test Structure", type: "table" })
|
|
11
|
+
}
|
|
12
|
+
>
|
|
13
|
+
Select Structure
|
|
14
|
+
</button>
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
return {
|
|
18
|
+
__esModule: true,
|
|
19
|
+
default: StructureSelector,
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
|
|
5
23
|
describe("<IngestToStructureForm />", () => {
|
|
6
|
-
it("matches the latest snapshot", () => {
|
|
24
|
+
it("matches the latest snapshot", async () => {
|
|
7
25
|
const tagOptions = [];
|
|
8
26
|
const ingest = {};
|
|
9
|
-
const props = {
|
|
10
|
-
|
|
11
|
-
|
|
27
|
+
const props = {
|
|
28
|
+
tagOptions,
|
|
29
|
+
ingest,
|
|
30
|
+
clearSelectedRelationTags: jest.fn(),
|
|
31
|
+
createRelation: jest.fn(),
|
|
32
|
+
selectedRelationTags: [],
|
|
33
|
+
};
|
|
34
|
+
const rendered = render(<IngestToStructureForm {...props} />);
|
|
35
|
+
await waitForLoad(rendered);
|
|
36
|
+
expect(rendered.container).toMatchSnapshot();
|
|
12
37
|
});
|
|
13
38
|
|
|
14
|
-
it("
|
|
39
|
+
it("renders TagTypeSelector when tagOptions is not empty", async () => {
|
|
15
40
|
const tagOptions = [{ text: "some text", value: "some value" }];
|
|
16
41
|
const ingest = {};
|
|
17
42
|
const selectedRelationTags = [];
|
|
18
|
-
const props = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const createRelation = jest.fn();
|
|
29
|
-
const props = { createRelation, tagOptions, ingest, selectedRelationTags };
|
|
30
|
-
const wrapper = shallow(<IngestToStructureForm {...props} />);
|
|
31
|
-
wrapper.setState({ selectedStructure });
|
|
32
|
-
wrapper.find({ primary: true }).simulate("click");
|
|
33
|
-
expect(createRelation.mock.calls.length).toEqual(1);
|
|
43
|
+
const props = {
|
|
44
|
+
tagOptions,
|
|
45
|
+
ingest,
|
|
46
|
+
selectedRelationTags,
|
|
47
|
+
clearSelectedRelationTags: jest.fn(),
|
|
48
|
+
createRelation: jest.fn(),
|
|
49
|
+
};
|
|
50
|
+
const rendered = render(<IngestToStructureForm {...props} />);
|
|
51
|
+
await waitForLoad(rendered);
|
|
52
|
+
expect(rendered.getByText(/relations.relationType/i)).toBeInTheDocument();
|
|
34
53
|
});
|
|
35
54
|
});
|
package/src/ingests/relations/components/__tests__/__snapshots__/IngestRelationsRoutes.spec.js.snap
CHANGED
|
@@ -1,26 +1,52 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<IngestRelationsRoutes />
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
3
|
+
exports[`<IngestRelationsRoutes /> renders correctly with default route 1`] = `<div />`;
|
|
4
|
+
|
|
5
|
+
exports[`<IngestRelationsRoutes /> renders correctly with ingests route 1`] = `
|
|
6
|
+
<div>
|
|
7
|
+
<div>
|
|
8
|
+
RelationsLoader
|
|
9
|
+
</div>
|
|
10
|
+
<div>
|
|
11
|
+
IngestToIngestRelations
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
exports[`<IngestRelationsRoutes /> renders correctly with ingests/new route 1`] = `
|
|
17
|
+
<div>
|
|
18
|
+
<div>
|
|
19
|
+
IngestsLoader
|
|
20
|
+
</div>
|
|
21
|
+
<div>
|
|
22
|
+
IngestFiltersLoader
|
|
23
|
+
</div>
|
|
24
|
+
<div>
|
|
25
|
+
IngestToIngestForm
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
exports[`<IngestRelationsRoutes /> renders correctly with structures route 1`] = `
|
|
31
|
+
<div>
|
|
32
|
+
<div>
|
|
33
|
+
RelationsLoader
|
|
34
|
+
</div>
|
|
35
|
+
<div>
|
|
36
|
+
StructureTypesLoader
|
|
37
|
+
</div>
|
|
38
|
+
<div>
|
|
39
|
+
IngestToDataStructureRelations
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
exports[`<IngestRelationsRoutes /> renders correctly with structures/new route 1`] = `
|
|
45
|
+
<div>
|
|
46
|
+
<div>
|
|
47
|
+
IngestToStructureForm
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
26
50
|
`;
|
|
51
|
+
|
|
52
|
+
exports[`<IngestRelationsRoutes /> renders nothing when ingest is not loaded 1`] = `<div />`;
|
package/src/ingests/relations/components/__tests__/__snapshots__/IngestToIngestForm.spec.js.snap
CHANGED
|
@@ -1,33 +1,91 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<IngestToIngestForm /> matches the latest snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
hidden
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui hidden divider"
|
|
7
7
|
/>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
<label>
|
|
9
|
+
ingestRelations.relatedDataIngest
|
|
10
|
+
</label>
|
|
11
|
+
<div
|
|
12
|
+
class="ui segment"
|
|
13
|
+
>
|
|
14
|
+
<div
|
|
15
|
+
class="ui action left icon input"
|
|
16
|
+
>
|
|
17
|
+
<input
|
|
18
|
+
placeholder="ingests.search.placeholder"
|
|
19
|
+
type="text"
|
|
20
|
+
/>
|
|
21
|
+
<i
|
|
22
|
+
aria-hidden="true"
|
|
23
|
+
class="search link icon"
|
|
24
|
+
/>
|
|
25
|
+
<div
|
|
26
|
+
aria-expanded="false"
|
|
27
|
+
class="ui button floating labeled scrolling dropdown icon"
|
|
28
|
+
role="listbox"
|
|
29
|
+
tabindex="0"
|
|
30
|
+
>
|
|
31
|
+
<div
|
|
32
|
+
aria-atomic="true"
|
|
33
|
+
aria-live="polite"
|
|
34
|
+
class="divider text"
|
|
35
|
+
role="alert"
|
|
36
|
+
>
|
|
37
|
+
Filters
|
|
38
|
+
</div>
|
|
39
|
+
<i
|
|
40
|
+
aria-hidden="true"
|
|
41
|
+
class="filter icon"
|
|
28
42
|
/>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
43
|
+
<div
|
|
44
|
+
class="menu transition"
|
|
45
|
+
>
|
|
46
|
+
<div
|
|
47
|
+
class="item"
|
|
48
|
+
role="option"
|
|
49
|
+
>
|
|
50
|
+
<em>
|
|
51
|
+
(reset filters)
|
|
52
|
+
</em>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<div
|
|
58
|
+
class="ui message"
|
|
59
|
+
>
|
|
60
|
+
<div
|
|
61
|
+
class="content"
|
|
62
|
+
>
|
|
63
|
+
<div
|
|
64
|
+
class="header"
|
|
65
|
+
>
|
|
66
|
+
ingests.search.results.empty
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div
|
|
72
|
+
class="ui buttons"
|
|
73
|
+
>
|
|
74
|
+
<button
|
|
75
|
+
class="ui primary disabled button"
|
|
76
|
+
disabled=""
|
|
77
|
+
tabindex="-1"
|
|
78
|
+
>
|
|
79
|
+
actions.create
|
|
80
|
+
</button>
|
|
81
|
+
<a
|
|
82
|
+
class="ui secondary button"
|
|
83
|
+
data-discover="true"
|
|
84
|
+
href="/"
|
|
85
|
+
role="button"
|
|
86
|
+
>
|
|
87
|
+
actions.cancel
|
|
88
|
+
</a>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
33
91
|
`;
|
package/src/ingests/relations/components/__tests__/__snapshots__/IngestToStructureForm.spec.js.snap
CHANGED
|
@@ -1,40 +1,35 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<IngestToStructureForm /> matches the latest snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
hidden
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui hidden divider"
|
|
7
7
|
/>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/>
|
|
36
|
-
}
|
|
37
|
-
/>
|
|
38
|
-
</ButtonGroup>
|
|
39
|
-
</Fragment>
|
|
8
|
+
<div
|
|
9
|
+
data-testid="structure-selector"
|
|
10
|
+
>
|
|
11
|
+
<button>
|
|
12
|
+
Select Structure
|
|
13
|
+
</button>
|
|
14
|
+
</div>
|
|
15
|
+
<div
|
|
16
|
+
class="ui buttons"
|
|
17
|
+
>
|
|
18
|
+
<button
|
|
19
|
+
class="ui primary disabled button"
|
|
20
|
+
disabled=""
|
|
21
|
+
tabindex="-1"
|
|
22
|
+
>
|
|
23
|
+
actions.create
|
|
24
|
+
</button>
|
|
25
|
+
<a
|
|
26
|
+
class="ui secondary button"
|
|
27
|
+
data-discover="true"
|
|
28
|
+
href="/"
|
|
29
|
+
role="button"
|
|
30
|
+
>
|
|
31
|
+
actions.cancel
|
|
32
|
+
</a>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
40
35
|
`;
|
|
@@ -13,7 +13,7 @@ const foo = {
|
|
|
13
13
|
system: {
|
|
14
14
|
external_id: "oracle",
|
|
15
15
|
id: 11,
|
|
16
|
-
name: "oracle"
|
|
16
|
+
name: "oracle",
|
|
17
17
|
},
|
|
18
18
|
tags: [],
|
|
19
19
|
updated_at: "2020-05-20 13:24:33Z",
|
|
@@ -21,14 +21,14 @@ const foo = {
|
|
|
21
21
|
create_link: {
|
|
22
22
|
href: "/api/ingest_versions/11/links",
|
|
23
23
|
input: {},
|
|
24
|
-
method: "POST"
|
|
24
|
+
method: "POST",
|
|
25
25
|
},
|
|
26
26
|
delete: {
|
|
27
27
|
href: "/api/ingest_versions/20/links/11",
|
|
28
28
|
input: {},
|
|
29
|
-
method: "DELETE"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
29
|
+
method: "DELETE",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const bar = {
|
|
@@ -43,7 +43,7 @@ const bar = {
|
|
|
43
43
|
system: {
|
|
44
44
|
external_id: "oracle",
|
|
45
45
|
id: 11,
|
|
46
|
-
name: "oracle"
|
|
46
|
+
name: "oracle",
|
|
47
47
|
},
|
|
48
48
|
tags: [],
|
|
49
49
|
type: "Column",
|
|
@@ -52,14 +52,14 @@ const bar = {
|
|
|
52
52
|
create_link: {
|
|
53
53
|
href: "/api/ingest_versions/12/links",
|
|
54
54
|
input: {},
|
|
55
|
-
method: "POST"
|
|
55
|
+
method: "POST",
|
|
56
56
|
},
|
|
57
57
|
delete: {
|
|
58
58
|
href: "/api/ingest_versions/20/links/12",
|
|
59
59
|
input: {},
|
|
60
|
-
method: "DELETE"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
60
|
+
method: "DELETE",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
63
|
};
|
|
64
64
|
const baz = {
|
|
65
65
|
ingest_version_id: 20,
|
|
@@ -73,7 +73,7 @@ const baz = {
|
|
|
73
73
|
system: {
|
|
74
74
|
external_id: "oracle",
|
|
75
75
|
id: 11,
|
|
76
|
-
name: "oracle"
|
|
76
|
+
name: "oracle",
|
|
77
77
|
},
|
|
78
78
|
tags: ["ingest_to_field_master"],
|
|
79
79
|
type: "Column",
|
|
@@ -82,28 +82,28 @@ const baz = {
|
|
|
82
82
|
create_link: {
|
|
83
83
|
href: "/api/ingest_versions/14/links",
|
|
84
84
|
input: {},
|
|
85
|
-
method: "POST"
|
|
85
|
+
method: "POST",
|
|
86
86
|
},
|
|
87
87
|
delete: {
|
|
88
88
|
href: "/api/ingest_versions/20/links/14",
|
|
89
89
|
input: {},
|
|
90
|
-
method: "DELETE"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
90
|
+
method: "DELETE",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
93
|
};
|
|
94
94
|
const ingestLinks = [foo, bar, baz];
|
|
95
95
|
const structuresColumns = [
|
|
96
96
|
{
|
|
97
97
|
name: "name",
|
|
98
98
|
sort: {
|
|
99
|
-
name: "name.sort"
|
|
99
|
+
name: "name.sort",
|
|
100
100
|
},
|
|
101
|
-
width: 2
|
|
101
|
+
width: 2,
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
name: "type",
|
|
105
|
-
width: 1
|
|
106
|
-
}
|
|
105
|
+
width: 1,
|
|
106
|
+
},
|
|
107
107
|
];
|
|
108
108
|
|
|
109
109
|
describe("selectors: getIngestLinks", () => {
|
|
@@ -114,7 +114,7 @@ describe("selectors: getIngestLinks", () => {
|
|
|
114
114
|
expect(links).toEqual([
|
|
115
115
|
["ingest_to_field_master", [baz]],
|
|
116
116
|
["\uffee", [bar]],
|
|
117
|
-
["deleted", [foo]]
|
|
117
|
+
["deleted", [foo]],
|
|
118
118
|
]);
|
|
119
119
|
});
|
|
120
120
|
it("should return the keys of the ingest filters which are not currently active", () => {
|
|
@@ -8,13 +8,13 @@ describe("selectors: getRelations", () => {
|
|
|
8
8
|
id: 1,
|
|
9
9
|
ingest_id: 1,
|
|
10
10
|
name: "Ingest",
|
|
11
|
-
version: 1
|
|
11
|
+
version: 1,
|
|
12
12
|
},
|
|
13
13
|
target: {
|
|
14
14
|
id: 40,
|
|
15
15
|
name: "Structure",
|
|
16
|
-
type: "Document"
|
|
17
|
-
}
|
|
16
|
+
type: "Document",
|
|
17
|
+
},
|
|
18
18
|
},
|
|
19
19
|
source_id: 1,
|
|
20
20
|
source_type: "ingest",
|
|
@@ -26,10 +26,10 @@ describe("selectors: getRelations", () => {
|
|
|
26
26
|
value: {
|
|
27
27
|
label: "ingest.relatedTo.dataStructure",
|
|
28
28
|
target_type: "data_structure",
|
|
29
|
-
type: "ingest_to_data_structure"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
]
|
|
29
|
+
type: "ingest_to_data_structure",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const r2 = {
|
|
@@ -39,13 +39,13 @@ describe("selectors: getRelations", () => {
|
|
|
39
39
|
id: 1,
|
|
40
40
|
ingest_id: 1,
|
|
41
41
|
name: "Ingest",
|
|
42
|
-
version: 1
|
|
42
|
+
version: 1,
|
|
43
43
|
},
|
|
44
44
|
target: {
|
|
45
45
|
id: 41,
|
|
46
46
|
name: "Structure",
|
|
47
|
-
type: "Document"
|
|
48
|
-
}
|
|
47
|
+
type: "Document",
|
|
48
|
+
},
|
|
49
49
|
},
|
|
50
50
|
source_id: 1,
|
|
51
51
|
source_type: "ingest",
|
|
@@ -57,10 +57,10 @@ describe("selectors: getRelations", () => {
|
|
|
57
57
|
value: {
|
|
58
58
|
label: "ingest.relatedTo.ingest",
|
|
59
59
|
target_type: "ingest",
|
|
60
|
-
type: "ingest_to_ingest"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
]
|
|
60
|
+
type: "ingest_to_ingest",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
const relations_structures = [r1];
|
|
@@ -71,11 +71,11 @@ describe("selectors: getRelations", () => {
|
|
|
71
71
|
it("should return all the relations with data_structure target", () => {
|
|
72
72
|
const res = getDataStructureRelations({
|
|
73
73
|
relations: relations_structures,
|
|
74
|
-
ingest
|
|
74
|
+
ingest,
|
|
75
75
|
});
|
|
76
76
|
expect(res).toHaveLength(1);
|
|
77
77
|
expect(res).toEqual([
|
|
78
|
-
{ ...r1, relationPath: `/structures/${r1["target_id"]}` }
|
|
78
|
+
{ ...r1, relationPath: `/structures/${r1["target_id"]}` },
|
|
79
79
|
]);
|
|
80
80
|
});
|
|
81
81
|
|
|
@@ -83,7 +83,7 @@ describe("selectors: getRelations", () => {
|
|
|
83
83
|
const res = getIngestRelations({ relations: relations_ingests, ingest });
|
|
84
84
|
expect(res).toHaveLength(1);
|
|
85
85
|
expect(res).toEqual([
|
|
86
|
-
{ ...r2, relationPath: `/ingests/${r2["target_id"]}` }
|
|
86
|
+
{ ...r2, relationPath: `/ingests/${r2["target_id"]}` },
|
|
87
87
|
]);
|
|
88
88
|
});
|
|
89
89
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
|
-
import { Link } from "react-router
|
|
3
|
+
import { Link } from "react-router";
|
|
5
4
|
import { Icon, Label } from "semantic-ui-react";
|
|
6
5
|
import { createSelector } from "reselect";
|
|
7
6
|
import { accentInsensitivePathOrder } from "@truedat/core/services/sort";
|
|
@@ -13,16 +13,16 @@ export const getDataStructureRelations = createSelector(
|
|
|
13
13
|
return _.flow(
|
|
14
14
|
_.sortBy([
|
|
15
15
|
_.negate(_.propEq("source_id", ingest_id)),
|
|
16
|
-
_.pathOr("", "tags[0].value.type")
|
|
16
|
+
_.pathOr("", "tags[0].value.type"),
|
|
17
17
|
]),
|
|
18
|
-
_.map(relation => {
|
|
18
|
+
_.map((relation) => {
|
|
19
19
|
const linkedId =
|
|
20
20
|
relation.target_id == ingest_id
|
|
21
21
|
? relation.source_id
|
|
22
22
|
: relation.target_id;
|
|
23
23
|
return {
|
|
24
24
|
...relation,
|
|
25
|
-
relationPath: linkTo.STRUCTURE({ id: linkedId })
|
|
25
|
+
relationPath: linkTo.STRUCTURE({ id: linkedId }),
|
|
26
26
|
};
|
|
27
27
|
})
|
|
28
28
|
)(relations);
|
|
@@ -36,14 +36,14 @@ export const getIngestRelations = createSelector(
|
|
|
36
36
|
return _.flow(
|
|
37
37
|
_.sortBy([
|
|
38
38
|
_.negate(_.propEq("source_id", ingest_id)),
|
|
39
|
-
_.pathOr("", "tags[0].value.type")
|
|
39
|
+
_.pathOr("", "tags[0].value.type"),
|
|
40
40
|
]),
|
|
41
|
-
_.map(relation => {
|
|
41
|
+
_.map((relation) => {
|
|
42
42
|
const { target, source } = relation.context;
|
|
43
43
|
const linkedId = target.ingest_id == ingest_id ? source.id : target.id;
|
|
44
44
|
return {
|
|
45
45
|
...relation,
|
|
46
|
-
relationPath: linkTo.INGEST({ id: linkedId })
|
|
46
|
+
relationPath: linkTo.INGEST({ id: linkedId }),
|
|
47
47
|
};
|
|
48
48
|
})
|
|
49
49
|
)(relations);
|
|
@@ -7,7 +7,7 @@ import { API_INGEST_VERSION } from "../api";
|
|
|
7
7
|
export function* fetchIngestSaga({ payload }) {
|
|
8
8
|
try {
|
|
9
9
|
const { id } = payload;
|
|
10
|
-
const url = compile(API_INGEST_VERSION)({ id });
|
|
10
|
+
const url = compile(API_INGEST_VERSION)({ id: `${id}` });
|
|
11
11
|
yield put(fetchIngest.request());
|
|
12
12
|
const { data } = yield call(apiJson, url, JSON_OPTS);
|
|
13
13
|
yield put(fetchIngest.success(data));
|
|
@@ -7,7 +7,7 @@ import { API_INGEST_ARCHIVE } from "../api";
|
|
|
7
7
|
export function* fetchIngestArchiveSaga({ payload }) {
|
|
8
8
|
try {
|
|
9
9
|
const { id } = payload;
|
|
10
|
-
const url = compile(API_INGEST_ARCHIVE)({ id });
|
|
10
|
+
const url = compile(API_INGEST_ARCHIVE)({ id: `${id}` });
|
|
11
11
|
yield put(fetchIngestArchive.request());
|
|
12
12
|
const { data } = yield call(apiJson, url, JSON_OPTS);
|
|
13
13
|
yield put(fetchIngestArchive.success(data));
|
|
@@ -7,7 +7,7 @@ import { API_INGEST_EXECUTIONS } from "../api";
|
|
|
7
7
|
export function* fetchIngestExecutionsSaga({ payload }) {
|
|
8
8
|
try {
|
|
9
9
|
const { id } = payload;
|
|
10
|
-
const url = compile(API_INGEST_EXECUTIONS)({ id });
|
|
10
|
+
const url = compile(API_INGEST_EXECUTIONS)({ id: `${id}` });
|
|
11
11
|
yield put(fetchIngestExecutions.request());
|
|
12
12
|
const { data } = yield call(apiJson, url, JSON_OPTS);
|
|
13
13
|
yield put(fetchIngestExecutions.success({ data }));
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import { FormattedMessage } from "react-intl";
|
|
4
3
|
import { createSelector } from "reselect";
|
|
5
4
|
import Moment from "react-moment";
|
|
6
5
|
|
|
7
|
-
const dateDecorator = date =>
|
|
6
|
+
const dateDecorator = (date) =>
|
|
8
7
|
date && <Moment locale="es" date={date} format="YYYY-MM-DD HH:mm" />;
|
|
9
8
|
|
|
10
9
|
export const defaultIngestColumns = [
|
|
@@ -12,39 +11,39 @@ export const defaultIngestColumns = [
|
|
|
12
11
|
{
|
|
13
12
|
name: "status",
|
|
14
13
|
sort: { name: "status" },
|
|
15
|
-
fieldDecorator: field => translateDecorator(`ingests.status.${field}`),
|
|
16
|
-
width: 2
|
|
14
|
+
fieldDecorator: (field) => translateDecorator(`ingests.status.${field}`),
|
|
15
|
+
width: 2,
|
|
17
16
|
},
|
|
18
17
|
{
|
|
19
18
|
name: "domain",
|
|
20
19
|
fieldSelector: _.path("domain.name"),
|
|
21
|
-
sort: { name: "domain.name.sort" }
|
|
20
|
+
sort: { name: "domain.name.sort" },
|
|
22
21
|
},
|
|
23
22
|
{
|
|
24
23
|
name: "last_change_at",
|
|
25
24
|
sort: { name: "last_change_at" },
|
|
26
25
|
fieldDecorator: dateDecorator,
|
|
27
26
|
textAlign: "center",
|
|
28
|
-
width: 2
|
|
27
|
+
width: 2,
|
|
29
28
|
},
|
|
30
29
|
{
|
|
31
30
|
name: "execution_status",
|
|
32
|
-
sort: { name: "execution_status.sort" }
|
|
31
|
+
sort: { name: "execution_status.sort" },
|
|
33
32
|
},
|
|
34
33
|
{
|
|
35
34
|
name: "last_execution",
|
|
36
35
|
sort: { name: "last_execution" },
|
|
37
36
|
fieldDecorator: dateDecorator,
|
|
38
37
|
textAlign: "center",
|
|
39
|
-
width: 2
|
|
40
|
-
}
|
|
38
|
+
width: 2,
|
|
39
|
+
},
|
|
41
40
|
];
|
|
42
41
|
|
|
43
|
-
const translateDecorator = text => <FormattedMessage id={text} />;
|
|
44
|
-
const getIngests = state => state.ingests;
|
|
45
|
-
const getColumns = state => state.ingestsColumns;
|
|
42
|
+
const translateDecorator = (text) => <FormattedMessage id={text} />;
|
|
43
|
+
const getIngests = (state) => state.ingests;
|
|
44
|
+
const getColumns = (state) => state.ingestsColumns;
|
|
46
45
|
|
|
47
|
-
export const getIngestColumns = createSelector(getColumns, ingestsColumns =>
|
|
46
|
+
export const getIngestColumns = createSelector(getColumns, (ingestsColumns) =>
|
|
48
47
|
_.defaultTo(defaultIngestColumns)(ingestsColumns)
|
|
49
48
|
);
|
|
50
49
|
|