@truedat/df 8.6.7 → 8.7.0
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/df",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.7.0",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
"@testing-library/jest-dom": "^6.6.3",
|
|
52
52
|
"@testing-library/react": "^16.3.0",
|
|
53
53
|
"@testing-library/user-event": "^14.6.1",
|
|
54
|
-
"@truedat/test": "8.
|
|
54
|
+
"@truedat/test": "8.7.0",
|
|
55
55
|
"identity-obj-proxy": "^3.0.0",
|
|
56
56
|
"jest": "^29.7.0",
|
|
57
57
|
"redux-saga-test-plan": "^4.0.6"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@apollo/client": "^3.13.8",
|
|
61
|
-
"@truedat/core": "8.
|
|
61
|
+
"@truedat/core": "8.7.0",
|
|
62
62
|
"axios": "^1.15.0",
|
|
63
63
|
"graphql": "^16.11.0",
|
|
64
64
|
"is-hotkey": "^0.2.0",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"semantic-ui-react": "^3.0.0-beta.2",
|
|
88
88
|
"swr": "^2.3.3"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "375298315086154cea326bfaebc504d6e45873ed"
|
|
91
91
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { Grid, Header } from "semantic-ui-react";
|
|
5
5
|
import { TemplateSelector } from "@truedat/core/components";
|
|
@@ -29,13 +29,15 @@ export default function SelectDynamicFormWithTranslations({
|
|
|
29
29
|
showTemplateSectionTitle,
|
|
30
30
|
}) {
|
|
31
31
|
const [thisTemplate, setThisTemplate] = useState();
|
|
32
|
-
const template = _.isEmpty(selectedTemplate)
|
|
32
|
+
const template = _.isEmpty(selectedTemplate)
|
|
33
|
+
? thisTemplate
|
|
34
|
+
: selectedTemplate;
|
|
33
35
|
const { enabledLangs } = useLanguage();
|
|
34
36
|
const { formatMessage } = useIntl();
|
|
35
37
|
const domainIdsArray = _.isArray(domainIds) ? domainIds : [];
|
|
36
|
-
const domain =
|
|
38
|
+
const domain =
|
|
39
|
+
_.size(domainIdsArray) > 0 ? { id: _.head(domainIdsArray) } : null;
|
|
37
40
|
const hasDomainSelection = domain !== null;
|
|
38
|
-
const domainKey = domainIdsArray.join(",");
|
|
39
41
|
const templateTitle =
|
|
40
42
|
template &&
|
|
41
43
|
formatMessage({
|
|
@@ -50,17 +52,11 @@ export default function SelectDynamicFormWithTranslations({
|
|
|
50
52
|
});
|
|
51
53
|
};
|
|
52
54
|
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
if (actionKey === "create") {
|
|
55
|
-
setThisTemplate(undefined);
|
|
56
|
-
onChangeTemplate(undefined);
|
|
57
|
-
}
|
|
58
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
|
-
}, [domainKey]);
|
|
60
|
-
|
|
61
55
|
const applyTemplateToLangs = (tpl) => {
|
|
62
56
|
enabledLangs.forEach((lang) => {
|
|
63
|
-
const content = tpl
|
|
57
|
+
const content = tpl
|
|
58
|
+
? applyTemplate(tpl)(i18nContent[lang] || {}, domain?.id)
|
|
59
|
+
: {};
|
|
64
60
|
handleChange(content, tpl, lang);
|
|
65
61
|
});
|
|
66
62
|
};
|
|
@@ -89,10 +85,13 @@ export default function SelectDynamicFormWithTranslations({
|
|
|
89
85
|
|
|
90
86
|
return (
|
|
91
87
|
<>
|
|
92
|
-
{(beforeSelector ||
|
|
88
|
+
{(beforeSelector ||
|
|
89
|
+
(hasDomainSelection && (!actionKey || actionKey === "create"))) && (
|
|
93
90
|
<Grid stackable>
|
|
94
91
|
<Grid.Row columns={beforeSelector ? 2 : 1} verticalAlign="bottom">
|
|
95
|
-
{beforeSelector ?
|
|
92
|
+
{beforeSelector ? (
|
|
93
|
+
<Grid.Column>{beforeSelector}</Grid.Column>
|
|
94
|
+
) : null}
|
|
96
95
|
{hasDomainSelection && (!actionKey || actionKey === "create") ? (
|
|
97
96
|
<Grid.Column>
|
|
98
97
|
<TemplateSelector
|