@truedat/dq 5.0.2 → 5.0.4
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 +11 -0
- package/package.json +5 -5
- package/src/components/ImplementationActions.js +16 -0
- package/src/components/ImplementationSearchResults.js +5 -2
- package/src/components/Implementations.js +1 -1
- package/src/components/ImplementationsRoutes.js +41 -0
- package/src/components/NewRuleImplementation.js +11 -4
- package/src/messages/en.js +2 -0
- package/src/messages/es.js +2 -0
- package/src/selectors/__tests__/getExecutionQuery.spec.js +14 -1
- package/src/selectors/getExecutionQuery.js +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.0.4] 2023-01-27
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- [TD-5522] Merge default and user filters for implementation execution
|
|
8
|
+
|
|
9
|
+
## [5.0.3] 2023-01-27
|
|
10
|
+
|
|
11
|
+
- [TD-5478] Render actions and views to convert basic implementation to default
|
|
12
|
+
or raw implementation
|
|
13
|
+
|
|
3
14
|
## [4.59.10] 2023-01-16
|
|
4
15
|
|
|
5
16
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dq",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@testing-library/jest-dom": "^5.16.5",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "5.0.
|
|
37
|
+
"@truedat/test": "5.0.4",
|
|
38
38
|
"babel-jest": "^28.1.0",
|
|
39
39
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
40
40
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"@apollo/client": "^3.7.1",
|
|
95
|
-
"@truedat/core": "5.0.
|
|
96
|
-
"@truedat/df": "5.0.
|
|
95
|
+
"@truedat/core": "5.0.4",
|
|
96
|
+
"@truedat/df": "5.0.4",
|
|
97
97
|
"decode-uri-component": "^0.2.2",
|
|
98
98
|
"graphql": "^15.5.3",
|
|
99
99
|
"moment": "^2.29.4",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"react-dom": ">= 16.8.6 < 17",
|
|
119
119
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "91d484a16499494eedec012362b3a7f45cb1cbc9"
|
|
122
122
|
}
|
|
@@ -24,6 +24,22 @@ export const implementationActions = ({
|
|
|
24
24
|
formatMessage,
|
|
25
25
|
}) =>
|
|
26
26
|
_.filter(({ key }) => _.flow(Object.keys, _.includes(key))(actions))([
|
|
27
|
+
{
|
|
28
|
+
key: "convert_default",
|
|
29
|
+
icon: "edit",
|
|
30
|
+
text: formatMessage({ id: "ruleImplementation.actions.convert_default" }),
|
|
31
|
+
value: "convert_default",
|
|
32
|
+
as: Link,
|
|
33
|
+
to: linkTo.IMPLEMENTATION_EDIT_AS_DEFAULT({ implementation_id: id }),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: "convert_raw",
|
|
37
|
+
icon: "edit outline",
|
|
38
|
+
text: formatMessage({ id: "ruleImplementation.actions.convert_raw" }),
|
|
39
|
+
value: "convert_raw",
|
|
40
|
+
as: Link,
|
|
41
|
+
to: linkTo.IMPLEMENTATION_EDIT_AS_RAW({ implementation_id: id }),
|
|
42
|
+
},
|
|
27
43
|
{
|
|
28
44
|
key: "clone",
|
|
29
45
|
icon: "copy outline",
|
|
@@ -127,8 +127,11 @@ ImplementationSearchResults.propTypes = {
|
|
|
127
127
|
ruleImplementations: PropTypes.array,
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
const mapStateToProps = (state) => ({
|
|
131
|
-
implementationQuery: getExecutionQuery(
|
|
130
|
+
const mapStateToProps = (state, props) => ({
|
|
131
|
+
implementationQuery: getExecutionQuery({
|
|
132
|
+
...state,
|
|
133
|
+
ruleImplementationDefaultFilters: _.propOr({}, "defaultFilters")(props),
|
|
134
|
+
}),
|
|
132
135
|
role: state.authentication?.role,
|
|
133
136
|
loading: state.ruleImplementationsLoading,
|
|
134
137
|
ruleImplementations: state.ruleImplementations,
|
|
@@ -18,7 +18,7 @@ export const Implementations = ({ defaultFilters }) => (
|
|
|
18
18
|
<Segment>
|
|
19
19
|
<ImplementationsHeader />
|
|
20
20
|
<Segment attached="bottom">
|
|
21
|
-
<ImplementationSearchResults />
|
|
21
|
+
<ImplementationSearchResults defaultFilters={defaultFilters} />
|
|
22
22
|
</Segment>
|
|
23
23
|
</Segment>
|
|
24
24
|
</>
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
IMPLEMENTATION_CONCEPT_LINKS_NEW,
|
|
12
12
|
IMPLEMENTATION_CONCEPT_LINKS,
|
|
13
13
|
IMPLEMENTATION_EDIT,
|
|
14
|
+
IMPLEMENTATION_EDIT_AS_DEFAULT,
|
|
15
|
+
IMPLEMENTATION_EDIT_AS_RAW,
|
|
14
16
|
IMPLEMENTATION_EVENTS,
|
|
15
17
|
IMPLEMENTATION_EXECUTIONS,
|
|
16
18
|
IMPLEMENTATION_HISTORY,
|
|
@@ -218,6 +220,45 @@ export const ImplementationsRoutes = ({
|
|
|
218
220
|
</>
|
|
219
221
|
)}
|
|
220
222
|
/>
|
|
223
|
+
<Route
|
|
224
|
+
exact
|
|
225
|
+
path={IMPLEMENTATION_EDIT_AS_DEFAULT}
|
|
226
|
+
render={() => (
|
|
227
|
+
<>
|
|
228
|
+
{ruleImplementationLoaded ? (
|
|
229
|
+
<ImplementationStructuresLoader
|
|
230
|
+
structureIds={implementationStructures}
|
|
231
|
+
/>
|
|
232
|
+
) : null}
|
|
233
|
+
{!structuresAliasesLoading &&
|
|
234
|
+
ruleImplementationLoaded &&
|
|
235
|
+
implementationStructuresLoaded ? (
|
|
236
|
+
<NewRuleImplementation
|
|
237
|
+
edition
|
|
238
|
+
implementationType="default"
|
|
239
|
+
/>
|
|
240
|
+
) : null}
|
|
241
|
+
</>
|
|
242
|
+
)}
|
|
243
|
+
/>
|
|
244
|
+
<Route
|
|
245
|
+
exact
|
|
246
|
+
path={IMPLEMENTATION_EDIT_AS_RAW}
|
|
247
|
+
render={() => (
|
|
248
|
+
<>
|
|
249
|
+
{ruleImplementationLoaded ? (
|
|
250
|
+
<ImplementationStructuresLoader
|
|
251
|
+
structureIds={implementationStructures}
|
|
252
|
+
/>
|
|
253
|
+
) : null}
|
|
254
|
+
{!structuresAliasesLoading &&
|
|
255
|
+
ruleImplementationLoaded &&
|
|
256
|
+
implementationStructuresLoaded ? (
|
|
257
|
+
<NewRuleImplementation edition implementationType="raw" />
|
|
258
|
+
) : null}
|
|
259
|
+
</>
|
|
260
|
+
)}
|
|
261
|
+
/>
|
|
221
262
|
<Route
|
|
222
263
|
exact
|
|
223
264
|
path={IMPLEMENTATION_MOVE}
|
|
@@ -261,7 +261,7 @@ export const NewRuleImplementation = ({
|
|
|
261
261
|
structuresFields,
|
|
262
262
|
structuresSiblings,
|
|
263
263
|
operators,
|
|
264
|
-
implementationType
|
|
264
|
+
implementationType,
|
|
265
265
|
rule,
|
|
266
266
|
}) => {
|
|
267
267
|
const precalculatedDataset = _.flow(
|
|
@@ -272,11 +272,17 @@ export const NewRuleImplementation = ({
|
|
|
272
272
|
edition
|
|
273
273
|
? {
|
|
274
274
|
id: clone ? null : ruleImplementationProps.id,
|
|
275
|
-
executable:
|
|
275
|
+
executable:
|
|
276
|
+
ruleImplementationProps.implementation_type !== "basic"
|
|
277
|
+
? ruleImplementationProps.executable
|
|
278
|
+
: true,
|
|
276
279
|
implementationKey: clone
|
|
277
280
|
? ""
|
|
278
281
|
: ruleImplementationProps.implementation_key,
|
|
279
|
-
implementationType:
|
|
282
|
+
implementationType:
|
|
283
|
+
ruleImplementationProps.implementation_type !== "basic"
|
|
284
|
+
? ruleImplementationProps.implementation_type
|
|
285
|
+
: implementationType,
|
|
280
286
|
dataset: precalculatedDataset,
|
|
281
287
|
populations: _.flow(
|
|
282
288
|
_.pathOr([], "populations"),
|
|
@@ -338,7 +344,7 @@ export const NewRuleImplementation = ({
|
|
|
338
344
|
: {
|
|
339
345
|
executable: true,
|
|
340
346
|
implementationKey: "",
|
|
341
|
-
implementationType,
|
|
347
|
+
implementationType: implementationType || "",
|
|
342
348
|
dataset: [{}],
|
|
343
349
|
population: [],
|
|
344
350
|
populations: [],
|
|
@@ -635,6 +641,7 @@ NewRuleImplementation.propTypes = {
|
|
|
635
641
|
updateRuleImplementation: PropTypes.func,
|
|
636
642
|
conceptDomainId: PropTypes.number,
|
|
637
643
|
conceptDomainIds: PropTypes.array,
|
|
644
|
+
rule: PropTypes.object,
|
|
638
645
|
};
|
|
639
646
|
|
|
640
647
|
const mapStateToProps = (state) => ({
|
package/src/messages/en.js
CHANGED
|
@@ -267,6 +267,8 @@ export default {
|
|
|
267
267
|
"Deprecate implementation",
|
|
268
268
|
"ruleImplementation.actions.edit": "Edit implementation",
|
|
269
269
|
"ruleImplementation.actions.move": "Move to another rule",
|
|
270
|
+
"ruleImplementation.actions.convert_default": "Edit as default implementation",
|
|
271
|
+
"ruleImplementation.actions.convert_raw": "Edit as raw implementation",
|
|
270
272
|
"ruleImplementation.actions.restore": "Restore Implementation",
|
|
271
273
|
"ruleImplementation.actions.restore.confirmation.content":
|
|
272
274
|
"A deleted implementation will be restored. ¿Are you sure?",
|
package/src/messages/es.js
CHANGED
|
@@ -275,6 +275,8 @@ export default {
|
|
|
275
275
|
"Archivar Implementación",
|
|
276
276
|
"ruleImplementation.actions.edit": "Editar implementación",
|
|
277
277
|
"ruleImplementation.actions.move": "Mover a otra regla",
|
|
278
|
+
"ruleImplementation.actions.convert_default": "Editar como implementación normal",
|
|
279
|
+
"ruleImplementation.actions.convert_raw": "Editar como implementación nativa",
|
|
278
280
|
"ruleImplementation.actions.restore": "Restaurar Implementación",
|
|
279
281
|
"ruleImplementation.actions.restore.confirmation.content":
|
|
280
282
|
"Se va a restaurar una implementación que está borrada. ¿Estás seguro de continuar?",
|
|
@@ -2,13 +2,26 @@ import { getExecutionQuery } from "..";
|
|
|
2
2
|
|
|
3
3
|
const ruleImplementationQuery = { query: "foo" };
|
|
4
4
|
const ruleImplementationActiveFilters = { foo: "bar", bar: "baz" };
|
|
5
|
+
const ruleImplementationDefaultFilters = { status: "some status" };
|
|
5
6
|
|
|
6
7
|
describe("selectors: getExecutionQuery", () => {
|
|
7
8
|
it("should return query", () => {
|
|
8
9
|
const res = getExecutionQuery({
|
|
9
10
|
ruleImplementationQuery,
|
|
10
|
-
ruleImplementationActiveFilters
|
|
11
|
+
ruleImplementationActiveFilters,
|
|
11
12
|
});
|
|
12
13
|
expect(res).toEqual({ query: "foo", filters: { foo: "bar", bar: "baz" } });
|
|
13
14
|
});
|
|
15
|
+
|
|
16
|
+
it("should return query with default filters", () => {
|
|
17
|
+
const res = getExecutionQuery({
|
|
18
|
+
ruleImplementationQuery,
|
|
19
|
+
ruleImplementationActiveFilters,
|
|
20
|
+
ruleImplementationDefaultFilters,
|
|
21
|
+
});
|
|
22
|
+
expect(res).toEqual({
|
|
23
|
+
query: "foo",
|
|
24
|
+
filters: { foo: "bar", bar: "baz", status: "some status" },
|
|
25
|
+
});
|
|
26
|
+
});
|
|
14
27
|
});
|
|
@@ -4,9 +4,16 @@ import { createSelector } from "reselect";
|
|
|
4
4
|
export const getExecutionQuery = createSelector(
|
|
5
5
|
_.prop("ruleImplementationQuery"),
|
|
6
6
|
_.prop("ruleImplementationActiveFilters"),
|
|
7
|
-
(
|
|
7
|
+
_.prop("ruleImplementationDefaultFilters"),
|
|
8
|
+
(implementationQuery, implementationActiveFilters, defaultFilters) => {
|
|
8
9
|
const query = _.trim(implementationQuery?.query);
|
|
9
10
|
const filters = _.omitBy(_.isEmpty)(implementationActiveFilters);
|
|
10
|
-
|
|
11
|
+
const filtersWithDefaults = {
|
|
12
|
+
...defaultFilters,
|
|
13
|
+
...filters,
|
|
14
|
+
};
|
|
15
|
+
return query
|
|
16
|
+
? { filters: filtersWithDefaults, query }
|
|
17
|
+
: { filters: filtersWithDefaults };
|
|
11
18
|
}
|
|
12
19
|
);
|