@truedat/dd 4.53.1 → 4.53.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
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
## [4.53.3] 2022-10-07
|
|
5
|
+
|
|
6
|
+
### Added
|
|
7
|
+
|
|
8
|
+
- [TD-5195] Support for global user filters
|
|
9
|
+
|
|
10
|
+
## [4.53.2] 2022-10-07
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- [TD-5226] Use `useOperators` hook to load operators
|
|
15
|
+
|
|
3
16
|
## [4.53.1] 2022-10-05
|
|
4
17
|
|
|
5
18
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "4.53.
|
|
3
|
+
"version": "4.53.3",
|
|
4
4
|
"description": "Truedat Web Data Dictionary",
|
|
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.53.
|
|
37
|
+
"@truedat/test": "4.53.3",
|
|
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,9 +88,9 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@apollo/client": "^3.6.4",
|
|
91
|
-
"@truedat/auth": "4.53.
|
|
92
|
-
"@truedat/core": "4.53.
|
|
93
|
-
"@truedat/df": "4.53.
|
|
91
|
+
"@truedat/auth": "4.53.3",
|
|
92
|
+
"@truedat/core": "4.53.3",
|
|
93
|
+
"@truedat/df": "4.53.3",
|
|
94
94
|
"lodash": "^4.17.21",
|
|
95
95
|
"path-to-regexp": "^1.7.0",
|
|
96
96
|
"prop-types": "^15.8.1",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"react-dom": ">= 16.8.6 < 17",
|
|
113
113
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "d4f6cc40692e4d1e3f13e42774938765fe49c3b7"
|
|
116
116
|
}
|
|
@@ -3,7 +3,6 @@ import _ from "lodash/fp";
|
|
|
3
3
|
import React, { useState, useEffect } from "react";
|
|
4
4
|
import { Link, useLocation, useHistory } from "react-router-dom";
|
|
5
5
|
import PropTypes from "prop-types";
|
|
6
|
-
import { bindActionCreators } from "redux";
|
|
7
6
|
import { connect } from "react-redux";
|
|
8
7
|
import { useIntl } from "react-intl";
|
|
9
8
|
import {
|
|
@@ -16,9 +15,10 @@ import {
|
|
|
16
15
|
Grid,
|
|
17
16
|
Form,
|
|
18
17
|
} from "semantic-ui-react";
|
|
18
|
+
import { Loading } from "@truedat/core/components";
|
|
19
|
+
import { useOperators } from "@truedat/core/hooks";
|
|
19
20
|
import { GRANTS_REQUESTS_CHECKOUT, STRUCTURES } from "@truedat/core/routes";
|
|
20
21
|
import { FiltersGrid } from "@truedat/dq/components/ruleImplementationForm/FiltersGrid";
|
|
21
|
-
import { getRuleImplementationOperators } from "@truedat/dq/selectors/getRuleImplementationOperators";
|
|
22
22
|
import {
|
|
23
23
|
removeGrantRequestFromCart,
|
|
24
24
|
updateGrantRequestFilter,
|
|
@@ -142,22 +142,24 @@ StructureGrantCart.propTypes = {
|
|
|
142
142
|
updateGrantRequestFilter: PropTypes.func,
|
|
143
143
|
};
|
|
144
144
|
|
|
145
|
-
const
|
|
146
|
-
const {
|
|
147
|
-
return
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
authorized: _.pathOr(false, "request_grant")(userPermissions),
|
|
151
|
-
typeOperators: getRuleImplementationOperators(state),
|
|
152
|
-
};
|
|
145
|
+
export const StructureGrantCartLoader = (props) => {
|
|
146
|
+
const { data, error, loading } = useOperators();
|
|
147
|
+
if (error) return null;
|
|
148
|
+
if (loading) return <Loading />;
|
|
149
|
+
return <StructureGrantCart typeOperators={data} {...props} />;
|
|
153
150
|
};
|
|
154
|
-
const mapDispatchToProps = (dispatch) =>
|
|
155
|
-
bindActionCreators(
|
|
156
|
-
{
|
|
157
|
-
removeGrantRequestFromCart,
|
|
158
|
-
updateGrantRequestFilter,
|
|
159
|
-
},
|
|
160
|
-
dispatch
|
|
161
|
-
);
|
|
162
151
|
|
|
163
|
-
export
|
|
152
|
+
export const mapStateToProps = ({
|
|
153
|
+
structure,
|
|
154
|
+
grantRequestsCart,
|
|
155
|
+
userPermissions,
|
|
156
|
+
}) => ({
|
|
157
|
+
structure,
|
|
158
|
+
grantRequestsCart,
|
|
159
|
+
authorized: _.pathOr(false, "request_grant")(userPermissions),
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
export default connect(mapStateToProps, {
|
|
163
|
+
removeGrantRequestFromCart,
|
|
164
|
+
updateGrantRequestFilter,
|
|
165
|
+
})(StructureGrantCartLoader);
|
|
@@ -33,12 +33,14 @@ describe("sagas: saveStructureFiltersSaga", () => {
|
|
|
33
33
|
filterName: "a",
|
|
34
34
|
filters: { country: ["A"] },
|
|
35
35
|
scope: "data_structure",
|
|
36
|
+
isGlobal: true,
|
|
36
37
|
};
|
|
37
38
|
const requestData = {
|
|
38
39
|
user_search_filter: {
|
|
39
40
|
name: "a",
|
|
40
41
|
filters: { country: ["A"] },
|
|
41
42
|
scope: "data_structure",
|
|
43
|
+
is_global: true,
|
|
42
44
|
},
|
|
43
45
|
};
|
|
44
46
|
it("should put a success action when a response is returned", () => {
|
|
@@ -5,10 +5,15 @@ import { API_USER_SEARCH_FILTERS } from "../api";
|
|
|
5
5
|
|
|
6
6
|
export function* saveUserSearchFiltersSaga({ payload }) {
|
|
7
7
|
try {
|
|
8
|
-
const { filterName, filters, scope } = payload;
|
|
8
|
+
const { filterName, filters, scope, isGlobal } = payload;
|
|
9
9
|
const url = API_USER_SEARCH_FILTERS;
|
|
10
10
|
const requestData = {
|
|
11
|
-
user_search_filter: {
|
|
11
|
+
user_search_filter: {
|
|
12
|
+
name: filterName,
|
|
13
|
+
filters,
|
|
14
|
+
scope,
|
|
15
|
+
is_global: isGlobal,
|
|
16
|
+
},
|
|
12
17
|
};
|
|
13
18
|
yield put({ ...saveUserSearchFilters.request() });
|
|
14
19
|
const { data } = yield call(apiJsonPost, url, requestData, JSON_OPTS);
|