@truedat/dd 7.0.1 → 7.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
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.5",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "7.0.1",
37
+ "@truedat/test": "7.0.2",
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.7.1",
91
- "@truedat/auth": "7.0.1",
92
- "@truedat/core": "7.0.1",
93
- "@truedat/df": "7.0.1",
91
+ "@truedat/auth": "7.0.2",
92
+ "@truedat/core": "7.0.2",
93
+ "@truedat/df": "7.0.2",
94
94
  "lodash": "^4.17.21",
95
95
  "moment": "^2.29.4",
96
96
  "path-to-regexp": "^1.7.0",
@@ -115,5 +115,5 @@
115
115
  "react-dom": ">= 16.8.6 < 17",
116
116
  "semantic-ui-react": ">= 2.0.3 < 2.2"
117
117
  },
118
- "gitHead": "fff3313b142abb69e4d4139e0b6fd85d1af1a898"
118
+ "gitHead": "09343887ddeed9a87dffd993a089458eb9d06363"
119
119
  }
@@ -25,40 +25,33 @@ export const StructureGrantCartUserSelector = ({
25
25
  const [domainIds, setDomainIds] = useState([]);
26
26
  const [selectedRoles, setSelectedRoles] = useState([]);
27
27
  const [selectedRoleIds, setSelectedRoleIds] = useState([]);
28
-
29
- const [userId, setUserId] = useState(_.path("user.id")(grantRequestsCart));
28
+ const [userId, setUserId] = useState(null);
30
29
 
31
30
  const { modificationGrant } = grantRequestsCart;
32
31
  const updateGrant = !_.isEmpty(modificationGrant);
33
-
34
32
  const domainActions = ["publishGrantRequest"];
35
33
 
36
34
  const { data: roles } = useRoles();
37
35
 
36
+ useEffect(() => {
37
+ if (!_.isNil(modificationGrant?.user_id)) {
38
+ selectUser(modificationGrant?.user_id);
39
+ } else if (!_.isNil(grantRequestsCart?.user?.id) && !_.isEmpty(options)) {
40
+ _.flow(
41
+ _.find({ value: userId }),
42
+ _.pathOr(null, "value"),
43
+ selectUser
44
+ )(options);
45
+ }
46
+ }, [grantRequestsCart?.user?.id, modificationGrant?.user_id, options]);
47
+
38
48
  useEffect(() => {
39
49
  updateGrantRequestUser({
40
50
  id: userId,
41
51
  valid:
42
52
  !thirdParty || (thirdParty && !(_.isNil(userId) && _.isEmpty(userId))),
43
53
  });
44
- if (updateGrant && modificationGrant.user_id)
45
- setUserId(modificationGrant.user_id);
46
- }, [
47
- modificationGrant,
48
- thirdParty,
49
- updateGrant,
50
- updateGrantRequestUser,
51
- userId,
52
- ]);
53
-
54
- useEffect(() => {
55
- _.flow(
56
- _.filter({ value: userId }),
57
- _.first,
58
- _.pathOr(null, "value"),
59
- selectUser
60
- )(options);
61
- }, [userId, options]);
54
+ }, [thirdParty, updateGrantRequestUser, userId]);
62
55
 
63
56
  useEffect(() => {
64
57
  _.flow(
@@ -145,7 +138,6 @@ export const StructureGrantCartUserSelector = ({
145
138
  domains={domainIds}
146
139
  roles={selectedRoleIds}
147
140
  permission="allow_foreign_grant_request"
148
- hideLoading
149
141
  />
150
142
  <Form.Dropdown
151
143
  placeholder={formatMessage({