@truedat/cx 6.8.1 → 6.8.3
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/cx",
|
|
3
|
-
"version": "6.8.
|
|
3
|
+
"version": "6.8.3",
|
|
4
4
|
"description": "Truedat Web Connectors",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@testing-library/jest-dom": "^5.16.5",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "6.
|
|
37
|
+
"@truedat/test": "6.8.3",
|
|
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",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@apollo/client": "^3.7.1",
|
|
94
|
-
"@truedat/core": "6.8.
|
|
94
|
+
"@truedat/core": "6.8.3",
|
|
95
95
|
"lodash": "^4.17.21",
|
|
96
96
|
"match-sorter": "^6.3.1",
|
|
97
97
|
"moment": "^2.29.4",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"react-dom": ">= 16.8.6 < 17",
|
|
113
113
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "d3bea8cda996ea5ec5d2a0a75dfeb9a0594269d5"
|
|
116
116
|
}
|
|
@@ -33,7 +33,7 @@ export const Configuration = ({ configuration, template }) =>
|
|
|
33
33
|
<Grid.Column width={8}>
|
|
34
34
|
<DynamicFormViewer
|
|
35
35
|
template={template}
|
|
36
|
-
content={_.prop("
|
|
36
|
+
content={_.prop("dynamic_content")(configuration)}
|
|
37
37
|
/>
|
|
38
38
|
</Grid.Column>
|
|
39
39
|
</Grid>
|
|
@@ -43,12 +43,12 @@ export const Configuration = ({ configuration, template }) =>
|
|
|
43
43
|
|
|
44
44
|
Configuration.propTypes = {
|
|
45
45
|
configuration: PropTypes.object.isRequired,
|
|
46
|
-
template: PropTypes.object
|
|
46
|
+
template: PropTypes.object,
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
const mapStateToProps = ({ configuration, templates }) => ({
|
|
50
50
|
configuration,
|
|
51
|
-
template: _.find(_.propEq("name", configuration.type))(templates)
|
|
51
|
+
template: _.find(_.propEq("name", configuration.type))(templates),
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
export default connect(mapStateToProps)(Configuration);
|
|
@@ -38,7 +38,7 @@ const ConfigurationForm = ({
|
|
|
38
38
|
const [formState, setFormState] = useState(configuration || {});
|
|
39
39
|
const { formatMessage } = useIntl();
|
|
40
40
|
const applyTemplate = applyTemplateGenerator(template);
|
|
41
|
-
const { external_id, type, content } = formState;
|
|
41
|
+
const { external_id, type, dynamic_content: content } = formState;
|
|
42
42
|
|
|
43
43
|
useEffect(() => {
|
|
44
44
|
if (!_.isEmpty(template)) {
|
|
@@ -46,7 +46,7 @@ const ConfigurationForm = ({
|
|
|
46
46
|
setFormState({
|
|
47
47
|
...formState,
|
|
48
48
|
type: _.prop("name")(template),
|
|
49
|
-
|
|
49
|
+
dynamic_content: newContent,
|
|
50
50
|
contentErrors: validateContent(template)(content),
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -78,7 +78,7 @@ const ConfigurationForm = ({
|
|
|
78
78
|
};
|
|
79
79
|
const handleContentChange = (content) => {
|
|
80
80
|
const contentErrors = validateContent(template)(content);
|
|
81
|
-
setFormState({ ...formState, content, contentErrors });
|
|
81
|
+
setFormState({ ...formState, dynamic_content: content, contentErrors });
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
const handleTemplateSelected = (e, data) => {
|
|
@@ -91,7 +91,10 @@ const ConfigurationForm = ({
|
|
|
91
91
|
const doHandleSubmit = (e) => {
|
|
92
92
|
e.preventDefault();
|
|
93
93
|
const newConfiguration = _.pick(["external_id", "type"])(formState);
|
|
94
|
-
const appliedContent = _.flow(
|
|
94
|
+
const appliedContent = _.flow(
|
|
95
|
+
_.prop("dynamic_content"),
|
|
96
|
+
applyTemplate
|
|
97
|
+
)(formState);
|
|
95
98
|
|
|
96
99
|
onSubmit({
|
|
97
100
|
configuration: {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import { fetchConfiguration, clearConfiguration } from "../routines";
|
|
3
3
|
|
|
4
|
-
const pickFields = _.pick([
|
|
4
|
+
const pickFields = _.pick([
|
|
5
|
+
"external_id",
|
|
6
|
+
"type",
|
|
7
|
+
"content",
|
|
8
|
+
"dynamic_content",
|
|
9
|
+
]);
|
|
5
10
|
|
|
6
11
|
const initialState = {};
|
|
7
12
|
|