@truedat/dq 4.43.5 → 4.44.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 +6 -0
- package/package.json +5 -5
- package/src/components/ImplementationCrumbs.js +91 -0
- package/src/components/ImplementationResultBar.js +1 -2
- package/src/components/ImplementationStructures.js +1 -3
- package/src/components/Implementations.js +9 -2
- package/src/components/ImplementationsRoutes.js +386 -17
- package/src/components/NewRuleImplementation.js +11 -27
- package/src/components/RemediationCrumbs.js +1 -2
- package/src/components/RuleCrumbs.js +6 -63
- package/src/components/RuleImplementation.js +15 -36
- package/src/components/RuleImplementationActions.js +18 -12
- package/src/components/RuleImplementationLink.js +2 -3
- package/src/components/RuleImplementationProperties.js +14 -14
- package/src/components/RuleImplementationResultTabs.js +9 -12
- package/src/components/RuleImplementationResults.js +1 -6
- package/src/components/RuleImplementationResultsLink.js +4 -5
- package/src/components/RuleImplementationTabs.js +13 -18
- package/src/components/RuleImplementationsActions.js +47 -1
- package/src/components/RuleLink.js +3 -4
- package/src/components/RuleResultRow.js +1 -6
- package/src/components/RuleResultsRoutes.js +10 -10
- package/src/components/RuleRoutes.js +8 -285
- package/src/components/__tests__/__snapshots__/ImplementationResultBar.spec.js.snap +5 -5
- package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +3 -0
- package/src/components/__tests__/__snapshots__/RuleCrumbs.spec.js.snap +2 -73
- package/src/components/__tests__/__snapshots__/RuleImplementation.spec.js.snap +7 -86
- package/src/components/__tests__/__snapshots__/RuleImplementationResultTabs.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/RuleImplementationResults.spec.js.snap +0 -7
- package/src/components/__tests__/__snapshots__/RuleImplementationResultsLink.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/RuleImplementationTabs.spec.js.snap +5 -5
- package/src/components/ruleImplementationForm/InformationForm.js +14 -1
- package/src/components/ruleImplementationForm/RuleImplementationForm.js +16 -11
- package/src/components/ruleImplementationForm/RuleImplementationRawForm.js +16 -0
- package/src/components/ruleImplementationForm/__tests__/RuleImplementationForm.spec.js +4 -2
- package/src/components/ruleImplementationForm/__tests__/RuleImplementationRawForm.spec.js +40 -0
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationForm.spec.js.snap +4 -0
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationRawForm.spec.js.snap +5 -0
- package/src/messages/en.js +4 -0
- package/src/messages/es.js +4 -0
- package/src/reducers/__tests__/ruleImplementationRedirect.spec.js +2 -2
- package/src/reducers/__tests__/ruleRedirect.spec.js +3 -3
- package/src/reducers/ruleImplementation.js +3 -0
- package/src/reducers/ruleImplementationRedirect.js +7 -6
- package/src/reducers/ruleRedirect.js +4 -2
- package/src/reducers/userRulePermissions.js +3 -1
- package/src/sagas/__tests__/setRuleImplementationStatus.spec.js +7 -4
- package/src/sagas/setRuleImplementationStatus.js +7 -1
|
@@ -27,58 +27,10 @@ exports[`<RuleCrumbs /> matches a snapshot with resultId 1`] = `
|
|
|
27
27
|
<BreadcrumbDivider
|
|
28
28
|
icon="right angle"
|
|
29
29
|
/>
|
|
30
|
-
<BreadcrumbSection
|
|
31
|
-
active={false}
|
|
32
|
-
as={
|
|
33
|
-
Object {
|
|
34
|
-
"$$typeof": Symbol(react.forward_ref),
|
|
35
|
-
"displayName": "Link",
|
|
36
|
-
"propTypes": Object {
|
|
37
|
-
"innerRef": [Function],
|
|
38
|
-
"onClick": [Function],
|
|
39
|
-
"replace": [Function],
|
|
40
|
-
"target": [Function],
|
|
41
|
-
"to": [Function],
|
|
42
|
-
},
|
|
43
|
-
"render": [Function],
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
to="/rules/1"
|
|
47
|
-
>
|
|
48
|
-
foo
|
|
49
|
-
</BreadcrumbSection>
|
|
50
|
-
<BreadcrumbDivider
|
|
51
|
-
icon="right angle"
|
|
52
|
-
/>
|
|
53
|
-
<BreadcrumbSection
|
|
54
|
-
active={false}
|
|
55
|
-
as={
|
|
56
|
-
Object {
|
|
57
|
-
"$$typeof": Symbol(react.forward_ref),
|
|
58
|
-
"displayName": "Link",
|
|
59
|
-
"propTypes": Object {
|
|
60
|
-
"innerRef": [Function],
|
|
61
|
-
"onClick": [Function],
|
|
62
|
-
"replace": [Function],
|
|
63
|
-
"target": [Function],
|
|
64
|
-
"to": [Function],
|
|
65
|
-
},
|
|
66
|
-
"render": [Function],
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
to="/rules/1/implementations/2"
|
|
70
|
-
>
|
|
71
|
-
ri
|
|
72
|
-
</BreadcrumbSection>
|
|
73
|
-
<BreadcrumbDivider
|
|
74
|
-
icon="right angle"
|
|
75
|
-
/>
|
|
76
30
|
<BreadcrumbSection
|
|
77
31
|
active={true}
|
|
78
32
|
>
|
|
79
|
-
|
|
80
|
-
value="2021-10-14 11:57"
|
|
81
|
-
/>
|
|
33
|
+
foo
|
|
82
34
|
</BreadcrumbSection>
|
|
83
35
|
</Breadcrumb>
|
|
84
36
|
`;
|
|
@@ -110,33 +62,10 @@ exports[`<RuleCrumbs /> matches the latest snapshot 1`] = `
|
|
|
110
62
|
<BreadcrumbDivider
|
|
111
63
|
icon="right angle"
|
|
112
64
|
/>
|
|
113
|
-
<BreadcrumbSection
|
|
114
|
-
active={false}
|
|
115
|
-
as={
|
|
116
|
-
Object {
|
|
117
|
-
"$$typeof": Symbol(react.forward_ref),
|
|
118
|
-
"displayName": "Link",
|
|
119
|
-
"propTypes": Object {
|
|
120
|
-
"innerRef": [Function],
|
|
121
|
-
"onClick": [Function],
|
|
122
|
-
"replace": [Function],
|
|
123
|
-
"target": [Function],
|
|
124
|
-
"to": [Function],
|
|
125
|
-
},
|
|
126
|
-
"render": [Function],
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
to="/rules/1"
|
|
130
|
-
>
|
|
131
|
-
foo
|
|
132
|
-
</BreadcrumbSection>
|
|
133
|
-
<BreadcrumbDivider
|
|
134
|
-
icon="right angle"
|
|
135
|
-
/>
|
|
136
65
|
<BreadcrumbSection
|
|
137
66
|
active={true}
|
|
138
67
|
>
|
|
139
|
-
|
|
68
|
+
foo
|
|
140
69
|
</BreadcrumbSection>
|
|
141
70
|
</Breadcrumb>
|
|
142
71
|
`;
|
|
@@ -25,7 +25,7 @@ exports[`<RuleImplementation /> matches the latest snapshot 1`] = `
|
|
|
25
25
|
<a
|
|
26
26
|
as="div"
|
|
27
27
|
class="rule-summary pointer"
|
|
28
|
-
href="/
|
|
28
|
+
href="/implementations/1/results"
|
|
29
29
|
>
|
|
30
30
|
<span
|
|
31
31
|
class="not-executed-color"
|
|
@@ -44,117 +44,38 @@ exports[`<RuleImplementation /> matches the latest snapshot 1`] = `
|
|
|
44
44
|
</div>
|
|
45
45
|
<div
|
|
46
46
|
class="right aligned eight wide column"
|
|
47
|
-
|
|
48
|
-
<div
|
|
49
|
-
aria-expanded="false"
|
|
50
|
-
class="ui floating dropdown button icon group-actions"
|
|
51
|
-
role="listbox"
|
|
52
|
-
tabindex="0"
|
|
53
|
-
>
|
|
54
|
-
<i
|
|
55
|
-
aria-hidden="true"
|
|
56
|
-
class="ellipsis vertical icon"
|
|
57
|
-
/>
|
|
58
|
-
<div
|
|
59
|
-
class="left menu transition"
|
|
60
|
-
>
|
|
61
|
-
<a
|
|
62
|
-
class="item"
|
|
63
|
-
>
|
|
64
|
-
<i
|
|
65
|
-
aria-hidden="true"
|
|
66
|
-
class="black folder open outline icon"
|
|
67
|
-
/>
|
|
68
|
-
archive
|
|
69
|
-
</a>
|
|
70
|
-
<a
|
|
71
|
-
aria-checked="false"
|
|
72
|
-
aria-selected="false"
|
|
73
|
-
class="item"
|
|
74
|
-
href="/rules/1/implementations/1/edit"
|
|
75
|
-
role="option"
|
|
76
|
-
style="pointer-events: all;"
|
|
77
|
-
>
|
|
78
|
-
<i
|
|
79
|
-
aria-hidden="true"
|
|
80
|
-
class="edit outline icon"
|
|
81
|
-
/>
|
|
82
|
-
<span
|
|
83
|
-
class="text"
|
|
84
|
-
>
|
|
85
|
-
edit
|
|
86
|
-
</span>
|
|
87
|
-
</a>
|
|
88
|
-
<a
|
|
89
|
-
aria-checked="false"
|
|
90
|
-
aria-selected="false"
|
|
91
|
-
class="item"
|
|
92
|
-
href="/rules/1/implementations/1/move"
|
|
93
|
-
role="option"
|
|
94
|
-
style="pointer-events: all;"
|
|
95
|
-
>
|
|
96
|
-
<i
|
|
97
|
-
aria-hidden="true"
|
|
98
|
-
class="share square icon"
|
|
99
|
-
/>
|
|
100
|
-
<span
|
|
101
|
-
class="text"
|
|
102
|
-
>
|
|
103
|
-
move
|
|
104
|
-
</span>
|
|
105
|
-
</a>
|
|
106
|
-
<a
|
|
107
|
-
aria-checked="false"
|
|
108
|
-
aria-selected="false"
|
|
109
|
-
class="item"
|
|
110
|
-
href="/rules/1/implementations/1/clone"
|
|
111
|
-
role="option"
|
|
112
|
-
style="pointer-events: all;"
|
|
113
|
-
>
|
|
114
|
-
<i
|
|
115
|
-
aria-hidden="true"
|
|
116
|
-
class="copy outline icon"
|
|
117
|
-
/>
|
|
118
|
-
<span
|
|
119
|
-
class="text"
|
|
120
|
-
>
|
|
121
|
-
clone
|
|
122
|
-
</span>
|
|
123
|
-
</a>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
47
|
+
/>
|
|
127
48
|
</div>
|
|
128
49
|
<div
|
|
129
50
|
class="ui pointing secondary top attached tabular menu"
|
|
130
51
|
>
|
|
131
52
|
<a
|
|
132
53
|
class="item"
|
|
133
|
-
href="/
|
|
54
|
+
href="/implementations/1"
|
|
134
55
|
>
|
|
135
56
|
implementation
|
|
136
57
|
</a>
|
|
137
58
|
<a
|
|
138
59
|
class="item"
|
|
139
|
-
href="/
|
|
60
|
+
href="/implementations/1/links/concepts"
|
|
140
61
|
>
|
|
141
62
|
Related concepts
|
|
142
63
|
</a>
|
|
143
64
|
<a
|
|
144
65
|
class="item"
|
|
145
|
-
href="/
|
|
66
|
+
href="/implementations/1/structures"
|
|
146
67
|
>
|
|
147
68
|
Structures
|
|
148
69
|
</a>
|
|
149
70
|
<a
|
|
150
71
|
class="item"
|
|
151
|
-
href="/
|
|
72
|
+
href="/implementations/1/results"
|
|
152
73
|
>
|
|
153
74
|
results
|
|
154
75
|
</a>
|
|
155
76
|
<a
|
|
156
77
|
class="item"
|
|
157
|
-
href="/
|
|
78
|
+
href="/implementations/1/events"
|
|
158
79
|
>
|
|
159
80
|
events
|
|
160
81
|
</a>
|
|
@@ -45,13 +45,6 @@ exports[`<RuleImplementationResults /> matches the latest snapshot 1`] = `
|
|
|
45
45
|
}
|
|
46
46
|
key="0"
|
|
47
47
|
optionalColumns={Array []}
|
|
48
|
-
rule={
|
|
49
|
-
Object {
|
|
50
|
-
"goal": 100,
|
|
51
|
-
"minimum": 50,
|
|
52
|
-
"result_type": "percentage",
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
48
|
ruleImplementation={
|
|
56
49
|
Object {
|
|
57
50
|
"results": Array [
|
|
@@ -7,31 +7,31 @@ exports[`<RuleImplementationTabs /> matches the latest snapshot 1`] = `
|
|
|
7
7
|
>
|
|
8
8
|
<a
|
|
9
9
|
class="item"
|
|
10
|
-
href="/
|
|
10
|
+
href="/implementations/1"
|
|
11
11
|
>
|
|
12
12
|
ruleImplementation
|
|
13
13
|
</a>
|
|
14
14
|
<a
|
|
15
15
|
class="item"
|
|
16
|
-
href="/
|
|
16
|
+
href="/implementations/1/links/concepts"
|
|
17
17
|
>
|
|
18
18
|
concepts
|
|
19
19
|
</a>
|
|
20
20
|
<a
|
|
21
21
|
class="item"
|
|
22
|
-
href="/
|
|
22
|
+
href="/implementations/1/structures"
|
|
23
23
|
>
|
|
24
24
|
structures
|
|
25
25
|
</a>
|
|
26
26
|
<a
|
|
27
27
|
class="item"
|
|
28
|
-
href="/
|
|
28
|
+
href="/implementations/1/results"
|
|
29
29
|
>
|
|
30
30
|
results
|
|
31
31
|
</a>
|
|
32
32
|
<a
|
|
33
33
|
class="item"
|
|
34
|
-
href="/
|
|
34
|
+
href="/implementations/1/events"
|
|
35
35
|
>
|
|
36
36
|
audit
|
|
37
37
|
</a>
|
|
@@ -8,6 +8,9 @@ import { selectTemplate } from "@truedat/df/routines";
|
|
|
8
8
|
|
|
9
9
|
import LimitsForm from "./LimitsForm";
|
|
10
10
|
|
|
11
|
+
const DomainDropdownSelector = React.lazy(() =>
|
|
12
|
+
import("@truedat/bg/taxonomy/components/DomainDropdownSelector")
|
|
13
|
+
);
|
|
11
14
|
const TemplateSelector = React.lazy(() =>
|
|
12
15
|
import("@truedat/df/templates/components/TemplateSelector")
|
|
13
16
|
);
|
|
@@ -74,6 +77,7 @@ export const InformationForm = ({
|
|
|
74
77
|
templates,
|
|
75
78
|
onChange,
|
|
76
79
|
ruleImplementation,
|
|
80
|
+
rule,
|
|
77
81
|
}) => {
|
|
78
82
|
const { formatMessage } = useIntl();
|
|
79
83
|
|
|
@@ -113,6 +117,14 @@ export const InformationForm = ({
|
|
|
113
117
|
autoComplete="off"
|
|
114
118
|
/>
|
|
115
119
|
</Form.Field>
|
|
120
|
+
{_.isEmpty(rule) && !ruleImplementation?.rule_id ? (
|
|
121
|
+
<Form.Field>
|
|
122
|
+
<DomainDropdownSelector
|
|
123
|
+
value={ruleImplementation.domain_id}
|
|
124
|
+
onChange={(_e, { value }) => onChange("domain_id", value)}
|
|
125
|
+
/>
|
|
126
|
+
</Form.Field>
|
|
127
|
+
) : null}
|
|
116
128
|
<LimitsForm onChange={onChange} ruleImplementation={ruleImplementation} />
|
|
117
129
|
{!_.isEmpty(templates) && (
|
|
118
130
|
<ImplementationDynamicForm
|
|
@@ -134,8 +146,9 @@ InformationForm.propTypes = {
|
|
|
134
146
|
template: PropTypes.object,
|
|
135
147
|
templates: PropTypes.object,
|
|
136
148
|
ruleImplementation: PropTypes.object,
|
|
149
|
+
rule: PropTypes.object,
|
|
137
150
|
};
|
|
138
151
|
|
|
139
|
-
const mapStateToProps = _.pick(["templates", "template"]);
|
|
152
|
+
const mapStateToProps = _.pick(["templates", "template", "rule"]);
|
|
140
153
|
|
|
141
154
|
export default connect(mapStateToProps, { selectTemplate })(InformationForm);
|
|
@@ -53,6 +53,7 @@ export const RuleImplementationForm = ({
|
|
|
53
53
|
operators,
|
|
54
54
|
onChange,
|
|
55
55
|
template,
|
|
56
|
+
rule,
|
|
56
57
|
}) => {
|
|
57
58
|
const { formatMessage } = useIntl();
|
|
58
59
|
const history = useHistory();
|
|
@@ -61,15 +62,17 @@ export const RuleImplementationForm = ({
|
|
|
61
62
|
{ name: "dataset", icon: "database", isValid: () => validDataSet() },
|
|
62
63
|
{ name: "populations", icon: "user", isValid: () => validPopulations() },
|
|
63
64
|
{ name: "validations", icon: "setting", isValid: () => validValidations() },
|
|
65
|
+
...(authManageSegments
|
|
66
|
+
? [
|
|
67
|
+
{
|
|
68
|
+
name: "segments",
|
|
69
|
+
icon: "grid layout",
|
|
70
|
+
isValid: () => validSegments(),
|
|
71
|
+
},
|
|
72
|
+
]
|
|
73
|
+
: []),
|
|
64
74
|
];
|
|
65
75
|
|
|
66
|
-
if (authManageSegments)
|
|
67
|
-
steps.push({
|
|
68
|
-
name: "segments",
|
|
69
|
-
icon: "grid layout",
|
|
70
|
-
isValid: () => validSegments(),
|
|
71
|
-
});
|
|
72
|
-
|
|
73
76
|
const [activeStep, setActiveStep] = useState("information");
|
|
74
77
|
const [selector, setSelector] = useState();
|
|
75
78
|
|
|
@@ -85,6 +88,7 @@ export const RuleImplementationForm = ({
|
|
|
85
88
|
template &&
|
|
86
89
|
!_.isEmpty(template) &&
|
|
87
90
|
_.size(validateContent(template)(dfContent)) == 0 &&
|
|
91
|
+
(!_.isEmpty(rule) || _.isNumber(_.prop("domain_id")(ruleImplementation))) &&
|
|
88
92
|
areLimitsValid(ruleImplementation);
|
|
89
93
|
|
|
90
94
|
const validPopulations = () =>
|
|
@@ -355,15 +359,16 @@ RuleImplementationForm.propTypes = {
|
|
|
355
359
|
operators: PropTypes.object,
|
|
356
360
|
onChange: PropTypes.func,
|
|
357
361
|
template: PropTypes.object,
|
|
362
|
+
rule: PropTypes.object,
|
|
358
363
|
};
|
|
359
364
|
|
|
360
365
|
const mapStateToProps = (state) => ({
|
|
366
|
+
rule: state.rule,
|
|
361
367
|
isSubmitting: state.ruleImplementationCreating,
|
|
362
368
|
template: state.template,
|
|
363
|
-
authManageSegments:
|
|
364
|
-
false,
|
|
365
|
-
"manage_segments"
|
|
366
|
-
)(state.userRulesPermissions),
|
|
369
|
+
authManageSegments:
|
|
370
|
+
_.pathOr(false, "userRulePermissions.manage_segments")(state) ||
|
|
371
|
+
_.pathOr(false, "implementationActions.manage_segments")(state),
|
|
367
372
|
});
|
|
368
373
|
|
|
369
374
|
export default connect(mapStateToProps)(RuleImplementationForm);
|
|
@@ -11,6 +11,10 @@ import { selectTemplate } from "@truedat/df/routines";
|
|
|
11
11
|
import LimitsForm from "./LimitsForm";
|
|
12
12
|
import { areLimitsValid } from "./limitsValidation";
|
|
13
13
|
|
|
14
|
+
const DomainDropdownSelector = React.lazy(() =>
|
|
15
|
+
import("@truedat/bg/taxonomy/components/DomainDropdownSelector")
|
|
16
|
+
);
|
|
17
|
+
|
|
14
18
|
const Help = ({ message }) => {
|
|
15
19
|
const { formatMessage } = useIntl();
|
|
16
20
|
return (
|
|
@@ -77,6 +81,7 @@ ImplementationDynamicForm.propTypes = {
|
|
|
77
81
|
};
|
|
78
82
|
|
|
79
83
|
export const RuleImplementationRawForm = ({
|
|
84
|
+
rule,
|
|
80
85
|
ruleImplementation,
|
|
81
86
|
handleSubmit,
|
|
82
87
|
isSubmitting,
|
|
@@ -145,6 +150,7 @@ export const RuleImplementationRawForm = ({
|
|
|
145
150
|
template &&
|
|
146
151
|
!_.isEmpty(template) &&
|
|
147
152
|
_.size(validDfContent(template)(ruleImplementation?.dfContent)) == 0 &&
|
|
153
|
+
(!_.isEmpty(rule) || _.isNumber(_.prop("domain_id")(ruleImplementation))) &&
|
|
148
154
|
areLimitsValid(ruleImplementation);
|
|
149
155
|
|
|
150
156
|
const isValidForm = () => {
|
|
@@ -209,6 +215,14 @@ export const RuleImplementationRawForm = ({
|
|
|
209
215
|
value={implementationKey}
|
|
210
216
|
/>
|
|
211
217
|
</Form.Field>
|
|
218
|
+
{_.isEmpty(rule) && !ruleImplementation?.rule_id && (
|
|
219
|
+
<Form.Field>
|
|
220
|
+
<DomainDropdownSelector
|
|
221
|
+
value={ruleImplementation.domain_id}
|
|
222
|
+
onChange={(_e, { value }) => onChange("domain_id", value)}
|
|
223
|
+
/>
|
|
224
|
+
</Form.Field>
|
|
225
|
+
)}
|
|
212
226
|
<LimitsForm onChange={onChange} ruleImplementation={ruleImplementation} />
|
|
213
227
|
{!_.isEmpty(templates) && (
|
|
214
228
|
<ImplementationDynamicForm
|
|
@@ -361,12 +375,14 @@ RuleImplementationRawForm.propTypes = {
|
|
|
361
375
|
templates: PropTypes.object,
|
|
362
376
|
ruleImplementation: PropTypes.object,
|
|
363
377
|
onChange: PropTypes.func,
|
|
378
|
+
rule: PropTypes.object,
|
|
364
379
|
};
|
|
365
380
|
|
|
366
381
|
const mapStateToProps = (state) => ({
|
|
367
382
|
isSubmitting: state.ruleImplementationCreating,
|
|
368
383
|
templates: state.templates,
|
|
369
384
|
template: getTemplate(state),
|
|
385
|
+
rule: state.rule,
|
|
370
386
|
});
|
|
371
387
|
|
|
372
388
|
const getTemplate = ({ template, templates, ruleImplementation }) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { Suspense } from "react";
|
|
2
2
|
import { render } from "@truedat/test/render";
|
|
3
3
|
import { intl } from "@truedat/test/intl-stub";
|
|
4
4
|
import { RuleImplementationForm } from "../RuleImplementationForm";
|
|
@@ -55,7 +55,9 @@ describe("<RuleImplementationForm />", () => {
|
|
|
55
55
|
|
|
56
56
|
it("matches the latest snapshot", () => {
|
|
57
57
|
const { container } = render(
|
|
58
|
-
<
|
|
58
|
+
<Suspense fallback={null}>
|
|
59
|
+
<RuleImplementationForm {...props} />
|
|
60
|
+
</Suspense>,
|
|
59
61
|
renderOpts
|
|
60
62
|
);
|
|
61
63
|
expect(container).toMatchSnapshot();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { shallow } from "enzyme";
|
|
3
4
|
import { intl } from "@truedat/test/intl-stub";
|
|
@@ -110,6 +111,25 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
110
111
|
expect(databaseDropdown).toHaveLength(0);
|
|
111
112
|
});
|
|
112
113
|
|
|
114
|
+
it("submit button enabled if there is valid content in form with database without rule", () => {
|
|
115
|
+
const domainProps = _.set("ruleImplementation.domain_id", 5)(props);
|
|
116
|
+
const customProps = {
|
|
117
|
+
...domainProps,
|
|
118
|
+
rawContent: {
|
|
119
|
+
dataset: "address a on c.address_id=a.id",
|
|
120
|
+
source_id: 2,
|
|
121
|
+
database: "db2",
|
|
122
|
+
population: "",
|
|
123
|
+
validations: "a.city='MADRID'",
|
|
124
|
+
},
|
|
125
|
+
template: { id: 1 },
|
|
126
|
+
dfContent: {},
|
|
127
|
+
};
|
|
128
|
+
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
129
|
+
const submitButton = wrapper.find("FormButton[type='submit']");
|
|
130
|
+
expect(submitButton.props().disabled).toBe(false);
|
|
131
|
+
});
|
|
132
|
+
|
|
113
133
|
it("submit button enabled if there is valid content in form with database", () => {
|
|
114
134
|
const customProps = {
|
|
115
135
|
...props,
|
|
@@ -122,6 +142,7 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
122
142
|
},
|
|
123
143
|
template: { id: 1 },
|
|
124
144
|
dfContent: {},
|
|
145
|
+
rule: { id: 5, name: "regla" },
|
|
125
146
|
};
|
|
126
147
|
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
127
148
|
const submitButton = wrapper.find("FormButton[type='submit']");
|
|
@@ -177,6 +198,24 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
177
198
|
});
|
|
178
199
|
});
|
|
179
200
|
|
|
201
|
+
it("submit button enabled if there is valid content in form without rule", () => {
|
|
202
|
+
const domainProps = _.set("ruleImplementation.domain_id", 5)(props);
|
|
203
|
+
const customProps = {
|
|
204
|
+
...domainProps,
|
|
205
|
+
rawContent: {
|
|
206
|
+
dataset: "cliente c join address a on c.address_id=a.id",
|
|
207
|
+
source_id: 1,
|
|
208
|
+
population: "",
|
|
209
|
+
validations: "a.city='MADRID'",
|
|
210
|
+
},
|
|
211
|
+
template: { id: 1 },
|
|
212
|
+
dfContent: {},
|
|
213
|
+
};
|
|
214
|
+
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
215
|
+
const submitButton = wrapper.find("FormButton[type='submit']");
|
|
216
|
+
expect(submitButton.props().disabled).toBe(false);
|
|
217
|
+
});
|
|
218
|
+
|
|
180
219
|
it("submit button enabled if there is valid content in form", () => {
|
|
181
220
|
const customProps = {
|
|
182
221
|
...props,
|
|
@@ -188,6 +227,7 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
188
227
|
},
|
|
189
228
|
template: { id: 1 },
|
|
190
229
|
dfContent: {},
|
|
230
|
+
rule: { id: 5, name: "regla" },
|
|
191
231
|
};
|
|
192
232
|
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
193
233
|
const submitButton = wrapper.find("FormButton[type='submit']");
|
|
@@ -4,6 +4,7 @@ exports[`<RuleImplementationForm /> matches the latest snapshot 1`] = `
|
|
|
4
4
|
<div>
|
|
5
5
|
<div
|
|
6
6
|
class="column"
|
|
7
|
+
style="display: none;"
|
|
7
8
|
>
|
|
8
9
|
<div
|
|
9
10
|
class="stretched center aligned row"
|
|
@@ -136,6 +137,9 @@ exports[`<RuleImplementationForm /> matches the latest snapshot 1`] = `
|
|
|
136
137
|
</div>
|
|
137
138
|
</div>
|
|
138
139
|
</div>
|
|
140
|
+
<div
|
|
141
|
+
class="field"
|
|
142
|
+
/>
|
|
139
143
|
<div
|
|
140
144
|
class="ui segment"
|
|
141
145
|
>
|
package/src/messages/en.js
CHANGED
|
@@ -58,6 +58,8 @@ export default {
|
|
|
58
58
|
"filtersGrid.field.label": "Field",
|
|
59
59
|
"filtersGrid.field.operator": "Operator",
|
|
60
60
|
"filtersGrid.field.value": "Value",
|
|
61
|
+
"implementations.actions.create": "Create implementation",
|
|
62
|
+
"implementations.actions.create_raw": "Create raw implementation",
|
|
61
63
|
"implementations.actions.do_execution": "Execute implementations",
|
|
62
64
|
"implementations.actions.download.tooltip": "Download with csv format",
|
|
63
65
|
"implementations.actions.download.empty":
|
|
@@ -67,6 +69,7 @@ export default {
|
|
|
67
69
|
"implementations.actions.execution.confirmation.header":
|
|
68
70
|
"Implementations execution",
|
|
69
71
|
"implementations.actions.execution.confirmation.legend": "Template fields",
|
|
72
|
+
"implementations.crumbs.top": "Implementations",
|
|
70
73
|
"implementations.execute.filtered": "{count} implementations to execute",
|
|
71
74
|
"implementations.search.placeholder": "Search implementations...",
|
|
72
75
|
"implementationStructures.empty": "No structures found",
|
|
@@ -117,6 +120,7 @@ export default {
|
|
|
117
120
|
"quality.result.percentage.description": "{result}%",
|
|
118
121
|
"quality.result_type": "Result Type",
|
|
119
122
|
"quality.rule.actions.create": "New Implementation",
|
|
123
|
+
"quality.rule.actions.create_raw": "New raw Implementation",
|
|
120
124
|
"quality.rule.description": "Description",
|
|
121
125
|
"quality.rule.failed": "Failed",
|
|
122
126
|
"quality.rule.name": "Name",
|
package/src/messages/es.js
CHANGED
|
@@ -59,6 +59,8 @@ export default {
|
|
|
59
59
|
"filtersGrid.field.label": "Campo",
|
|
60
60
|
"filtersGrid.field.operator": "Operador",
|
|
61
61
|
"filtersGrid.field.value": "Valor",
|
|
62
|
+
"implementations.actions.create": "Crear implementación",
|
|
63
|
+
"implementations.actions.create_raw": "Crear implementacion nativa",
|
|
62
64
|
"implementations.actions.do_execution": "Ejecutar implementaciones",
|
|
63
65
|
"implementations.actions.download.tooltip": "Descargar en formato csv",
|
|
64
66
|
"implementations.actions.download.empty":
|
|
@@ -69,6 +71,7 @@ export default {
|
|
|
69
71
|
"Solicitar ejecución de implementaciones",
|
|
70
72
|
"implementations.actions.execution.confirmation.legend":
|
|
71
73
|
"Campos de la plantilla",
|
|
74
|
+
"implementations.crumbs.top": "Implementaciones",
|
|
72
75
|
"implementations.execute.filtered": "{count} implementaciones a ejecutar",
|
|
73
76
|
"implementations.search.placeholder": "Buscar implementaciones...",
|
|
74
77
|
"implementationStructures.empty": "Ningúna estructura encontrada",
|
|
@@ -126,6 +129,7 @@ export default {
|
|
|
126
129
|
"quality.result.percentage.description": "{result}%",
|
|
127
130
|
"quality.result": "Resultado",
|
|
128
131
|
"quality.rule.actions.create": "Nueva Implementación",
|
|
132
|
+
"quality.rule.actions.create_raw": "Nueva implementación nativa",
|
|
129
133
|
"quality.rule.description": "Descripción",
|
|
130
134
|
"quality.rule.failed": "Failed",
|
|
131
135
|
"quality.rule.name": "Nombre",
|
|
@@ -23,7 +23,7 @@ describe("reducers: ruleImplementationRedirect", () => {
|
|
|
23
23
|
|
|
24
24
|
it("should be a link redirect after receiving the updateRuleImplementation.SUCCESS action", () => {
|
|
25
25
|
const payload = { data: { id: 2, rule_id: 1 } };
|
|
26
|
-
const url = linkTo.
|
|
26
|
+
const url = linkTo.IMPLEMENTATION({ id: 1, implementation_id: 2 });
|
|
27
27
|
|
|
28
28
|
expect(
|
|
29
29
|
ruleImplementationRedirect(fooState, {
|
|
@@ -49,7 +49,7 @@ describe("reducers: ruleImplementationRedirect", () => {
|
|
|
49
49
|
it("should return a link to ruleImplementationResults after deleteRuleResult.SUCCESS action", () => {
|
|
50
50
|
const payload = { rule_id: 1, rule_implementation_id: 2 };
|
|
51
51
|
|
|
52
|
-
const url = linkTo.
|
|
52
|
+
const url = linkTo.IMPLEMENTATION_RESULTS({
|
|
53
53
|
id: 1,
|
|
54
54
|
implementation_id: 2,
|
|
55
55
|
});
|
|
@@ -36,10 +36,10 @@ describe("reducers: ruleImplementationRedirect", () => {
|
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
it("should be a link redirect after receiving the setRuleImplementationStatus.SUCCESS action and redirect info", () => {
|
|
39
|
-
const payload = {
|
|
39
|
+
const payload = { implementation_id: 1, redirect: true };
|
|
40
40
|
|
|
41
|
-
const url = linkTo.
|
|
42
|
-
|
|
41
|
+
const url = linkTo.IMPLEMENTATION({
|
|
42
|
+
implementation_id: 1,
|
|
43
43
|
});
|
|
44
44
|
const meta = {};
|
|
45
45
|
expect(
|
|
@@ -9,6 +9,8 @@ const pickFields = _.pick([
|
|
|
9
9
|
"deleted_at",
|
|
10
10
|
"df_content",
|
|
11
11
|
"df_name",
|
|
12
|
+
"domain",
|
|
13
|
+
"domain_id",
|
|
12
14
|
"event_inserted_at",
|
|
13
15
|
"event_message",
|
|
14
16
|
"event_type",
|
|
@@ -20,6 +22,7 @@ const pickFields = _.pick([
|
|
|
20
22
|
"segments",
|
|
21
23
|
"raw_content",
|
|
22
24
|
"results",
|
|
25
|
+
"rule",
|
|
23
26
|
"rule_id",
|
|
24
27
|
"system",
|
|
25
28
|
"validations",
|