@truedat/dq 4.36.9 → 4.37.3
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 +26 -0
- package/package.json +4 -4
- package/src/components/ImplementationsRoutes.js +4 -0
- package/src/components/RuleEventRow.js +47 -0
- package/src/components/RuleEvents.js +31 -0
- package/src/components/RuleImplementationSelectedFilters.js +18 -0
- package/src/components/RuleImplementationsDownload.js +2 -1
- package/src/components/RuleRoutes.js +24 -0
- package/src/components/RuleSelectedFilters.js +18 -0
- package/src/components/RuleTabs.js +16 -2
- package/src/components/RulesRoutes.js +13 -1
- package/src/components/__tests__/RuleEventRow.spec.js +33 -0
- package/src/components/__tests__/RuleEvents.spec.js +64 -0
- package/src/components/__tests__/RuleImplementationEvents.spec.js +2 -3
- package/src/components/__tests__/__snapshots__/RuleEventRow.spec.js.snap +38 -0
- package/src/components/__tests__/__snapshots__/RuleEvents.spec.js.snap +78 -0
- package/src/components/__tests__/__snapshots__/RuleImplementationEvents.spec.js.snap +2 -2
- package/src/components/ruleImplementationForm/DatasetForm.js +9 -26
- package/src/components/ruleImplementationForm/FiltersField.js +2 -12
- package/src/components/ruleImplementationForm/__tests__/DataSetForm.spec.js +19 -59
- package/src/components/ruleImplementationForm/__tests__/FiltersField.spec.js +4 -18
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/DataSetForm.spec.js.snap +7 -147
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/FiltersField.spec.js.snap +7 -12
- package/src/messages/en.js +8 -0
- package/src/messages/es.js +11 -0
- package/src/reducers/__tests__/ruleActiveFilters.spec.js +19 -7
- package/src/reducers/__tests__/ruleImplementationActiveFilters.spec.js +19 -7
- package/src/reducers/index.js +0 -2
- package/src/reducers/ruleActiveFilters.js +5 -0
- package/src/reducers/ruleImplementationActiveFilters.js +7 -0
- package/src/routines.js +0 -3
- package/src/selectors/__tests__/datasetDefaultFiltersSelector.spec.js +17 -0
- package/src/selectors/__tests__/getParsedEvents.spec.js +173 -0
- package/src/selectors/datasetDefaultFiltersSelector.js +8 -0
- package/src/selectors/getParsedEvents.js +55 -0
- package/src/selectors/index.js +1 -1
- package/src/reducers/__tests__/ruleImplementationFilterValues.spec.js +0 -36
- package/src/reducers/ruleImplementationFilterValues.js +0 -20
- package/src/selectors/__tests__/getRuleImplementationFormFilters.spec.js +0 -22
- package/src/selectors/getRuleImplementationFormFilters.js +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.37.3] 2022-02-03
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- [TD-2929] Added support for `UserSearchFilters` on `Rules` and `RuleImplementations`
|
|
8
|
+
|
|
9
|
+
## [4.37.2] 2022-02-02
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- [TD-4294] Rule audit tab
|
|
14
|
+
|
|
15
|
+
## [4.37.1] 2022-02-02
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- [TD-4152] Include aditional information on implementations download
|
|
20
|
+
|
|
21
|
+
## [4.37.0] 2022-01-25
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- [TD-2564] `DatasetForm` now has a configurable `defaultFilters` prop
|
|
26
|
+
- Simplified `DatasetForm` and `FiltersField` components by removing obscure
|
|
27
|
+
code for installation-specific custom filters
|
|
28
|
+
|
|
3
29
|
## [4.36.4] 2022-01-19
|
|
4
30
|
|
|
5
31
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dq",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.37.3",
|
|
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.
|
|
86
|
-
"@truedat/df": "4.
|
|
85
|
+
"@truedat/core": "4.37.3",
|
|
86
|
+
"@truedat/df": "4.37.3",
|
|
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": "1c418784d34e171a6d62dd7fab3dfd05400998ba"
|
|
107
107
|
}
|
|
@@ -8,6 +8,9 @@ import RuleImplementationsLoader from "./RuleImplementationsLoader";
|
|
|
8
8
|
const TemplatesLoader = React.lazy(() =>
|
|
9
9
|
import("@truedat/df/templates/components/TemplatesLoader")
|
|
10
10
|
);
|
|
11
|
+
const UserSearchFiltersLoader = React.lazy(() =>
|
|
12
|
+
import("@truedat/dd/components/UserSearchFiltersLoader")
|
|
13
|
+
);
|
|
11
14
|
|
|
12
15
|
const ImplementationsRoutes = () => (
|
|
13
16
|
<Route
|
|
@@ -17,6 +20,7 @@ const ImplementationsRoutes = () => (
|
|
|
17
20
|
<RuleImplementationsLoader />
|
|
18
21
|
<ImplementationFiltersLoader />
|
|
19
22
|
<TemplatesLoader scope="qe" />
|
|
23
|
+
<UserSearchFiltersLoader scope="rule_implementation" />
|
|
20
24
|
<RuleImplementations exact />
|
|
21
25
|
</>
|
|
22
26
|
)}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { Feed } from "semantic-ui-react";
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
6
|
+
import Moment from "react-moment";
|
|
7
|
+
|
|
8
|
+
export const RuleEventRow = ({ user, user_name, ts, payload }) => {
|
|
9
|
+
const { formatMessage, locale } = useIntl();
|
|
10
|
+
const userName = _.propOr(user_name, "user_name")(user);
|
|
11
|
+
|
|
12
|
+
return _.isEmpty(payload) ? null : (
|
|
13
|
+
<Feed.Event>
|
|
14
|
+
<Feed.Content>
|
|
15
|
+
<Feed.Summary>
|
|
16
|
+
<Feed.User>{userName}</Feed.User>{" "}
|
|
17
|
+
<Feed.Date>
|
|
18
|
+
<Moment locale={locale} date={ts} format="YYYY-MM-DD HH:mm" />
|
|
19
|
+
</Feed.Date>
|
|
20
|
+
</Feed.Summary>
|
|
21
|
+
{payload.map(({ field, action, value }, i) => (
|
|
22
|
+
<Feed.Extra
|
|
23
|
+
key={i}
|
|
24
|
+
text
|
|
25
|
+
content={formatMessage(
|
|
26
|
+
{
|
|
27
|
+
id: `rules.events.action_${action}${
|
|
28
|
+
typeof value === "undefined" || _.isObject(value) ? "" : "_to"
|
|
29
|
+
}`,
|
|
30
|
+
},
|
|
31
|
+
[field, JSON.stringify(value)]
|
|
32
|
+
)}
|
|
33
|
+
/>
|
|
34
|
+
))}
|
|
35
|
+
</Feed.Content>
|
|
36
|
+
</Feed.Event>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
RuleEventRow.propTypes = {
|
|
41
|
+
user: PropTypes.object,
|
|
42
|
+
user_name: PropTypes.string,
|
|
43
|
+
ts: PropTypes.string,
|
|
44
|
+
payload: PropTypes.array,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default RuleEventRow;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { Feed, Segment } from "semantic-ui-react";
|
|
4
|
+
import { connect } from "react-redux";
|
|
5
|
+
import { getParsedEvents } from "../selectors";
|
|
6
|
+
import { RuleEventRow } from "./RuleEventRow";
|
|
7
|
+
|
|
8
|
+
export const RuleEvents = ({ events, eventsLoading }) => {
|
|
9
|
+
return eventsLoading ? null : (
|
|
10
|
+
<Segment attached="bottom">
|
|
11
|
+
<Feed size="small">
|
|
12
|
+
{events.map((e, i) => (
|
|
13
|
+
<RuleEventRow key={i} {...e} />
|
|
14
|
+
))}
|
|
15
|
+
</Feed>
|
|
16
|
+
</Segment>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
RuleEvents.propTypes = {
|
|
20
|
+
events: PropTypes.array.isRequired,
|
|
21
|
+
eventsLoading: PropTypes.bool,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const mapStateToProps = (state) => {
|
|
25
|
+
return {
|
|
26
|
+
events: getParsedEvents(state),
|
|
27
|
+
eventsLoading: state.eventsLoading,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default connect(mapStateToProps)(RuleEvents);
|
|
@@ -4,6 +4,11 @@ import { connect } from "react-redux";
|
|
|
4
4
|
import { injectIntl } from "react-intl";
|
|
5
5
|
import { makeOption } from "@truedat/core/services/i18n";
|
|
6
6
|
import { SelectedFilters } from "@truedat/core/components";
|
|
7
|
+
import {
|
|
8
|
+
applyUserSearchFilter,
|
|
9
|
+
deleteUserSearchFilter,
|
|
10
|
+
saveUserSearchFilters,
|
|
11
|
+
} from "@truedat/dd/routines";
|
|
7
12
|
import {
|
|
8
13
|
closeImplementationFilter,
|
|
9
14
|
openImplementationFilter,
|
|
@@ -30,23 +35,36 @@ export const mapStateToProps = (state, ownProps) => {
|
|
|
30
35
|
_.map(makeOption(translations(formatMessage), selectedFilter))
|
|
31
36
|
)(state);
|
|
32
37
|
|
|
38
|
+
const {
|
|
39
|
+
selectedUserSearchFilter: selectedUserFilter,
|
|
40
|
+
ruleImplementationActiveFilters: activeFilters,
|
|
41
|
+
userSearchFilters: userFilters,
|
|
42
|
+
} = state;
|
|
43
|
+
|
|
33
44
|
return {
|
|
34
45
|
selectedFilter,
|
|
35
46
|
selectedFilters: getRuleImplementationSelectedFilters(state),
|
|
36
47
|
selectedFilterActiveValues:
|
|
37
48
|
getRuleImplementationSelectedFilterActiveValues(state),
|
|
38
49
|
selectedFilterValues: i18nValues,
|
|
50
|
+
selectedUserFilter,
|
|
51
|
+
activeFilters,
|
|
52
|
+
userFilters,
|
|
53
|
+
userFilterScope: "rule_implementation",
|
|
39
54
|
};
|
|
40
55
|
};
|
|
41
56
|
|
|
42
57
|
const mapDispatchToProps = (dispatch) =>
|
|
43
58
|
bindActionCreators(
|
|
44
59
|
{
|
|
60
|
+
applyUserFilter: applyUserSearchFilter,
|
|
45
61
|
closeFilter: closeImplementationFilter,
|
|
62
|
+
deleteUserFilter: deleteUserSearchFilter,
|
|
46
63
|
openFilter: openImplementationFilter,
|
|
47
64
|
removeFilter: removeImplementationFilter,
|
|
48
65
|
resetFilters: resetImplementationFilters,
|
|
49
66
|
toggleFilterValue: toggleImplementationFilterValue,
|
|
67
|
+
saveFilters: saveUserSearchFilters,
|
|
50
68
|
},
|
|
51
69
|
dispatch
|
|
52
70
|
);
|
|
@@ -9,6 +9,7 @@ import { useAuthorized } from "@truedat/core/hooks";
|
|
|
9
9
|
import {
|
|
10
10
|
RULE,
|
|
11
11
|
RULE_EDIT,
|
|
12
|
+
RULE_EVENTS,
|
|
12
13
|
RULE_IMPLEMENTATION_RESULT_DETAILS,
|
|
13
14
|
RULE_IMPLEMENTATION_RESULTS_DETAILS,
|
|
14
15
|
RULE_IMPLEMENTATION,
|
|
@@ -32,6 +33,7 @@ import NewRule from "./NewRule";
|
|
|
32
33
|
import NewRuleImplementation from "./NewRuleImplementation";
|
|
33
34
|
import Rule from "./Rule";
|
|
34
35
|
import RuleCrumbs from "./RuleCrumbs";
|
|
36
|
+
import RuleEvents from "./RuleEvents";
|
|
35
37
|
import RuleImplementation from "./RuleImplementation";
|
|
36
38
|
import RuleImplementationEvents from "./RuleImplementationEvents";
|
|
37
39
|
import RuleImplementationLoader from "./RuleImplementationLoader";
|
|
@@ -61,6 +63,12 @@ const ImplementationStructuresLoader = React.lazy(() =>
|
|
|
61
63
|
const QualityTemplatesLoader = () => <TemplatesLoader scope="dq" />;
|
|
62
64
|
const ImplementationTemplatesLoader = () => <TemplatesLoader scope="ri" />;
|
|
63
65
|
|
|
66
|
+
const RuleEventsLoader = () => {
|
|
67
|
+
const match = useRouteMatch();
|
|
68
|
+
const id = _.path("params.id")(match);
|
|
69
|
+
return <EventsLoader resource_id={id} resource_type="rule" />;
|
|
70
|
+
};
|
|
71
|
+
|
|
64
72
|
const ImplementationEventsLoader = () => {
|
|
65
73
|
const match = useRouteMatch();
|
|
66
74
|
const id = _.path("params.implementation_id")(match);
|
|
@@ -135,6 +143,22 @@ const RuleRoutes = ({
|
|
|
135
143
|
</>
|
|
136
144
|
)}
|
|
137
145
|
/>
|
|
146
|
+
|
|
147
|
+
<Route
|
|
148
|
+
exact
|
|
149
|
+
path={RULE_EVENTS}
|
|
150
|
+
render={() => (
|
|
151
|
+
<>
|
|
152
|
+
<RuleCrumbs />
|
|
153
|
+
<Segment>
|
|
154
|
+
<RuleEventsLoader />
|
|
155
|
+
{ruleLoaded && <Rule />}
|
|
156
|
+
{ruleLoaded && <RuleEvents />}
|
|
157
|
+
</Segment>
|
|
158
|
+
</>
|
|
159
|
+
)}
|
|
160
|
+
/>
|
|
161
|
+
|
|
138
162
|
<Route
|
|
139
163
|
exact
|
|
140
164
|
path={RULE_IMPLEMENTATIONS}
|
|
@@ -4,6 +4,11 @@ import { connect } from "react-redux";
|
|
|
4
4
|
import { injectIntl } from "react-intl";
|
|
5
5
|
import { makeOption } from "@truedat/core/services/i18n";
|
|
6
6
|
import { SelectedFilters } from "@truedat/core/components";
|
|
7
|
+
import {
|
|
8
|
+
applyUserSearchFilter,
|
|
9
|
+
deleteUserSearchFilter,
|
|
10
|
+
saveUserSearchFilters,
|
|
11
|
+
} from "@truedat/dd/routines";
|
|
7
12
|
import {
|
|
8
13
|
closeRuleFilter,
|
|
9
14
|
openRuleFilter,
|
|
@@ -30,22 +35,35 @@ export const mapStateToProps = (state, ownProps) => {
|
|
|
30
35
|
_.map(makeOption(translations(formatMessage), selectedFilter))
|
|
31
36
|
)(state);
|
|
32
37
|
|
|
38
|
+
const {
|
|
39
|
+
selectedUserSearchFilter: selectedUserFilter,
|
|
40
|
+
ruleActiveFilters: activeFilters,
|
|
41
|
+
userSearchFilters: userFilters,
|
|
42
|
+
} = state;
|
|
43
|
+
|
|
33
44
|
return {
|
|
34
45
|
selectedFilter,
|
|
35
46
|
selectedFilters: getRuleSelectedFilters(state),
|
|
36
47
|
selectedFilterActiveValues: getRuleSelectedFilterActiveValues(state),
|
|
37
48
|
selectedFilterValues: i18nValues,
|
|
49
|
+
selectedUserFilter,
|
|
50
|
+
activeFilters,
|
|
51
|
+
userFilters,
|
|
52
|
+
userFilterScope: "rule",
|
|
38
53
|
};
|
|
39
54
|
};
|
|
40
55
|
|
|
41
56
|
const mapDispatchToProps = (dispatch) =>
|
|
42
57
|
bindActionCreators(
|
|
43
58
|
{
|
|
59
|
+
applyUserFilter: applyUserSearchFilter,
|
|
44
60
|
closeFilter: closeRuleFilter,
|
|
61
|
+
deleteUserFilter: deleteUserSearchFilter,
|
|
45
62
|
openFilter: openRuleFilter,
|
|
46
63
|
removeFilter: removeRuleFilter,
|
|
47
64
|
resetFilters: resetRuleFilters,
|
|
48
65
|
toggleFilterValue: toggleRuleFilterValue,
|
|
66
|
+
saveFilters: saveUserSearchFilters,
|
|
49
67
|
},
|
|
50
68
|
dispatch
|
|
51
69
|
);
|
|
@@ -6,7 +6,12 @@ import { Link } from "react-router-dom";
|
|
|
6
6
|
import { connect } from "react-redux";
|
|
7
7
|
import { FormattedMessage } from "react-intl";
|
|
8
8
|
import { usePath } from "@truedat/core/hooks";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
RULE,
|
|
11
|
+
RULE_IMPLEMENTATIONS,
|
|
12
|
+
RULE_EVENTS,
|
|
13
|
+
linkTo,
|
|
14
|
+
} from "@truedat/core/routes";
|
|
10
15
|
|
|
11
16
|
const RuleTabs = ({ rule }) => {
|
|
12
17
|
const path = usePath();
|
|
@@ -22,12 +27,21 @@ const RuleTabs = ({ rule }) => {
|
|
|
22
27
|
>
|
|
23
28
|
<FormattedMessage id="tabs.dq.ruleImplementations" />
|
|
24
29
|
</Menu.Item>
|
|
30
|
+
<Menu.Item
|
|
31
|
+
active={path === RULE_EVENTS}
|
|
32
|
+
as={Link}
|
|
33
|
+
to={linkTo.RULE_EVENTS({
|
|
34
|
+
id: rule.id,
|
|
35
|
+
})}
|
|
36
|
+
>
|
|
37
|
+
<FormattedMessage id="tabs.dq.rule.audit" />
|
|
38
|
+
</Menu.Item>
|
|
25
39
|
</Menu>
|
|
26
40
|
);
|
|
27
41
|
};
|
|
28
42
|
|
|
29
43
|
RuleTabs.propTypes = {
|
|
30
|
-
rule: PropTypes.object
|
|
44
|
+
rule: PropTypes.object,
|
|
31
45
|
};
|
|
32
46
|
|
|
33
47
|
const mapStateToProps = ({ rule }) => ({ rule });
|
|
@@ -13,13 +13,25 @@ const DomainsLoader = React.lazy(() =>
|
|
|
13
13
|
const TemplatesLoader = React.lazy(() =>
|
|
14
14
|
import("@truedat/df/templates/components/TemplatesLoader")
|
|
15
15
|
);
|
|
16
|
+
const UserSearchFiltersLoader = React.lazy(() =>
|
|
17
|
+
import("@truedat/dd/components/UserSearchFiltersLoader")
|
|
18
|
+
);
|
|
16
19
|
const QualityTemplatesLoader = () => <TemplatesLoader scope="dq" />;
|
|
17
20
|
|
|
18
21
|
const RulesRoutes = () => (
|
|
19
22
|
<>
|
|
20
23
|
<Route path={RULES} component={RulesLoader} />
|
|
21
24
|
<Route path={RULES} component={RuleFiltersLoader} />
|
|
22
|
-
<Route
|
|
25
|
+
<Route
|
|
26
|
+
exact
|
|
27
|
+
path={RULES}
|
|
28
|
+
render={() => (
|
|
29
|
+
<>
|
|
30
|
+
<UserSearchFiltersLoader scope="rule" />
|
|
31
|
+
<Rules />
|
|
32
|
+
</>
|
|
33
|
+
)}
|
|
34
|
+
/>
|
|
23
35
|
<Switch>
|
|
24
36
|
<Route
|
|
25
37
|
exact
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import { RuleEventRow } from "../RuleEventRow";
|
|
4
|
+
|
|
5
|
+
describe("<RuleEventsRow />", () => {
|
|
6
|
+
const props = {
|
|
7
|
+
payload: [
|
|
8
|
+
{
|
|
9
|
+
field: "field1",
|
|
10
|
+
action: "changed",
|
|
11
|
+
value: "new value",
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
user_name: "some.user@domain.tld",
|
|
15
|
+
user: {
|
|
16
|
+
email: "some.user@domain.tld",
|
|
17
|
+
full_name: "Some User",
|
|
18
|
+
id: 142,
|
|
19
|
+
user_name: "some.user@domain.tld",
|
|
20
|
+
},
|
|
21
|
+
ts: "2021-09-16T07:36:32.848603Z",
|
|
22
|
+
};
|
|
23
|
+
const renderOpts = {
|
|
24
|
+
messages: {
|
|
25
|
+
en: { "rules.events.action_changed_to": "Field {0} changed to: {1}" },
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
it("matches the latest snapshot", () => {
|
|
30
|
+
const { container } = render(<RuleEventRow {...props} />, renderOpts);
|
|
31
|
+
expect(container).toMatchSnapshot();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import { RuleEvents } from "../RuleEvents";
|
|
4
|
+
import { getParsedEvents } from "../../selectors/getParsedEvents";
|
|
5
|
+
|
|
6
|
+
describe("<RuleEvents />", () => {
|
|
7
|
+
const events = [
|
|
8
|
+
{
|
|
9
|
+
id: 100217,
|
|
10
|
+
service: "td_dd",
|
|
11
|
+
resource_id: 777,
|
|
12
|
+
resource_type: "rule",
|
|
13
|
+
event: "rule_updated",
|
|
14
|
+
payload: {
|
|
15
|
+
domain_id: 140,
|
|
16
|
+
},
|
|
17
|
+
user_id: 142,
|
|
18
|
+
user_name: null,
|
|
19
|
+
user: {
|
|
20
|
+
email: "some.user@domain.tld",
|
|
21
|
+
full_name: "Some User",
|
|
22
|
+
id: 142,
|
|
23
|
+
user_name: "some.user@domain.tld",
|
|
24
|
+
},
|
|
25
|
+
ts: "2021-09-16T07:36:32.848603Z",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 100436,
|
|
29
|
+
service: "td_dd",
|
|
30
|
+
resource_id: 777,
|
|
31
|
+
resource_type: "rule",
|
|
32
|
+
event: "rule_updated",
|
|
33
|
+
payload: {
|
|
34
|
+
domain_id: 168,
|
|
35
|
+
},
|
|
36
|
+
user_id: 171,
|
|
37
|
+
user_name: null,
|
|
38
|
+
user: {
|
|
39
|
+
email: "some.user@domain.tld",
|
|
40
|
+
full_name: "Some User",
|
|
41
|
+
id: 171,
|
|
42
|
+
user_name: "some.user",
|
|
43
|
+
},
|
|
44
|
+
ts: "2021-09-16T09:31:03.061864Z",
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
const renderOpts = {
|
|
48
|
+
messages: {
|
|
49
|
+
en: {
|
|
50
|
+
"rules.events.action_created": "Rule created",
|
|
51
|
+
"rules.events.action_changed": "Field {0} changed: {1}",
|
|
52
|
+
"rules.events.action_changed_to": "Field {0} changed to: {1}",
|
|
53
|
+
"rules.events.action_updated": "Rule updated",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const props = { events: getParsedEvents({ events }), eventsLoading: false };
|
|
59
|
+
|
|
60
|
+
it("matches the latest snapshot", () => {
|
|
61
|
+
const { container } = render(<RuleEvents {...props} />, renderOpts);
|
|
62
|
+
expect(container).toMatchSnapshot();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -24,9 +24,8 @@ describe("<RuleImplementationEvents />", () => {
|
|
|
24
24
|
const renderOpts = {
|
|
25
25
|
messages: {
|
|
26
26
|
en: {
|
|
27
|
-
"ruleImplementations.events.
|
|
28
|
-
"ruleImplementations.events.
|
|
29
|
-
"implementation deprecated",
|
|
27
|
+
"ruleImplementations.events.action_deprecated": "deprecated",
|
|
28
|
+
"ruleImplementations.events.action_restored": "restored",
|
|
30
29
|
},
|
|
31
30
|
},
|
|
32
31
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<RuleEventsRow /> matches the latest snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="event"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="content"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="summary"
|
|
13
|
+
>
|
|
14
|
+
<a
|
|
15
|
+
class="user"
|
|
16
|
+
>
|
|
17
|
+
some.user@domain.tld
|
|
18
|
+
</a>
|
|
19
|
+
|
|
20
|
+
<div
|
|
21
|
+
class="date"
|
|
22
|
+
>
|
|
23
|
+
<time
|
|
24
|
+
datetime="1631777792848"
|
|
25
|
+
>
|
|
26
|
+
2021-09-16 07:36
|
|
27
|
+
</time>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
<div
|
|
31
|
+
class="text extra"
|
|
32
|
+
>
|
|
33
|
+
Field field1 changed to: "new value"
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
`;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<RuleEvents /> matches the latest snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui bottom attached segment"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="ui small feed"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="event"
|
|
13
|
+
>
|
|
14
|
+
<div
|
|
15
|
+
class="content"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
class="summary"
|
|
19
|
+
>
|
|
20
|
+
<a
|
|
21
|
+
class="user"
|
|
22
|
+
>
|
|
23
|
+
some.user@domain.tld
|
|
24
|
+
</a>
|
|
25
|
+
|
|
26
|
+
<div
|
|
27
|
+
class="date"
|
|
28
|
+
>
|
|
29
|
+
<time
|
|
30
|
+
datetime="1631777792848"
|
|
31
|
+
>
|
|
32
|
+
2021-09-16 07:36
|
|
33
|
+
</time>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div
|
|
37
|
+
class="text extra"
|
|
38
|
+
>
|
|
39
|
+
Field domain_id changed to: 140
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div
|
|
44
|
+
class="event"
|
|
45
|
+
>
|
|
46
|
+
<div
|
|
47
|
+
class="content"
|
|
48
|
+
>
|
|
49
|
+
<div
|
|
50
|
+
class="summary"
|
|
51
|
+
>
|
|
52
|
+
<a
|
|
53
|
+
class="user"
|
|
54
|
+
>
|
|
55
|
+
some.user
|
|
56
|
+
</a>
|
|
57
|
+
|
|
58
|
+
<div
|
|
59
|
+
class="date"
|
|
60
|
+
>
|
|
61
|
+
<time
|
|
62
|
+
datetime="1631784663061"
|
|
63
|
+
>
|
|
64
|
+
2021-09-16 09:31
|
|
65
|
+
</time>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div
|
|
69
|
+
class="text extra"
|
|
70
|
+
>
|
|
71
|
+
Field domain_id changed to: 168
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
`;
|
|
@@ -34,7 +34,7 @@ exports[`<RuleImplementationEvents /> matches the latest snapshot 1`] = `
|
|
|
34
34
|
<div
|
|
35
35
|
class="text extra"
|
|
36
36
|
>
|
|
37
|
-
|
|
37
|
+
restored
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
40
|
</div>
|
|
@@ -64,7 +64,7 @@ exports[`<RuleImplementationEvents /> matches the latest snapshot 1`] = `
|
|
|
64
64
|
<div
|
|
65
65
|
class="text extra"
|
|
66
66
|
>
|
|
67
|
-
|
|
67
|
+
deprecated
|
|
68
68
|
</div>
|
|
69
69
|
</div>
|
|
70
70
|
</div>
|