@truedat/dq 4.48.11 → 4.49.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/CHANGELOG.md +9 -3
- package/package.json +4 -4
- package/src/components/ImplementationsRoutes.js +6 -6
- package/src/components/NewRule.js +33 -17
- package/src/components/NewRuleImplementation.js +2 -2
- package/src/components/Rule.js +2 -2
- package/src/components/RuleForm.js +17 -30
- package/src/components/RuleProperties.js +1 -1
- package/src/components/RuleRoutes.js +88 -108
- package/src/components/RulesRoutes.js +1 -10
- package/src/components/__tests__/NewRule.spec.js +13 -9
- package/src/components/__tests__/Rules.spec.js +0 -2
- package/src/components/__tests__/__snapshots__/NewRule.spec.js.snap +334 -23
- package/src/components/__tests__/__snapshots__/Rules.spec.js.snap +0 -2
- package/src/messages/en.js +0 -9
- package/src/messages/es.js +0 -9
- package/src/reducers/rule.js +6 -7
- package/src/reducers/rules.js +7 -7
- package/src/sagas/createRule.js +3 -4
- package/src/selectors/ruleColumnsSelector.js +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.48.13] 2022-26-07
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- [TD-5072] Edit quality rule was broken by 4.48.6
|
|
8
|
+
|
|
3
9
|
## [4.48.9] 2022-07-18
|
|
4
10
|
|
|
5
11
|
### Added
|
|
@@ -173,7 +179,7 @@
|
|
|
173
179
|
|
|
174
180
|
## [4.43.5] 2022-05-05
|
|
175
181
|
|
|
176
|
-
|
|
182
|
+
### Added
|
|
177
183
|
|
|
178
184
|
- [TD-4538] Add more coding for segments configuration and segment results for
|
|
179
185
|
implementations
|
|
@@ -193,13 +199,13 @@
|
|
|
193
199
|
|
|
194
200
|
## [4.43.1] 2022-04-28
|
|
195
201
|
|
|
196
|
-
|
|
202
|
+
### Added
|
|
197
203
|
|
|
198
204
|
- [TD-4538] Add Segment configuration and segment results for implementations
|
|
199
205
|
|
|
200
206
|
## [4.43.0] 2022-04-26
|
|
201
207
|
|
|
202
|
-
|
|
208
|
+
### Added
|
|
203
209
|
|
|
204
210
|
- [TD-3186] Support for linking Implementations and Structures
|
|
205
211
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dq",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.49.0",
|
|
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.6.4",
|
|
96
|
-
"@truedat/core": "4.
|
|
97
|
-
"@truedat/df": "4.
|
|
96
|
+
"@truedat/core": "4.49.0",
|
|
97
|
+
"@truedat/df": "4.49.0",
|
|
98
98
|
"axios": "^0.19.2",
|
|
99
99
|
"graphql": "^15.5.3",
|
|
100
100
|
"path-to-regexp": "^1.7.0",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"react-dom": ">= 16.8.6 < 17",
|
|
116
116
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "7260126df6067fe59b11c5dc2b94dbdd881fed7b"
|
|
119
119
|
}
|
|
@@ -95,9 +95,9 @@ export const ImplementationsRoutes = ({
|
|
|
95
95
|
]}
|
|
96
96
|
filter="all"
|
|
97
97
|
/>
|
|
98
|
-
{!structuresAliasesLoading && !systemsLoading
|
|
99
|
-
<NewRuleImplementation
|
|
100
|
-
)}
|
|
98
|
+
{!structuresAliasesLoading && !systemsLoading ? (
|
|
99
|
+
<NewRuleImplementation />
|
|
100
|
+
) : null}
|
|
101
101
|
</>
|
|
102
102
|
)}
|
|
103
103
|
/>
|
|
@@ -114,9 +114,9 @@ export const ImplementationsRoutes = ({
|
|
|
114
114
|
filter="all"
|
|
115
115
|
/>
|
|
116
116
|
<TemplatesLoader scope="ri" />
|
|
117
|
-
{!structuresAliasesLoading && !systemsLoading
|
|
118
|
-
<NewRuleImplementation
|
|
119
|
-
)}
|
|
117
|
+
{!structuresAliasesLoading && !systemsLoading ? (
|
|
118
|
+
<NewRuleImplementation implementationType="raw" />
|
|
119
|
+
) : null}
|
|
120
120
|
</>
|
|
121
121
|
)}
|
|
122
122
|
/>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import { connect } from "react-redux";
|
|
5
|
+
import { useParams } from "react-router-dom";
|
|
5
6
|
import { Container, Header, Icon, Segment } from "semantic-ui-react";
|
|
6
|
-
import { FormattedMessage } from "react-intl";
|
|
7
7
|
import { createRule } from "../routines";
|
|
8
8
|
import RuleForm from "./RuleForm";
|
|
9
9
|
|
|
@@ -11,25 +11,41 @@ const DomainsLoader = React.lazy(() =>
|
|
|
11
11
|
import("@truedat/bg/taxonomy/components/DomainsLoader")
|
|
12
12
|
);
|
|
13
13
|
|
|
14
|
-
export const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
export const ConceptRuleForm = ({ createRule, concept }) => {
|
|
15
|
+
if (!concept?.business_concept_id) return null;
|
|
16
|
+
return <RuleForm concept={concept} onSubmit={createRule} />;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
ConceptRuleForm.propTypes = {
|
|
20
|
+
createRule: PropTypes.func.isRequired,
|
|
21
|
+
concept: PropTypes.object,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const NewRule = ({ createRule, concept }) => {
|
|
25
|
+
const { business_concept_id } = useParams();
|
|
26
|
+
return (
|
|
27
|
+
<Container as={Segment} text>
|
|
28
|
+
<Header as="h2">
|
|
29
|
+
<Icon name="wrench" />
|
|
30
|
+
<Header.Content>
|
|
31
|
+
<FormattedMessage id="rules.actions.create" />
|
|
32
|
+
</Header.Content>
|
|
33
|
+
</Header>
|
|
34
|
+
<DomainsLoader actions="manage_quality_rule" />
|
|
35
|
+
{business_concept_id ? (
|
|
36
|
+
<ConceptRuleForm concept={concept} createRule={createRule} />
|
|
37
|
+
) : (
|
|
38
|
+
<RuleForm onSubmit={createRule} />
|
|
39
|
+
)}
|
|
40
|
+
</Container>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
27
43
|
|
|
28
44
|
NewRule.propTypes = {
|
|
29
|
-
|
|
45
|
+
concept: PropTypes.object,
|
|
30
46
|
createRule: PropTypes.func.isRequired,
|
|
31
47
|
};
|
|
32
48
|
|
|
33
|
-
const mapStateToProps = ({
|
|
49
|
+
export const mapStateToProps = ({ concept }) => ({ concept });
|
|
34
50
|
|
|
35
51
|
export default connect(mapStateToProps, { createRule })(NewRule);
|
|
@@ -244,10 +244,10 @@ const withConditionDefaultAlias = (conditions, structures) =>
|
|
|
244
244
|
})(conditions);
|
|
245
245
|
|
|
246
246
|
export const NewRuleImplementation = ({
|
|
247
|
-
clone,
|
|
247
|
+
clone = false,
|
|
248
248
|
createRuleImplementation,
|
|
249
249
|
updateRuleImplementation,
|
|
250
|
-
edition,
|
|
250
|
+
edition = false,
|
|
251
251
|
rule,
|
|
252
252
|
ruleImplementationProps,
|
|
253
253
|
structuresFields,
|
package/src/components/Rule.js
CHANGED
|
@@ -10,7 +10,7 @@ import RuleSummary from "./RuleSummary";
|
|
|
10
10
|
|
|
11
11
|
export const Rule = ({ rule, userRulePermissions, implementations }) => {
|
|
12
12
|
return _.isEmpty(rule) ? null : (
|
|
13
|
-
|
|
13
|
+
<>
|
|
14
14
|
<Grid>
|
|
15
15
|
<Grid.Column width={8}>
|
|
16
16
|
<Header as="h2">
|
|
@@ -29,7 +29,7 @@ export const Rule = ({ rule, userRulePermissions, implementations }) => {
|
|
|
29
29
|
</Grid.Column>
|
|
30
30
|
</Grid>
|
|
31
31
|
<RuleTabs />
|
|
32
|
-
|
|
32
|
+
</>
|
|
33
33
|
);
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -82,7 +82,6 @@ export class RuleForm extends React.Component {
|
|
|
82
82
|
domain_id: null,
|
|
83
83
|
name: "",
|
|
84
84
|
description: null,
|
|
85
|
-
type_params: {},
|
|
86
85
|
df_name: "",
|
|
87
86
|
df_content: {},
|
|
88
87
|
template: null,
|
|
@@ -101,7 +100,11 @@ export class RuleForm extends React.Component {
|
|
|
101
100
|
},
|
|
102
101
|
});
|
|
103
102
|
} else if (!_.isEmpty(concept)) {
|
|
104
|
-
this.setState({
|
|
103
|
+
this.setState({
|
|
104
|
+
business_concept_id: concept?.business_concept_id,
|
|
105
|
+
domain_id: concept?.domain_id,
|
|
106
|
+
concept,
|
|
107
|
+
});
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
this.updateDescription(description);
|
|
@@ -148,29 +151,16 @@ export class RuleForm extends React.Component {
|
|
|
148
151
|
e.preventDefault();
|
|
149
152
|
if (this.messagesInformed(this.generateValidationMessages())) return;
|
|
150
153
|
const { onSubmit, match } = this.props;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
concept,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
df_name,
|
|
159
|
-
name,
|
|
160
|
-
} = this.state;
|
|
154
|
+
const rule = _.omit([
|
|
155
|
+
"activeSelection",
|
|
156
|
+
"concept",
|
|
157
|
+
"template",
|
|
158
|
+
"templatesLoading",
|
|
159
|
+
"valid",
|
|
160
|
+
])(this.state);
|
|
161
161
|
|
|
162
162
|
onSubmit({
|
|
163
|
-
rule
|
|
164
|
-
...(concept?.business_concept_id && {
|
|
165
|
-
business_concept_id: concept?.business_concept_id,
|
|
166
|
-
}),
|
|
167
|
-
domain_id,
|
|
168
|
-
active,
|
|
169
|
-
description,
|
|
170
|
-
df_content,
|
|
171
|
-
df_name,
|
|
172
|
-
name,
|
|
173
|
-
},
|
|
163
|
+
rule,
|
|
174
164
|
ids: match.params,
|
|
175
165
|
});
|
|
176
166
|
};
|
|
@@ -227,13 +217,10 @@ export class RuleForm extends React.Component {
|
|
|
227
217
|
const { domain_id } = rule;
|
|
228
218
|
const { concept, domainOptions } = this.props;
|
|
229
219
|
const messages = this.generateValidationMessages();
|
|
230
|
-
const hasDomainSelected =
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
const defaultFilters = !hasDomainSelected
|
|
235
|
-
? filters
|
|
236
|
-
: { ...filters, domain_ids: [domain_id] };
|
|
220
|
+
const hasDomainSelected = !!domain_id;
|
|
221
|
+
const defaultFilters = hasDomainSelected
|
|
222
|
+
? { ...filters, domain_ids: [domain_id] }
|
|
223
|
+
: filters;
|
|
237
224
|
|
|
238
225
|
return (
|
|
239
226
|
<>
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
RULE_EVENTS,
|
|
11
11
|
RULE_IMPLEMENTATION_NEW,
|
|
12
12
|
RULE_IMPLEMENTATION_NEW_RAW,
|
|
13
|
-
RULE_NEW,
|
|
14
13
|
RULE_IMPLEMENTATIONS,
|
|
15
14
|
} from "@truedat/core/routes";
|
|
16
15
|
import {
|
|
@@ -18,7 +17,6 @@ import {
|
|
|
18
17
|
getImplementationStructuresLoaded,
|
|
19
18
|
} from "../selectors";
|
|
20
19
|
import EditRule from "./EditRule";
|
|
21
|
-
import NewRule from "./NewRule";
|
|
22
20
|
import NewRuleImplementation from "./NewRuleImplementation";
|
|
23
21
|
import Rule from "./Rule";
|
|
24
22
|
import RuleCrumbs from "./RuleCrumbs";
|
|
@@ -57,113 +55,95 @@ export const RuleRoutes = ({
|
|
|
57
55
|
systemsLoading,
|
|
58
56
|
template,
|
|
59
57
|
templatesLoaded,
|
|
60
|
-
}) =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<>
|
|
83
|
-
<RuleCrumbs />
|
|
84
|
-
<Segment>
|
|
85
|
-
<RuleSubscriptionLoader />
|
|
86
|
-
<QualityTemplatesLoader />
|
|
87
|
-
<RuleImplementationsFromRuleLoader />
|
|
88
|
-
{ruleLoaded ? <Rule /> : null}
|
|
89
|
-
{ruleLoaded ? <RuleProperties /> : null}
|
|
90
|
-
{templatesLoaded && template ? (
|
|
91
|
-
<DynamicFormViewer
|
|
92
|
-
template={template}
|
|
93
|
-
content={rule.df_content}
|
|
94
|
-
/>
|
|
95
|
-
) : null}
|
|
96
|
-
</Segment>
|
|
97
|
-
</>
|
|
98
|
-
)}
|
|
99
|
-
/>
|
|
100
|
-
|
|
101
|
-
<Route
|
|
102
|
-
exact
|
|
103
|
-
path={RULE_EDIT}
|
|
104
|
-
render={() => (
|
|
105
|
-
<>
|
|
106
|
-
<DomainsLoader actions="manage_quality_rule" />
|
|
107
|
-
<EditRule />
|
|
108
|
-
</>
|
|
109
|
-
)}
|
|
110
|
-
/>
|
|
111
|
-
<Route
|
|
112
|
-
exact
|
|
113
|
-
path={RULE_EVENTS}
|
|
114
|
-
render={() => (
|
|
115
|
-
<>
|
|
116
|
-
<RuleCrumbs />
|
|
117
|
-
<Segment>
|
|
118
|
-
<RuleEventsLoader />
|
|
119
|
-
{ruleLoaded ? <Rule /> : null}
|
|
120
|
-
{ruleLoaded ? <RuleEvents /> : null}
|
|
121
|
-
</Segment>
|
|
122
|
-
</>
|
|
123
|
-
)}
|
|
124
|
-
/>
|
|
125
|
-
<Route
|
|
126
|
-
exact
|
|
127
|
-
path={RULE_IMPLEMENTATIONS}
|
|
128
|
-
render={() => (
|
|
129
|
-
<>
|
|
130
|
-
<RuleCrumbs />
|
|
131
|
-
<Segment>
|
|
132
|
-
<RuleSubscriptionLoader />
|
|
133
|
-
<RuleImplementationsFromRuleLoader />
|
|
134
|
-
{ruleLoaded ? <Rule /> : null}
|
|
135
|
-
{ruleLoaded ? <RuleFormImplementations /> : null}
|
|
136
|
-
</Segment>
|
|
137
|
-
</>
|
|
138
|
-
)}
|
|
139
|
-
/>
|
|
140
|
-
<Route
|
|
141
|
-
exact
|
|
142
|
-
path={RULE_IMPLEMENTATION_NEW}
|
|
143
|
-
render={() =>
|
|
144
|
-
structuresAliasesLoading || systemsLoading ? null : (
|
|
145
|
-
<NewRuleImplementation edition={false} />
|
|
146
|
-
)
|
|
147
|
-
}
|
|
148
|
-
/>
|
|
149
|
-
<Route
|
|
150
|
-
exact
|
|
151
|
-
path={RULE_IMPLEMENTATION_NEW_RAW}
|
|
152
|
-
render={() =>
|
|
153
|
-
structuresAliasesLoading || systemsLoading ? null : (
|
|
154
|
-
<NewRuleImplementation
|
|
155
|
-
edition={false}
|
|
156
|
-
implementationType="raw"
|
|
58
|
+
}) => (
|
|
59
|
+
<Route
|
|
60
|
+
path={RULE}
|
|
61
|
+
render={() => (
|
|
62
|
+
<>
|
|
63
|
+
<RuleLoader />
|
|
64
|
+
<Route
|
|
65
|
+
exact
|
|
66
|
+
path={RULE}
|
|
67
|
+
render={() => (
|
|
68
|
+
<>
|
|
69
|
+
<RuleCrumbs />
|
|
70
|
+
<Segment>
|
|
71
|
+
<RuleSubscriptionLoader />
|
|
72
|
+
<QualityTemplatesLoader />
|
|
73
|
+
<RuleImplementationsFromRuleLoader />
|
|
74
|
+
{ruleLoaded ? <Rule /> : null}
|
|
75
|
+
{ruleLoaded ? <RuleProperties /> : null}
|
|
76
|
+
{templatesLoaded && template ? (
|
|
77
|
+
<DynamicFormViewer
|
|
78
|
+
template={template}
|
|
79
|
+
content={rule.df_content}
|
|
157
80
|
/>
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
81
|
+
) : null}
|
|
82
|
+
</Segment>
|
|
83
|
+
</>
|
|
84
|
+
)}
|
|
85
|
+
/>
|
|
86
|
+
<Route
|
|
87
|
+
exact
|
|
88
|
+
path={RULE_EDIT}
|
|
89
|
+
render={() => (
|
|
90
|
+
<>
|
|
91
|
+
<DomainsLoader actions="manage_quality_rule" />
|
|
92
|
+
<EditRule />
|
|
93
|
+
</>
|
|
94
|
+
)}
|
|
95
|
+
/>
|
|
96
|
+
<Route
|
|
97
|
+
exact
|
|
98
|
+
path={RULE_EVENTS}
|
|
99
|
+
render={() => (
|
|
100
|
+
<>
|
|
101
|
+
<RuleCrumbs />
|
|
102
|
+
<Segment>
|
|
103
|
+
<RuleEventsLoader />
|
|
104
|
+
{ruleLoaded ? <Rule /> : null}
|
|
105
|
+
{ruleLoaded ? <RuleEvents /> : null}
|
|
106
|
+
</Segment>
|
|
107
|
+
</>
|
|
108
|
+
)}
|
|
109
|
+
/>
|
|
110
|
+
<Route
|
|
111
|
+
exact
|
|
112
|
+
path={RULE_IMPLEMENTATIONS}
|
|
113
|
+
render={() => (
|
|
114
|
+
<>
|
|
115
|
+
<RuleCrumbs />
|
|
116
|
+
<Segment>
|
|
117
|
+
<RuleSubscriptionLoader />
|
|
118
|
+
<RuleImplementationsFromRuleLoader />
|
|
119
|
+
{ruleLoaded ? <Rule /> : null}
|
|
120
|
+
{ruleLoaded ? <RuleFormImplementations /> : null}
|
|
121
|
+
</Segment>
|
|
122
|
+
</>
|
|
123
|
+
)}
|
|
124
|
+
/>
|
|
125
|
+
<Route
|
|
126
|
+
exact
|
|
127
|
+
path={RULE_IMPLEMENTATION_NEW}
|
|
128
|
+
render={() =>
|
|
129
|
+
structuresAliasesLoading || systemsLoading ? null : (
|
|
130
|
+
<NewRuleImplementation />
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
/>
|
|
134
|
+
<Route
|
|
135
|
+
exact
|
|
136
|
+
path={RULE_IMPLEMENTATION_NEW_RAW}
|
|
137
|
+
render={() =>
|
|
138
|
+
structuresAliasesLoading || systemsLoading ? null : (
|
|
139
|
+
<NewRuleImplementation implementationType="raw" />
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
/>
|
|
143
|
+
</>
|
|
144
|
+
)}
|
|
145
|
+
/>
|
|
146
|
+
);
|
|
167
147
|
|
|
168
148
|
RuleRoutes.propTypes = {
|
|
169
149
|
rule: PropTypes.object,
|
|
@@ -29,16 +29,7 @@ const RulesRoutes = () => (
|
|
|
29
29
|
)}
|
|
30
30
|
/>
|
|
31
31
|
<Switch>
|
|
32
|
-
<Route
|
|
33
|
-
exact
|
|
34
|
-
path={RULE_NEW}
|
|
35
|
-
render={() => (
|
|
36
|
-
<>
|
|
37
|
-
<DomainsLoader actions="manage_quality_rule" />
|
|
38
|
-
<NewRule />
|
|
39
|
-
</>
|
|
40
|
-
)}
|
|
41
|
-
/>
|
|
32
|
+
<Route exact path={RULE_NEW} render={() => <NewRule />} />
|
|
42
33
|
<Route path={RULE} render={() => <RuleRoutes />} />
|
|
43
34
|
</Switch>
|
|
44
35
|
</>
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { waitFor } from "@testing-library/react";
|
|
3
|
+
import { render } from "@truedat/test/render";
|
|
4
|
+
import NewRule from "../NewRule";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const state = {
|
|
7
|
+
concept: { business_concept_id: 123, domain_id: 22 },
|
|
8
|
+
conceptActiveFilters: {},
|
|
9
|
+
};
|
|
10
|
+
const renderOpts = { fallback: "lazy", state };
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
describe("<NewRule />", () => {
|
|
13
|
+
it("matches the latest snapshot (with concept)", async () => {
|
|
14
|
+
const { container, queryByText } = render(<NewRule />, renderOpts);
|
|
15
|
+
await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
|
|
16
|
+
expect(container).toMatchSnapshot();
|
|
13
17
|
});
|
|
14
18
|
});
|
|
@@ -11,7 +11,6 @@ describe("<Rules />", () => {
|
|
|
11
11
|
name: "control1",
|
|
12
12
|
description: "desc1",
|
|
13
13
|
type: "type1",
|
|
14
|
-
type_params: {},
|
|
15
14
|
status: "status1",
|
|
16
15
|
},
|
|
17
16
|
{
|
|
@@ -20,7 +19,6 @@ describe("<Rules />", () => {
|
|
|
20
19
|
name: "control2",
|
|
21
20
|
description: "desc2",
|
|
22
21
|
type: "type2",
|
|
23
|
-
type_params: {},
|
|
24
22
|
status: "status2",
|
|
25
23
|
},
|
|
26
24
|
];
|
|
@@ -1,28 +1,339 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<NewRule /> matches the latest snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<Header
|
|
9
|
-
as="h2"
|
|
3
|
+
exports[`<NewRule /> matches the latest snapshot (with concept) 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui segment ui text container"
|
|
7
|
+
style=""
|
|
10
8
|
>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
id="rule.actions.create"
|
|
9
|
+
<h2
|
|
10
|
+
class="ui header"
|
|
11
|
+
>
|
|
12
|
+
<i
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
class="wrench icon"
|
|
18
15
|
/>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
<div
|
|
17
|
+
class="content"
|
|
18
|
+
>
|
|
19
|
+
New Quality Rule
|
|
20
|
+
</div>
|
|
21
|
+
</h2>
|
|
22
|
+
<form
|
|
23
|
+
class="ui form rule-form"
|
|
24
|
+
>
|
|
25
|
+
<div
|
|
26
|
+
class="field rule-form__field-right"
|
|
27
|
+
>
|
|
28
|
+
<div
|
|
29
|
+
class="ui checked toggle checkbox"
|
|
30
|
+
>
|
|
31
|
+
<input
|
|
32
|
+
checked=""
|
|
33
|
+
class="hidden"
|
|
34
|
+
name="active"
|
|
35
|
+
readonly=""
|
|
36
|
+
tabindex="0"
|
|
37
|
+
type="radio"
|
|
38
|
+
value=""
|
|
39
|
+
/>
|
|
40
|
+
<label>
|
|
41
|
+
Active
|
|
42
|
+
</label>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div
|
|
46
|
+
class="field"
|
|
47
|
+
>
|
|
48
|
+
<label
|
|
49
|
+
class="rule-form-label"
|
|
50
|
+
>
|
|
51
|
+
Name
|
|
52
|
+
<span>
|
|
53
|
+
*
|
|
54
|
+
</span>
|
|
55
|
+
<div
|
|
56
|
+
class="ui left pointing label"
|
|
57
|
+
>
|
|
58
|
+
Required field is empty
|
|
59
|
+
</div>
|
|
60
|
+
</label>
|
|
61
|
+
<div
|
|
62
|
+
class="field"
|
|
63
|
+
>
|
|
64
|
+
<div
|
|
65
|
+
class="ui input"
|
|
66
|
+
>
|
|
67
|
+
<input
|
|
68
|
+
aria-label="Rule name"
|
|
69
|
+
autocomplete="off"
|
|
70
|
+
name="name"
|
|
71
|
+
placeholder="Rule name"
|
|
72
|
+
type="text"
|
|
73
|
+
value=""
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
<div
|
|
79
|
+
class="field"
|
|
80
|
+
>
|
|
81
|
+
<label
|
|
82
|
+
class="rule-form-label"
|
|
83
|
+
>
|
|
84
|
+
Description
|
|
85
|
+
</label>
|
|
86
|
+
<div>
|
|
87
|
+
<div
|
|
88
|
+
style="border: 1px solid rgba(34, 36, 38, 0.15); border-radius: 0.28571429rem;"
|
|
89
|
+
>
|
|
90
|
+
<div
|
|
91
|
+
class="ui menu"
|
|
92
|
+
>
|
|
93
|
+
<div
|
|
94
|
+
class="disabled icon item"
|
|
95
|
+
>
|
|
96
|
+
<i
|
|
97
|
+
aria-hidden="true"
|
|
98
|
+
class="bold icon"
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
<div
|
|
102
|
+
class="disabled icon item"
|
|
103
|
+
>
|
|
104
|
+
<i
|
|
105
|
+
aria-hidden="true"
|
|
106
|
+
class="italic icon"
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
109
|
+
<div
|
|
110
|
+
class="disabled icon item"
|
|
111
|
+
>
|
|
112
|
+
<i
|
|
113
|
+
aria-hidden="true"
|
|
114
|
+
class="underline icon"
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
<div
|
|
118
|
+
class="disabled icon item"
|
|
119
|
+
>
|
|
120
|
+
<i
|
|
121
|
+
aria-hidden="true"
|
|
122
|
+
class="header icon"
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
<div
|
|
126
|
+
class="disabled icon item"
|
|
127
|
+
>
|
|
128
|
+
<i
|
|
129
|
+
aria-hidden="true"
|
|
130
|
+
class="h icon"
|
|
131
|
+
/>
|
|
132
|
+
</div>
|
|
133
|
+
<div
|
|
134
|
+
class="disabled icon item"
|
|
135
|
+
>
|
|
136
|
+
<i
|
|
137
|
+
aria-hidden="true"
|
|
138
|
+
class="list ol icon"
|
|
139
|
+
/>
|
|
140
|
+
</div>
|
|
141
|
+
<div
|
|
142
|
+
class="disabled icon item"
|
|
143
|
+
>
|
|
144
|
+
<i
|
|
145
|
+
aria-hidden="true"
|
|
146
|
+
class="list ul icon"
|
|
147
|
+
/>
|
|
148
|
+
</div>
|
|
149
|
+
<div
|
|
150
|
+
class="disabled icon item"
|
|
151
|
+
>
|
|
152
|
+
<i
|
|
153
|
+
aria-hidden="true"
|
|
154
|
+
class="linkify icon"
|
|
155
|
+
/>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
<div
|
|
159
|
+
style="padding: 10px;"
|
|
160
|
+
>
|
|
161
|
+
<div
|
|
162
|
+
autocorrect="on"
|
|
163
|
+
contenteditable="true"
|
|
164
|
+
data-gramm="false"
|
|
165
|
+
data-key="0"
|
|
166
|
+
data-slate-editor="true"
|
|
167
|
+
role="textbox"
|
|
168
|
+
spellcheck="true"
|
|
169
|
+
style="outline: none; white-space: pre-wrap; word-wrap: break-word;"
|
|
170
|
+
>
|
|
171
|
+
<div
|
|
172
|
+
data-key="1"
|
|
173
|
+
data-slate-object="block"
|
|
174
|
+
style="position: relative;"
|
|
175
|
+
>
|
|
176
|
+
<span
|
|
177
|
+
data-key="3"
|
|
178
|
+
data-slate-object="text"
|
|
179
|
+
>
|
|
180
|
+
<span
|
|
181
|
+
data-offset-key="3:0"
|
|
182
|
+
data-slate-leaf="true"
|
|
183
|
+
>
|
|
184
|
+
<span>
|
|
185
|
+
<span
|
|
186
|
+
contenteditable="false"
|
|
187
|
+
style="pointer-events: none; display: inline-block; width: 0px; max-width: 100%; white-space: nowrap; opacity: 0.333; vertical-align: text-top;"
|
|
188
|
+
/>
|
|
189
|
+
<span
|
|
190
|
+
data-slate-length="0"
|
|
191
|
+
data-slate-zero-width="n"
|
|
192
|
+
>
|
|
193
|
+
|
|
194
|
+
<br />
|
|
195
|
+
</span>
|
|
196
|
+
</span>
|
|
197
|
+
</span>
|
|
198
|
+
</span>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
<div
|
|
206
|
+
class="field"
|
|
207
|
+
>
|
|
208
|
+
<label
|
|
209
|
+
class="rule-form-label"
|
|
210
|
+
>
|
|
211
|
+
Domain
|
|
212
|
+
<span>
|
|
213
|
+
*
|
|
214
|
+
</span>
|
|
215
|
+
</label>
|
|
216
|
+
<div
|
|
217
|
+
class="field"
|
|
218
|
+
>
|
|
219
|
+
<div
|
|
220
|
+
class="field"
|
|
221
|
+
>
|
|
222
|
+
<div
|
|
223
|
+
aria-expanded="false"
|
|
224
|
+
class="ui fluid search selection dropdown"
|
|
225
|
+
name="domain"
|
|
226
|
+
role="combobox"
|
|
227
|
+
>
|
|
228
|
+
<input
|
|
229
|
+
aria-autocomplete="list"
|
|
230
|
+
autocomplete="off"
|
|
231
|
+
class="search"
|
|
232
|
+
tabindex="0"
|
|
233
|
+
type="text"
|
|
234
|
+
value=""
|
|
235
|
+
/>
|
|
236
|
+
<div
|
|
237
|
+
aria-atomic="true"
|
|
238
|
+
aria-live="polite"
|
|
239
|
+
class="divider text"
|
|
240
|
+
role="alert"
|
|
241
|
+
>
|
|
242
|
+
Select a domain...
|
|
243
|
+
</div>
|
|
244
|
+
<i
|
|
245
|
+
aria-hidden="true"
|
|
246
|
+
class="dropdown icon clear"
|
|
247
|
+
/>
|
|
248
|
+
<div
|
|
249
|
+
aria-multiselectable="false"
|
|
250
|
+
class="menu transition"
|
|
251
|
+
role="listbox"
|
|
252
|
+
>
|
|
253
|
+
<div
|
|
254
|
+
class="message"
|
|
255
|
+
>
|
|
256
|
+
No results found.
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
<div
|
|
264
|
+
class="required field"
|
|
265
|
+
>
|
|
266
|
+
<label>
|
|
267
|
+
Template
|
|
268
|
+
<div
|
|
269
|
+
class="ui left pointing label"
|
|
270
|
+
>
|
|
271
|
+
Empty required field
|
|
272
|
+
</div>
|
|
273
|
+
</label>
|
|
274
|
+
<div
|
|
275
|
+
class="field"
|
|
276
|
+
>
|
|
277
|
+
<div
|
|
278
|
+
aria-busy="true"
|
|
279
|
+
aria-expanded="false"
|
|
280
|
+
class="ui loading search selection dropdown"
|
|
281
|
+
name="template"
|
|
282
|
+
role="combobox"
|
|
283
|
+
>
|
|
284
|
+
<input
|
|
285
|
+
aria-autocomplete="list"
|
|
286
|
+
autocomplete="off"
|
|
287
|
+
class="search"
|
|
288
|
+
tabindex="0"
|
|
289
|
+
type="text"
|
|
290
|
+
value=""
|
|
291
|
+
/>
|
|
292
|
+
<div
|
|
293
|
+
aria-atomic="true"
|
|
294
|
+
aria-live="polite"
|
|
295
|
+
class="divider default text"
|
|
296
|
+
role="alert"
|
|
297
|
+
>
|
|
298
|
+
loading...
|
|
299
|
+
</div>
|
|
300
|
+
<i
|
|
301
|
+
aria-hidden="true"
|
|
302
|
+
class="dropdown icon"
|
|
303
|
+
/>
|
|
304
|
+
<div
|
|
305
|
+
class="menu transition"
|
|
306
|
+
role="listbox"
|
|
307
|
+
>
|
|
308
|
+
<div
|
|
309
|
+
class="message"
|
|
310
|
+
>
|
|
311
|
+
No results found.
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
<div
|
|
318
|
+
class="actions"
|
|
319
|
+
>
|
|
320
|
+
<a
|
|
321
|
+
class="ui secondary button"
|
|
322
|
+
href="/"
|
|
323
|
+
role="button"
|
|
324
|
+
>
|
|
325
|
+
Cancel
|
|
326
|
+
</a>
|
|
327
|
+
<button
|
|
328
|
+
class="ui primary disabled button"
|
|
329
|
+
disabled=""
|
|
330
|
+
tabindex="-1"
|
|
331
|
+
type="submit"
|
|
332
|
+
>
|
|
333
|
+
Save
|
|
334
|
+
</button>
|
|
335
|
+
</div>
|
|
336
|
+
</form>
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
28
339
|
`;
|
|
@@ -101,7 +101,6 @@ exports[`<Rules /> matches the latest snapshot 1`] = `
|
|
|
101
101
|
"name": "control1",
|
|
102
102
|
"status": "status1",
|
|
103
103
|
"type": "type1",
|
|
104
|
-
"type_params": Object {},
|
|
105
104
|
}
|
|
106
105
|
}
|
|
107
106
|
/>
|
|
@@ -144,7 +143,6 @@ exports[`<Rules /> matches the latest snapshot 1`] = `
|
|
|
144
143
|
"name": "control2",
|
|
145
144
|
"status": "status2",
|
|
146
145
|
"type": "type2",
|
|
147
|
-
"type_params": Object {},
|
|
148
146
|
}
|
|
149
147
|
}
|
|
150
148
|
/>
|
package/src/messages/en.js
CHANGED
|
@@ -135,7 +135,6 @@ export default {
|
|
|
135
135
|
"quality.threshold": "Threshold",
|
|
136
136
|
"quality.thresholds": "Limits",
|
|
137
137
|
"quality.type": "Type",
|
|
138
|
-
"quality.type_params": "Params",
|
|
139
138
|
"quality_result.no_execution": "Not executed",
|
|
140
139
|
"quality_result.over_goal": "Over goal",
|
|
141
140
|
"quality_result.under_goal": "Under goal",
|
|
@@ -232,8 +231,6 @@ export default {
|
|
|
232
231
|
"rule.props.name.placeholder": "Rule name",
|
|
233
232
|
"rule.props.type": "Rule Type",
|
|
234
233
|
"rule.props.type.placeholder": "Values range",
|
|
235
|
-
"rule.props.type_params": "Parameters",
|
|
236
|
-
"rule.props.type_params.placeholder": "Parameters",
|
|
237
234
|
"rule.ruleImplementation.results.empty":
|
|
238
235
|
"No results found for current implementation",
|
|
239
236
|
"rule.ruleImplementation.results.details.empty":
|
|
@@ -256,12 +253,6 @@ export default {
|
|
|
256
253
|
"rule.type.min_value": "Has a minimum value",
|
|
257
254
|
"rule.type.numeric_format": "Has a numeric format",
|
|
258
255
|
"rule.type.unique_values": "Has unique values",
|
|
259
|
-
"rule.type_params.error.max_date.cast.date": "Max date invalid",
|
|
260
|
-
"rule.type_params.error.max_date.must.be.greater.than.or.equal.to.min_date":
|
|
261
|
-
"Date not valid",
|
|
262
|
-
"rule.type_params.error.max_date.required": "Max date required",
|
|
263
|
-
"rule.type_params.error.min_date.cast.date": "Min date invalid",
|
|
264
|
-
"rule.type_params.error.min_date.required": "Min date required",
|
|
265
256
|
"rule.values_list": "List values",
|
|
266
257
|
"ruleImplementation.action.deprecate": "deprecated",
|
|
267
258
|
"ruleImplementation.actions.clone": "Clone implementation",
|
package/src/messages/es.js
CHANGED
|
@@ -143,7 +143,6 @@ export default {
|
|
|
143
143
|
"quality.template": "Plantilla",
|
|
144
144
|
"quality.threshold": "Umbral",
|
|
145
145
|
"quality.thresholds": "Umbrales",
|
|
146
|
-
"quality.type_params": "Parámetros",
|
|
147
146
|
"quality.type": "Tipo",
|
|
148
147
|
"remediation": "Plan de remediación",
|
|
149
148
|
"remediation.actions.create": "Crear plan de remediación",
|
|
@@ -212,8 +211,6 @@ export default {
|
|
|
212
211
|
"rule.props.implementations": "Implementaciones",
|
|
213
212
|
"rule.props.name.placeholder": "Nombre de la regla",
|
|
214
213
|
"rule.props.name": "Nombre",
|
|
215
|
-
"rule.props.type_params.placeholder": "Parametros a cumplimentar",
|
|
216
|
-
"rule.props.type_params": "Parametros",
|
|
217
214
|
"rule.props.type": "Tipo de regla",
|
|
218
215
|
"rule.props.type.placeholder": "Rango de valores",
|
|
219
216
|
"rule.ruleImplementation.results.details.empty":
|
|
@@ -222,12 +219,6 @@ export default {
|
|
|
222
219
|
"No existen resultados para esta implementación",
|
|
223
220
|
"rule.ruleImplementations.empty":
|
|
224
221
|
"No existen reglas de implementación de esta regla",
|
|
225
|
-
"rule.type_params.error.max_date.cast.date": "Fecha máxima inválida",
|
|
226
|
-
"rule.type_params.error.max_date.must.be.greater.than.or.equal.to.min_date":
|
|
227
|
-
"Fecha no valida",
|
|
228
|
-
"rule.type_params.error.max_date.required": "Fecha máxima requerida",
|
|
229
|
-
"rule.type_params.error.min_date.cast.date": "Fecha mínima inválida",
|
|
230
|
-
"rule.type_params.error.min_date.required": "Fecha mínima requerida",
|
|
231
222
|
"rule.type.custom_validation": "Es una validación a medida",
|
|
232
223
|
"rule.type.date_format": "Tiene formato de fecha",
|
|
233
224
|
"rule.type.dates_range": "Pertenece a un rango de fechas",
|
package/src/reducers/rule.js
CHANGED
|
@@ -4,19 +4,18 @@ import { clearRule, fetchRule } from "../routines";
|
|
|
4
4
|
const initialState = {};
|
|
5
5
|
|
|
6
6
|
const pickFields = _.pick([
|
|
7
|
-
"id",
|
|
8
7
|
"active",
|
|
9
8
|
"business_concept_id",
|
|
9
|
+
"current_business_concept_version",
|
|
10
10
|
"deleted_at",
|
|
11
|
+
"description",
|
|
12
|
+
"df_content",
|
|
13
|
+
"df_name",
|
|
11
14
|
"domain",
|
|
12
15
|
"domain_id",
|
|
13
|
-
"
|
|
16
|
+
"id",
|
|
14
17
|
"name",
|
|
15
|
-
"description",
|
|
16
18
|
"system_values",
|
|
17
|
-
"type_params",
|
|
18
|
-
"df_name",
|
|
19
|
-
"df_content",
|
|
20
19
|
]);
|
|
21
20
|
|
|
22
21
|
const rule = (state = initialState, { type, payload }) => {
|
|
@@ -24,7 +23,7 @@ const rule = (state = initialState, { type, payload }) => {
|
|
|
24
23
|
case fetchRule.TRIGGER:
|
|
25
24
|
return initialState;
|
|
26
25
|
case fetchRule.SUCCESS:
|
|
27
|
-
return pickFields(payload.data) ||
|
|
26
|
+
return pickFields(payload.data) || initialState;
|
|
28
27
|
case clearRule.TRIGGER:
|
|
29
28
|
return initialState;
|
|
30
29
|
default:
|
package/src/reducers/rules.js
CHANGED
|
@@ -4,18 +4,18 @@ import { fetchRules } from "../routines";
|
|
|
4
4
|
const initialState = [];
|
|
5
5
|
|
|
6
6
|
const pickFields = _.pick([
|
|
7
|
-
"
|
|
8
|
-
"current_business_concept_version",
|
|
9
|
-
"domain",
|
|
7
|
+
"active",
|
|
10
8
|
"business_concept_id",
|
|
9
|
+
"current_business_concept_version",
|
|
11
10
|
"deleted_at",
|
|
12
|
-
"name",
|
|
13
11
|
"description",
|
|
12
|
+
"df_content",
|
|
13
|
+
"df_name",
|
|
14
|
+
"domain",
|
|
14
15
|
"goal",
|
|
16
|
+
"id",
|
|
15
17
|
"minimum",
|
|
16
|
-
"
|
|
17
|
-
"active",
|
|
18
|
-
"df_content",
|
|
18
|
+
"name",
|
|
19
19
|
"result_type",
|
|
20
20
|
]);
|
|
21
21
|
|
package/src/sagas/createRule.js
CHANGED
|
@@ -6,13 +6,12 @@ import { API_RULES } from "../api";
|
|
|
6
6
|
|
|
7
7
|
export function* createRuleSaga({ payload }) {
|
|
8
8
|
try {
|
|
9
|
-
const { rule
|
|
9
|
+
const { rule } = payload;
|
|
10
10
|
const url = API_RULES;
|
|
11
11
|
const requestData = { rule };
|
|
12
|
-
|
|
13
|
-
yield put({ meta, ...createRule.request() });
|
|
12
|
+
yield put(createRule.request());
|
|
14
13
|
const { data } = yield call(apiJsonPost, url, requestData, JSON_OPTS);
|
|
15
|
-
yield put(
|
|
14
|
+
yield put(createRule.success(data));
|
|
16
15
|
} catch (error) {
|
|
17
16
|
if (error.response) {
|
|
18
17
|
const { status, data } = error.response;
|
|
@@ -56,11 +56,6 @@ export const optionalRuleColumns = [
|
|
|
56
56
|
name: "active",
|
|
57
57
|
fieldDecorator: (field) => translateDecorator(`quality.active.${field}`),
|
|
58
58
|
},
|
|
59
|
-
{
|
|
60
|
-
name: "params",
|
|
61
|
-
fieldSelector: _.prop("type_params"),
|
|
62
|
-
fieldDecorator: dynamicDecorator,
|
|
63
|
-
},
|
|
64
59
|
{
|
|
65
60
|
name: "template",
|
|
66
61
|
fieldSelector: _.prop("df_content"),
|