@truedat/dq 4.54.0 → 4.54.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
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dq",
|
|
3
|
-
"version": "4.54.
|
|
3
|
+
"version": "4.54.2",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
95
|
"@apollo/client": "^3.7.0",
|
|
96
|
-
"@truedat/core": "4.54.
|
|
97
|
-
"@truedat/df": "4.54.
|
|
96
|
+
"@truedat/core": "4.54.2",
|
|
97
|
+
"@truedat/df": "4.54.2",
|
|
98
98
|
"graphql": "^15.5.3",
|
|
99
99
|
"path-to-regexp": "^1.7.0",
|
|
100
100
|
"prop-types": "^15.8.1",
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"react-dom": ">= 16.8.6 < 17",
|
|
115
115
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "5f8e708ced0c68fbe8a38373f3cc579702f3e7e4"
|
|
118
118
|
}
|
|
@@ -168,7 +168,28 @@ const ConditionCell = ({ row, alias }) => {
|
|
|
168
168
|
{`${formatMessage({
|
|
169
169
|
id: `filtersGrid.field.modifier.${row.modifier.name}.${paramName}`,
|
|
170
170
|
defaultMessage: paramName,
|
|
171
|
-
})}
|
|
171
|
+
})}:`}
|
|
172
|
+
{_.isArray(paramValue)
|
|
173
|
+
? paramValue.map((row, i) =>
|
|
174
|
+
_.isObject(row) ? (
|
|
175
|
+
_.path("data_structure_id")(row) ? (
|
|
176
|
+
<Link
|
|
177
|
+
key={i}
|
|
178
|
+
to={linkTo.STRUCTURE({
|
|
179
|
+
id: _.path("data_structure_id")(row),
|
|
180
|
+
})}
|
|
181
|
+
>
|
|
182
|
+
<span className="highlighted">
|
|
183
|
+
{alias_text && `(${alias_text}).`}{" "}
|
|
184
|
+
{`"${_.pathOr("", "name")(row)}"`}
|
|
185
|
+
</span>
|
|
186
|
+
</Link>
|
|
187
|
+
) : (
|
|
188
|
+
<span key={i}>{_.path("name")(row)}</span>
|
|
189
|
+
)
|
|
190
|
+
) : null
|
|
191
|
+
)
|
|
192
|
+
: `${paramValue}`}
|
|
172
193
|
</div>
|
|
173
194
|
))
|
|
174
195
|
)(row)}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import React, { Fragment } from "react";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { Form, Icon, Segment } from "semantic-ui-react";
|
|
6
6
|
|
|
7
|
+
import { getStructureFieldOptionValue } from "@truedat/dd/selectors/getStructureFieldOptionValue";
|
|
8
|
+
const StructureFieldsDropdown = React.lazy(() =>
|
|
9
|
+
import("@truedat/dd/components/StructureFieldsDropdown")
|
|
10
|
+
);
|
|
11
|
+
|
|
7
12
|
export default function FieldModifier({
|
|
8
13
|
modifier,
|
|
9
14
|
value,
|
|
10
15
|
onChange,
|
|
11
16
|
removable = false,
|
|
17
|
+
fieldListParams,
|
|
12
18
|
}) {
|
|
13
19
|
const { formatMessage } = useIntl();
|
|
14
20
|
|
|
@@ -24,9 +30,9 @@ export default function FieldModifier({
|
|
|
24
30
|
/>
|
|
25
31
|
) : null}
|
|
26
32
|
</label>
|
|
27
|
-
{isEmpty(modifier?.params) ? null : (
|
|
33
|
+
{_.isEmpty(modifier?.params) ? null : (
|
|
28
34
|
<Segment>
|
|
29
|
-
{getOr(
|
|
35
|
+
{_.getOr(
|
|
30
36
|
[],
|
|
31
37
|
"params"
|
|
32
38
|
)(modifier).map((param) => (
|
|
@@ -36,21 +42,58 @@ export default function FieldModifier({
|
|
|
36
42
|
id: `filtersGrid.field.modifier.${modifier.name}.${param.name}`,
|
|
37
43
|
})}
|
|
38
44
|
</label>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
[
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
{param.type == "field_list" && !_.isNull(fieldListParams) ? (
|
|
46
|
+
<StructureFieldsDropdown
|
|
47
|
+
multiple={true}
|
|
48
|
+
inline={false}
|
|
49
|
+
parentStructures={fieldListParams.parentStructures}
|
|
50
|
+
structureFields={fieldListParams.structureFields}
|
|
51
|
+
typeCastModifiers={modifier.type}
|
|
52
|
+
filters={{ field_type: [fieldListParams.fieldType] }}
|
|
53
|
+
onSelectFields={(values) => {
|
|
54
|
+
const pickedValues = _.map(
|
|
55
|
+
_.pick([
|
|
56
|
+
"data_structure_id",
|
|
57
|
+
"name",
|
|
58
|
+
"parent_index",
|
|
59
|
+
"type",
|
|
60
|
+
])
|
|
61
|
+
)(values);
|
|
62
|
+
// onChange(index, {name: modifier.name, params: _.set(param.name, pickedValues)({})}); // cambiar fields: por params.name
|
|
63
|
+
onChange({
|
|
64
|
+
name: modifier.name,
|
|
65
|
+
params: {
|
|
66
|
+
[param.name]: pickedValues,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
}}
|
|
70
|
+
value={_.flow(
|
|
71
|
+
_.get(`params.${param.name}`),
|
|
72
|
+
_.map((v) =>
|
|
73
|
+
getStructureFieldOptionValue({
|
|
74
|
+
...v,
|
|
75
|
+
id: v.data_structure_id,
|
|
76
|
+
})
|
|
77
|
+
)
|
|
78
|
+
)(value)}
|
|
79
|
+
/>
|
|
80
|
+
) : (
|
|
81
|
+
<input
|
|
82
|
+
placeholder={formatMessage({
|
|
83
|
+
id: `filtersGrid.field.modifier.${modifier.name}.${param.name}`,
|
|
84
|
+
})}
|
|
85
|
+
value={_.getOr("", `params.${param.name}`)(value)}
|
|
86
|
+
onChange={({ target }) => {
|
|
87
|
+
onChange({
|
|
88
|
+
...value,
|
|
89
|
+
params: {
|
|
90
|
+
..._.getOr({}, "params")(value),
|
|
91
|
+
[param.name]: target.value,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
)}
|
|
54
97
|
</Fragment>
|
|
55
98
|
))}
|
|
56
99
|
</Segment>
|
|
@@ -64,4 +107,5 @@ FieldModifier.propTypes = {
|
|
|
64
107
|
value: PropTypes.object,
|
|
65
108
|
onChange: PropTypes.func,
|
|
66
109
|
removable: PropTypes.bool,
|
|
110
|
+
fieldListParams: PropTypes.object,
|
|
67
111
|
};
|
|
@@ -102,14 +102,15 @@ export const FiltersFormGroup = ({
|
|
|
102
102
|
</Dropdown>
|
|
103
103
|
) : null}
|
|
104
104
|
</div>
|
|
105
|
-
{selectedModifier
|
|
105
|
+
{selectedModifier ? (
|
|
106
106
|
<FieldModifier
|
|
107
107
|
modifier={selectedModifier}
|
|
108
108
|
value={modifierValue}
|
|
109
109
|
onChange={(value) => onModifierChange(index, value)}
|
|
110
|
+
fieldListParams={{ parentStructures, structureFields, fieldType }}
|
|
110
111
|
removable
|
|
111
112
|
/>
|
|
112
|
-
)}
|
|
113
|
+
) : null}
|
|
113
114
|
</div>
|
|
114
115
|
<Form.Field>
|
|
115
116
|
<OptionGroup
|