@truedat/ie 4.47.8 → 4.48.2
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 +6 -0
- package/package.json +5 -5
- package/src/ingests/components/IngestCompleteness.js +7 -2
- package/src/ingests/components/IngestHeader.js +6 -1
- package/src/ingests/components/IngestSummary.js +7 -15
- package/src/ingests/components/__tests__/__snapshots__/IngestHeader.spec.js.snap +5 -3
- package/src/ingests/selectors/index.js +0 -1
- package/src/ingests/selectors/getFieldValues.js +0 -32
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/ie",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.48.2",
|
|
4
4
|
"description": "Truedat Web Ingests",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@testing-library/jest-dom": "^5.16.4",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "4.47.
|
|
37
|
+
"@truedat/test": "4.47.9",
|
|
38
38
|
"babel-jest": "^28.1.0",
|
|
39
39
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
40
40
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@truedat/core": "4.
|
|
91
|
-
"@truedat/df": "4.
|
|
90
|
+
"@truedat/core": "4.48.2",
|
|
91
|
+
"@truedat/df": "4.48.2",
|
|
92
92
|
"file-saver": "^2.0.5",
|
|
93
93
|
"moment": "^2.24.0",
|
|
94
94
|
"path-to-regexp": "^1.7.0",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"react-dom": ">= 16.8.6 < 17",
|
|
108
108
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "93133e957332713e64c97eecdf45cc283c29bd32"
|
|
111
111
|
}
|
|
@@ -37,7 +37,12 @@ export const IngestCompleteness = ({ ingest }) => {
|
|
|
37
37
|
{_.map.convert({ cap: false })(({ label }, i) => (
|
|
38
38
|
<List.Item key={i}>
|
|
39
39
|
<Icon name="right angle" color="grey" fitted />
|
|
40
|
-
{label
|
|
40
|
+
{label ? (
|
|
41
|
+
<FormattedMessage
|
|
42
|
+
id={`fields.${label}`}
|
|
43
|
+
defaultMessage={label}
|
|
44
|
+
/>
|
|
45
|
+
) : null}
|
|
41
46
|
</List.Item>
|
|
42
47
|
))(missingRequiredFields)}
|
|
43
48
|
</List>
|
|
@@ -47,7 +52,7 @@ export const IngestCompleteness = ({ ingest }) => {
|
|
|
47
52
|
};
|
|
48
53
|
|
|
49
54
|
IngestCompleteness.propTypes = {
|
|
50
|
-
ingest: PropTypes.object
|
|
55
|
+
ingest: PropTypes.object,
|
|
51
56
|
};
|
|
52
57
|
|
|
53
58
|
const mapStateToProps = _.pick(["ingest"]);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
3
4
|
import { connect } from "react-redux";
|
|
4
5
|
import { Header, Icon } from "semantic-ui-react";
|
|
5
6
|
|
|
@@ -9,7 +10,11 @@ export const IngestHeader = ({ ingest, domain, template }) => (
|
|
|
9
10
|
<Header.Content>
|
|
10
11
|
{ingest.name}
|
|
11
12
|
<Header.Subheader>
|
|
12
|
-
|
|
13
|
+
<FormattedMessage
|
|
14
|
+
id={`templates.${template.label}`}
|
|
15
|
+
defaultMessage={template.label}
|
|
16
|
+
/>
|
|
17
|
+
{domain ? ` in ${domain.name}` : null}
|
|
13
18
|
</Header.Subheader>
|
|
14
19
|
</Header.Content>
|
|
15
20
|
</Header>
|
|
@@ -4,25 +4,20 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import { connect } from "react-redux";
|
|
5
5
|
import { Header, Label, List, Icon, Segment } from "semantic-ui-react";
|
|
6
6
|
import { FormattedMessage } from "react-intl";
|
|
7
|
-
import { getFieldValues } from "../selectors";
|
|
8
7
|
import { mapStatusColor } from "../constants/mappings";
|
|
9
8
|
|
|
10
|
-
const Bold = ({ children }) => (
|
|
11
|
-
<div className="ingest-summary__content-bold">{children}</div>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
9
|
const FieldValue = ({ field, value, color, in_progress }) => (
|
|
15
10
|
<List.Item className="ingest-summary">
|
|
16
11
|
<List.Content className="ingest-summary__content">
|
|
17
|
-
<
|
|
12
|
+
<div className="ingest-summary__content-bold">
|
|
18
13
|
<FormattedMessage id={`ingest.props.${field}`} />:
|
|
19
|
-
</
|
|
14
|
+
</div>
|
|
20
15
|
<Label color={color}>
|
|
21
16
|
{value || <Icon name="ellipsis vertical" color="grey" />}
|
|
22
17
|
</Label>
|
|
23
18
|
{in_progress && (
|
|
24
19
|
<Label color="red">
|
|
25
|
-
|
|
20
|
+
<FormattedMessage id="ingest.props.in_progress" />
|
|
26
21
|
</Label>
|
|
27
22
|
)}
|
|
28
23
|
</List.Content>
|
|
@@ -33,11 +28,11 @@ FieldValue.propTypes = {
|
|
|
33
28
|
field: PropTypes.any,
|
|
34
29
|
value: PropTypes.any,
|
|
35
30
|
color: PropTypes.any,
|
|
36
|
-
in_progress: PropTypes.bool
|
|
31
|
+
in_progress: PropTypes.bool,
|
|
37
32
|
};
|
|
38
33
|
|
|
39
34
|
export const IngestSummary = ({
|
|
40
|
-
ingest: { status, version, last_change_at, last_change_user, in_progress }
|
|
35
|
+
ingest: { status, version, last_change_at, last_change_user, in_progress },
|
|
41
36
|
}) => (
|
|
42
37
|
<Segment>
|
|
43
38
|
<Header as="h3" dividing>
|
|
@@ -63,12 +58,9 @@ export const IngestSummary = ({
|
|
|
63
58
|
);
|
|
64
59
|
|
|
65
60
|
IngestSummary.propTypes = {
|
|
66
|
-
ingest: PropTypes.object
|
|
61
|
+
ingest: PropTypes.object,
|
|
67
62
|
};
|
|
68
63
|
|
|
69
|
-
const mapStateToProps =
|
|
70
|
-
ingest: state.ingest,
|
|
71
|
-
fieldValues: getFieldValues(state)
|
|
72
|
-
});
|
|
64
|
+
const mapStateToProps = ({ ingest }) => ({ ingest });
|
|
73
65
|
|
|
74
66
|
export default connect(mapStateToProps)(IngestSummary);
|
|
@@ -12,9 +12,11 @@ exports[`<IngestHeader /> matches the latest snapshot 1`] = `
|
|
|
12
12
|
<HeaderContent>
|
|
13
13
|
Ingest1
|
|
14
14
|
<HeaderSubheader>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
<MemoizedFormattedMessage
|
|
16
|
+
defaultMessage="Template1"
|
|
17
|
+
id="templates.Template1"
|
|
18
|
+
/>
|
|
19
|
+
in Domain name
|
|
18
20
|
</HeaderSubheader>
|
|
19
21
|
</HeaderContent>
|
|
20
22
|
</Header>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
|
-
import { createSelector } from "reselect";
|
|
3
|
-
import { getTemplateGroups } from "./getTemplateGroups";
|
|
4
|
-
import { getIngest } from "./getIngest";
|
|
5
|
-
|
|
6
|
-
const checkDependency = (field, content) => {
|
|
7
|
-
const on = _.prop(_.path("depends.on")(field))(content);
|
|
8
|
-
const to_be = _.path("depends.to_be")(field);
|
|
9
|
-
return _.isArray(on)
|
|
10
|
-
? _.some(d => to_be.includes(d))(on)
|
|
11
|
-
: to_be.includes(on);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const getFieldValues = createSelector(
|
|
15
|
-
[getTemplateGroups, getIngest],
|
|
16
|
-
(groups, ingest) =>
|
|
17
|
-
groups && ingest && ingest.content
|
|
18
|
-
? groups.map(([name, fields]) => [
|
|
19
|
-
name,
|
|
20
|
-
fields.map(f => ({
|
|
21
|
-
field: f.label,
|
|
22
|
-
type: f.type,
|
|
23
|
-
widget: f.widget,
|
|
24
|
-
value: ingest.content[f.name],
|
|
25
|
-
hidden:
|
|
26
|
-
_.has("depends.to_be")(f) &&
|
|
27
|
-
_.has("depends.on")(f) &&
|
|
28
|
-
!checkDependency(f, _.prop("content")(ingest))
|
|
29
|
-
}))
|
|
30
|
-
])
|
|
31
|
-
: []
|
|
32
|
-
);
|