@frontegg/redux-store 6.69.0 → 6.70.0
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/audits/AuditLogsState/index.js +1 -1
- package/audits/AuditLogsState/saga.js +1 -18
- package/audits/AuditsMetadataState/index.js +1 -1
- package/audits/AuditsMetadataState/saga.js +1 -5
- package/audits/backward-compatibility/saga.js +0 -18
- package/audits/dummy.js +0 -16
- package/audits/index.js +4 -2
- package/audits/reducer.js +0 -2
- package/auth/AcceptInvitationState/index.d.ts +2 -0
- package/auth/AcceptInvitationState/index.js +1 -1
- package/auth/AcceptInvitationState/interfaces.js +0 -1
- package/auth/AcceptInvitationState/saga.js +0 -3
- package/auth/AccountSettingsState/index.d.ts +2 -0
- package/auth/AccountSettingsState/index.js +1 -1
- package/auth/AccountSettingsState/interfaces.d.ts +2 -0
- package/auth/AccountSettingsState/saga.js +1 -11
- package/auth/ActivateState/index.d.ts +3 -0
- package/auth/ActivateState/index.js +1 -1
- package/auth/ActivateState/interfaces.js +0 -1
- package/auth/ActivateState/saga.js +14 -34
- package/auth/ApiTokensState/index.d.ts +2 -0
- package/auth/ApiTokensState/index.js +1 -1
- package/auth/ApiTokensState/interfaces.d.ts +1 -0
- package/auth/ApiTokensState/interfaces.js +0 -1
- package/auth/ApiTokensState/saga.js +1 -44
- package/auth/ForgotPasswordState/index.d.ts +2 -0
- package/auth/ForgotPasswordState/index.js +1 -1
- package/auth/ForgotPasswordState/interfaces.js +0 -1
- package/auth/ForgotPasswordState/saga.js +5 -12
- package/auth/ImpersonationState/index.d.ts +2 -0
- package/auth/ImpersonationState/index.js +1 -1
- package/auth/ImpersonationState/interfaces.js +0 -1
- package/auth/ImpersonationState/saga.js +5 -9
- package/auth/LoginState/index.d.ts +2 -0
- package/auth/LoginState/index.js +1 -1
- package/auth/LoginState/interfaces.js +0 -6
- package/auth/LoginState/saga.d.ts +2 -38
- package/auth/LoginState/saga.js +132 -292
- package/auth/MfaState/index.d.ts +4 -2
- package/auth/MfaState/index.js +1 -1
- package/auth/MfaState/interfaces.d.ts +2 -2
- package/auth/MfaState/interfaces.js +0 -1
- package/auth/MfaState/saga.js +64 -143
- package/auth/ProfileState/index.d.ts +2 -0
- package/auth/ProfileState/index.js +1 -1
- package/auth/ProfileState/saga.js +22 -50
- package/auth/Provisioning/index.d.ts +2 -0
- package/auth/Provisioning/index.js +1 -1
- package/auth/Provisioning/saga.js +11 -23
- package/auth/ResetPhoneNumberState/index.d.ts +2 -0
- package/auth/ResetPhoneNumberState/index.js +1 -1
- package/auth/ResetPhoneNumberState/interfaces.js +0 -1
- package/auth/ResetPhoneNumberState/saga.js +17 -26
- package/auth/RestrictionsState/index.d.ts +3 -0
- package/auth/RestrictionsState/index.js +1 -1
- package/auth/RestrictionsState/saga.js +52 -105
- package/auth/RolesState/index.d.ts +2 -0
- package/auth/RolesState/index.js +1 -1
- package/auth/RolesState/saga.js +30 -51
- package/auth/SSOState/index.d.ts +2 -0
- package/auth/SSOState/index.js +1 -1
- package/auth/SSOState/interfaces.js +0 -3
- package/auth/SSOState/saga.js +10 -58
- package/auth/SSOState/saga.v2.js +13 -49
- package/auth/SecurityPolicyState/index.d.ts +13 -0
- package/auth/SecurityPolicyState/index.js +1 -1
- package/auth/SecurityPolicyState/saga.js +36 -90
- package/auth/SessionsPolicyState/index.d.ts +2 -0
- package/auth/SessionsPolicyState/index.js +1 -1
- package/auth/SessionsPolicyState/saga.js +7 -19
- package/auth/SessionsState/index.d.ts +2 -0
- package/auth/SessionsState/index.js +1 -1
- package/auth/SessionsState/saga.js +1 -15
- package/auth/SignUp/index.d.ts +2 -0
- package/auth/SignUp/index.js +1 -1
- package/auth/SignUp/interfaces.js +0 -1
- package/auth/SignUp/saga.js +6 -15
- package/auth/SocialLogins/index.d.ts +2 -0
- package/auth/SocialLogins/index.js +1 -1
- package/auth/SocialLogins/saga.js +10 -20
- package/auth/TeamState/index.d.ts +2 -0
- package/auth/TeamState/index.js +1 -1
- package/auth/TeamState/interfaces.js +0 -1
- package/auth/TeamState/saga.js +85 -205
- package/auth/TenantsState/index.d.ts +2 -0
- package/auth/TenantsState/index.js +1 -1
- package/auth/TenantsState/saga.js +1 -17
- package/auth/index.d.ts +2 -2
- package/auth/index.js +4 -3
- package/auth/interfaces.d.ts +2 -1
- package/auth/interfaces.js +0 -6
- package/auth/reducer.d.ts +2 -2
- package/auth/reducer.js +0 -2
- package/auth/saga.js +2 -1
- package/auth/utils.d.ts +4 -0
- package/auth/utils.js +7 -21
- package/connectivity/ConnectivityState/index.d.ts +9 -0
- package/connectivity/ConnectivityState/index.js +1 -1
- package/connectivity/consts.js +0 -5
- package/connectivity/index.js +4 -2
- package/connectivity/interfaces.d.ts +1 -0
- package/connectivity/reducer.js +0 -2
- package/connectivity/saga.js +48 -85
- package/helpers.js +4 -7
- package/index.js +1 -1
- package/node/audits/AuditLogsState/index.js +1 -8
- package/node/audits/AuditLogsState/saga.js +1 -26
- package/node/audits/AuditsMetadataState/index.js +1 -8
- package/node/audits/AuditsMetadataState/saga.js +1 -10
- package/node/audits/backward-compatibility/index.js +0 -8
- package/node/audits/backward-compatibility/reducer.js +0 -5
- package/node/audits/backward-compatibility/saga.js +0 -23
- package/node/audits/dummy.js +0 -19
- package/node/audits/index.js +0 -14
- package/node/audits/initialState.js +0 -3
- package/node/audits/reducer.js +0 -8
- package/node/audits/saga.js +0 -5
- package/node/audits/utils.js +0 -4
- package/node/auth/AcceptInvitationState/index.js +1 -7
- package/node/auth/AcceptInvitationState/interfaces.js +0 -1
- package/node/auth/AcceptInvitationState/saga.js +0 -7
- package/node/auth/AccountSettingsState/index.js +1 -6
- package/node/auth/AccountSettingsState/saga.js +1 -16
- package/node/auth/ActivateState/index.js +1 -7
- package/node/auth/ActivateState/interfaces.js +0 -1
- package/node/auth/ActivateState/saga.js +14 -41
- package/node/auth/ApiTokensState/index.js +1 -6
- package/node/auth/ApiTokensState/interfaces.js +0 -1
- package/node/auth/ApiTokensState/saga.js +1 -51
- package/node/auth/ForgotPasswordState/index.js +1 -7
- package/node/auth/ForgotPasswordState/interfaces.js +0 -1
- package/node/auth/ForgotPasswordState/saga.js +5 -19
- package/node/auth/ImpersonationState/index.js +1 -7
- package/node/auth/ImpersonationState/interfaces.js +0 -1
- package/node/auth/ImpersonationState/saga.js +5 -15
- package/node/auth/LoginState/index.js +1 -7
- package/node/auth/LoginState/interfaces.js +0 -7
- package/node/auth/LoginState/saga.js +132 -322
- package/node/auth/MfaState/index.js +1 -7
- package/node/auth/MfaState/interfaces.js +0 -1
- package/node/auth/MfaState/saga.js +64 -137
- package/node/auth/ProfileState/index.js +1 -6
- package/node/auth/ProfileState/saga.js +22 -58
- package/node/auth/Provisioning/index.js +1 -6
- package/node/auth/Provisioning/saga.js +11 -28
- package/node/auth/ResetPhoneNumberState/index.js +1 -7
- package/node/auth/ResetPhoneNumberState/interfaces.js +0 -1
- package/node/auth/ResetPhoneNumberState/saga.js +17 -32
- package/node/auth/RestrictionsState/index.js +1 -7
- package/node/auth/RestrictionsState/saga.js +52 -109
- package/node/auth/RolesState/index.js +1 -6
- package/node/auth/RolesState/saga.js +30 -54
- package/node/auth/SSOState/index.js +1 -6
- package/node/auth/SSOState/interfaces.js +0 -3
- package/node/auth/SSOState/saga.js +10 -63
- package/node/auth/SSOState/saga.v2.js +13 -53
- package/node/auth/SecurityPolicyState/index.js +1 -6
- package/node/auth/SecurityPolicyState/saga.js +36 -89
- package/node/auth/SessionsPolicyState/index.js +1 -6
- package/node/auth/SessionsPolicyState/saga.js +7 -24
- package/node/auth/SessionsState/index.js +1 -6
- package/node/auth/SessionsState/saga.js +1 -22
- package/node/auth/SignUp/index.js +1 -7
- package/node/auth/SignUp/interfaces.js +0 -1
- package/node/auth/SignUp/saga.js +6 -30
- package/node/auth/SocialLogins/index.js +1 -6
- package/node/auth/SocialLogins/saga.js +10 -33
- package/node/auth/TeamState/index.js +1 -6
- package/node/auth/TeamState/interfaces.js +0 -1
- package/node/auth/TeamState/saga.js +86 -190
- package/node/auth/TenantsState/index.js +1 -6
- package/node/auth/TenantsState/saga.js +1 -24
- package/node/auth/dummy.js +0 -5
- package/node/auth/index.js +0 -90
- package/node/auth/initialState.js +0 -23
- package/node/auth/interfaces.js +0 -6
- package/node/auth/reducer.js +0 -28
- package/node/auth/saga.js +2 -26
- package/node/auth/utils.js +7 -42
- package/node/connectivity/ConnectivityState/index.js +1 -7
- package/node/connectivity/consts.js +1 -7
- package/node/connectivity/index.js +0 -5
- package/node/connectivity/reducer.js +0 -6
- package/node/connectivity/saga.js +47 -91
- package/node/helpers.js +2 -14
- package/node/index.js +1 -17
- package/node/subscriptions/Billing/Information/index.js +0 -7
- package/node/subscriptions/Billing/Information/saga.js +1 -25
- package/node/subscriptions/Billing/Invoices/index.js +0 -6
- package/node/subscriptions/Billing/Invoices/saga.js +1 -13
- package/node/subscriptions/Billing/PaymentMethod/index.js +2 -8
- package/node/subscriptions/Billing/PaymentMethod/interfaces.js +0 -1
- package/node/subscriptions/Billing/PaymentMethod/saga.js +1 -17
- package/node/subscriptions/Billing/Subscription/index.js +0 -6
- package/node/subscriptions/Billing/Subscription/saga.js +3 -23
- package/node/subscriptions/Billing/index.js +0 -6
- package/node/subscriptions/Billing/interfaces.js +0 -8
- package/node/subscriptions/Billing/saga.js +0 -7
- package/node/subscriptions/Checkout/index.js +0 -6
- package/node/subscriptions/Checkout/saga.js +2 -22
- package/node/subscriptions/Config/index.js +0 -6
- package/node/subscriptions/Config/saga.js +1 -12
- package/node/subscriptions/Plans/index.js +0 -6
- package/node/subscriptions/Plans/saga.js +1 -13
- package/node/subscriptions/Stripe/index.js +0 -6
- package/node/subscriptions/Stripe/saga.js +0 -8
- package/node/subscriptions/VendorPublicConfig/index.js +0 -6
- package/node/subscriptions/VendorPublicConfig/saga.js +1 -9
- package/node/subscriptions/dummy.js +2 -4
- package/node/subscriptions/general.interfaces.js +0 -5
- package/node/subscriptions/index.js +0 -5
- package/node/subscriptions/interfaces.js +0 -14
- package/node/subscriptions/mapper.js +0 -11
- package/node/subscriptions/reducer.js +0 -9
- package/node/subscriptions/saga.js +0 -9
- package/node/subscriptions/utils.js +0 -6
- package/node/toolkit/index.js +0 -31
- package/node/toolkit/redux-saga.js +0 -3
- package/node/toolkit/redux.js +0 -1
- package/node/vendor/VendorState/index.js +1 -7
- package/node/vendor/index.js +0 -5
- package/node/vendor/reducer.js +0 -6
- package/node/vendor/saga.js +1 -9
- package/package.json +1 -1
- package/subscriptions/Billing/Information/index.js +0 -4
- package/subscriptions/Billing/Information/saga.js +1 -12
- package/subscriptions/Billing/Invoices/index.js +0 -4
- package/subscriptions/Billing/Invoices/saga.js +1 -5
- package/subscriptions/Billing/PaymentMethod/index.js +2 -6
- package/subscriptions/Billing/PaymentMethod/interfaces.js +1 -1
- package/subscriptions/Billing/PaymentMethod/saga.js +1 -9
- package/subscriptions/Billing/Subscription/index.js +0 -4
- package/subscriptions/Billing/Subscription/saga.js +3 -17
- package/subscriptions/Billing/interfaces.js +1 -0
- package/subscriptions/Checkout/index.js +0 -4
- package/subscriptions/Checkout/saga.js +2 -12
- package/subscriptions/Config/index.js +0 -4
- package/subscriptions/Config/saga.js +1 -7
- package/subscriptions/Plans/index.js +0 -2
- package/subscriptions/Plans/saga.js +1 -6
- package/subscriptions/Stripe/index.js +0 -4
- package/subscriptions/Stripe/saga.js +0 -4
- package/subscriptions/VendorPublicConfig/index.js +0 -2
- package/subscriptions/VendorPublicConfig/saga.js +1 -4
- package/subscriptions/dummy.js +3 -2
- package/subscriptions/general.interfaces.js +0 -5
- package/subscriptions/index.js +3 -1
- package/subscriptions/mapper.js +0 -5
- package/toolkit/index.d.ts +1 -1
- package/toolkit/index.js +0 -9
- package/vendor/VendorState/index.js +1 -0
- package/vendor/index.js +4 -2
- package/vendor/reducer.js +0 -2
- package/vendor/saga.js +1 -2
|
@@ -1,62 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.teamSagas = teamSagas;
|
|
9
8
|
exports.teamSagasMock = teamSagasMock;
|
|
10
|
-
|
|
11
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
|
-
|
|
13
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
|
-
|
|
15
11
|
var _effects = require("redux-saga/effects");
|
|
16
|
-
|
|
17
12
|
var _restApi = require("@frontegg/rest-api");
|
|
18
|
-
|
|
19
13
|
var _reducer = require("../reducer");
|
|
20
|
-
|
|
21
14
|
var _interfaces = require("./interfaces");
|
|
22
|
-
|
|
23
15
|
var _constants = require("../../constants");
|
|
24
|
-
|
|
25
16
|
var _utils = require("../utils");
|
|
26
|
-
|
|
27
17
|
var _dummy = require("../dummy");
|
|
28
|
-
|
|
29
18
|
var _uuid = require("uuid");
|
|
30
|
-
|
|
31
19
|
const _excluded = ["callback"],
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
20
|
+
_excluded2 = ["roles"],
|
|
21
|
+
_excluded3 = ["callback"],
|
|
22
|
+
_excluded4 = ["callback", "profileImage"],
|
|
23
|
+
_excluded5 = ["callback"],
|
|
24
|
+
_excluded6 = ["callback", "userId"],
|
|
25
|
+
_excluded7 = ["callback"],
|
|
26
|
+
_excluded8 = ["callback"],
|
|
27
|
+
_excluded9 = ["callback"],
|
|
28
|
+
_excluded10 = ["callback"],
|
|
29
|
+
_excluded11 = ["callback"],
|
|
30
|
+
_excluded12 = ["callback"],
|
|
31
|
+
_excluded13 = ["callback"],
|
|
32
|
+
_excluded14 = ["callback", "profileImage"],
|
|
33
|
+
_excluded15 = ["callback"],
|
|
34
|
+
_excluded16 = ["callback"],
|
|
35
|
+
_excluded17 = ["callback"],
|
|
36
|
+
_excluded18 = ["callback"],
|
|
37
|
+
_excluded19 = ["callback"],
|
|
38
|
+
_excluded20 = ["callback"];
|
|
39
|
+
const selectTeamState = () => (0, _effects.select)(_ => _[_constants.authStoreName].teamState);
|
|
40
|
+
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
42
|
function* loadUsers({
|
|
56
43
|
payload
|
|
57
44
|
}) {
|
|
58
45
|
var _payload$pageSize, _payload$pageOffset, _payload$filter, _payload$sort;
|
|
59
|
-
|
|
60
46
|
const {
|
|
61
47
|
silentLoading,
|
|
62
48
|
callback
|
|
@@ -76,7 +62,6 @@ function* loadUsers({
|
|
|
76
62
|
filter,
|
|
77
63
|
sort
|
|
78
64
|
}));
|
|
79
|
-
|
|
80
65
|
try {
|
|
81
66
|
const [{
|
|
82
67
|
items: users,
|
|
@@ -111,35 +96,27 @@ function* loadUsers({
|
|
|
111
96
|
}));
|
|
112
97
|
callback == null ? void 0 : callback(null, e);
|
|
113
98
|
}
|
|
114
|
-
|
|
115
99
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
116
100
|
key: _interfaces.TeamStateKeys.USERS,
|
|
117
101
|
value: false
|
|
118
102
|
}));
|
|
119
|
-
}
|
|
120
|
-
|
|
103
|
+
}
|
|
121
104
|
|
|
105
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
122
106
|
function* loadAllSubTenantsUsers({
|
|
123
107
|
payload
|
|
124
108
|
}) {
|
|
125
109
|
var _payload$_limit, _payload$_offset, _payload$_filter, _payload$_sortBy, _payload$_order;
|
|
126
|
-
|
|
127
110
|
const {
|
|
128
111
|
silentLoading,
|
|
129
112
|
callback
|
|
130
113
|
} = payload;
|
|
131
114
|
const teamState = yield selectTeamState();
|
|
132
|
-
|
|
133
115
|
const _limit = (_payload$_limit = payload._limit) != null ? _payload$_limit : teamState.allUsersQueryParams._limit;
|
|
134
|
-
|
|
135
116
|
const _offset = (_payload$_offset = payload._offset) != null ? _payload$_offset : teamState.allUsersQueryParams._offset;
|
|
136
|
-
|
|
137
117
|
const _filter = (_payload$_filter = payload._filter) != null ? _payload$_filter : teamState.allUsersQueryParams._filter;
|
|
138
|
-
|
|
139
118
|
const _sortBy = (_payload$_sortBy = payload._sortBy) != null ? _payload$_sortBy : teamState.allUsersQueryParams._sortBy;
|
|
140
|
-
|
|
141
119
|
const _order = (_payload$_order = payload._order) != null ? _payload$_order : teamState.allUsersQueryParams._order;
|
|
142
|
-
|
|
143
120
|
const allUsersQueryParams = {
|
|
144
121
|
_limit: _limit || 20,
|
|
145
122
|
_offset: _offset || 0,
|
|
@@ -154,7 +131,6 @@ function* loadAllSubTenantsUsers({
|
|
|
154
131
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
155
132
|
allUsersQueryParams
|
|
156
133
|
}));
|
|
157
|
-
|
|
158
134
|
try {
|
|
159
135
|
const [{
|
|
160
136
|
items: users,
|
|
@@ -186,13 +162,11 @@ function* loadAllSubTenantsUsers({
|
|
|
186
162
|
}));
|
|
187
163
|
callback == null ? void 0 : callback(null, e);
|
|
188
164
|
}
|
|
189
|
-
|
|
190
165
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
191
166
|
key: _interfaces.TeamStateKeys.USERS,
|
|
192
167
|
value: false
|
|
193
168
|
}));
|
|
194
169
|
}
|
|
195
|
-
|
|
196
170
|
function* loadRoles({
|
|
197
171
|
payload
|
|
198
172
|
}) {
|
|
@@ -200,10 +174,8 @@ function* loadRoles({
|
|
|
200
174
|
key: _interfaces.TeamStateKeys.ROLES_AND_PERMISSIONS,
|
|
201
175
|
value: true
|
|
202
176
|
}));
|
|
203
|
-
|
|
204
177
|
try {
|
|
205
178
|
var _payload$callback;
|
|
206
|
-
|
|
207
179
|
const [{
|
|
208
180
|
items: roles
|
|
209
181
|
}, {
|
|
@@ -219,40 +191,36 @@ function* loadRoles({
|
|
|
219
191
|
});
|
|
220
192
|
} catch (e) {
|
|
221
193
|
var _payload$callback2;
|
|
222
|
-
|
|
223
194
|
payload == null ? void 0 : (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, null, e);
|
|
224
195
|
yield (0, _effects.put)(_reducer.actions.setTeamError({
|
|
225
196
|
key: _interfaces.TeamStateKeys.ROLES_AND_PERMISSIONS,
|
|
226
197
|
value: e.message
|
|
227
198
|
}));
|
|
228
199
|
}
|
|
229
|
-
|
|
230
200
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
231
201
|
key: _interfaces.TeamStateKeys.ROLES_AND_PERMISSIONS,
|
|
232
202
|
value: true
|
|
233
203
|
}));
|
|
234
204
|
}
|
|
235
|
-
|
|
236
205
|
function* addUser({
|
|
237
206
|
payload
|
|
238
207
|
}) {
|
|
239
208
|
const {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
209
|
+
callback
|
|
210
|
+
} = payload,
|
|
211
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded);
|
|
243
212
|
const teamState = yield selectTeamState();
|
|
244
213
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
245
214
|
addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
|
|
246
215
|
loading: true
|
|
247
216
|
})
|
|
248
217
|
}));
|
|
249
|
-
|
|
250
218
|
try {
|
|
251
219
|
const res = yield (0, _effects.call)(_restApi.api.teams.addUser, body);
|
|
252
220
|
const {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
221
|
+
roles
|
|
222
|
+
} = res,
|
|
223
|
+
userWithoutRoleIds = (0, _objectWithoutPropertiesLoose2.default)(res, _excluded2);
|
|
256
224
|
const roleIds = roles.map(role => role.id);
|
|
257
225
|
const newUser = (0, _extends2.default)({}, userWithoutRoleIds, {
|
|
258
226
|
roleIds
|
|
@@ -275,7 +243,6 @@ function* addUser({
|
|
|
275
243
|
callback == null ? void 0 : callback(null, e.message);
|
|
276
244
|
}
|
|
277
245
|
}
|
|
278
|
-
|
|
279
246
|
function* addUsersBulk({
|
|
280
247
|
payload
|
|
281
248
|
}) {
|
|
@@ -300,10 +267,8 @@ function* addUsersBulk({
|
|
|
300
267
|
loading: true
|
|
301
268
|
}
|
|
302
269
|
}));
|
|
303
|
-
|
|
304
270
|
for (let i = 0; i < bodies.length; i++) {
|
|
305
271
|
const body = bodies.at(i);
|
|
306
|
-
|
|
307
272
|
try {
|
|
308
273
|
yield (0, _effects.call)(_restApi.api.teams.addUser, body);
|
|
309
274
|
allowedEmails.push(body.email);
|
|
@@ -311,7 +276,6 @@ function* addUsersBulk({
|
|
|
311
276
|
unallowedEmails.push(body.email);
|
|
312
277
|
}
|
|
313
278
|
}
|
|
314
|
-
|
|
315
279
|
const queryObject = {
|
|
316
280
|
pageOffset: 0,
|
|
317
281
|
pageSize: 10,
|
|
@@ -329,21 +293,19 @@ function* addUsersBulk({
|
|
|
329
293
|
allowedEmails
|
|
330
294
|
});
|
|
331
295
|
}
|
|
332
|
-
|
|
333
296
|
function* addUserToSubTenants({
|
|
334
297
|
payload
|
|
335
298
|
}) {
|
|
336
299
|
const {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
300
|
+
callback
|
|
301
|
+
} = payload,
|
|
302
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded3);
|
|
340
303
|
const teamState = yield selectTeamState();
|
|
341
304
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
342
305
|
addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
|
|
343
306
|
loading: true
|
|
344
307
|
})
|
|
345
308
|
}));
|
|
346
|
-
|
|
347
309
|
try {
|
|
348
310
|
yield (0, _effects.call)(_restApi.api.subTenants.addUserToTenantAndSubTenants, body);
|
|
349
311
|
const {
|
|
@@ -379,14 +341,13 @@ function* addUserToSubTenants({
|
|
|
379
341
|
callback == null ? void 0 : callback(null, e.message);
|
|
380
342
|
}
|
|
381
343
|
}
|
|
382
|
-
|
|
383
344
|
function* updateUser({
|
|
384
345
|
payload
|
|
385
346
|
}) {
|
|
386
347
|
const {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
348
|
+
callback
|
|
349
|
+
} = payload,
|
|
350
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded4);
|
|
390
351
|
const {
|
|
391
352
|
id: userId
|
|
392
353
|
} = body;
|
|
@@ -409,18 +370,14 @@ function* updateUser({
|
|
|
409
370
|
if (user.id === body.id) {
|
|
410
371
|
return (0, _extends2.default)({}, user, body);
|
|
411
372
|
}
|
|
412
|
-
|
|
413
373
|
return user;
|
|
414
374
|
})
|
|
415
375
|
}));
|
|
416
|
-
|
|
417
376
|
try {
|
|
418
377
|
var _body$roleIds;
|
|
419
|
-
|
|
420
378
|
if (oldUserData.roleIds.length > 0 && ((_body$roleIds = body.roleIds) == null ? void 0 : _body$roleIds.length) === 0) {
|
|
421
379
|
body.roleIds = [''];
|
|
422
380
|
}
|
|
423
|
-
|
|
424
381
|
const {
|
|
425
382
|
item: newUser
|
|
426
383
|
} = yield (0, _effects.call)(_restApi.api.teams.updateUser, body);
|
|
@@ -451,21 +408,19 @@ function* updateUser({
|
|
|
451
408
|
callback == null ? void 0 : callback(null, e.message);
|
|
452
409
|
}
|
|
453
410
|
}
|
|
454
|
-
|
|
455
411
|
function* deleteUser({
|
|
456
412
|
payload
|
|
457
413
|
}) {
|
|
458
414
|
const {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
415
|
+
callback
|
|
416
|
+
} = payload,
|
|
417
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded5);
|
|
462
418
|
const teamState = yield selectTeamState();
|
|
463
419
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
464
420
|
deleteUserDialogState: (0, _extends2.default)({}, teamState.deleteUserDialogState, {
|
|
465
421
|
loading: true
|
|
466
422
|
})
|
|
467
423
|
}));
|
|
468
|
-
|
|
469
424
|
try {
|
|
470
425
|
yield (0, _effects.call)(_restApi.api.teams.deleteUser, body);
|
|
471
426
|
callback == null ? void 0 : callback(true);
|
|
@@ -486,31 +441,27 @@ function* deleteUser({
|
|
|
486
441
|
callback == null ? void 0 : callback(null, e.message);
|
|
487
442
|
}
|
|
488
443
|
}
|
|
489
|
-
|
|
490
444
|
function* setUserRolesForSubTenants({
|
|
491
445
|
payload
|
|
492
446
|
}) {
|
|
493
447
|
const {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
448
|
+
callback,
|
|
449
|
+
userId
|
|
450
|
+
} = payload,
|
|
451
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded6);
|
|
498
452
|
const teamState = yield selectTeamState();
|
|
499
453
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
500
454
|
addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
|
|
501
455
|
loading: true
|
|
502
456
|
})
|
|
503
457
|
}));
|
|
504
|
-
|
|
505
458
|
try {
|
|
506
459
|
yield (0, _effects.call)(_restApi.api.subTenants.setUserRolesForSubTenants, userId, body);
|
|
507
460
|
const updatedUser = teamState.allUsers.find(user => user.id === userId);
|
|
508
461
|
let newTenants = [];
|
|
509
|
-
|
|
510
462
|
if (updatedUser) {
|
|
511
463
|
newTenants = updatedUser.tenants.map(tenant => {
|
|
512
464
|
var _body$subTenantsRoles;
|
|
513
|
-
|
|
514
465
|
return (0, _extends2.default)({}, tenant, {
|
|
515
466
|
roles: ((_body$subTenantsRoles = body.subTenantsRoles.find(roleUpdate => roleUpdate.tenantId === tenant.tenantId)) == null ? void 0 : _body$subTenantsRoles.roleIds.map(roleId => {
|
|
516
467
|
const role = teamState.roles.find(({
|
|
@@ -521,7 +472,6 @@ function* setUserRolesForSubTenants({
|
|
|
521
472
|
});
|
|
522
473
|
});
|
|
523
474
|
}
|
|
524
|
-
|
|
525
475
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
526
476
|
allUsers: [...teamState.allUsers.filter(user => user.id !== userId), ...(updatedUser ? [(0, _extends2.default)({}, updatedUser, {
|
|
527
477
|
tenants: newTenants
|
|
@@ -542,21 +492,19 @@ function* setUserRolesForSubTenants({
|
|
|
542
492
|
callback == null ? void 0 : callback(null, e.message);
|
|
543
493
|
}
|
|
544
494
|
}
|
|
545
|
-
|
|
546
495
|
function* deleteUserFromSubTenants({
|
|
547
496
|
payload
|
|
548
497
|
}) {
|
|
549
498
|
const {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
499
|
+
callback
|
|
500
|
+
} = payload,
|
|
501
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded7);
|
|
553
502
|
const teamState = yield selectTeamState();
|
|
554
503
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
555
504
|
deleteUserDialogState: (0, _extends2.default)({}, teamState.deleteUserDialogState, {
|
|
556
505
|
loading: true
|
|
557
506
|
})
|
|
558
507
|
}));
|
|
559
|
-
|
|
560
508
|
try {
|
|
561
509
|
yield (0, _effects.call)(_restApi.api.subTenants.removeUserFromTenantAndSubTenants, body);
|
|
562
510
|
callback == null ? void 0 : callback(true);
|
|
@@ -577,19 +525,17 @@ function* deleteUserFromSubTenants({
|
|
|
577
525
|
callback == null ? void 0 : callback(null, e.message);
|
|
578
526
|
}
|
|
579
527
|
}
|
|
580
|
-
|
|
581
528
|
function* resendActivationLink({
|
|
582
529
|
payload
|
|
583
530
|
}) {
|
|
584
531
|
const {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
532
|
+
callback
|
|
533
|
+
} = payload,
|
|
534
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded8);
|
|
588
535
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
589
536
|
key: _interfaces.TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
590
537
|
value: body.userId
|
|
591
538
|
}));
|
|
592
|
-
|
|
593
539
|
try {
|
|
594
540
|
yield (0, _effects.call)(_restApi.api.teams.resendActivationLink, body);
|
|
595
541
|
callback == null ? void 0 : callback(true);
|
|
@@ -600,25 +546,22 @@ function* resendActivationLink({
|
|
|
600
546
|
}));
|
|
601
547
|
callback == null ? void 0 : callback(null, e.message);
|
|
602
548
|
}
|
|
603
|
-
|
|
604
549
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
605
550
|
key: _interfaces.TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
606
551
|
value: false
|
|
607
552
|
}));
|
|
608
553
|
}
|
|
609
|
-
|
|
610
554
|
function* resendInvitationLink({
|
|
611
555
|
payload
|
|
612
556
|
}) {
|
|
613
557
|
const {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
558
|
+
callback
|
|
559
|
+
} = payload,
|
|
560
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded9);
|
|
617
561
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
618
562
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
619
563
|
value: body.email
|
|
620
564
|
}));
|
|
621
|
-
|
|
622
565
|
try {
|
|
623
566
|
yield (0, _effects.call)(_restApi.api.teams.resendInvitationLink, body);
|
|
624
567
|
callback == null ? void 0 : callback(true);
|
|
@@ -629,25 +572,22 @@ function* resendInvitationLink({
|
|
|
629
572
|
}));
|
|
630
573
|
callback == null ? void 0 : callback(null, e.message);
|
|
631
574
|
}
|
|
632
|
-
|
|
633
575
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
634
576
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
635
577
|
value: false
|
|
636
578
|
}));
|
|
637
579
|
}
|
|
638
|
-
|
|
639
580
|
function* resendInvitationEmail({
|
|
640
581
|
payload
|
|
641
582
|
}) {
|
|
642
583
|
const {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
584
|
+
callback
|
|
585
|
+
} = payload,
|
|
586
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded10);
|
|
646
587
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
647
588
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
648
589
|
value: body.email
|
|
649
590
|
}));
|
|
650
|
-
|
|
651
591
|
try {
|
|
652
592
|
yield (0, _effects.call)(_restApi.api.auth.resendInvitationEmail, body);
|
|
653
593
|
callback == null ? void 0 : callback(true);
|
|
@@ -658,25 +598,22 @@ function* resendInvitationEmail({
|
|
|
658
598
|
}));
|
|
659
599
|
callback == null ? void 0 : callback(null, e.message);
|
|
660
600
|
}
|
|
661
|
-
|
|
662
601
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
663
602
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
664
603
|
value: false
|
|
665
604
|
}));
|
|
666
605
|
}
|
|
667
|
-
|
|
668
606
|
function* resendInvitationLinkToAllSubTenants({
|
|
669
607
|
payload
|
|
670
608
|
}) {
|
|
671
609
|
const {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
610
|
+
callback
|
|
611
|
+
} = payload,
|
|
612
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded11);
|
|
675
613
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
676
614
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
677
615
|
value: body.email
|
|
678
616
|
}));
|
|
679
|
-
|
|
680
617
|
try {
|
|
681
618
|
yield (0, _effects.call)(_restApi.api.teams.resendInvitationLinkToAllTenants, body);
|
|
682
619
|
callback == null ? void 0 : callback(true);
|
|
@@ -687,19 +624,16 @@ function* resendInvitationLinkToAllSubTenants({
|
|
|
687
624
|
}));
|
|
688
625
|
callback == null ? void 0 : callback(null, e.message);
|
|
689
626
|
}
|
|
690
|
-
|
|
691
627
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
692
628
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
693
629
|
value: false
|
|
694
630
|
}));
|
|
695
631
|
}
|
|
696
|
-
|
|
697
632
|
function* getInvitationLinkConfig() {
|
|
698
633
|
yield (0, _effects.put)(_reducer.actions.setTeamError({
|
|
699
634
|
key: _interfaces.TeamStateKeys.CONFIG_TOKEN_LINK,
|
|
700
635
|
value: false
|
|
701
636
|
}));
|
|
702
|
-
|
|
703
637
|
try {
|
|
704
638
|
const invitationLinkConfig = yield (0, _effects.call)(_restApi.api.teams.getInviteLinkConfiguration);
|
|
705
639
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
@@ -712,13 +646,11 @@ function* getInvitationLinkConfig() {
|
|
|
712
646
|
}));
|
|
713
647
|
}
|
|
714
648
|
}
|
|
715
|
-
|
|
716
649
|
function* getInvitationLink() {
|
|
717
650
|
yield (0, _effects.put)(_reducer.actions.setTeamError({
|
|
718
651
|
key: _interfaces.TeamStateKeys.GET_TOKEN_LINK,
|
|
719
652
|
value: false
|
|
720
653
|
}));
|
|
721
|
-
|
|
722
654
|
try {
|
|
723
655
|
yield (0, _effects.call)(getInvitationLinkConfig);
|
|
724
656
|
const data = yield (0, _effects.call)(_restApi.api.teams.getInviteUserLink);
|
|
@@ -735,7 +667,6 @@ function* getInvitationLink() {
|
|
|
735
667
|
}));
|
|
736
668
|
}
|
|
737
669
|
}
|
|
738
|
-
|
|
739
670
|
function* createInvitationLink({
|
|
740
671
|
payload: {
|
|
741
672
|
callback
|
|
@@ -748,7 +679,6 @@ function* createInvitationLink({
|
|
|
748
679
|
const {
|
|
749
680
|
inviteTokenState
|
|
750
681
|
} = yield selectTeamState();
|
|
751
|
-
|
|
752
682
|
try {
|
|
753
683
|
const data = yield (0, _effects.call)(_restApi.api.teams.createInviteUserLink, {
|
|
754
684
|
expiresInMinutes: 43200
|
|
@@ -765,7 +695,6 @@ function* createInvitationLink({
|
|
|
765
695
|
}));
|
|
766
696
|
}
|
|
767
697
|
}
|
|
768
|
-
|
|
769
698
|
function* updateInvitationLink({
|
|
770
699
|
payload: {
|
|
771
700
|
callback,
|
|
@@ -780,7 +709,6 @@ function* updateInvitationLink({
|
|
|
780
709
|
key: _interfaces.TeamStateKeys.UPDATE_TOKEN_LINK,
|
|
781
710
|
value: false
|
|
782
711
|
}));
|
|
783
|
-
|
|
784
712
|
try {
|
|
785
713
|
const data = yield (0, _effects.call)(_restApi.api.teams.updateInviteUserLink, {
|
|
786
714
|
expiresInMinutes,
|
|
@@ -798,7 +726,6 @@ function* updateInvitationLink({
|
|
|
798
726
|
}));
|
|
799
727
|
}
|
|
800
728
|
}
|
|
801
|
-
|
|
802
729
|
function* deleteInvitationLink({
|
|
803
730
|
payload
|
|
804
731
|
}) {
|
|
@@ -809,7 +736,6 @@ function* deleteInvitationLink({
|
|
|
809
736
|
key: _interfaces.TeamStateKeys.DELETE_TOKEN_LINK,
|
|
810
737
|
value: false
|
|
811
738
|
}));
|
|
812
|
-
|
|
813
739
|
try {
|
|
814
740
|
yield (0, _effects.call)(_restApi.api.teams.deleteInviteUserLink);
|
|
815
741
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
@@ -824,7 +750,6 @@ function* deleteInvitationLink({
|
|
|
824
750
|
callback == null ? void 0 : callback(false, e.message);
|
|
825
751
|
}
|
|
826
752
|
}
|
|
827
|
-
|
|
828
753
|
function* openAddUserDialog({
|
|
829
754
|
payload
|
|
830
755
|
}) {
|
|
@@ -836,7 +761,6 @@ function* openAddUserDialog({
|
|
|
836
761
|
}, payload)
|
|
837
762
|
}));
|
|
838
763
|
}
|
|
839
|
-
|
|
840
764
|
function* closeAddUserDialog({
|
|
841
765
|
payload
|
|
842
766
|
}) {
|
|
@@ -855,7 +779,6 @@ function* closeAddUserDialog({
|
|
|
855
779
|
}
|
|
856
780
|
}));
|
|
857
781
|
}
|
|
858
|
-
|
|
859
782
|
function* openDeleteUserDialog({
|
|
860
783
|
payload
|
|
861
784
|
}) {
|
|
@@ -867,7 +790,6 @@ function* openDeleteUserDialog({
|
|
|
867
790
|
}, payload)
|
|
868
791
|
}));
|
|
869
792
|
}
|
|
870
|
-
|
|
871
793
|
function* closeDeleteUserDialog({
|
|
872
794
|
payload
|
|
873
795
|
}) {
|
|
@@ -886,7 +808,6 @@ function* closeDeleteUserDialog({
|
|
|
886
808
|
}
|
|
887
809
|
}));
|
|
888
810
|
}
|
|
889
|
-
|
|
890
811
|
function* teamSagas() {
|
|
891
812
|
yield (0, _effects.takeLatest)(_reducer.actions.loadUsers, loadUsers);
|
|
892
813
|
yield (0, _effects.takeLatest)(_reducer.actions.loadAllSubTenantsUsers, loadAllSubTenantsUsers);
|
|
@@ -911,16 +832,15 @@ function* teamSagas() {
|
|
|
911
832
|
yield (0, _effects.takeEvery)(_reducer.actions.openDeleteUserDialog, openDeleteUserDialog);
|
|
912
833
|
yield (0, _effects.takeEvery)(_reducer.actions.closeDeleteUserDialog, closeDeleteUserDialog);
|
|
913
834
|
}
|
|
835
|
+
|
|
914
836
|
/*********************************
|
|
915
837
|
* Preview Sagas
|
|
916
838
|
*********************************/
|
|
917
839
|
|
|
918
|
-
|
|
919
840
|
function* loadUsersMock({
|
|
920
841
|
payload
|
|
921
842
|
}) {
|
|
922
843
|
var _payload$pageSize2, _payload$pageOffset2, _payload$filter2, _payload$sort2;
|
|
923
|
-
|
|
924
844
|
const {
|
|
925
845
|
silentLoading,
|
|
926
846
|
callback
|
|
@@ -956,28 +876,20 @@ function* loadUsersMock({
|
|
|
956
876
|
}));
|
|
957
877
|
callback == null ? void 0 : callback(_dummy.usersDemo);
|
|
958
878
|
}
|
|
959
|
-
|
|
960
879
|
function* loadAllSubTenantsUsersMock({
|
|
961
880
|
payload
|
|
962
881
|
}) {
|
|
963
882
|
var _payload$_limit2, _payload$_offset2, _payload$_filter2, _payload$_sortBy2, _payload$_order2;
|
|
964
|
-
|
|
965
883
|
const {
|
|
966
884
|
silentLoading,
|
|
967
885
|
callback
|
|
968
886
|
} = payload;
|
|
969
887
|
const teamState = yield selectTeamState();
|
|
970
|
-
|
|
971
888
|
const _limit = (_payload$_limit2 = payload._limit) != null ? _payload$_limit2 : teamState.allUsersQueryParams._limit;
|
|
972
|
-
|
|
973
889
|
const _offset = (_payload$_offset2 = payload._offset) != null ? _payload$_offset2 : teamState.allUsersQueryParams._offset;
|
|
974
|
-
|
|
975
890
|
const _filter = (_payload$_filter2 = payload._filter) != null ? _payload$_filter2 : teamState.allUsersQueryParams._filter;
|
|
976
|
-
|
|
977
891
|
const _sortBy = (_payload$_sortBy2 = payload._sortBy) != null ? _payload$_sortBy2 : teamState.allUsersQueryParams._sortBy;
|
|
978
|
-
|
|
979
892
|
const _order = (_payload$_order2 = payload._order) != null ? _payload$_order2 : teamState.allUsersQueryParams._order;
|
|
980
|
-
|
|
981
893
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
982
894
|
key: _interfaces.TeamStateKeys.USERS,
|
|
983
895
|
value: !silentLoading
|
|
@@ -1007,12 +919,10 @@ function* loadAllSubTenantsUsersMock({
|
|
|
1007
919
|
}));
|
|
1008
920
|
callback == null ? void 0 : callback(_dummy.allUsersDemo);
|
|
1009
921
|
}
|
|
1010
|
-
|
|
1011
922
|
function* loadRolesMock({
|
|
1012
923
|
payload
|
|
1013
924
|
}) {
|
|
1014
925
|
var _payload$callback3;
|
|
1015
|
-
|
|
1016
926
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
1017
927
|
key: _interfaces.TeamStateKeys.ROLES_AND_PERMISSIONS,
|
|
1018
928
|
value: true
|
|
@@ -1031,14 +941,13 @@ function* loadRolesMock({
|
|
|
1031
941
|
permissions: _dummy.permissionsDemo
|
|
1032
942
|
});
|
|
1033
943
|
}
|
|
1034
|
-
|
|
1035
944
|
function* addUserMock({
|
|
1036
945
|
payload
|
|
1037
946
|
}) {
|
|
1038
947
|
const {
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
948
|
+
callback
|
|
949
|
+
} = payload,
|
|
950
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded12);
|
|
1042
951
|
const teamState = yield selectTeamState();
|
|
1043
952
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
1044
953
|
addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
|
|
@@ -1058,14 +967,13 @@ function* addUserMock({
|
|
|
1058
967
|
}
|
|
1059
968
|
}));
|
|
1060
969
|
}
|
|
1061
|
-
|
|
1062
970
|
function* addUserToSubTenantsMock({
|
|
1063
971
|
payload
|
|
1064
972
|
}) {
|
|
1065
973
|
const {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
974
|
+
callback
|
|
975
|
+
} = payload,
|
|
976
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded13);
|
|
1069
977
|
const teamState = yield selectTeamState();
|
|
1070
978
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
1071
979
|
addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
|
|
@@ -1085,16 +993,14 @@ function* addUserToSubTenantsMock({
|
|
|
1085
993
|
}));
|
|
1086
994
|
callback == null ? void 0 : callback(null);
|
|
1087
995
|
}
|
|
1088
|
-
|
|
1089
996
|
function* updateUserMock({
|
|
1090
997
|
payload
|
|
1091
998
|
}) {
|
|
1092
999
|
var _body$roleIds2;
|
|
1093
|
-
|
|
1094
1000
|
const {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1001
|
+
callback
|
|
1002
|
+
} = payload,
|
|
1003
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded14);
|
|
1098
1004
|
const {
|
|
1099
1005
|
id: userId
|
|
1100
1006
|
} = body;
|
|
@@ -1117,15 +1023,12 @@ function* updateUserMock({
|
|
|
1117
1023
|
if (user.id === body.id) {
|
|
1118
1024
|
return (0, _extends2.default)({}, user, body);
|
|
1119
1025
|
}
|
|
1120
|
-
|
|
1121
1026
|
return user;
|
|
1122
1027
|
})
|
|
1123
1028
|
}));
|
|
1124
|
-
|
|
1125
1029
|
if (oldUserData.roleIds.length > 0 && ((_body$roleIds2 = body.roleIds) == null ? void 0 : _body$roleIds2.length) === 0) {
|
|
1126
1030
|
body.roleIds = [''];
|
|
1127
1031
|
}
|
|
1128
|
-
|
|
1129
1032
|
yield (0, _utils.delay)();
|
|
1130
1033
|
const newUser = (0, _extends2.default)({}, oldUserData, body);
|
|
1131
1034
|
callback == null ? void 0 : callback(newUser);
|
|
@@ -1141,14 +1044,13 @@ function* updateUserMock({
|
|
|
1141
1044
|
value: false
|
|
1142
1045
|
}));
|
|
1143
1046
|
}
|
|
1144
|
-
|
|
1145
1047
|
function* deleteUserMock({
|
|
1146
1048
|
payload
|
|
1147
1049
|
}) {
|
|
1148
1050
|
const {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1051
|
+
callback
|
|
1052
|
+
} = payload,
|
|
1053
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded15);
|
|
1152
1054
|
const teamState = yield selectTeamState();
|
|
1153
1055
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
1154
1056
|
deleteUserDialogState: (0, _extends2.default)({}, teamState.deleteUserDialogState, {
|
|
@@ -1165,14 +1067,13 @@ function* deleteUserMock({
|
|
|
1165
1067
|
}
|
|
1166
1068
|
}));
|
|
1167
1069
|
}
|
|
1168
|
-
|
|
1169
1070
|
function* deleteUserFromSubTenantsMock({
|
|
1170
1071
|
payload
|
|
1171
1072
|
}) {
|
|
1172
1073
|
const {
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1074
|
+
callback
|
|
1075
|
+
} = payload,
|
|
1076
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded16);
|
|
1176
1077
|
const teamState = yield selectTeamState();
|
|
1177
1078
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
1178
1079
|
deleteUserDialogState: (0, _extends2.default)({}, teamState.deleteUserDialogState, {
|
|
@@ -1189,14 +1090,13 @@ function* deleteUserFromSubTenantsMock({
|
|
|
1189
1090
|
}
|
|
1190
1091
|
}));
|
|
1191
1092
|
}
|
|
1192
|
-
|
|
1193
1093
|
function* resendActivationLinkMock({
|
|
1194
1094
|
payload
|
|
1195
1095
|
}) {
|
|
1196
1096
|
const {
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1097
|
+
callback
|
|
1098
|
+
} = payload,
|
|
1099
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded17);
|
|
1200
1100
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
1201
1101
|
key: _interfaces.TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
1202
1102
|
value: body.userId
|
|
@@ -1208,14 +1108,13 @@ function* resendActivationLinkMock({
|
|
|
1208
1108
|
value: false
|
|
1209
1109
|
}));
|
|
1210
1110
|
}
|
|
1211
|
-
|
|
1212
1111
|
function* resendInvitationLinkMock({
|
|
1213
1112
|
payload
|
|
1214
1113
|
}) {
|
|
1215
1114
|
const {
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1115
|
+
callback
|
|
1116
|
+
} = payload,
|
|
1117
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded18);
|
|
1219
1118
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
1220
1119
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
1221
1120
|
value: body.email
|
|
@@ -1227,14 +1126,13 @@ function* resendInvitationLinkMock({
|
|
|
1227
1126
|
value: false
|
|
1228
1127
|
}));
|
|
1229
1128
|
}
|
|
1230
|
-
|
|
1231
1129
|
function* resendInvitationEmailMock({
|
|
1232
1130
|
payload
|
|
1233
1131
|
}) {
|
|
1234
1132
|
const {
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1133
|
+
callback
|
|
1134
|
+
} = payload,
|
|
1135
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded19);
|
|
1238
1136
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
1239
1137
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
1240
1138
|
value: body.email
|
|
@@ -1246,14 +1144,13 @@ function* resendInvitationEmailMock({
|
|
|
1246
1144
|
value: false
|
|
1247
1145
|
}));
|
|
1248
1146
|
}
|
|
1249
|
-
|
|
1250
1147
|
function* resendInvitationLinkToAllSubTenantsMock({
|
|
1251
1148
|
payload
|
|
1252
1149
|
}) {
|
|
1253
1150
|
const {
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1151
|
+
callback
|
|
1152
|
+
} = payload,
|
|
1153
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded20);
|
|
1257
1154
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
1258
1155
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
1259
1156
|
value: body.email
|
|
@@ -1265,7 +1162,6 @@ function* resendInvitationLinkToAllSubTenantsMock({
|
|
|
1265
1162
|
value: false
|
|
1266
1163
|
}));
|
|
1267
1164
|
}
|
|
1268
|
-
|
|
1269
1165
|
function* teamSagasMock() {
|
|
1270
1166
|
yield (0, _effects.takeLatest)(_reducer.actions.loadUsers, loadUsersMock);
|
|
1271
1167
|
yield (0, _effects.takeLatest)(_reducer.actions.loadAllSubTenantsUsers, loadAllSubTenantsUsersMock);
|