@truedat/dq 4.45.3 → 4.45.6
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 +7 -0
- package/package.json +5 -5
- package/src/api/mutations.js +25 -0
- package/src/components/ImplementationActions.js +147 -0
- package/src/components/ImplementationFiltersLoader.js +2 -1
- package/src/components/{RuleImplementations.js → ImplementationSearchResults.js} +68 -53
- package/src/components/Implementations.js +16 -120
- package/src/components/ImplementationsRoutes.js +45 -57
- package/src/components/NewRuleImplementation.js +4 -1
- package/src/components/QualityRoutes.js +12 -1
- package/src/components/RuleFormImplementations.js +8 -63
- package/src/components/RuleImplementation.js +13 -204
- package/src/components/RuleImplementationProperties.js +9 -2
- package/src/components/RuleImplementationRow.js +0 -10
- package/src/components/RuleImplementationsActions.js +6 -31
- package/src/components/RuleImplementationsFromRuleLoader.js +3 -6
- package/src/components/RuleImplementationsTable.js +31 -44
- package/src/components/Subscription.js +11 -0
- package/src/components/__tests__/ExecutionForm.spec.js +1 -1
- package/src/components/__tests__/ImplementationActions.spec.js +21 -0
- package/src/components/__tests__/ImplementationFiltersLoader.spec.js +20 -0
- package/src/components/__tests__/{RuleImplementations.spec.js → ImplementationSearchResults.spec.js} +6 -6
- package/src/components/__tests__/Implementations.spec.js +12 -112
- package/src/components/__tests__/NewRuleImplementation.spec.js +3 -2
- package/src/components/__tests__/RemediationForm.spec.js +1 -1
- package/src/components/__tests__/RemediationPlan.spec.js +1 -1
- package/src/components/__tests__/RuleForm.spec.js +2 -2
- package/src/components/__tests__/RuleFormImplementations.spec.js +2 -10
- package/src/components/__tests__/RuleImplementationProperties.spec.js +3 -2
- package/src/components/__tests__/RuleImplementationsActions.spec.js +10 -5
- package/src/components/__tests__/RuleImplementationsFromRuleLoader.spec.js +3 -16
- package/src/components/__tests__/RuleProperties.spec.js +1 -1
- package/src/components/__tests__/__snapshots__/ImplementationActions.spec.js.snap +71 -0
- package/src/components/__tests__/__snapshots__/ImplementationSearchResults.spec.js.snap +90 -0
- package/src/components/__tests__/__snapshots__/Implementations.spec.js.snap +159 -53
- package/src/components/__tests__/__snapshots__/RuleForm.spec.js.snap +6 -6
- package/src/components/__tests__/__snapshots__/RuleFormImplementations.spec.js.snap +6 -48
- package/src/components/__tests__/__snapshots__/RuleImplementation.spec.js.snap +19 -19
- package/src/components/__tests__/__snapshots__/RuleImplementationProperties.spec.js.snap +2 -4
- package/src/components/__tests__/__snapshots__/RuleImplementationsActions.spec.js.snap +37 -0
- package/src/components/__tests__/__snapshots__/RuleImplementationsFromRuleLoader.spec.js.snap +0 -1
- package/src/components/__tests__/__snapshots__/RuleImplementationsTable.spec.js.snap +0 -3
- package/src/components/__tests__/__snapshots__/Subscription.spec.js.snap +19 -0
- package/src/components/index.js +0 -2
- package/src/components/ruleImplementationForm/InformationForm.js +1 -0
- package/src/components/ruleImplementationForm/RuleImplementationForm.js +7 -3
- package/src/components/ruleImplementationForm/RuleImplementationRawForm.js +11 -2
- package/src/components/ruleImplementationForm/__tests__/RuleImplementationForm.spec.js +2 -2
- package/src/components/ruleImplementationForm/__tests__/RuleImplementationRawForm.spec.js +6 -4
- package/src/messages/en.js +11 -6
- package/src/messages/es.js +13 -10
- package/src/reducers/__tests__/implementationsActions.spec.js +0 -9
- package/src/reducers/__tests__/ruleImplementationRedirect.spec.js +4 -13
- package/src/reducers/__tests__/ruleRedirect.spec.js +47 -67
- package/src/reducers/implementationsActions.js +0 -2
- package/src/reducers/index.js +0 -4
- package/src/reducers/ruleImplementation.js +7 -5
- package/src/reducers/ruleImplementationRedirect.js +6 -5
- package/src/reducers/ruleRedirect.js +14 -9
- package/src/routines.js +76 -76
- package/src/sagas/__tests__/deleteImplementation.spec.js +92 -0
- package/src/sagas/__tests__/publishImplementation.spec.js +80 -0
- package/src/sagas/__tests__/rejectImplementation.spec.js +80 -0
- package/src/sagas/__tests__/submitImplementation.spec.js +80 -0
- package/src/sagas/deleteImplementation.js +28 -0
- package/src/sagas/index.js +12 -3
- package/src/sagas/publishImplementation.js +24 -0
- package/src/sagas/rejectImplementation.js +24 -0
- package/src/sagas/submitImplementation.js +24 -0
- package/src/selectors/getExecutionQuery.js +4 -11
- package/src/components/__tests__/__snapshots__/RuleImplementations.spec.js.snap +0 -130
- package/src/reducers/__tests__/deletionQuery.spec.js +0 -24
- package/src/reducers/deletionQuery.js +0 -23
- package/src/reducers/userImplementationsPermissions.js +0 -23
- package/src/sagas/__tests__/setRuleImplementationStatus.spec.js +0 -165
- package/src/sagas/setRuleImplementationStatus.js +0 -53
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dq",
|
|
3
|
-
"version": "4.45.
|
|
3
|
+
"version": "4.45.6",
|
|
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.45.
|
|
37
|
+
"@truedat/test": "4.45.6",
|
|
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.45.
|
|
92
|
-
"@truedat/df": "4.45.
|
|
91
|
+
"@truedat/core": "4.45.6",
|
|
92
|
+
"@truedat/df": "4.45.6",
|
|
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": "6624767ce3b6893d538087057b662d11f90eb72d"
|
|
114
114
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { gql } from "@apollo/client";
|
|
2
|
+
|
|
3
|
+
export const SUBMIT_IMPLEMENTATION = gql`
|
|
4
|
+
mutation SubmitImplementation($id: ID!) {
|
|
5
|
+
submitImplementation(id: $id) {
|
|
6
|
+
id
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export const REJECT_IMPLEMENTATION = gql`
|
|
12
|
+
mutation rejectImplementation($id: ID!) {
|
|
13
|
+
rejectImplementation(id: $id) {
|
|
14
|
+
id
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const PUBLISH_IMPLEMENTATION = gql`
|
|
20
|
+
mutation publishImplementation($id: ID!) {
|
|
21
|
+
publishImplementation(id: $id) {
|
|
22
|
+
id
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { Link } from "react-router-dom";
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
6
|
+
import { connect } from "react-redux";
|
|
7
|
+
import { Button } from "semantic-ui-react";
|
|
8
|
+
import { GroupActions, OptionModal } from "@truedat/core/components";
|
|
9
|
+
import { linkTo, IMPLEMENTATIONS } from "@truedat/core/routes";
|
|
10
|
+
import {
|
|
11
|
+
createExecutionGroup,
|
|
12
|
+
submitImplementation,
|
|
13
|
+
publishImplementation,
|
|
14
|
+
rejectImplementation,
|
|
15
|
+
deleteImplementation,
|
|
16
|
+
} from "../routines";
|
|
17
|
+
import ExecutionPopup from "./ExecutionPopup";
|
|
18
|
+
|
|
19
|
+
export const implementationActions = ({
|
|
20
|
+
id,
|
|
21
|
+
deleteImplementation,
|
|
22
|
+
formatMessage,
|
|
23
|
+
}) => [
|
|
24
|
+
{
|
|
25
|
+
key: "clone",
|
|
26
|
+
icon: "copy outline",
|
|
27
|
+
text: formatMessage({ id: "ruleImplementation.actions.clone" }),
|
|
28
|
+
value: "clone",
|
|
29
|
+
as: Link,
|
|
30
|
+
to: linkTo.IMPLEMENTATION_CLONE({ implementation_id: id }),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: "move",
|
|
34
|
+
icon: "share square",
|
|
35
|
+
text: formatMessage({ id: "ruleImplementation.actions.move" }),
|
|
36
|
+
value: "move",
|
|
37
|
+
as: Link,
|
|
38
|
+
to: linkTo.IMPLEMENTATION_MOVE({ implementation_id: id }),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "delete",
|
|
42
|
+
value: "delete",
|
|
43
|
+
as: OptionModal,
|
|
44
|
+
headerMessage: "ruleImplementation.actions.delete.confirmation.header",
|
|
45
|
+
contentMessage: "ruleImplementation.actions.delete.confirmation.content",
|
|
46
|
+
iconName: "trash alternate outline",
|
|
47
|
+
iconColor: "red",
|
|
48
|
+
option: "ruleImplementation.actions.delete",
|
|
49
|
+
onConfirm: () => deleteImplementation({ id, redirectUrl: IMPLEMENTATIONS }),
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
export const ImplementationActions = ({
|
|
54
|
+
actions,
|
|
55
|
+
createExecutionGroup,
|
|
56
|
+
deleteImplementation,
|
|
57
|
+
publishImplementation,
|
|
58
|
+
rejectImplementation,
|
|
59
|
+
ruleImplementation,
|
|
60
|
+
submitImplementation,
|
|
61
|
+
}) => {
|
|
62
|
+
const { formatMessage } = useIntl();
|
|
63
|
+
const id = ruleImplementation?.id;
|
|
64
|
+
const handleExecute = (df_content) => {
|
|
65
|
+
const query = { filters: { id: [ruleImplementation?.id] } };
|
|
66
|
+
createExecutionGroup({ ...query, df_content });
|
|
67
|
+
};
|
|
68
|
+
const secondaryActions = implementationActions({
|
|
69
|
+
id,
|
|
70
|
+
deleteImplementation,
|
|
71
|
+
formatMessage,
|
|
72
|
+
});
|
|
73
|
+
return (
|
|
74
|
+
<>
|
|
75
|
+
{actions?.edit ? (
|
|
76
|
+
<Button
|
|
77
|
+
primary
|
|
78
|
+
content={formatMessage({ id: "actions.edit" })}
|
|
79
|
+
as={Link}
|
|
80
|
+
to={linkTo.IMPLEMENTATION_EDIT({ implementation_id: id })}
|
|
81
|
+
/>
|
|
82
|
+
) : null}
|
|
83
|
+
{actions?.publish ? (
|
|
84
|
+
<Button
|
|
85
|
+
primary
|
|
86
|
+
content={formatMessage({ id: "actions.publish" })}
|
|
87
|
+
onClick={() =>
|
|
88
|
+
publishImplementation({
|
|
89
|
+
id,
|
|
90
|
+
redirectUrl: linkTo.IMPLEMENTATION({ implementation_id: id }),
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
/>
|
|
94
|
+
) : null}
|
|
95
|
+
{actions?.reject ? (
|
|
96
|
+
<Button
|
|
97
|
+
secondary
|
|
98
|
+
content={formatMessage({ id: "actions.reject" })}
|
|
99
|
+
onClick={() =>
|
|
100
|
+
rejectImplementation({
|
|
101
|
+
id,
|
|
102
|
+
redirectUrl: linkTo.IMPLEMENTATION({ implementation_id: id }),
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
/>
|
|
106
|
+
) : null}
|
|
107
|
+
{actions?.submit ? (
|
|
108
|
+
<Button
|
|
109
|
+
content={formatMessage({ id: "actions.submit" })}
|
|
110
|
+
onClick={() =>
|
|
111
|
+
submitImplementation({
|
|
112
|
+
id,
|
|
113
|
+
redirectUrl: linkTo.IMPLEMENTATION({ implementation_id: id }),
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
/>
|
|
117
|
+
) : null}
|
|
118
|
+
{actions?.execute ? <ExecutionPopup onSubmit={handleExecute} /> : null}
|
|
119
|
+
<GroupActions availableActions={secondaryActions} />
|
|
120
|
+
</>
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
ImplementationActions.propTypes = {
|
|
125
|
+
actions: PropTypes.object,
|
|
126
|
+
deleteImplementation: PropTypes.func,
|
|
127
|
+
publishImplementation: PropTypes.func,
|
|
128
|
+
rejectImplementation: PropTypes.func,
|
|
129
|
+
ruleImplementation: PropTypes.object,
|
|
130
|
+
submitImplementation: PropTypes.func,
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const mapStateToProps = ({
|
|
134
|
+
implementationActions,
|
|
135
|
+
ruleImplementation,
|
|
136
|
+
}) => ({
|
|
137
|
+
actions: implementationActions,
|
|
138
|
+
ruleImplementation,
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export default connect(mapStateToProps, {
|
|
142
|
+
createExecutionGroup,
|
|
143
|
+
deleteImplementation,
|
|
144
|
+
publishImplementation,
|
|
145
|
+
rejectImplementation,
|
|
146
|
+
submitImplementation,
|
|
147
|
+
})(ImplementationActions);
|
|
@@ -16,13 +16,14 @@ const mapDispatchToProps = (dispatch) =>
|
|
|
16
16
|
dispatch
|
|
17
17
|
);
|
|
18
18
|
|
|
19
|
-
const makeMapStateToProps = () => {
|
|
19
|
+
export const makeMapStateToProps = () => {
|
|
20
20
|
const activeFiltersSelector = makeActiveFiltersSelector(
|
|
21
21
|
"ruleImplementationActiveFilters"
|
|
22
22
|
);
|
|
23
23
|
const mapStateToProps = (state, props) => ({
|
|
24
24
|
selectedFilter: state.ruleImplementationSelectedFilter,
|
|
25
25
|
filters: activeFiltersSelector(state, props),
|
|
26
|
+
defaultFilters: props?.defaultFilters || {},
|
|
26
27
|
});
|
|
27
28
|
return mapStateToProps;
|
|
28
29
|
};
|
|
@@ -4,6 +4,8 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import { connect } from "react-redux";
|
|
5
5
|
import { Dimmer, Header, Icon, Loader, Segment } from "semantic-ui-react";
|
|
6
6
|
import { FormattedMessage } from "react-intl";
|
|
7
|
+
import { useActiveRoute } from "@truedat/core/hooks";
|
|
8
|
+
import { IMPLEMENTATIONS_PENDING } from "@truedat/core/routes";
|
|
7
9
|
import { getExecutionQuery } from "../selectors";
|
|
8
10
|
import RuleImplementationsActions from "./RuleImplementationsActions";
|
|
9
11
|
import RuleImplementationsLabelResults from "./RuleImplementationsLabelResults";
|
|
@@ -12,7 +14,7 @@ import RuleImplementationsSearch from "./RuleImplementationsSearch";
|
|
|
12
14
|
import RuleImplementationsTable from "./RuleImplementationsTable";
|
|
13
15
|
import RuleImplementationSelectedFilters from "./RuleImplementationSelectedFilters";
|
|
14
16
|
|
|
15
|
-
const usePrevious = value => {
|
|
17
|
+
const usePrevious = (value) => {
|
|
16
18
|
const ref = useRef();
|
|
17
19
|
useEffect(() => {
|
|
18
20
|
ref.current = value;
|
|
@@ -20,11 +22,32 @@ const usePrevious = value => {
|
|
|
20
22
|
return ref.current;
|
|
21
23
|
};
|
|
22
24
|
|
|
23
|
-
export const
|
|
25
|
+
export const ImplementationSearchResultsHeader = () => {
|
|
26
|
+
const pending = useActiveRoute(IMPLEMENTATIONS_PENDING);
|
|
27
|
+
const header = pending
|
|
28
|
+
? "implementations.header.manage"
|
|
29
|
+
: "implementations.header";
|
|
30
|
+
const subheader = pending
|
|
31
|
+
? "implementations.subheader.manage"
|
|
32
|
+
: "implementations.subheader";
|
|
33
|
+
return (
|
|
34
|
+
<Header as="h2">
|
|
35
|
+
<Icon circular name="tags" />
|
|
36
|
+
<Header.Content>
|
|
37
|
+
<FormattedMessage id={header} />
|
|
38
|
+
<Header.Subheader>
|
|
39
|
+
<FormattedMessage id={subheader} />
|
|
40
|
+
</Header.Subheader>
|
|
41
|
+
</Header.Content>
|
|
42
|
+
</Header>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const ImplementationSearchResults = ({
|
|
24
47
|
implementationQuery,
|
|
25
48
|
role,
|
|
26
49
|
loading,
|
|
27
|
-
ruleImplementations
|
|
50
|
+
ruleImplementations,
|
|
28
51
|
}) => {
|
|
29
52
|
const [executeImplementationsOn, setMode] = useState(
|
|
30
53
|
_.matches({ filters: { executable: [true] } })(implementationQuery)
|
|
@@ -41,7 +64,7 @@ export const RuleImplementations = ({
|
|
|
41
64
|
const ids = _.map(_.prop("id"))(ruleImplementations);
|
|
42
65
|
return (
|
|
43
66
|
_.negate(_.isEmpty)(selectedImplementations) &&
|
|
44
|
-
_.every(id => _.includes(id)(selectedImplementations))(ids)
|
|
67
|
+
_.every((id) => _.includes(id)(selectedImplementations))(ids)
|
|
45
68
|
);
|
|
46
69
|
};
|
|
47
70
|
|
|
@@ -56,15 +79,15 @@ export const RuleImplementations = ({
|
|
|
56
79
|
_.flow(_.difference(selectedImplementations), _.uniq)(ids)
|
|
57
80
|
);
|
|
58
81
|
};
|
|
59
|
-
const checkRow = implementation => {
|
|
82
|
+
const checkRow = (implementation) => {
|
|
60
83
|
const id = _.prop("id")(implementation);
|
|
61
|
-
const exists = _.some(selectedId => _.eq(id, selectedId))(
|
|
84
|
+
const exists = _.some((selectedId) => _.eq(id, selectedId))(
|
|
62
85
|
selectedImplementations
|
|
63
86
|
);
|
|
64
87
|
exists
|
|
65
88
|
? setSelectedImplementations(
|
|
66
89
|
_.flow(
|
|
67
|
-
_.remove(selectedId => _.eq(id, selectedId)),
|
|
90
|
+
_.remove((selectedId) => _.eq(id, selectedId)),
|
|
68
91
|
_.uniq
|
|
69
92
|
)(selectedImplementations)
|
|
70
93
|
)
|
|
@@ -72,69 +95,61 @@ export const RuleImplementations = ({
|
|
|
72
95
|
_.flow(_.concat(id), _.uniq)(selectedImplementations)
|
|
73
96
|
);
|
|
74
97
|
};
|
|
75
|
-
const isRowChecked = implementation => {
|
|
98
|
+
const isRowChecked = (implementation) => {
|
|
76
99
|
const id = _.prop("id")(implementation);
|
|
77
|
-
return _.some(selectedId => _.eq(id, selectedId))(
|
|
100
|
+
return _.some((selectedId) => _.eq(id, selectedId))(
|
|
101
|
+
selectedImplementations
|
|
102
|
+
);
|
|
78
103
|
};
|
|
79
104
|
|
|
80
105
|
return (
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<
|
|
93
|
-
|
|
106
|
+
<Segment>
|
|
107
|
+
<ImplementationSearchResultsHeader />
|
|
108
|
+
<Segment attached="bottom">
|
|
109
|
+
<RuleImplementationsActions
|
|
110
|
+
executeImplementationsOn={executeImplementationsOn}
|
|
111
|
+
implementationQuery={implementationQuery}
|
|
112
|
+
role={role}
|
|
113
|
+
setMode={setMode}
|
|
114
|
+
selectedImplementations={selectedImplementations}
|
|
115
|
+
/>
|
|
116
|
+
<RuleImplementationsSearch />
|
|
117
|
+
<RuleImplementationSelectedFilters />
|
|
118
|
+
<Dimmer.Dimmable dimmed={loading}>
|
|
119
|
+
<Dimmer active={loading} inverted>
|
|
120
|
+
<Loader />
|
|
121
|
+
</Dimmer>
|
|
122
|
+
<RuleImplementationsLabelResults
|
|
123
|
+
executeImplementationsOn={executeImplementationsOn}
|
|
124
|
+
implementationsToExecute={_.size(selectedImplementations)}
|
|
125
|
+
/>
|
|
126
|
+
<RuleImplementationsTable
|
|
127
|
+
addAll={addAll}
|
|
128
|
+
checkedAll={allChecked()}
|
|
129
|
+
checkRow={checkRow}
|
|
94
130
|
executeImplementationsOn={executeImplementationsOn}
|
|
95
|
-
|
|
96
|
-
role={role}
|
|
97
|
-
setMode={setMode}
|
|
131
|
+
isRowChecked={isRowChecked}
|
|
98
132
|
selectedImplementations={selectedImplementations}
|
|
99
133
|
/>
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
<Dimmer.Dimmable dimmed={loading}>
|
|
103
|
-
<Dimmer active={loading} inverted>
|
|
104
|
-
<Loader />
|
|
105
|
-
</Dimmer>
|
|
106
|
-
<RuleImplementationsLabelResults
|
|
107
|
-
executeImplementationsOn={executeImplementationsOn}
|
|
108
|
-
implementationsToExecute={_.size(selectedImplementations)}
|
|
109
|
-
/>
|
|
110
|
-
<RuleImplementationsTable
|
|
111
|
-
addAll={addAll}
|
|
112
|
-
checkedAll={allChecked()}
|
|
113
|
-
checkRow={checkRow}
|
|
114
|
-
executeImplementationsOn={executeImplementationsOn}
|
|
115
|
-
isRowChecked={isRowChecked}
|
|
116
|
-
selectedImplementations={selectedImplementations}
|
|
117
|
-
/>
|
|
118
|
-
<RuleImplementationsPagination />
|
|
119
|
-
</Dimmer.Dimmable>
|
|
120
|
-
</Segment>
|
|
134
|
+
<RuleImplementationsPagination />
|
|
135
|
+
</Dimmer.Dimmable>
|
|
121
136
|
</Segment>
|
|
122
|
-
|
|
137
|
+
</Segment>
|
|
123
138
|
);
|
|
124
139
|
};
|
|
125
140
|
|
|
126
|
-
|
|
141
|
+
ImplementationSearchResults.propTypes = {
|
|
127
142
|
implementationQuery: PropTypes.object,
|
|
128
143
|
role: PropTypes.string,
|
|
129
144
|
loading: PropTypes.bool,
|
|
130
|
-
ruleImplementations: PropTypes.array
|
|
145
|
+
ruleImplementations: PropTypes.array,
|
|
131
146
|
};
|
|
132
147
|
|
|
133
|
-
const mapStateToProps = state => ({
|
|
148
|
+
const mapStateToProps = (state) => ({
|
|
134
149
|
implementationQuery: getExecutionQuery(state),
|
|
135
|
-
role: state.authentication
|
|
150
|
+
role: state.authentication?.role,
|
|
136
151
|
loading: state.ruleImplementationsLoading,
|
|
137
|
-
ruleImplementations: state.ruleImplementations
|
|
152
|
+
ruleImplementations: state.ruleImplementations,
|
|
138
153
|
});
|
|
139
154
|
|
|
140
|
-
export default connect(mapStateToProps)(
|
|
155
|
+
export default connect(mapStateToProps)(ImplementationSearchResults);
|
|
@@ -1,128 +1,24 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { ConfirmModal } from "@truedat/core/components";
|
|
8
|
-
import { setRuleImplementationStatus } from "../routines";
|
|
9
|
-
import RuleImplementationsTable from "./RuleImplementationsTable";
|
|
3
|
+
import ImplementationFiltersLoader from "./ImplementationFiltersLoader";
|
|
4
|
+
import ImplementationSearchResults from "./ImplementationSearchResults";
|
|
5
|
+
import RuleImplementationsLoader from "./RuleImplementationsLoader";
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
handleStatusChange,
|
|
15
|
-
}) => {
|
|
16
|
-
const { formatMessage } = useIntl();
|
|
17
|
-
const active = _.isNil(deletedAt);
|
|
18
|
-
const deleted = !active;
|
|
19
|
-
const mode = deleted ? "delete" : "deprecate";
|
|
20
|
-
return (
|
|
21
|
-
<>
|
|
22
|
-
{deleted && (
|
|
23
|
-
<ConfirmModal
|
|
24
|
-
trigger={<Icon name="undo" />}
|
|
25
|
-
header={formatMessage({
|
|
26
|
-
id: `ruleImplementation.actions.restore.confirmation.header`,
|
|
27
|
-
})}
|
|
28
|
-
content={formatMessage({
|
|
29
|
-
id: `ruleImplementation.actions.restore.confirmation.content`,
|
|
30
|
-
})}
|
|
31
|
-
onConfirm={() => handleStatusChange(id, { restore: true, deleted })}
|
|
32
|
-
onOpen={(e) => e.stopPropagation()}
|
|
33
|
-
onClose={(e) => e.stopPropagation()}
|
|
34
|
-
/>
|
|
35
|
-
)}
|
|
36
|
-
<ConfirmModal
|
|
37
|
-
icon="trash"
|
|
38
|
-
trigger={
|
|
39
|
-
active ? (
|
|
40
|
-
<Icon name="folder open outline" />
|
|
41
|
-
) : (
|
|
42
|
-
<Icon name="trash alternate outline" color="red" />
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
header={formatMessage({
|
|
46
|
-
id: `ruleImplementation.actions.${mode}.confirmation.header`,
|
|
47
|
-
})}
|
|
48
|
-
content={formatMessage(
|
|
49
|
-
{ id: `ruleImplementation.actions.${mode}.confirmation.content` },
|
|
50
|
-
{
|
|
51
|
-
action: formatMessage({
|
|
52
|
-
id: `ruleImplementation.actions.${mode}`,
|
|
53
|
-
}),
|
|
54
|
-
mode: formatMessage(
|
|
55
|
-
{ id: `ruleImplementation.${mode}.folder` },
|
|
56
|
-
// eslint-disable-next-line react/display-name
|
|
57
|
-
{ span: (str) => <span className="highlighted">{str}</span> }
|
|
58
|
-
),
|
|
59
|
-
}
|
|
60
|
-
)}
|
|
61
|
-
onConfirm={() =>
|
|
62
|
-
handleStatusChange(id, { softDelete: active, deleted })
|
|
63
|
-
}
|
|
64
|
-
onOpen={(e) => e.stopPropagation()}
|
|
65
|
-
onClose={(e) => e.stopPropagation()}
|
|
66
|
-
/>
|
|
67
|
-
</>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
ActionsCell.propTypes = {
|
|
72
|
-
id: PropTypes.number,
|
|
73
|
-
deleted_at: PropTypes.string,
|
|
74
|
-
handleStatusChange: PropTypes.func,
|
|
75
|
-
};
|
|
7
|
+
const UserSearchFiltersLoader = React.lazy(() =>
|
|
8
|
+
import("@truedat/dd/components/UserSearchFiltersLoader")
|
|
9
|
+
);
|
|
76
10
|
|
|
77
|
-
export const Implementations = ({
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const additionalColumns = manageRuleImplementationAction
|
|
86
|
-
? [<Table.HeaderCell key={"status"} width={1} />]
|
|
87
|
-
: [];
|
|
88
|
-
const additionalCells = manageRuleImplementationAction
|
|
89
|
-
? [
|
|
90
|
-
{
|
|
91
|
-
style: { textAlign: "center", padding: "1px" },
|
|
92
|
-
className: "pointer",
|
|
93
|
-
props: { deletedRender, handleStatusChange },
|
|
94
|
-
content: ActionsCell,
|
|
95
|
-
},
|
|
96
|
-
]
|
|
97
|
-
: [];
|
|
98
|
-
return (
|
|
99
|
-
<RuleImplementationsTable
|
|
100
|
-
withoutColumns={["rule", "business_concept"]}
|
|
101
|
-
additionalCells={additionalCells}
|
|
102
|
-
additionalColumns={additionalColumns}
|
|
103
|
-
/>
|
|
104
|
-
);
|
|
105
|
-
};
|
|
11
|
+
export const Implementations = ({ defaultFilters }) => (
|
|
12
|
+
<>
|
|
13
|
+
<ImplementationFiltersLoader defaultFilters={defaultFilters} />
|
|
14
|
+
<UserSearchFiltersLoader scope="rule_implementation" />
|
|
15
|
+
<RuleImplementationsLoader defaultFilters={defaultFilters} />
|
|
16
|
+
<ImplementationSearchResults />
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
106
19
|
|
|
107
20
|
Implementations.propTypes = {
|
|
108
|
-
|
|
109
|
-
setRuleImplementationStatus: PropTypes.func,
|
|
110
|
-
manageRuleImplementationAction: PropTypes.bool,
|
|
111
|
-
rule: PropTypes.object,
|
|
21
|
+
defaultFilters: PropTypes.object,
|
|
112
22
|
};
|
|
113
23
|
|
|
114
|
-
|
|
115
|
-
ruleImplementations,
|
|
116
|
-
userRulePermissions,
|
|
117
|
-
rule,
|
|
118
|
-
}) => ({
|
|
119
|
-
ruleImplementations,
|
|
120
|
-
manageRuleImplementationAction: _.prop("manage_quality_rule_implementations")(
|
|
121
|
-
userRulePermissions
|
|
122
|
-
),
|
|
123
|
-
rule,
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
export default connect(mapStateToProps, { setRuleImplementationStatus })(
|
|
127
|
-
Implementations
|
|
128
|
-
);
|
|
24
|
+
export default Implementations;
|