@truedat/ie 4.48.0 → 4.48.4

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.48.2] 2022-07-08
4
+
5
+ ### Changed
6
+
7
+ - [TD-4995] Support localization of template fields and fixed values
8
+
3
9
  ## [4.46.10] 2022-06-20
4
10
 
5
11
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/ie",
3
- "version": "4.48.0",
3
+ "version": "4.48.4",
4
4
  "description": "Truedat Web Ingests",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -87,8 +87,8 @@
87
87
  ]
88
88
  },
89
89
  "dependencies": {
90
- "@truedat/core": "4.48.0",
91
- "@truedat/df": "4.48.0",
90
+ "@truedat/core": "4.48.4",
91
+ "@truedat/df": "4.48.4",
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": "c4587d045fa6c9028082bdfbcfb35e4383f117ed"
110
+ "gitHead": "5e50a034469bf3ad8e02a64eb875ad2b710b6b03"
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
- {template.label} {domain && `in ${domain.name}`}
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
- <Bold>
12
+ <div className="ingest-summary__content-bold">
18
13
  <FormattedMessage id={`ingest.props.${field}`} />:
19
- </Bold>
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
- {<FormattedMessage id={`ingest.props.in_progress`} />}
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 = state => ({
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
- Template1
16
-
17
- in Domain name
15
+ <MemoizedFormattedMessage
16
+ defaultMessage="Template1"
17
+ id="templates.Template1"
18
+ />
19
+ in Domain name
18
20
  </HeaderSubheader>
19
21
  </HeaderContent>
20
22
  </Header>
@@ -1,4 +1,3 @@
1
- export { getFieldValues } from "./getFieldValues";
2
1
  export { getParsedEvents } from "./getParsedEvents";
3
2
  export { getTemplateFields } from "./getTemplateFields";
4
3
  export { getTemplateGroups } from "./getTemplateGroups";
@@ -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
- );