@truedat/dq 4.40.0 → 4.40.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 +7 -0
- package/package.json +4 -4
- package/src/components/ImplementationsRoutes.js +0 -4
- package/src/components/RuleImplementationsActions.js +16 -8
- package/src/components/RuleImplementationsOptions.js +3 -2
- package/src/components/RuleResultsUpload.js +10 -28
- package/src/components/__tests__/RuleImplementationsActions.spec.js +2 -0
- package/src/components/__tests__/RuleImplementationsOptions.spec.js +16 -12
- package/src/components/__tests__/RuleResultsUpload.spec.js +8 -66
- package/src/components/__tests__/__snapshots__/RuleImplementationsActions.spec.js.snap +1 -0
- package/src/components/__tests__/__snapshots__/RuleImplementationsOptions.spec.js.snap +63 -54
- package/src/components/__tests__/__snapshots__/RuleResultsUpload.spec.js.snap +16 -8
- package/src/reducers/__tests__/implementationsActions.spec.js +50 -0
- package/src/reducers/__tests__/{uploadingResults.spec.js → resultsUploading.spec.js} +5 -5
- package/src/reducers/implementationsActions.js +24 -0
- package/src/reducers/index.js +12 -10
- package/src/reducers/{uploadingResults.js → resultsUploading.js} +2 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dq",
|
|
3
|
-
"version": "4.40.
|
|
3
|
+
"version": "4.40.1",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
84
|
"@apollo/client": "^3.4.10",
|
|
85
|
-
"@truedat/core": "4.40.
|
|
86
|
-
"@truedat/df": "4.40.
|
|
85
|
+
"@truedat/core": "4.40.1",
|
|
86
|
+
"@truedat/df": "4.40.1",
|
|
87
87
|
"axios": "^0.19.2",
|
|
88
88
|
"graphql": "^15.5.3",
|
|
89
89
|
"path-to-regexp": "^1.7.0",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"react-dom": ">= 16.8.6 < 17",
|
|
104
104
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "58b35b48833fbed1602d1070853e6c805bcc48f1"
|
|
107
107
|
}
|
|
@@ -8,9 +8,6 @@ import RuleImplementationsLoader from "./RuleImplementationsLoader";
|
|
|
8
8
|
const TemplatesLoader = React.lazy(() =>
|
|
9
9
|
import("@truedat/df/templates/components/TemplatesLoader")
|
|
10
10
|
);
|
|
11
|
-
const UserDomainsLoader = React.lazy(() =>
|
|
12
|
-
import("@truedat/auth/users/components/UserDomainsLoader")
|
|
13
|
-
);
|
|
14
11
|
const UserSearchFiltersLoader = React.lazy(() =>
|
|
15
12
|
import("@truedat/dd/components/UserSearchFiltersLoader")
|
|
16
13
|
);
|
|
@@ -24,7 +21,6 @@ const ImplementationsRoutes = () => (
|
|
|
24
21
|
<ImplementationFiltersLoader />
|
|
25
22
|
<TemplatesLoader scope="qe" />
|
|
26
23
|
<UserSearchFiltersLoader scope="rule_implementation" />
|
|
27
|
-
<UserDomainsLoader permissions={["manage_rule_results"]} />
|
|
28
24
|
<RuleImplementations exact />
|
|
29
25
|
</>
|
|
30
26
|
)}
|
|
@@ -14,18 +14,19 @@ import ExecutionPopup from "./ExecutionPopup";
|
|
|
14
14
|
import RuleImplementationsOptions from "./RuleImplementationsOptions";
|
|
15
15
|
|
|
16
16
|
export const RuleImplementationsActions = ({
|
|
17
|
+
actions,
|
|
17
18
|
addImplementationFilter,
|
|
18
19
|
canExecute,
|
|
19
|
-
executeImplementationsOn,
|
|
20
|
-
toggleImplementationFilterValue,
|
|
21
|
-
removeImplementationFilter,
|
|
22
20
|
createExecutionGroup,
|
|
23
|
-
|
|
21
|
+
executeImplementationsOn,
|
|
24
22
|
implementationQuery,
|
|
25
|
-
setMode,
|
|
26
23
|
implementationsExecution,
|
|
24
|
+
removeImplementationFilter,
|
|
27
25
|
ruleImplementationCount,
|
|
28
26
|
ruleImplementationsLoading,
|
|
27
|
+
selectedImplementations,
|
|
28
|
+
setMode,
|
|
29
|
+
toggleImplementationFilterValue,
|
|
29
30
|
}) => {
|
|
30
31
|
const showExecutableInfo = () => {
|
|
31
32
|
addImplementationFilter({ filter: "executable" });
|
|
@@ -50,6 +51,8 @@ export const RuleImplementationsActions = ({
|
|
|
50
51
|
: { filters: { id: selectedImplementations } };
|
|
51
52
|
createExecutionGroup({ ...query, df_content });
|
|
52
53
|
};
|
|
54
|
+
|
|
55
|
+
const canUploadResults = !!actions?.uploadResults;
|
|
53
56
|
return (
|
|
54
57
|
<div style={{ float: "right" }}>
|
|
55
58
|
{implementationsExecution && canExecute && (
|
|
@@ -73,24 +76,28 @@ export const RuleImplementationsActions = ({
|
|
|
73
76
|
/>
|
|
74
77
|
</>
|
|
75
78
|
)}
|
|
76
|
-
<RuleImplementationsOptions
|
|
79
|
+
<RuleImplementationsOptions
|
|
80
|
+
loading={ruleImplementationsLoading}
|
|
81
|
+
canUploadResults={canUploadResults}
|
|
82
|
+
/>
|
|
77
83
|
</div>
|
|
78
84
|
);
|
|
79
85
|
};
|
|
80
86
|
|
|
81
87
|
RuleImplementationsActions.propTypes = {
|
|
88
|
+
actions: PropTypes.object,
|
|
82
89
|
addImplementationFilter: PropTypes.func,
|
|
83
90
|
canExecute: PropTypes.bool,
|
|
84
91
|
createExecutionGroup: PropTypes.func,
|
|
85
92
|
executeImplementationsOn: PropTypes.bool,
|
|
86
|
-
implementationsExecution: PropTypes.bool,
|
|
87
93
|
implementationQuery: PropTypes.object,
|
|
94
|
+
implementationsExecution: PropTypes.bool,
|
|
88
95
|
removeImplementationFilter: PropTypes.func,
|
|
89
96
|
ruleImplementationCount: PropTypes.number,
|
|
97
|
+
ruleImplementationsLoading: PropTypes.bool,
|
|
90
98
|
selectedImplementations: PropTypes.array,
|
|
91
99
|
setMode: PropTypes.func,
|
|
92
100
|
toggleImplementationFilterValue: PropTypes.func,
|
|
93
|
-
ruleImplementationsLoading: PropTypes.bool,
|
|
94
101
|
};
|
|
95
102
|
|
|
96
103
|
const mapStateToProps = (state) => ({
|
|
@@ -98,6 +105,7 @@ const mapStateToProps = (state) => ({
|
|
|
98
105
|
ruleImplementationCount: state.ruleImplementationCount,
|
|
99
106
|
implementationsExecution: getImplementationsExecution(state),
|
|
100
107
|
ruleImplementationsLoading: state.ruleImplementationsLoading,
|
|
108
|
+
actions: state.implementationsActions,
|
|
101
109
|
});
|
|
102
110
|
|
|
103
111
|
export default connect(mapStateToProps, {
|
|
@@ -5,7 +5,7 @@ import RuleImplementationsDownload from "./RuleImplementationsDownload";
|
|
|
5
5
|
import RuleResultsUpload from "./RuleResultsUpload";
|
|
6
6
|
import ImplementationsUploadButton from "./ImplementationsUploadButton";
|
|
7
7
|
|
|
8
|
-
export const RuleImplementationsOptions = ({ loading }) => (
|
|
8
|
+
export const RuleImplementationsOptions = ({ loading, canUploadResults }) => (
|
|
9
9
|
<Dropdown
|
|
10
10
|
icon="ellipsis vertical"
|
|
11
11
|
className="button icon group-actions button-update"
|
|
@@ -16,13 +16,14 @@ export const RuleImplementationsOptions = ({ loading }) => (
|
|
|
16
16
|
<Dropdown.Menu>
|
|
17
17
|
<RuleImplementationsDownload />
|
|
18
18
|
<ImplementationsUploadButton />
|
|
19
|
-
<RuleResultsUpload />
|
|
19
|
+
{canUploadResults ? <RuleResultsUpload /> : null}
|
|
20
20
|
</Dropdown.Menu>
|
|
21
21
|
</Dropdown>
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
RuleImplementationsOptions.propTypes = {
|
|
25
25
|
loading: PropTypes.bool,
|
|
26
|
+
canUploadResults: PropTypes.bool,
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export default RuleImplementationsOptions;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { useEffect, useState } from "react";
|
|
1
|
+
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { connect } from "react-redux";
|
|
5
4
|
import { Dropdown } from "semantic-ui-react";
|
|
@@ -7,31 +6,18 @@ import { useIntl } from "react-intl";
|
|
|
7
6
|
import { UploadModal } from "@truedat/core/components";
|
|
8
7
|
import { uploadResults } from "../routines";
|
|
9
8
|
|
|
10
|
-
export const RuleResultsUpload = ({ uploadResults, loading
|
|
9
|
+
export const RuleResultsUpload = ({ uploadResults, loading }) => {
|
|
11
10
|
const { formatMessage } = useIntl();
|
|
12
|
-
const [permissionFound, setPermissionFound] = useState(false);
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
setPermissionFound(
|
|
16
|
-
!_.flow(
|
|
17
|
-
_.find({ permission: "manage_rule_results" }),
|
|
18
|
-
_.path("domains"),
|
|
19
|
-
_.isEmpty
|
|
20
|
-
)(userDomains)
|
|
21
|
-
);
|
|
22
|
-
}, [userDomains]);
|
|
23
11
|
|
|
24
12
|
return (
|
|
25
13
|
<UploadModal
|
|
26
14
|
icon="upload"
|
|
27
15
|
trigger={
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/>
|
|
34
|
-
) : null
|
|
16
|
+
<Dropdown.Item
|
|
17
|
+
icon="upload"
|
|
18
|
+
text={formatMessage({ id: "ruleResults.actions.upload.tooltip" })}
|
|
19
|
+
disabled={loading}
|
|
20
|
+
/>
|
|
35
21
|
}
|
|
36
22
|
header={formatMessage({
|
|
37
23
|
id: "ruleResults.actions.upload.confirmation.header",
|
|
@@ -52,14 +38,10 @@ export const RuleResultsUpload = ({ uploadResults, loading, userDomains }) => {
|
|
|
52
38
|
RuleResultsUpload.propTypes = {
|
|
53
39
|
uploadResults: PropTypes.func,
|
|
54
40
|
loading: PropTypes.bool,
|
|
55
|
-
userDomains: PropTypes.array,
|
|
56
41
|
};
|
|
57
42
|
|
|
58
|
-
const mapStateToProps = (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
userDomains: state.userDomains,
|
|
62
|
-
};
|
|
63
|
-
};
|
|
43
|
+
const mapStateToProps = ({ resultsUploading: loading }) => ({
|
|
44
|
+
loading,
|
|
45
|
+
});
|
|
64
46
|
|
|
65
47
|
export default connect(mapStateToProps, { uploadResults })(RuleResultsUpload);
|
|
@@ -12,6 +12,7 @@ describe("<RuleImplementationsActions />", () => {
|
|
|
12
12
|
const setMode = jest.fn();
|
|
13
13
|
const removeImplementationFilter = jest.fn();
|
|
14
14
|
const props = {
|
|
15
|
+
actions: { uploadResults: {} },
|
|
15
16
|
canExecute: true,
|
|
16
17
|
executionGroupLoading: false,
|
|
17
18
|
ruleImplementationCount: 12,
|
|
@@ -23,6 +24,7 @@ describe("<RuleImplementationsActions />", () => {
|
|
|
23
24
|
setMode,
|
|
24
25
|
removeImplementationFilter,
|
|
25
26
|
};
|
|
27
|
+
|
|
26
28
|
it("matches the latest snapshot", () => {
|
|
27
29
|
const wrapper = shallow(<RuleImplementationsActions {...props} />);
|
|
28
30
|
expect(wrapper).toMatchSnapshot();
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
1
|
import React from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
2
|
+
import { waitFor } from "@testing-library/react";
|
|
3
|
+
import { render } from "@truedat/test/render";
|
|
4
|
+
import coreEn from "@truedat/core/messages/en";
|
|
5
|
+
import RuleImplementationsOptions from "../RuleImplementationsOptions";
|
|
6
|
+
import en from "../../messages/en";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
const renderOpts = {
|
|
9
|
+
messages: { en: { ...coreEn, ...en } },
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const props = { canUploadResults: true };
|
|
8
13
|
|
|
9
14
|
describe("<RuleImplementationsOptions />", () => {
|
|
10
|
-
it("matches the latest snapshot", () => {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
expect(wrapper).toMatchSnapshot();
|
|
15
|
+
it("matches the latest snapshot", async () => {
|
|
16
|
+
const { container } = render(
|
|
17
|
+
<RuleImplementationsOptions {...props} />,
|
|
18
|
+
renderOpts
|
|
19
|
+
);
|
|
20
|
+
await waitFor(() => expect(container).toMatchSnapshot());
|
|
17
21
|
});
|
|
18
22
|
});
|
|
@@ -1,73 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { IntlProvider } from "react-intl";
|
|
2
|
+
import { waitFor } from "@testing-library/react";
|
|
4
3
|
import { render } from "@truedat/test/render";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import coreEn from "@truedat/core/messages/en";
|
|
5
|
+
import RuleResultsUpload from "../RuleResultsUpload";
|
|
6
|
+
import en from "../../messages/en";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
jest.clearAllMocks();
|
|
10
|
-
});
|
|
8
|
+
const renderOpts = { messages: { en: { ...coreEn, ...en } } };
|
|
11
9
|
|
|
12
10
|
describe("<RuleResultsUpload />", () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"ruleResults.actions.upload.tooltip": "Upload rule results",
|
|
17
|
-
"ruleResults.actions.upload.confirmation.header": "Upload rule results",
|
|
18
|
-
"uploadModal.actions.upload.confirmation.content": "Drag an drop file or click to select file",
|
|
19
|
-
"ruleResults.actions.upload.confirmation.header": "Upload rule results",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
it("matches the latest snapshot", () => {
|
|
25
|
-
const spy = jest.spyOn(React, "useContext").mockImplementation(() => intl);
|
|
26
|
-
const props = {
|
|
27
|
-
uploadResults: jest.fn(),
|
|
28
|
-
loading: false,
|
|
29
|
-
};
|
|
30
|
-
const wrapper = shallow(<RuleResultsUpload {...props} />);
|
|
31
|
-
expect(wrapper).toMatchSnapshot();
|
|
32
|
-
spy.mockRestore();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it("Renders upload rule results menu item if there is a domain with manage_rule_results permission", () => {
|
|
36
|
-
const props = {
|
|
37
|
-
uploadResults: jest.fn(),
|
|
38
|
-
loading: false,
|
|
39
|
-
userDomains: [
|
|
40
|
-
{
|
|
41
|
-
domains: [
|
|
42
|
-
{
|
|
43
|
-
external_id: "Truedat",
|
|
44
|
-
id: 2,
|
|
45
|
-
name: "Truedat",
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
permission: "manage_rule_results",
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
};
|
|
52
|
-
const { getByText } = render(<RuleResultsUpload {...props} />, renderOpts);
|
|
53
|
-
|
|
54
|
-
const element = getByText("Upload rule results");
|
|
55
|
-
expect(element).toBeInTheDocument()
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it("Does not render upload rule results menu item if there is no domain with manage_rule_results permission", () => {
|
|
59
|
-
const props = {
|
|
60
|
-
uploadResults: jest.fn(),
|
|
61
|
-
loading: false,
|
|
62
|
-
userDomains: [],
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const { queryByText } = render(
|
|
66
|
-
<RuleResultsUpload {...props} />,
|
|
67
|
-
renderOpts
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
const element = queryByText("Upload rule results");
|
|
71
|
-
expect(element).toBeNull();
|
|
11
|
+
it("matches the latest snapshot", async () => {
|
|
12
|
+
const { container } = render(<RuleResultsUpload />, renderOpts);
|
|
13
|
+
await waitFor(() => expect(container).toMatchSnapshot());
|
|
72
14
|
});
|
|
73
15
|
});
|
|
@@ -1,58 +1,67 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<RuleImplementationsOptions /> matches the latest loading snapshot 1`] = `
|
|
4
|
-
<Dropdown
|
|
5
|
-
additionLabel="Add "
|
|
6
|
-
additionPosition="top"
|
|
7
|
-
className="button icon group-actions button-update"
|
|
8
|
-
closeOnBlur={true}
|
|
9
|
-
closeOnEscape={true}
|
|
10
|
-
deburr={false}
|
|
11
|
-
direction="left"
|
|
12
|
-
disabled={true}
|
|
13
|
-
floating={true}
|
|
14
|
-
icon="ellipsis vertical"
|
|
15
|
-
minCharacters={1}
|
|
16
|
-
noResultsMessage="No results found."
|
|
17
|
-
openOnFocus={true}
|
|
18
|
-
renderLabel={[Function]}
|
|
19
|
-
searchInput="text"
|
|
20
|
-
selectOnBlur={true}
|
|
21
|
-
selectOnNavigation={true}
|
|
22
|
-
wrapSelection={true}
|
|
23
|
-
>
|
|
24
|
-
<DropdownMenu>
|
|
25
|
-
<Connect(RuleImplementationsDownload) />
|
|
26
|
-
<Connect(ImplementationsUploadButton) />
|
|
27
|
-
<Connect(RuleResultsUpload) />
|
|
28
|
-
</DropdownMenu>
|
|
29
|
-
</Dropdown>
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
3
|
exports[`<RuleImplementationsOptions /> matches the latest snapshot 1`] = `
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
aria-expanded="false"
|
|
7
|
+
class="ui floating dropdown button icon group-actions button-update"
|
|
8
|
+
role="listbox"
|
|
9
|
+
tabindex="0"
|
|
10
|
+
>
|
|
11
|
+
<i
|
|
12
|
+
aria-hidden="true"
|
|
13
|
+
class="ellipsis vertical icon"
|
|
14
|
+
/>
|
|
15
|
+
<div
|
|
16
|
+
class="menu transition left"
|
|
17
|
+
>
|
|
18
|
+
<div
|
|
19
|
+
aria-disabled="true"
|
|
20
|
+
class="disabled item"
|
|
21
|
+
role="option"
|
|
22
|
+
>
|
|
23
|
+
<i
|
|
24
|
+
aria-hidden="true"
|
|
25
|
+
class="download icon"
|
|
26
|
+
/>
|
|
27
|
+
<span>
|
|
28
|
+
Download with csv format
|
|
29
|
+
</span>
|
|
30
|
+
<p
|
|
31
|
+
class="menu-item-description"
|
|
32
|
+
>
|
|
33
|
+
There are no Implementations to be downloaded
|
|
34
|
+
</p>
|
|
35
|
+
</div>
|
|
36
|
+
<div
|
|
37
|
+
class="item"
|
|
38
|
+
role="option"
|
|
39
|
+
>
|
|
40
|
+
<i
|
|
41
|
+
aria-hidden="true"
|
|
42
|
+
class="upload icon"
|
|
43
|
+
/>
|
|
44
|
+
<span
|
|
45
|
+
class="text"
|
|
46
|
+
>
|
|
47
|
+
Upload Implementations
|
|
48
|
+
</span>
|
|
49
|
+
</div>
|
|
50
|
+
<div
|
|
51
|
+
class="item"
|
|
52
|
+
role="option"
|
|
53
|
+
>
|
|
54
|
+
<i
|
|
55
|
+
aria-hidden="true"
|
|
56
|
+
class="upload icon"
|
|
57
|
+
/>
|
|
58
|
+
<span
|
|
59
|
+
class="text"
|
|
60
|
+
>
|
|
61
|
+
Upload rule results
|
|
62
|
+
</span>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
58
67
|
`;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<RuleResultsUpload /> matches the latest snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="item"
|
|
7
|
+
role="option"
|
|
8
|
+
>
|
|
9
|
+
<i
|
|
10
|
+
aria-hidden="true"
|
|
11
|
+
class="upload icon"
|
|
12
|
+
/>
|
|
13
|
+
<span
|
|
14
|
+
class="text"
|
|
15
|
+
>
|
|
16
|
+
Upload rule results
|
|
17
|
+
</span>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
12
20
|
`;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clearRuleImplementations,
|
|
3
|
+
searchRuleImplementations,
|
|
4
|
+
} from "../../routines";
|
|
5
|
+
import {
|
|
6
|
+
implementationsActions,
|
|
7
|
+
initialState,
|
|
8
|
+
} from "../implementationsActions";
|
|
9
|
+
|
|
10
|
+
const fooState = { foo: "bar" };
|
|
11
|
+
const payload = {};
|
|
12
|
+
|
|
13
|
+
describe("reducers: implementationsActions", () => {
|
|
14
|
+
it("should provide the initial state", () => {
|
|
15
|
+
expect(implementationsActions(undefined, {})).toBe(initialState);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("should be the initial state after receiving the clearRuleImplementations.TRIGGER action", () => {
|
|
19
|
+
expect(
|
|
20
|
+
implementationsActions(fooState, {
|
|
21
|
+
type: clearRuleImplementations.TRIGGER,
|
|
22
|
+
payload,
|
|
23
|
+
})
|
|
24
|
+
).toBe(initialState);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("should be the initial state after receiving the searchRuleImplementations.TRIGGER action", () => {
|
|
28
|
+
expect(
|
|
29
|
+
implementationsActions(fooState, {
|
|
30
|
+
type: searchRuleImplementations.TRIGGER,
|
|
31
|
+
payload,
|
|
32
|
+
})
|
|
33
|
+
).toBe(initialState);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("should extract _actions from the searchRuleImplementations.SUCCESS action", () => {
|
|
37
|
+
const _actions = { uploadResults: { foo: "bar" } };
|
|
38
|
+
const payload = { data: { _actions } };
|
|
39
|
+
expect(
|
|
40
|
+
implementationsActions(fooState, {
|
|
41
|
+
type: searchRuleImplementations.SUCCESS,
|
|
42
|
+
payload,
|
|
43
|
+
})
|
|
44
|
+
).toMatchObject(_actions);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("should ignore unhandled actions", () => {
|
|
48
|
+
expect(implementationsActions(fooState, { type: "FOO" })).toBe(fooState);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { uploadResults } from "../../routines";
|
|
2
|
-
import {
|
|
2
|
+
import { resultsUploading } from "../resultsUploading";
|
|
3
3
|
|
|
4
4
|
const fooState = { foo: "bar" };
|
|
5
5
|
|
|
6
6
|
const initialState = false;
|
|
7
7
|
|
|
8
|
-
describe("reducers:
|
|
8
|
+
describe("reducers: resultsUploading", () => {
|
|
9
9
|
it("should provide the initial state", () => {
|
|
10
|
-
expect(
|
|
10
|
+
expect(resultsUploading(undefined, {})).toEqual(initialState);
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
it("should handle the uploadResults.TRIGGER action", () => {
|
|
14
14
|
expect(
|
|
15
|
-
|
|
15
|
+
resultsUploading(fooState, {
|
|
16
16
|
type: uploadResults.TRIGGER,
|
|
17
17
|
})
|
|
18
18
|
).toBeTruthy();
|
|
@@ -20,7 +20,7 @@ describe("reducers: uploadingResults", () => {
|
|
|
20
20
|
|
|
21
21
|
it("should handle the uploadResults.FULFILL action", () => {
|
|
22
22
|
expect(
|
|
23
|
-
|
|
23
|
+
resultsUploading(fooState, {
|
|
24
24
|
type: uploadResults.FULFILL,
|
|
25
25
|
})
|
|
26
26
|
).toBeFalsy();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clearRuleImplementations,
|
|
3
|
+
searchRuleImplementations,
|
|
4
|
+
} from "../routines";
|
|
5
|
+
|
|
6
|
+
export const initialState = null;
|
|
7
|
+
|
|
8
|
+
export const implementationsActions = (
|
|
9
|
+
state = initialState,
|
|
10
|
+
{ type, payload }
|
|
11
|
+
) => {
|
|
12
|
+
switch (type) {
|
|
13
|
+
case clearRuleImplementations.TRIGGER:
|
|
14
|
+
return initialState;
|
|
15
|
+
case searchRuleImplementations.TRIGGER:
|
|
16
|
+
return initialState;
|
|
17
|
+
case searchRuleImplementations.SUCCESS:
|
|
18
|
+
return payload?.data?._actions || initialState;
|
|
19
|
+
default:
|
|
20
|
+
return state;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default implementationsActions;
|
package/src/reducers/index.js
CHANGED
|
@@ -3,9 +3,11 @@ import { conceptRulesActions } from "./conceptRulesActions";
|
|
|
3
3
|
import { conceptRulesLoading } from "./conceptRulesLoading";
|
|
4
4
|
import { deletionQuery } from "./deletionQuery";
|
|
5
5
|
import { dqMessage } from "./dqMessage";
|
|
6
|
-
import { previousRuleImplementationQuery } from "./previousRuleImplementationQuery";
|
|
7
|
-
import { executionGroupLoading } from "./executionGroupLoading";
|
|
8
6
|
import { executionGroup } from "./executionGroup";
|
|
7
|
+
import { executionGroupLoading } from "./executionGroupLoading";
|
|
8
|
+
import { implementationsActions } from "./implementationsActions";
|
|
9
|
+
import { previousRuleImplementationQuery } from "./previousRuleImplementationQuery";
|
|
10
|
+
import { resultsUploading } from "./resultsUploading";
|
|
9
11
|
import { rule } from "./rule";
|
|
10
12
|
import { ruleActions } from "./ruleActions";
|
|
11
13
|
import { ruleActiveFilters } from "./ruleActiveFilters";
|
|
@@ -14,6 +16,7 @@ import { ruleCreating } from "./ruleCreating";
|
|
|
14
16
|
import { ruleFilters } from "./ruleFilters";
|
|
15
17
|
import { ruleFiltersLoading } from "./ruleFiltersLoading";
|
|
16
18
|
import { ruleImplementation } from "./ruleImplementation";
|
|
19
|
+
import { ruleImplementationActiveFilters } from "./ruleImplementationActiveFilters";
|
|
17
20
|
import { ruleImplementationCount } from "./ruleImplementationCount";
|
|
18
21
|
import { ruleImplementationCreating } from "./ruleImplementationCreating";
|
|
19
22
|
import { ruleImplementationFilters } from "./ruleImplementationFilters";
|
|
@@ -26,7 +29,6 @@ import { ruleImplementationSaving } from "./ruleImplementationSaving";
|
|
|
26
29
|
import { ruleImplementationSelectedFilter } from "./ruleImplementationSelectedFilter";
|
|
27
30
|
import { ruleImplementations } from "./ruleImplementations";
|
|
28
31
|
import { ruleImplementationsDownloading } from "./ruleImplementationsDownloading";
|
|
29
|
-
import { ruleImplementationActiveFilters } from "./ruleImplementationActiveFilters";
|
|
30
32
|
import { ruleImplementationsLoading } from "./ruleImplementationsLoading";
|
|
31
33
|
import { ruleImplementationsPageSize } from "./ruleImplementationsPageSize";
|
|
32
34
|
import { ruleLoading } from "./ruleLoading";
|
|
@@ -39,10 +41,9 @@ import { rulesLoading } from "./rulesLoading";
|
|
|
39
41
|
import { rulesPageSize } from "./rulesPageSize";
|
|
40
42
|
import { uploadingImplementationsFile } from "./uploadingImplementationsFile";
|
|
41
43
|
import { uploadingRulesFile } from "./uploadingRulesFile";
|
|
44
|
+
import { userImplementationsPermissions } from "./userImplementationsPermissions";
|
|
42
45
|
import { userRulePermissions } from "./userRulePermissions";
|
|
43
46
|
import { userRulesPermissions } from "./userRulesPermissions";
|
|
44
|
-
import { userImplementationsPermissions } from "./userImplementationsPermissions";
|
|
45
|
-
import { uploadingResults } from "./uploadingResults";
|
|
46
47
|
|
|
47
48
|
export {
|
|
48
49
|
conceptRules,
|
|
@@ -50,9 +51,11 @@ export {
|
|
|
50
51
|
conceptRulesLoading,
|
|
51
52
|
deletionQuery,
|
|
52
53
|
dqMessage,
|
|
53
|
-
previousRuleImplementationQuery,
|
|
54
|
-
executionGroupLoading,
|
|
55
54
|
executionGroup,
|
|
55
|
+
executionGroupLoading,
|
|
56
|
+
implementationsActions,
|
|
57
|
+
previousRuleImplementationQuery,
|
|
58
|
+
resultsUploading,
|
|
56
59
|
rule,
|
|
57
60
|
ruleActions,
|
|
58
61
|
ruleActiveFilters,
|
|
@@ -84,10 +87,9 @@ export {
|
|
|
84
87
|
rules,
|
|
85
88
|
rulesLoading,
|
|
86
89
|
rulesPageSize,
|
|
87
|
-
uploadingRulesFile,
|
|
88
90
|
uploadingImplementationsFile,
|
|
91
|
+
uploadingRulesFile,
|
|
92
|
+
userImplementationsPermissions,
|
|
89
93
|
userRulePermissions,
|
|
90
94
|
userRulesPermissions,
|
|
91
|
-
userImplementationsPermissions,
|
|
92
|
-
uploadingResults,
|
|
93
95
|
};
|
|
@@ -2,7 +2,7 @@ import { uploadResults } from "../routines";
|
|
|
2
2
|
|
|
3
3
|
const initialState = false;
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const resultsUploading = (state = initialState, { type }) => {
|
|
6
6
|
switch (type) {
|
|
7
7
|
case uploadResults.TRIGGER:
|
|
8
8
|
return true;
|
|
@@ -13,4 +13,4 @@ export const uploadingResults = (state = initialState, { type }) => {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export default
|
|
16
|
+
export default resultsUploading;
|