@truedat/dd 8.4.3 → 8.4.5
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 +3 -3
- package/src/components/StructureGrantCartCheckout.js +227 -73
- package/src/components/StructureGrantCartInformation.js +11 -0
- package/src/components/StructureGrantCartUserSelector.js +25 -10
- package/src/components/__tests__/StructureGrantCartCheckout.spec.js +213 -12
- package/src/components/__tests__/__snapshots__/StructureGrantCartCheckout.spec.js.snap +807 -81
- package/src/components/__tests__/__snapshots__/StructureGrantCartInformation.spec.js.snap +0 -31
- package/src/reducers/grantRequestsCart.js +13 -0
- package/src/routines.js +3 -0
|
@@ -14,37 +14,6 @@ exports[`<StructureGrantCartInformation /> matches the latest snapshot 1`] = `
|
|
|
14
14
|
>
|
|
15
15
|
structure.grant.cart.template
|
|
16
16
|
</div>
|
|
17
|
-
<div
|
|
18
|
-
class="ui segment"
|
|
19
|
-
>
|
|
20
|
-
<h4
|
|
21
|
-
class="ui header"
|
|
22
|
-
>
|
|
23
|
-
g1
|
|
24
|
-
</h4>
|
|
25
|
-
<div
|
|
26
|
-
class="field"
|
|
27
|
-
data-testid="form-field"
|
|
28
|
-
>
|
|
29
|
-
<label>
|
|
30
|
-
field1
|
|
31
|
-
</label>
|
|
32
|
-
<div
|
|
33
|
-
class="field"
|
|
34
|
-
>
|
|
35
|
-
<div
|
|
36
|
-
class="ui input"
|
|
37
|
-
>
|
|
38
|
-
<input
|
|
39
|
-
name="field1"
|
|
40
|
-
placeholder="field1"
|
|
41
|
-
type="text"
|
|
42
|
-
value=""
|
|
43
|
-
/>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
17
|
</form>
|
|
49
18
|
</div>
|
|
50
19
|
</div>
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
updateGrantRequestTemplateContent,
|
|
13
13
|
updateGrantRequestTemplateContentForGroup,
|
|
14
14
|
updateGrantRequestUser,
|
|
15
|
+
updateGrantRequestUserForGroup,
|
|
15
16
|
} from "../routines";
|
|
16
17
|
import { formatLegacyContent } from "@truedat/df/utils";
|
|
17
18
|
|
|
@@ -21,6 +22,7 @@ const initialState = {
|
|
|
21
22
|
templateContent: {},
|
|
22
23
|
modificationGrant: null,
|
|
23
24
|
user: { id: null, valid: true },
|
|
25
|
+
groupUsers: {},
|
|
24
26
|
};
|
|
25
27
|
const mapPayload = (payload) =>
|
|
26
28
|
payload?.class === "field" ? { ...payload, filters: [] } : payload;
|
|
@@ -79,6 +81,17 @@ const grantRequestsCart = (state = initialState, { type, payload }) => {
|
|
|
79
81
|
valid: payload.valid,
|
|
80
82
|
},
|
|
81
83
|
};
|
|
84
|
+
case updateGrantRequestUserForGroup.TRIGGER: {
|
|
85
|
+
const { key, userId, valid } = payload;
|
|
86
|
+
const groupUsers = _.getOr({}, "groupUsers", state);
|
|
87
|
+
return {
|
|
88
|
+
...state,
|
|
89
|
+
groupUsers: {
|
|
90
|
+
...groupUsers,
|
|
91
|
+
[key]: { id: userId, valid },
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
82
95
|
case setGrantChangeRequestCart.TRIGGER:
|
|
83
96
|
const { structure, grant } = payload;
|
|
84
97
|
return {
|
package/src/routines.js
CHANGED
|
@@ -174,6 +174,9 @@ export const updateGrantRequestTemplateContent = createRoutine(
|
|
|
174
174
|
export const updateGrantRequestUser = createRoutine(
|
|
175
175
|
"UPDATE_GRANT_REQUEST_USER"
|
|
176
176
|
);
|
|
177
|
+
export const updateGrantRequestUserForGroup = createRoutine(
|
|
178
|
+
"UPDATE_GRANT_REQUEST_USER_FOR_GROUP"
|
|
179
|
+
);
|
|
177
180
|
export const updateReferenceDataset = createRoutine("UPDATE_REFERENCE_DATASET");
|
|
178
181
|
export const updateStructure = createRoutine("UPDATE_STRUCTURE");
|
|
179
182
|
export const updateStructureType = createRoutine("UPDATE_STRUCTURE_TYPE");
|