@truedat/dq 4.45.7 → 4.46.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/ImplementationActions.js +36 -30
- package/src/components/ImplementationSearchResults.js +4 -1
- package/src/components/QualityRoutes.js +1 -1
- package/src/components/RuleImplementationActions.js +3 -3
- package/src/components/RuleImplementationsActions.js +2 -2
- package/src/components/__tests__/ImplementationActions.spec.js +3 -0
- package/src/components/__tests__/ImplementationSearchResults.spec.js +7 -0
- package/src/components/__tests__/RuleImplementation.spec.js +6 -0
- package/src/components/__tests__/RuleImplementationsActions.spec.js +2 -2
- package/src/components/__tests__/__snapshots__/ImplementationSearchResults.spec.js.snap +2 -0
- package/src/components/ruleImplementationForm/__tests__/RuleImplementationRawForm.spec.js +2 -0
- package/src/reducers/implementationActions.js +8 -1
- package/src/reducers/ruleImplementations.js +1 -0
- package/src/selectors/getRuleImplementationColumns.js +7 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dq",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.46.1",
|
|
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.4",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "4.
|
|
37
|
+
"@truedat/test": "4.46.0",
|
|
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",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@apollo/client": "^3.6.4",
|
|
91
|
-
"@truedat/core": "4.
|
|
92
|
-
"@truedat/df": "4.
|
|
91
|
+
"@truedat/core": "4.46.0",
|
|
92
|
+
"@truedat/df": "4.46.1",
|
|
93
93
|
"axios": "^0.19.2",
|
|
94
94
|
"graphql": "^15.5.3",
|
|
95
95
|
"path-to-regexp": "^1.7.0",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"react-dom": ">= 16.8.6 < 17",
|
|
111
111
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "00524d691df3a57293aca6580e6bf96667e11761"
|
|
114
114
|
}
|
|
@@ -17,38 +17,41 @@ import {
|
|
|
17
17
|
import ExecutionPopup from "./ExecutionPopup";
|
|
18
18
|
|
|
19
19
|
export const implementationActions = ({
|
|
20
|
+
actions,
|
|
20
21
|
id,
|
|
21
22
|
deleteImplementation,
|
|
22
23
|
formatMessage,
|
|
23
|
-
}) =>
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
24
|
+
}) =>
|
|
25
|
+
_.filter(({ key }) => _.flow(Object.keys, _.includes(key))(actions))([
|
|
26
|
+
{
|
|
27
|
+
key: "clone",
|
|
28
|
+
icon: "copy outline",
|
|
29
|
+
text: formatMessage({ id: "ruleImplementation.actions.clone" }),
|
|
30
|
+
value: "clone",
|
|
31
|
+
as: Link,
|
|
32
|
+
to: linkTo.IMPLEMENTATION_CLONE({ implementation_id: id }),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "move",
|
|
36
|
+
icon: "share square",
|
|
37
|
+
text: formatMessage({ id: "ruleImplementation.actions.move" }),
|
|
38
|
+
value: "move",
|
|
39
|
+
as: Link,
|
|
40
|
+
to: linkTo.IMPLEMENTATION_MOVE({ implementation_id: id }),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: "delete",
|
|
44
|
+
value: "delete",
|
|
45
|
+
as: OptionModal,
|
|
46
|
+
headerMessage: "ruleImplementation.actions.delete.confirmation.header",
|
|
47
|
+
contentMessage: "ruleImplementation.actions.delete.confirmation.content",
|
|
48
|
+
iconName: "trash alternate outline",
|
|
49
|
+
iconColor: "red",
|
|
50
|
+
option: "ruleImplementation.actions.delete",
|
|
51
|
+
onConfirm: () =>
|
|
52
|
+
deleteImplementation({ id, redirectUrl: IMPLEMENTATIONS }),
|
|
53
|
+
},
|
|
54
|
+
]);
|
|
52
55
|
|
|
53
56
|
export const ImplementationActions = ({
|
|
54
57
|
actions,
|
|
@@ -66,6 +69,7 @@ export const ImplementationActions = ({
|
|
|
66
69
|
createExecutionGroup({ ...query, df_content });
|
|
67
70
|
};
|
|
68
71
|
const secondaryActions = implementationActions({
|
|
72
|
+
actions,
|
|
69
73
|
id,
|
|
70
74
|
deleteImplementation,
|
|
71
75
|
formatMessage,
|
|
@@ -116,7 +120,9 @@ export const ImplementationActions = ({
|
|
|
116
120
|
/>
|
|
117
121
|
) : null}
|
|
118
122
|
{actions?.execute ? <ExecutionPopup onSubmit={handleExecute} /> : null}
|
|
119
|
-
|
|
123
|
+
{_.isEmpty(secondaryActions) ? null : (
|
|
124
|
+
<GroupActions availableActions={secondaryActions} />
|
|
125
|
+
)}
|
|
120
126
|
</>
|
|
121
127
|
);
|
|
122
128
|
};
|
|
@@ -101,7 +101,9 @@ export const ImplementationSearchResults = ({
|
|
|
101
101
|
selectedImplementations
|
|
102
102
|
);
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
const withoutColumns = useActiveRoute(IMPLEMENTATIONS_PENDING)
|
|
105
|
+
? []
|
|
106
|
+
: ["status"];
|
|
105
107
|
return (
|
|
106
108
|
<Segment>
|
|
107
109
|
<ImplementationSearchResultsHeader />
|
|
@@ -130,6 +132,7 @@ export const ImplementationSearchResults = ({
|
|
|
130
132
|
executeImplementationsOn={executeImplementationsOn}
|
|
131
133
|
isRowChecked={isRowChecked}
|
|
132
134
|
selectedImplementations={selectedImplementations}
|
|
135
|
+
withoutColumns={withoutColumns}
|
|
133
136
|
/>
|
|
134
137
|
<RuleImplementationsPagination />
|
|
135
138
|
</Dimmer.Dimmable>
|
|
@@ -14,7 +14,7 @@ import ImplementationsRoutes from "./ImplementationsRoutes";
|
|
|
14
14
|
import RulesRoutes from "./RulesRoutes";
|
|
15
15
|
|
|
16
16
|
const QualityRoutes = () => {
|
|
17
|
-
const authorized = useAuthorized("
|
|
17
|
+
const authorized = useAuthorized("quality");
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<>
|
|
@@ -37,9 +37,9 @@ RuleImplementationActions.propTypes = {
|
|
|
37
37
|
canCreateRaw: PropTypes.bool,
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
const mapStateToProps = ({
|
|
41
|
-
canCreate: !!
|
|
42
|
-
canCreateRaw: !!
|
|
40
|
+
const mapStateToProps = ({ implementationActions }) => ({
|
|
41
|
+
canCreate: !!implementationActions?.create,
|
|
42
|
+
canCreateRaw: !!implementationActions?.createRaw,
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
export default connect(mapStateToProps)(RuleImplementationActions);
|
|
@@ -82,7 +82,7 @@ export const RuleImplementationsActions = ({
|
|
|
82
82
|
/>
|
|
83
83
|
</>
|
|
84
84
|
) : null}
|
|
85
|
-
{actions?.
|
|
85
|
+
{actions?.createRawRuleLess ? (
|
|
86
86
|
<Button
|
|
87
87
|
as={Link}
|
|
88
88
|
to={IMPLEMENTATION_NEW_RAW}
|
|
@@ -91,7 +91,7 @@ export const RuleImplementationsActions = ({
|
|
|
91
91
|
})}
|
|
92
92
|
/>
|
|
93
93
|
) : null}
|
|
94
|
-
{actions?.
|
|
94
|
+
{actions?.createRuleLess ? (
|
|
95
95
|
<Button
|
|
96
96
|
primary
|
|
97
97
|
as={Link}
|
|
@@ -2,6 +2,13 @@ import React from "react";
|
|
|
2
2
|
import { shallow } from "enzyme";
|
|
3
3
|
import { ImplementationSearchResults } from "../ImplementationSearchResults";
|
|
4
4
|
|
|
5
|
+
jest.mock("@truedat/core/hooks", () => ({
|
|
6
|
+
useAuthorized: jest.fn(() => true),
|
|
7
|
+
useActiveRoute: jest.fn((param) =>
|
|
8
|
+
param === "/pendingImplementations" ? true : false
|
|
9
|
+
),
|
|
10
|
+
}));
|
|
11
|
+
|
|
5
12
|
describe("<ImplementationSearchResults />", () => {
|
|
6
13
|
it("matches the latest snapshot", () => {
|
|
7
14
|
const props = {
|
|
@@ -19,6 +19,9 @@ const stateExecutePermission = {
|
|
|
19
19
|
manage: true,
|
|
20
20
|
link_concept: true,
|
|
21
21
|
execute: true,
|
|
22
|
+
move: true,
|
|
23
|
+
clone: true,
|
|
24
|
+
delete: true,
|
|
22
25
|
},
|
|
23
26
|
};
|
|
24
27
|
|
|
@@ -28,6 +31,9 @@ const stateNoExecutePermission = {
|
|
|
28
31
|
manage: true,
|
|
29
32
|
link_concept: true,
|
|
30
33
|
execute: false,
|
|
34
|
+
move: true,
|
|
35
|
+
clone: true,
|
|
36
|
+
delete: true,
|
|
31
37
|
},
|
|
32
38
|
};
|
|
33
39
|
|
|
@@ -33,6 +33,7 @@ exports[`<ImplementationSearchResults /> matches the latest snapshot 1`] = `
|
|
|
33
33
|
executeImplementationsOn={false}
|
|
34
34
|
isRowChecked={[Function]}
|
|
35
35
|
selectedImplementations={Array []}
|
|
36
|
+
withoutColumns={Array []}
|
|
36
37
|
/>
|
|
37
38
|
<Connect(Pagination) />
|
|
38
39
|
</DimmerDimmable>
|
|
@@ -82,6 +83,7 @@ exports[`<ImplementationSearchResults /> renders executions on when executionEna
|
|
|
82
83
|
executeImplementationsOn={true}
|
|
83
84
|
isRowChecked={[Function]}
|
|
84
85
|
selectedImplementations={Array []}
|
|
86
|
+
withoutColumns={Array []}
|
|
85
87
|
/>
|
|
86
88
|
<Connect(Pagination) />
|
|
87
89
|
</DimmerDimmable>
|
|
@@ -6,6 +6,8 @@ import { render } from "@truedat/test/render";
|
|
|
6
6
|
import { multipleTemplatesMock } from "@truedat/test/mocks";
|
|
7
7
|
import RuleImplementationRawForm from "../RuleImplementationRawForm";
|
|
8
8
|
|
|
9
|
+
jest.setTimeout(30000);
|
|
10
|
+
|
|
9
11
|
const renderOpts = {
|
|
10
12
|
mocks: [multipleTemplatesMock({ scope: "ri", domainIds: [1] })],
|
|
11
13
|
state: {
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
clearRuleImplementation,
|
|
4
|
+
clearRuleImplementations,
|
|
5
|
+
fetchRuleImplementation,
|
|
6
|
+
fetchRuleImplementations,
|
|
7
|
+
} from "../routines";
|
|
3
8
|
|
|
4
9
|
const initialState = {};
|
|
5
10
|
|
|
6
11
|
const implementationActions = (state = initialState, { type, payload }) => {
|
|
7
12
|
switch (type) {
|
|
8
13
|
case fetchRuleImplementation.SUCCESS:
|
|
14
|
+
case fetchRuleImplementations.SUCCESS:
|
|
9
15
|
return _.pathOr(initialState, "_actions")(payload);
|
|
10
16
|
case clearRuleImplementations.TRIGGER:
|
|
17
|
+
case clearRuleImplementation.TRIGGER:
|
|
11
18
|
return initialState;
|
|
12
19
|
default:
|
|
13
20
|
return state;
|
|
@@ -28,6 +28,13 @@ export const defaultImplementationColumns = [
|
|
|
28
28
|
fieldDecorator: RuleLink,
|
|
29
29
|
width: 2,
|
|
30
30
|
},
|
|
31
|
+
{
|
|
32
|
+
name: "status",
|
|
33
|
+
fieldDecorator: (value) =>
|
|
34
|
+
translateDecorator(`ruleImplementation.status.${value}`),
|
|
35
|
+
sort: { name: "status" },
|
|
36
|
+
width: 2,
|
|
37
|
+
},
|
|
31
38
|
{
|
|
32
39
|
name: "business_concept",
|
|
33
40
|
fieldSelector: _.path("current_business_concept_version.name"),
|