@truedat/ie 7.5.9 → 7.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import Moment from "react-moment";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { connect } from "react-redux";
|
|
@@ -38,7 +37,6 @@ export const IngestSummary = ({
|
|
|
38
37
|
<Header as="h3" dividing>
|
|
39
38
|
<FormattedMessage id="ingests.summary" defaultMessage="Resumen" />
|
|
40
39
|
</Header>
|
|
41
|
-
|
|
42
40
|
<FieldValue
|
|
43
41
|
field="status"
|
|
44
42
|
value={<FormattedMessage id={`ingests.status.${status}`} />}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { Menu } from "semantic-ui-react";
|
|
5
|
-
import { Link
|
|
4
|
+
import { Link } from "react-router";
|
|
5
|
+
import { useLocation } from "react-router";
|
|
6
6
|
import { connect } from "react-redux";
|
|
7
7
|
import { FormattedMessage } from "react-intl";
|
|
8
8
|
import {
|
|
@@ -12,16 +12,16 @@ import {
|
|
|
12
12
|
INGEST_EVENTS,
|
|
13
13
|
INGEST_EXECUTIONS,
|
|
14
14
|
INGEST_RELATIONS_STRUCTURES,
|
|
15
|
-
INGEST_RELATIONS_INGESTS
|
|
15
|
+
INGEST_RELATIONS_INGESTS,
|
|
16
16
|
} from "@truedat/core/routes";
|
|
17
17
|
import { makeTagOptionsSelector } from "@truedat/core/selectors";
|
|
18
18
|
|
|
19
19
|
const IngestTabs = ({ ingest, tagOptions }) => {
|
|
20
|
-
const
|
|
20
|
+
const { pathname } = useLocation();
|
|
21
21
|
return _.isEmpty(ingest) ? null : (
|
|
22
22
|
<Menu attached="top" pointing secondary tabular>
|
|
23
23
|
<Menu.Item
|
|
24
|
-
active={
|
|
24
|
+
active={pathname === INGEST}
|
|
25
25
|
as={Link}
|
|
26
26
|
to={linkTo.INGEST(ingest)}
|
|
27
27
|
replace
|
|
@@ -29,7 +29,7 @@ const IngestTabs = ({ ingest, tagOptions }) => {
|
|
|
29
29
|
<FormattedMessage id="tabs.ie.ingest" />
|
|
30
30
|
</Menu.Item>
|
|
31
31
|
<Menu.Item
|
|
32
|
-
active={
|
|
32
|
+
active={pathname === INGEST_EXECUTIONS}
|
|
33
33
|
as={Link}
|
|
34
34
|
to={linkTo.INGEST_EXECUTIONS(ingest)}
|
|
35
35
|
replace
|
|
@@ -37,7 +37,7 @@ const IngestTabs = ({ ingest, tagOptions }) => {
|
|
|
37
37
|
<FormattedMessage id="tabs.ie.ingestExecutions" />
|
|
38
38
|
</Menu.Item>
|
|
39
39
|
<Menu.Item
|
|
40
|
-
active={
|
|
40
|
+
active={pathname === INGEST_RELATIONS_STRUCTURES}
|
|
41
41
|
as={Link}
|
|
42
42
|
to={linkTo.INGEST_RELATIONS_STRUCTURES(ingest)}
|
|
43
43
|
replace
|
|
@@ -46,7 +46,7 @@ const IngestTabs = ({ ingest, tagOptions }) => {
|
|
|
46
46
|
</Menu.Item>
|
|
47
47
|
{_.isEmpty(tagOptions) ? null : (
|
|
48
48
|
<Menu.Item
|
|
49
|
-
active={
|
|
49
|
+
active={pathname === INGEST_RELATIONS_INGESTS}
|
|
50
50
|
as={Link}
|
|
51
51
|
to={linkTo.INGEST_RELATIONS_INGESTS(ingest)}
|
|
52
52
|
replace
|
|
@@ -55,7 +55,7 @@ const IngestTabs = ({ ingest, tagOptions }) => {
|
|
|
55
55
|
</Menu.Item>
|
|
56
56
|
)}
|
|
57
57
|
<Menu.Item
|
|
58
|
-
active={
|
|
58
|
+
active={pathname === INGEST_ARCHIVE}
|
|
59
59
|
as={Link}
|
|
60
60
|
to={linkTo.INGEST_ARCHIVE(ingest)}
|
|
61
61
|
replace
|
|
@@ -63,7 +63,7 @@ const IngestTabs = ({ ingest, tagOptions }) => {
|
|
|
63
63
|
<FormattedMessage id="tabs.ie.history" />
|
|
64
64
|
</Menu.Item>
|
|
65
65
|
<Menu.Item
|
|
66
|
-
active={
|
|
66
|
+
active={pathname === INGEST_EVENTS}
|
|
67
67
|
as={Link}
|
|
68
68
|
to={linkTo.INGEST_EVENTS(ingest)}
|
|
69
69
|
replace
|
|
@@ -76,14 +76,14 @@ const IngestTabs = ({ ingest, tagOptions }) => {
|
|
|
76
76
|
|
|
77
77
|
IngestTabs.propTypes = {
|
|
78
78
|
ingest: PropTypes.object,
|
|
79
|
-
tagOptions: PropTypes.array
|
|
79
|
+
tagOptions: PropTypes.array,
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
const makeMapStateToProps = () => {
|
|
83
83
|
const getTagOptions = makeTagOptionsSelector("ingest");
|
|
84
|
-
const mapStateToProps = state => ({
|
|
84
|
+
const mapStateToProps = (state) => ({
|
|
85
85
|
tagOptions: getTagOptions(state),
|
|
86
|
-
ingest: state.ingest
|
|
86
|
+
ingest: state.ingest,
|
|
87
87
|
});
|
|
88
88
|
return mapStateToProps;
|
|
89
89
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { connect } from "react-redux";
|
|
5
4
|
import { Button, Popup } from "semantic-ui-react";
|
|
6
|
-
import { Link } from "react-router
|
|
5
|
+
import { Link } from "react-router";
|
|
7
6
|
import { FormattedMessage } from "react-intl";
|
|
8
7
|
import { INGESTS_NEW } from "@truedat/core/routes";
|
|
9
8
|
import { downloadIngests } from "../routines";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import PropTypes from "prop-types";
|
|
3
2
|
import { connect } from "react-redux";
|
|
4
3
|
import { FormattedMessage } from "react-intl";
|
|
@@ -14,7 +13,7 @@ export const IngestsLabelResults = ({ ingestCount }) => (
|
|
|
14
13
|
);
|
|
15
14
|
|
|
16
15
|
IngestsLabelResults.propTypes = {
|
|
17
|
-
ingestCount: PropTypes.number
|
|
16
|
+
ingestCount: PropTypes.number,
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
const mapStateToProps = ({ ingestCount }) => ({ ingestCount });
|
|
@@ -1,103 +1,104 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import {
|
|
5
|
-
import { connect } from "react-redux";
|
|
4
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
6
5
|
import { Table, Header, Icon } from "semantic-ui-react";
|
|
7
6
|
import { FormattedMessage } from "react-intl";
|
|
8
|
-
import {
|
|
7
|
+
import { useLocation } from "react-router";
|
|
9
8
|
import { getSortInfo, sortColumn } from "@truedat/core/services/sort";
|
|
10
9
|
import { INGESTS, INGESTS_PENDING } from "@truedat/core/routes";
|
|
11
10
|
import { sortIngests } from "../routines";
|
|
12
11
|
import { getIngestsRows, getIngestColumns } from "../selectors";
|
|
13
12
|
import IngestRow from "./IngestRow";
|
|
14
13
|
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
export function IngestsTable() {
|
|
15
|
+
const dispatch = useDispatch();
|
|
16
|
+
const location = useLocation();
|
|
17
|
+
const columns = useSelector(getIngestColumns);
|
|
18
|
+
const ingests = useSelector(getIngestsRows);
|
|
19
|
+
const ingestsLoading = useSelector((state) => state.ingestsLoading);
|
|
20
|
+
const ingestsSorting = useSelector((state) =>
|
|
21
|
+
_.path("ingestQuery.sort")(state)
|
|
22
|
+
);
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
const initialSortInfo = getSortInfo(ingestsSorting);
|
|
25
|
+
const [sortedColumn, setSortedColumn] = useState(
|
|
26
|
+
_.prop("column")(initialSortInfo)
|
|
27
|
+
);
|
|
28
|
+
const [direction, setDirection] = useState(
|
|
29
|
+
_.prop("direction")(initialSortInfo)
|
|
30
|
+
);
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
const {
|
|
27
|
-
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const { column, direction } = getSortInfo(ingestsSorting);
|
|
34
|
+
setSortedColumn(column);
|
|
35
|
+
setDirection(direction);
|
|
36
|
+
}, [ingestsSorting]);
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
const pathname = _.prop("pathname")(location);
|
|
39
|
+
const ingestColumns = columns.filter(
|
|
40
|
+
(column) =>
|
|
41
|
+
(pathname == INGESTS && column.name != "status") ||
|
|
42
|
+
pathname == INGESTS_PENDING
|
|
43
|
+
);
|
|
34
44
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
pathname == INGESTS_PENDING
|
|
45
|
+
const handleSortColumn = (column) => {
|
|
46
|
+
sortColumn(
|
|
47
|
+
column,
|
|
48
|
+
(payload) => dispatch(sortIngests(payload)),
|
|
49
|
+
setDirection,
|
|
50
|
+
setSortedColumn,
|
|
51
|
+
direction,
|
|
52
|
+
sortedColumn
|
|
44
53
|
);
|
|
54
|
+
};
|
|
45
55
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<Header as="h4">
|
|
91
|
-
<Icon name="search" />
|
|
92
|
-
<Header.Content>
|
|
93
|
-
<FormattedMessage id="ingests.search.results.empty" />
|
|
94
|
-
</Header.Content>
|
|
95
|
-
</Header>
|
|
96
|
-
)}
|
|
97
|
-
</>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
{!_.isEmpty(ingests) && (
|
|
59
|
+
<Table selectable sortable>
|
|
60
|
+
<Table.Header>
|
|
61
|
+
<Table.Row>
|
|
62
|
+
{ingestColumns &&
|
|
63
|
+
ingestColumns.map((column, key) => (
|
|
64
|
+
<Table.HeaderCell
|
|
65
|
+
key={key}
|
|
66
|
+
width={column.width}
|
|
67
|
+
content={
|
|
68
|
+
<FormattedMessage
|
|
69
|
+
id={`ingests.props.${column.header || column.name}`}
|
|
70
|
+
/>
|
|
71
|
+
}
|
|
72
|
+
sorted={
|
|
73
|
+
_.path("sort.name")(column) === sortedColumn
|
|
74
|
+
? direction
|
|
75
|
+
: null
|
|
76
|
+
}
|
|
77
|
+
className={_.path("sort.name")(column) ? "" : "disabled"}
|
|
78
|
+
onClick={() => handleSortColumn(column)}
|
|
79
|
+
/>
|
|
80
|
+
))}
|
|
81
|
+
</Table.Row>
|
|
82
|
+
</Table.Header>
|
|
83
|
+
<Table.Body>
|
|
84
|
+
{ingests.map((ingest, i) => (
|
|
85
|
+
<IngestRow key={i} ingest={ingest} columns={ingestColumns} />
|
|
86
|
+
))}
|
|
87
|
+
</Table.Body>
|
|
88
|
+
</Table>
|
|
89
|
+
)}
|
|
90
|
+
{_.isEmpty(ingests) && !ingestsLoading && (
|
|
91
|
+
<Header as="h4">
|
|
92
|
+
<Icon name="search" />
|
|
93
|
+
<Header.Content>
|
|
94
|
+
<FormattedMessage id="ingests.search.results.empty" />
|
|
95
|
+
</Header.Content>
|
|
96
|
+
</Header>
|
|
97
|
+
)}
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
100
100
|
}
|
|
101
|
+
|
|
101
102
|
IngestsTable.propTypes = {
|
|
102
103
|
ingestsLoading: PropTypes.bool,
|
|
103
104
|
ingests: PropTypes.array,
|
|
@@ -105,14 +106,4 @@ IngestsTable.propTypes = {
|
|
|
105
106
|
location: PropTypes.object,
|
|
106
107
|
};
|
|
107
108
|
|
|
108
|
-
|
|
109
|
-
columns: getIngestColumns(state),
|
|
110
|
-
ingests: getIngestsRows(state),
|
|
111
|
-
ingestsLoading: state.ingestsLoading,
|
|
112
|
-
ingestsSorting: _.path("ingestQuery.sort")(state),
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
export default compose(
|
|
116
|
-
withRouter,
|
|
117
|
-
connect(mapStateToProps, { sortIngests })
|
|
118
|
-
)(IngestsTable);
|
|
109
|
+
export default IngestsTable;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { FormattedMessage } from "react-intl";
|
|
3
2
|
import { connect } from "react-redux";
|
|
4
|
-
import { Link } from "react-router
|
|
3
|
+
import { Link } from "react-router";
|
|
5
4
|
import { Menu, Divider } from "semantic-ui-react";
|
|
6
5
|
import { usePath } from "@truedat/core/hooks";
|
|
7
6
|
import { INGESTS, INGESTS_PENDING } from "@truedat/core/routes";
|
|
@@ -31,7 +30,7 @@ const IngestTabs = () => {
|
|
|
31
30
|
IngestTabs.propTypes = {};
|
|
32
31
|
|
|
33
32
|
const mapStateToProps = ({ ingestQuery: { filters } }) => ({
|
|
34
|
-
activeFilters: filters
|
|
33
|
+
activeFilters: filters,
|
|
35
34
|
});
|
|
36
35
|
|
|
37
36
|
export default connect(mapStateToProps)(IngestTabs);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { shallow } from "enzyme";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
2
|
import { Events } from "../Events";
|
|
4
3
|
|
|
5
4
|
describe("<Events />", () => {
|
|
6
|
-
it("matches the latest snapshot", () => {
|
|
5
|
+
it("matches the latest snapshot", async () => {
|
|
7
6
|
const events = [
|
|
8
7
|
{
|
|
9
8
|
id: 1,
|
|
@@ -11,8 +10,8 @@ describe("<Events />", () => {
|
|
|
11
10
|
resource_id: 2,
|
|
12
11
|
payload: [
|
|
13
12
|
{ field: "Ou", value: 5 },
|
|
14
|
-
{ field: "id", value: 6 }
|
|
15
|
-
]
|
|
13
|
+
{ field: "id", value: 6 },
|
|
14
|
+
],
|
|
16
15
|
},
|
|
17
16
|
{
|
|
18
17
|
id: 2,
|
|
@@ -20,12 +19,13 @@ describe("<Events />", () => {
|
|
|
20
19
|
resource_id: 2,
|
|
21
20
|
payload: [
|
|
22
21
|
{ field: "Ou", value: 7 },
|
|
23
|
-
{ field: "id", value: 3 }
|
|
24
|
-
]
|
|
25
|
-
}
|
|
22
|
+
{ field: "id", value: 3 },
|
|
23
|
+
],
|
|
24
|
+
},
|
|
26
25
|
];
|
|
27
26
|
const props = { events };
|
|
28
|
-
const
|
|
29
|
-
|
|
27
|
+
const rendered = render(<Events {...props} />);
|
|
28
|
+
await waitForLoad(rendered);
|
|
29
|
+
expect(rendered.container).toMatchSnapshot();
|
|
30
30
|
});
|
|
31
31
|
});
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { shallow } from "enzyme";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
2
|
import { Ingest } from "../Ingest";
|
|
4
3
|
|
|
4
|
+
// Mock the components used in Ingest
|
|
5
|
+
jest.mock("../IngestActions", () => () => (
|
|
6
|
+
<div data-testid="ingest-actions">IngestActions Mock</div>
|
|
7
|
+
));
|
|
8
|
+
jest.mock("../IngestHeader", () => () => (
|
|
9
|
+
<div data-testid="ingest-header">IngestHeader Mock</div>
|
|
10
|
+
));
|
|
11
|
+
jest.mock("../IngestTabs", () => () => (
|
|
12
|
+
<div data-testid="ingest-tabs">IngestTabs Mock</div>
|
|
13
|
+
));
|
|
14
|
+
|
|
5
15
|
describe("<Ingest />", () => {
|
|
6
16
|
const props = { ingest: { id: 1, name: "foo" } };
|
|
7
17
|
|
|
8
|
-
it("matches the latest snapshot", () => {
|
|
9
|
-
const
|
|
10
|
-
|
|
18
|
+
it("matches the latest snapshot", async () => {
|
|
19
|
+
const rendered = render(<Ingest {...props} />);
|
|
20
|
+
await waitForLoad(rendered);
|
|
21
|
+
expect(rendered.container).toMatchSnapshot();
|
|
11
22
|
});
|
|
12
23
|
});
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { shallow } from "enzyme";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
2
|
import { IngestActions } from "../IngestActions";
|
|
4
3
|
|
|
5
4
|
describe("<IngestActions />", () => {
|
|
6
5
|
const ingestAction = jest.fn();
|
|
7
6
|
const ingestActions = {
|
|
8
7
|
action1: { method: "POST", href: "/api/action1" },
|
|
9
|
-
action2: { method: "GET", href: "/api/action2" }
|
|
8
|
+
action2: { method: "GET", href: "/api/action2" },
|
|
10
9
|
};
|
|
11
10
|
|
|
12
11
|
const props = {
|
|
13
12
|
ingestAction,
|
|
14
|
-
ingestActions
|
|
13
|
+
ingestActions,
|
|
15
14
|
};
|
|
16
15
|
|
|
17
|
-
it("matches the latest snapshot", () => {
|
|
18
|
-
const
|
|
19
|
-
|
|
16
|
+
it("matches the latest snapshot", async () => {
|
|
17
|
+
const rendered = render(<IngestActions {...props} />);
|
|
18
|
+
await waitForLoad(rendered);
|
|
19
|
+
expect(rendered.container).toMatchSnapshot();
|
|
20
20
|
});
|
|
21
21
|
});
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { shallow } from "enzyme";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
2
|
import { IngestArchive } from "../IngestArchive";
|
|
4
3
|
|
|
5
4
|
describe("<IngestArchive />", () => {
|
|
6
|
-
it("matches the latest snapshot", () => {
|
|
5
|
+
it("matches the latest snapshot", async () => {
|
|
7
6
|
const ingestArchive = [
|
|
8
7
|
{
|
|
9
8
|
id: 123,
|
|
10
9
|
status: "status",
|
|
11
10
|
last_change_at: "2018-06-27T07:32:53.154377Z",
|
|
12
11
|
last_change_by: "maixu",
|
|
13
|
-
version: 1
|
|
14
|
-
}
|
|
12
|
+
version: 1,
|
|
13
|
+
},
|
|
15
14
|
];
|
|
16
15
|
const props = { ingestArchive };
|
|
17
|
-
const
|
|
18
|
-
|
|
16
|
+
const rendered = render(<IngestArchive {...props} />);
|
|
17
|
+
await waitForLoad(rendered);
|
|
18
|
+
expect(rendered.container).toMatchSnapshot();
|
|
19
19
|
});
|
|
20
20
|
});
|