@truedat/dq 4.41.3 → 4.42.1
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 +13 -0
- package/package.json +5 -5
- package/src/components/ConditionSummary.js +41 -27
- package/src/components/ImplementationSummary.js +5 -5
- package/src/components/NewRuleImplementation.js +76 -17
- package/src/components/RuleImplementationProperties.js +2 -1
- package/src/components/__test_samples__/NewRuleImplementationProps.js +44 -42
- package/src/components/__tests__/ImplementationSummary.spec.js +4 -4
- package/src/components/__tests__/__snapshots__/ImplementationSummary.spec.js.snap +68 -3
- package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +108 -100
- package/src/components/__tests__/__snapshots__/RuleImplementationProperties.spec.js.snap +1 -1
- package/src/components/ruleImplementationForm/PopulationForm.js +1 -27
- package/src/components/ruleImplementationForm/RuleImplementationForm.js +69 -20
- package/src/components/ruleImplementationForm/RuleImplementationRawForm.js +163 -177
- package/src/components/ruleImplementationForm/__tests__/RuleImplementationRawForm.spec.js +3 -3
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationForm.spec.js.snap +1 -1
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationRawForm.spec.js.snap +159 -156
- package/src/messages/en.js +4 -2
- package/src/messages/es.js +3 -1
- package/src/reducers/ruleImplementation.js +1 -1
- package/src/sagas/__tests__/createRuleImplementation.spec.js +12 -10
- package/src/sagas/__tests__/updateRuleImplementation.spec.js +8 -6
|
@@ -1,168 +1,171 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<RuleImplementationRawForm /> matches the latest snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
<Help
|
|
23
|
-
message="datasetForm.implementation_key.tooltip"
|
|
24
|
-
/>
|
|
25
|
-
</label>
|
|
26
|
-
<FormInput
|
|
27
|
-
as={[Function]}
|
|
28
|
-
autoComplete="off"
|
|
29
|
-
control={[Function]}
|
|
30
|
-
name="implementation_key"
|
|
31
|
-
onChange={[Function]}
|
|
32
|
-
placeholder="ruleImplementation.props.name.placeholder"
|
|
33
|
-
required={true}
|
|
34
|
-
value=""
|
|
4
|
+
<Form
|
|
5
|
+
as="form"
|
|
6
|
+
className="rule"
|
|
7
|
+
>
|
|
8
|
+
<FormRadio
|
|
9
|
+
as={[Function]}
|
|
10
|
+
checked={true}
|
|
11
|
+
control={[Function]}
|
|
12
|
+
label="ruleImplementation.props.executable"
|
|
13
|
+
name="executable"
|
|
14
|
+
onChange={[Function]}
|
|
15
|
+
toggle={true}
|
|
16
|
+
/>
|
|
17
|
+
<FormField>
|
|
18
|
+
<label>
|
|
19
|
+
ruleImplementation.props.name
|
|
20
|
+
<Help
|
|
21
|
+
message="datasetForm.implementation_key.tooltip"
|
|
35
22
|
/>
|
|
36
|
-
</
|
|
37
|
-
<
|
|
38
|
-
onChange={[MockFunction]}
|
|
39
|
-
ruleImplementation={
|
|
40
|
-
Object {
|
|
41
|
-
"executable": true,
|
|
42
|
-
"goal": "10",
|
|
43
|
-
"id": 1,
|
|
44
|
-
"minimum": "1",
|
|
45
|
-
"result_type": "percentage",
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/>
|
|
49
|
-
<FormDropdown
|
|
50
|
-
as={[Function]}
|
|
51
|
-
control={[Function]}
|
|
52
|
-
label={
|
|
53
|
-
<label>
|
|
54
|
-
<Memo(MemoizedFormattedMessage)
|
|
55
|
-
id="ruleImplementationRawForm.props.source"
|
|
56
|
-
/>
|
|
57
|
-
</label>
|
|
58
|
-
}
|
|
59
|
-
name="source_id"
|
|
60
|
-
onChange={[Function]}
|
|
61
|
-
options={
|
|
62
|
-
Array [
|
|
63
|
-
Object {
|
|
64
|
-
"key": 1,
|
|
65
|
-
"text": "ext_id_1",
|
|
66
|
-
"value": 1,
|
|
67
|
-
},
|
|
68
|
-
Object {
|
|
69
|
-
"key": 2,
|
|
70
|
-
"text": "ext_id_2",
|
|
71
|
-
"value": 2,
|
|
72
|
-
},
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
placeholder="ruleImplementationRawForm.props.source.placeholder"
|
|
76
|
-
required={true}
|
|
77
|
-
selection={true}
|
|
78
|
-
value={1}
|
|
79
|
-
/>
|
|
80
|
-
<FormTextArea
|
|
23
|
+
</label>
|
|
24
|
+
<FormInput
|
|
81
25
|
as={[Function]}
|
|
82
|
-
|
|
26
|
+
autoComplete="off"
|
|
83
27
|
control={[Function]}
|
|
84
|
-
|
|
85
|
-
label={
|
|
86
|
-
<label>
|
|
87
|
-
<Memo(MemoizedFormattedMessage)
|
|
88
|
-
id="ruleImplementationRawForm.props.dataset"
|
|
89
|
-
/>
|
|
90
|
-
<Help
|
|
91
|
-
message="ruleImplementationRawForm.props.dataset.help"
|
|
92
|
-
/>
|
|
93
|
-
</label>
|
|
94
|
-
}
|
|
95
|
-
name="dataset"
|
|
28
|
+
name="implementation_key"
|
|
96
29
|
onChange={[Function]}
|
|
97
|
-
placeholder="
|
|
30
|
+
placeholder="ruleImplementation.props.name.placeholder"
|
|
98
31
|
required={true}
|
|
99
|
-
rows={4}
|
|
100
|
-
size="small"
|
|
101
|
-
value=""
|
|
102
|
-
/>
|
|
103
|
-
<FormTextArea
|
|
104
|
-
as={[Function]}
|
|
105
|
-
className="raw"
|
|
106
|
-
control={[Function]}
|
|
107
|
-
error={false}
|
|
108
|
-
label={
|
|
109
|
-
<label>
|
|
110
|
-
<Memo(MemoizedFormattedMessage)
|
|
111
|
-
id="ruleImplementationRawForm.props.population"
|
|
112
|
-
/>
|
|
113
|
-
<Help
|
|
114
|
-
message="ruleImplementationRawForm.props.population.help"
|
|
115
|
-
/>
|
|
116
|
-
</label>
|
|
117
|
-
}
|
|
118
|
-
name="population"
|
|
119
|
-
onChange={[Function]}
|
|
120
|
-
placeholder="ruleImplementationRawForm.props.population.placeholder"
|
|
121
|
-
rows={4}
|
|
122
|
-
size="small"
|
|
123
32
|
value=""
|
|
124
33
|
/>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
<Help
|
|
136
|
-
message="ruleImplementationRawForm.props.validations.help"
|
|
137
|
-
/>
|
|
138
|
-
</label>
|
|
34
|
+
</FormField>
|
|
35
|
+
<LimitsForm
|
|
36
|
+
onChange={[MockFunction]}
|
|
37
|
+
ruleImplementation={
|
|
38
|
+
Object {
|
|
39
|
+
"executable": true,
|
|
40
|
+
"goal": "10",
|
|
41
|
+
"id": 1,
|
|
42
|
+
"minimum": "1",
|
|
43
|
+
"result_type": "percentage",
|
|
139
44
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
45
|
+
}
|
|
46
|
+
/>
|
|
47
|
+
<FormDropdown
|
|
48
|
+
as={[Function]}
|
|
49
|
+
control={[Function]}
|
|
50
|
+
label={
|
|
51
|
+
<label>
|
|
52
|
+
<Memo(MemoizedFormattedMessage)
|
|
53
|
+
id="ruleImplementationRawForm.props.source"
|
|
54
|
+
/>
|
|
55
|
+
</label>
|
|
56
|
+
}
|
|
57
|
+
name="source_id"
|
|
58
|
+
onChange={[Function]}
|
|
59
|
+
options={
|
|
60
|
+
Array [
|
|
61
|
+
Object {
|
|
62
|
+
"key": "1",
|
|
63
|
+
"text": undefined,
|
|
64
|
+
"value": "1",
|
|
65
|
+
},
|
|
66
|
+
Object {
|
|
67
|
+
"key": "2",
|
|
68
|
+
"text": undefined,
|
|
69
|
+
"value": "2",
|
|
70
|
+
},
|
|
71
|
+
Object {
|
|
72
|
+
"key": "3",
|
|
73
|
+
"text": undefined,
|
|
74
|
+
"value": "3",
|
|
75
|
+
},
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
placeholder="ruleImplementationRawForm.props.source.placeholder"
|
|
79
|
+
required={true}
|
|
80
|
+
search={true}
|
|
81
|
+
selection={true}
|
|
82
|
+
value="1"
|
|
83
|
+
/>
|
|
84
|
+
<FormTextArea
|
|
85
|
+
as={[Function]}
|
|
86
|
+
className="raw"
|
|
87
|
+
control={[Function]}
|
|
88
|
+
error={false}
|
|
89
|
+
label={
|
|
90
|
+
<label>
|
|
91
|
+
<Memo(MemoizedFormattedMessage)
|
|
92
|
+
id="ruleImplementationRawForm.props.dataset"
|
|
93
|
+
/>
|
|
94
|
+
<Help
|
|
95
|
+
message="ruleImplementationRawForm.props.dataset.help"
|
|
96
|
+
/>
|
|
97
|
+
</label>
|
|
98
|
+
}
|
|
99
|
+
name="dataset"
|
|
100
|
+
onChange={[Function]}
|
|
101
|
+
placeholder="ruleImplementationRawForm.props.dataset.placeholder"
|
|
102
|
+
required={true}
|
|
103
|
+
rows={4}
|
|
104
|
+
size="small"
|
|
105
|
+
value=""
|
|
106
|
+
/>
|
|
107
|
+
<FormTextArea
|
|
108
|
+
as={[Function]}
|
|
109
|
+
className="raw"
|
|
110
|
+
control={[Function]}
|
|
111
|
+
error={false}
|
|
112
|
+
label={
|
|
113
|
+
<label>
|
|
114
|
+
<Memo(MemoizedFormattedMessage)
|
|
115
|
+
id="ruleImplementationRawForm.props.population"
|
|
116
|
+
/>
|
|
117
|
+
<Help
|
|
118
|
+
message="ruleImplementationRawForm.props.population.help"
|
|
119
|
+
/>
|
|
120
|
+
</label>
|
|
121
|
+
}
|
|
122
|
+
name="population"
|
|
123
|
+
onChange={[Function]}
|
|
124
|
+
placeholder="ruleImplementationRawForm.props.population.placeholder"
|
|
125
|
+
rows={4}
|
|
126
|
+
size="small"
|
|
127
|
+
value=""
|
|
128
|
+
/>
|
|
129
|
+
<FormTextArea
|
|
130
|
+
as={[Function]}
|
|
131
|
+
className="raw"
|
|
132
|
+
control={[Function]}
|
|
133
|
+
error={false}
|
|
134
|
+
label={
|
|
135
|
+
<label>
|
|
136
|
+
<Memo(MemoizedFormattedMessage)
|
|
137
|
+
id="ruleImplementationRawForm.props.validations"
|
|
138
|
+
/>
|
|
139
|
+
<Help
|
|
140
|
+
message="ruleImplementationRawForm.props.validations.help"
|
|
141
|
+
/>
|
|
142
|
+
</label>
|
|
143
|
+
}
|
|
144
|
+
name="validations"
|
|
145
|
+
onChange={[Function]}
|
|
146
|
+
placeholder="ruleImplementationRawForm.props.validations.placeholder"
|
|
147
|
+
required={true}
|
|
148
|
+
rows={4}
|
|
149
|
+
size="small"
|
|
150
|
+
value=""
|
|
151
|
+
/>
|
|
152
|
+
<FormButton
|
|
153
|
+
as={[Function]}
|
|
154
|
+
content="actions.submit"
|
|
155
|
+
control={[Function]}
|
|
156
|
+
disabled={true}
|
|
157
|
+
floated="right"
|
|
158
|
+
loading={false}
|
|
159
|
+
onClick={[Function]}
|
|
160
|
+
primary={true}
|
|
161
|
+
type="submit"
|
|
162
|
+
/>
|
|
163
|
+
<Button
|
|
164
|
+
as="button"
|
|
165
|
+
content="actions.cancel"
|
|
166
|
+
floated="right"
|
|
167
|
+
onClick={[Function]}
|
|
168
|
+
secondary={true}
|
|
169
|
+
/>
|
|
170
|
+
</Form>
|
|
168
171
|
`;
|
package/src/messages/en.js
CHANGED
|
@@ -138,7 +138,7 @@ export default {
|
|
|
138
138
|
"All rule implementations should be removed",
|
|
139
139
|
"rule.error.rule_name_bc_id.unique_constraint":
|
|
140
140
|
"Duplicated rule name. Edit name or associated business concept.",
|
|
141
|
-
|
|
141
|
+
|
|
142
142
|
"rule.form.accordion.select": "Select",
|
|
143
143
|
"rule.form.concept.label": "Concept",
|
|
144
144
|
"ruleImplementation.form.tooltip.deviation.goal":
|
|
@@ -441,9 +441,10 @@ export default {
|
|
|
441
441
|
"ruleImplementation.system.placeholder": "Select a system",
|
|
442
442
|
"ruleImplementation.table": "Table",
|
|
443
443
|
"ruleImplementation.table.placeholder": "Select a table",
|
|
444
|
+
"ruleImplementationForm.populations.add": "Add population",
|
|
444
445
|
"ruleImplementationForm.step.information": "Information",
|
|
445
446
|
"ruleImplementationForm.step.dataset": "Data Set",
|
|
446
|
-
"ruleImplementationForm.step.
|
|
447
|
+
"ruleImplementationForm.step.populations": "Populations",
|
|
447
448
|
"ruleImplementationForm.step.validations": "Validations",
|
|
448
449
|
"ruleImplementationRawForm.props.database": "Database",
|
|
449
450
|
"ruleImplementationRawForm.props.database.placeholder": "Select database",
|
|
@@ -515,6 +516,7 @@ export default {
|
|
|
515
516
|
"ruleImplementations.summary.headers.filters": "Filters",
|
|
516
517
|
"ruleImplementations.summary.headers.implementation": "Rule Implementation",
|
|
517
518
|
"ruleImplementations.summary.headers.population": "Population",
|
|
519
|
+
"ruleImplementations.summary.headers.populations": "Populations",
|
|
518
520
|
"ruleImplementations.summary.headers.validations": "Validation",
|
|
519
521
|
"ruleImplementations.upload.success.errors":
|
|
520
522
|
"Error in {implementation_key} attribute: {key} message: {message} ",
|
package/src/messages/es.js
CHANGED
|
@@ -455,9 +455,10 @@ export default {
|
|
|
455
455
|
"ruleImplementation.system": "Sistema",
|
|
456
456
|
"ruleImplementation.table.placeholder": "Seleccionar tabla",
|
|
457
457
|
"ruleImplementation.table": "Tabla",
|
|
458
|
+
"ruleImplementationForm.populations.add": "Añadir población",
|
|
458
459
|
"ruleImplementationForm.step.dataset": "Datos",
|
|
459
460
|
"ruleImplementationForm.step.information": "Información",
|
|
460
|
-
"ruleImplementationForm.step.
|
|
461
|
+
"ruleImplementationForm.step.populations": "Poblaciones",
|
|
461
462
|
"ruleImplementationForm.step.validations": "Validaciones",
|
|
462
463
|
"ruleImplementationRawForm.props.database.placeholder":
|
|
463
464
|
"Seleccionar base de datos",
|
|
@@ -537,6 +538,7 @@ export default {
|
|
|
537
538
|
"ruleImplementations.summary.headers.implementation":
|
|
538
539
|
"Implementación de una Regla",
|
|
539
540
|
"ruleImplementations.summary.headers.population": "Población",
|
|
541
|
+
"ruleImplementations.summary.headers.populations": "Poblaciones",
|
|
540
542
|
"ruleImplementations.summary.headers.validations": "Validaciones",
|
|
541
543
|
"ruleImplementations.upload.success.errors":
|
|
542
544
|
"Error en {name} atributo: {key} mensaje: {message} ",
|
|
@@ -2,7 +2,7 @@ import { testSaga } from "redux-saga-test-plan";
|
|
|
2
2
|
import { apiJsonPost, JSON_OPTS } from "@truedat/core/services/api";
|
|
3
3
|
import {
|
|
4
4
|
createRuleImplementationRequestSaga,
|
|
5
|
-
createRuleImplementationSaga
|
|
5
|
+
createRuleImplementationSaga,
|
|
6
6
|
} from "../createRuleImplementation";
|
|
7
7
|
import { API_RULE_IMPLEMENTATIONS } from "../../api";
|
|
8
8
|
import { createRuleImplementation, clearStructure } from "../../routines";
|
|
@@ -35,21 +35,23 @@ describe("sagas: createRuleImplementationSaga", () => {
|
|
|
35
35
|
const rule_implementation = {
|
|
36
36
|
implementation_key: "Awesome Impl Key",
|
|
37
37
|
dataset: [{ structure: { id: 1 } }],
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
populations: [
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
operator: { name: "eq", value_type: "number" },
|
|
42
|
+
structure: { id: 2 },
|
|
43
|
+
value: [{ raw: 3 }],
|
|
44
|
+
},
|
|
45
|
+
],
|
|
44
46
|
],
|
|
45
47
|
validations: [
|
|
46
48
|
{
|
|
47
49
|
operator: { name: "between", value_type: "field" },
|
|
48
50
|
structure: { id: 3 },
|
|
49
|
-
value: [{ id: 4 }, { id: 5 }]
|
|
50
|
-
}
|
|
51
|
+
value: [{ id: 4 }, { id: 5 }],
|
|
52
|
+
},
|
|
51
53
|
],
|
|
52
|
-
rule_id: 1
|
|
54
|
+
rule_id: 1,
|
|
53
55
|
};
|
|
54
56
|
const data = { rule_implementation };
|
|
55
57
|
const url = API_RULE_IMPLEMENTATIONS;
|
|
@@ -39,12 +39,14 @@ describe("sagas: updateRuleImplementationSaga", () => {
|
|
|
39
39
|
id: 1,
|
|
40
40
|
implementation_key: "impl_key",
|
|
41
41
|
dataset: [{ structure: { id: 1 } }],
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
populations: [
|
|
43
|
+
[
|
|
44
|
+
{
|
|
45
|
+
operator: { name: "eq", value_type: "number" },
|
|
46
|
+
structure: { id: 2 },
|
|
47
|
+
value: [{ raw: 3 }],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
48
50
|
],
|
|
49
51
|
validations: [
|
|
50
52
|
{
|