@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.
Files changed (22) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +5 -5
  3. package/src/components/ConditionSummary.js +41 -27
  4. package/src/components/ImplementationSummary.js +5 -5
  5. package/src/components/NewRuleImplementation.js +76 -17
  6. package/src/components/RuleImplementationProperties.js +2 -1
  7. package/src/components/__test_samples__/NewRuleImplementationProps.js +44 -42
  8. package/src/components/__tests__/ImplementationSummary.spec.js +4 -4
  9. package/src/components/__tests__/__snapshots__/ImplementationSummary.spec.js.snap +68 -3
  10. package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +108 -100
  11. package/src/components/__tests__/__snapshots__/RuleImplementationProperties.spec.js.snap +1 -1
  12. package/src/components/ruleImplementationForm/PopulationForm.js +1 -27
  13. package/src/components/ruleImplementationForm/RuleImplementationForm.js +69 -20
  14. package/src/components/ruleImplementationForm/RuleImplementationRawForm.js +163 -177
  15. package/src/components/ruleImplementationForm/__tests__/RuleImplementationRawForm.spec.js +3 -3
  16. package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationForm.spec.js.snap +1 -1
  17. package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationRawForm.spec.js.snap +159 -156
  18. package/src/messages/en.js +4 -2
  19. package/src/messages/es.js +3 -1
  20. package/src/reducers/ruleImplementation.js +1 -1
  21. package/src/sagas/__tests__/createRuleImplementation.spec.js +12 -10
  22. 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
- <Fragment>
5
- <lazy />
6
- <Form
7
- as="form"
8
- className="rule"
9
- >
10
- <FormRadio
11
- as={[Function]}
12
- checked={true}
13
- control={[Function]}
14
- label="ruleImplementation.props.executable"
15
- name="executable"
16
- onChange={[Function]}
17
- toggle={true}
18
- />
19
- <FormField>
20
- <label>
21
- ruleImplementation.props.name
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
- </FormField>
37
- <LimitsForm
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
- className="raw"
26
+ autoComplete="off"
83
27
  control={[Function]}
84
- error={false}
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="ruleImplementationRawForm.props.dataset.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
- <FormTextArea
126
- as={[Function]}
127
- className="raw"
128
- control={[Function]}
129
- error={false}
130
- label={
131
- <label>
132
- <Memo(MemoizedFormattedMessage)
133
- id="ruleImplementationRawForm.props.validations"
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
- name="validations"
141
- onChange={[Function]}
142
- placeholder="ruleImplementationRawForm.props.validations.placeholder"
143
- required={true}
144
- rows={4}
145
- size="small"
146
- value=""
147
- />
148
- <FormButton
149
- as={[Function]}
150
- content="actions.submit"
151
- control={[Function]}
152
- disabled={true}
153
- floated="right"
154
- loading={false}
155
- onClick={[Function]}
156
- primary={true}
157
- type="submit"
158
- />
159
- <Button
160
- as="button"
161
- content="actions.cancel"
162
- floated="right"
163
- onClick={[Function]}
164
- secondary={true}
165
- />
166
- </Form>
167
- </Fragment>
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
  `;
@@ -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.population": "Population",
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} ",
@@ -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.population": "Población",
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} ",
@@ -15,7 +15,7 @@ const pickFields = _.pick([
15
15
  "id",
16
16
  "implementation_key",
17
17
  "implementation_type",
18
- "population",
18
+ "populations",
19
19
  "raw_content",
20
20
  "results",
21
21
  "rule_id",
@@ -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
- population: [
39
- {
40
- operator: { name: "eq", value_type: "number" },
41
- structure: { id: 2 },
42
- value: [{ raw: 3 }]
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
- population: [
43
- {
44
- operator: { name: "eq", value_type: "number" },
45
- structure: { id: 2 },
46
- value: [{ raw: 3 }],
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
  {