@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
package/auth/TeamState/saga.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["callback"],
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
_excluded2 = ["roles"],
|
|
5
|
+
_excluded3 = ["callback"],
|
|
6
|
+
_excluded4 = ["callback", "profileImage"],
|
|
7
|
+
_excluded5 = ["callback"],
|
|
8
|
+
_excluded6 = ["callback", "userId"],
|
|
9
|
+
_excluded7 = ["callback"],
|
|
10
|
+
_excluded8 = ["callback"],
|
|
11
|
+
_excluded9 = ["callback"],
|
|
12
|
+
_excluded10 = ["callback"],
|
|
13
|
+
_excluded11 = ["callback"],
|
|
14
|
+
_excluded12 = ["callback"],
|
|
15
|
+
_excluded13 = ["callback"],
|
|
16
|
+
_excluded14 = ["callback", "profileImage"],
|
|
17
|
+
_excluded15 = ["callback"],
|
|
18
|
+
_excluded16 = ["callback"],
|
|
19
|
+
_excluded17 = ["callback"],
|
|
20
|
+
_excluded18 = ["callback"],
|
|
21
|
+
_excluded19 = ["callback"],
|
|
22
|
+
_excluded20 = ["callback"];
|
|
23
23
|
import { takeLatest, put, call, all, takeEvery, select as sagaSelect } from 'redux-saga/effects';
|
|
24
24
|
import { api } from '@frontegg/rest-api';
|
|
25
25
|
import { actions } from '../reducer';
|
|
@@ -28,15 +28,13 @@ import { authStoreName } from '../../constants';
|
|
|
28
28
|
import { delay } from '../utils';
|
|
29
29
|
import { allUsersDemo, permissionsDemo, rolesDemo, usersDemo, userTeamDemo } from '../dummy';
|
|
30
30
|
import { v4 as uuidv4 } from 'uuid';
|
|
31
|
+
const selectTeamState = () => sagaSelect(_ => _[authStoreName].teamState);
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
34
|
function* loadUsers({
|
|
36
35
|
payload
|
|
37
36
|
}) {
|
|
38
37
|
var _payload$pageSize, _payload$pageOffset, _payload$filter, _payload$sort;
|
|
39
|
-
|
|
40
38
|
const {
|
|
41
39
|
silentLoading,
|
|
42
40
|
callback
|
|
@@ -56,7 +54,6 @@ function* loadUsers({
|
|
|
56
54
|
filter,
|
|
57
55
|
sort
|
|
58
56
|
}));
|
|
59
|
-
|
|
60
57
|
try {
|
|
61
58
|
const [{
|
|
62
59
|
items: users,
|
|
@@ -91,35 +88,27 @@ function* loadUsers({
|
|
|
91
88
|
}));
|
|
92
89
|
callback == null ? void 0 : callback(null, e);
|
|
93
90
|
}
|
|
94
|
-
|
|
95
91
|
yield put(actions.setTeamLoader({
|
|
96
92
|
key: TeamStateKeys.USERS,
|
|
97
93
|
value: false
|
|
98
94
|
}));
|
|
99
|
-
}
|
|
100
|
-
|
|
95
|
+
}
|
|
101
96
|
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
98
|
function* loadAllSubTenantsUsers({
|
|
103
99
|
payload
|
|
104
100
|
}) {
|
|
105
101
|
var _payload$_limit, _payload$_offset, _payload$_filter, _payload$_sortBy, _payload$_order;
|
|
106
|
-
|
|
107
102
|
const {
|
|
108
103
|
silentLoading,
|
|
109
104
|
callback
|
|
110
105
|
} = payload;
|
|
111
106
|
const teamState = yield selectTeamState();
|
|
112
|
-
|
|
113
107
|
const _limit = (_payload$_limit = payload._limit) != null ? _payload$_limit : teamState.allUsersQueryParams._limit;
|
|
114
|
-
|
|
115
108
|
const _offset = (_payload$_offset = payload._offset) != null ? _payload$_offset : teamState.allUsersQueryParams._offset;
|
|
116
|
-
|
|
117
109
|
const _filter = (_payload$_filter = payload._filter) != null ? _payload$_filter : teamState.allUsersQueryParams._filter;
|
|
118
|
-
|
|
119
110
|
const _sortBy = (_payload$_sortBy = payload._sortBy) != null ? _payload$_sortBy : teamState.allUsersQueryParams._sortBy;
|
|
120
|
-
|
|
121
111
|
const _order = (_payload$_order = payload._order) != null ? _payload$_order : teamState.allUsersQueryParams._order;
|
|
122
|
-
|
|
123
112
|
const allUsersQueryParams = {
|
|
124
113
|
_limit: _limit || 20,
|
|
125
114
|
_offset: _offset || 0,
|
|
@@ -134,7 +123,6 @@ function* loadAllSubTenantsUsers({
|
|
|
134
123
|
yield put(actions.setTeamState({
|
|
135
124
|
allUsersQueryParams
|
|
136
125
|
}));
|
|
137
|
-
|
|
138
126
|
try {
|
|
139
127
|
const [{
|
|
140
128
|
items: users,
|
|
@@ -166,13 +154,11 @@ function* loadAllSubTenantsUsers({
|
|
|
166
154
|
}));
|
|
167
155
|
callback == null ? void 0 : callback(null, e);
|
|
168
156
|
}
|
|
169
|
-
|
|
170
157
|
yield put(actions.setTeamLoader({
|
|
171
158
|
key: TeamStateKeys.USERS,
|
|
172
159
|
value: false
|
|
173
160
|
}));
|
|
174
161
|
}
|
|
175
|
-
|
|
176
162
|
function* loadRoles({
|
|
177
163
|
payload
|
|
178
164
|
}) {
|
|
@@ -180,10 +166,8 @@ function* loadRoles({
|
|
|
180
166
|
key: TeamStateKeys.ROLES_AND_PERMISSIONS,
|
|
181
167
|
value: true
|
|
182
168
|
}));
|
|
183
|
-
|
|
184
169
|
try {
|
|
185
170
|
var _payload$callback;
|
|
186
|
-
|
|
187
171
|
const [{
|
|
188
172
|
items: roles
|
|
189
173
|
}, {
|
|
@@ -199,49 +183,40 @@ function* loadRoles({
|
|
|
199
183
|
});
|
|
200
184
|
} catch (e) {
|
|
201
185
|
var _payload$callback2;
|
|
202
|
-
|
|
203
186
|
payload == null ? void 0 : (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, null, e);
|
|
204
187
|
yield put(actions.setTeamError({
|
|
205
188
|
key: TeamStateKeys.ROLES_AND_PERMISSIONS,
|
|
206
189
|
value: e.message
|
|
207
190
|
}));
|
|
208
191
|
}
|
|
209
|
-
|
|
210
192
|
yield put(actions.setTeamLoader({
|
|
211
193
|
key: TeamStateKeys.ROLES_AND_PERMISSIONS,
|
|
212
194
|
value: true
|
|
213
195
|
}));
|
|
214
196
|
}
|
|
215
|
-
|
|
216
197
|
function* addUser({
|
|
217
198
|
payload
|
|
218
199
|
}) {
|
|
219
200
|
const {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
201
|
+
callback
|
|
202
|
+
} = payload,
|
|
203
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded);
|
|
224
204
|
const teamState = yield selectTeamState();
|
|
225
205
|
yield put(actions.setTeamState({
|
|
226
206
|
addUserDialogState: _extends({}, teamState.addUserDialogState, {
|
|
227
207
|
loading: true
|
|
228
208
|
})
|
|
229
209
|
}));
|
|
230
|
-
|
|
231
210
|
try {
|
|
232
211
|
const res = yield call(api.teams.addUser, body);
|
|
233
|
-
|
|
234
212
|
const {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
213
|
+
roles
|
|
214
|
+
} = res,
|
|
215
|
+
userWithoutRoleIds = _objectWithoutPropertiesLoose(res, _excluded2);
|
|
239
216
|
const roleIds = roles.map(role => role.id);
|
|
240
|
-
|
|
241
217
|
const newUser = _extends({}, userWithoutRoleIds, {
|
|
242
218
|
roleIds
|
|
243
219
|
});
|
|
244
|
-
|
|
245
220
|
callback == null ? void 0 : callback(newUser);
|
|
246
221
|
yield put(actions.setTeamState({
|
|
247
222
|
users: [newUser, ...teamState.users],
|
|
@@ -260,7 +235,6 @@ function* addUser({
|
|
|
260
235
|
callback == null ? void 0 : callback(null, e.message);
|
|
261
236
|
}
|
|
262
237
|
}
|
|
263
|
-
|
|
264
238
|
function* addUsersBulk({
|
|
265
239
|
payload
|
|
266
240
|
}) {
|
|
@@ -285,10 +259,8 @@ function* addUsersBulk({
|
|
|
285
259
|
loading: true
|
|
286
260
|
}
|
|
287
261
|
}));
|
|
288
|
-
|
|
289
262
|
for (let i = 0; i < bodies.length; i++) {
|
|
290
263
|
const body = bodies.at(i);
|
|
291
|
-
|
|
292
264
|
try {
|
|
293
265
|
yield call(api.teams.addUser, body);
|
|
294
266
|
allowedEmails.push(body.email);
|
|
@@ -296,7 +268,6 @@ function* addUsersBulk({
|
|
|
296
268
|
unallowedEmails.push(body.email);
|
|
297
269
|
}
|
|
298
270
|
}
|
|
299
|
-
|
|
300
271
|
const queryObject = {
|
|
301
272
|
pageOffset: 0,
|
|
302
273
|
pageSize: 10,
|
|
@@ -314,22 +285,19 @@ function* addUsersBulk({
|
|
|
314
285
|
allowedEmails
|
|
315
286
|
});
|
|
316
287
|
}
|
|
317
|
-
|
|
318
288
|
function* addUserToSubTenants({
|
|
319
289
|
payload
|
|
320
290
|
}) {
|
|
321
291
|
const {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
292
|
+
callback
|
|
293
|
+
} = payload,
|
|
294
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded3);
|
|
326
295
|
const teamState = yield selectTeamState();
|
|
327
296
|
yield put(actions.setTeamState({
|
|
328
297
|
addUserDialogState: _extends({}, teamState.addUserDialogState, {
|
|
329
298
|
loading: true
|
|
330
299
|
})
|
|
331
300
|
}));
|
|
332
|
-
|
|
333
301
|
try {
|
|
334
302
|
yield call(api.subTenants.addUserToTenantAndSubTenants, body);
|
|
335
303
|
const {
|
|
@@ -365,15 +333,13 @@ function* addUserToSubTenants({
|
|
|
365
333
|
callback == null ? void 0 : callback(null, e.message);
|
|
366
334
|
}
|
|
367
335
|
}
|
|
368
|
-
|
|
369
336
|
function* updateUser({
|
|
370
337
|
payload
|
|
371
338
|
}) {
|
|
372
339
|
const {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
340
|
+
callback
|
|
341
|
+
} = payload,
|
|
342
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded4);
|
|
377
343
|
const {
|
|
378
344
|
id: userId
|
|
379
345
|
} = body;
|
|
@@ -396,18 +362,14 @@ function* updateUser({
|
|
|
396
362
|
if (user.id === body.id) {
|
|
397
363
|
return _extends({}, user, body);
|
|
398
364
|
}
|
|
399
|
-
|
|
400
365
|
return user;
|
|
401
366
|
})
|
|
402
367
|
}));
|
|
403
|
-
|
|
404
368
|
try {
|
|
405
369
|
var _body$roleIds;
|
|
406
|
-
|
|
407
370
|
if (oldUserData.roleIds.length > 0 && ((_body$roleIds = body.roleIds) == null ? void 0 : _body$roleIds.length) === 0) {
|
|
408
371
|
body.roleIds = [''];
|
|
409
372
|
}
|
|
410
|
-
|
|
411
373
|
const {
|
|
412
374
|
item: newUser
|
|
413
375
|
} = yield call(api.teams.updateUser, body);
|
|
@@ -438,22 +400,19 @@ function* updateUser({
|
|
|
438
400
|
callback == null ? void 0 : callback(null, e.message);
|
|
439
401
|
}
|
|
440
402
|
}
|
|
441
|
-
|
|
442
403
|
function* deleteUser({
|
|
443
404
|
payload
|
|
444
405
|
}) {
|
|
445
406
|
const {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
407
|
+
callback
|
|
408
|
+
} = payload,
|
|
409
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded5);
|
|
450
410
|
const teamState = yield selectTeamState();
|
|
451
411
|
yield put(actions.setTeamState({
|
|
452
412
|
deleteUserDialogState: _extends({}, teamState.deleteUserDialogState, {
|
|
453
413
|
loading: true
|
|
454
414
|
})
|
|
455
415
|
}));
|
|
456
|
-
|
|
457
416
|
try {
|
|
458
417
|
yield call(api.teams.deleteUser, body);
|
|
459
418
|
callback == null ? void 0 : callback(true);
|
|
@@ -474,32 +433,27 @@ function* deleteUser({
|
|
|
474
433
|
callback == null ? void 0 : callback(null, e.message);
|
|
475
434
|
}
|
|
476
435
|
}
|
|
477
|
-
|
|
478
436
|
function* setUserRolesForSubTenants({
|
|
479
437
|
payload
|
|
480
438
|
}) {
|
|
481
439
|
const {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
440
|
+
callback,
|
|
441
|
+
userId
|
|
442
|
+
} = payload,
|
|
443
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded6);
|
|
487
444
|
const teamState = yield selectTeamState();
|
|
488
445
|
yield put(actions.setTeamState({
|
|
489
446
|
addUserDialogState: _extends({}, teamState.addUserDialogState, {
|
|
490
447
|
loading: true
|
|
491
448
|
})
|
|
492
449
|
}));
|
|
493
|
-
|
|
494
450
|
try {
|
|
495
451
|
yield call(api.subTenants.setUserRolesForSubTenants, userId, body);
|
|
496
452
|
const updatedUser = teamState.allUsers.find(user => user.id === userId);
|
|
497
453
|
let newTenants = [];
|
|
498
|
-
|
|
499
454
|
if (updatedUser) {
|
|
500
455
|
newTenants = updatedUser.tenants.map(tenant => {
|
|
501
456
|
var _body$subTenantsRoles;
|
|
502
|
-
|
|
503
457
|
return _extends({}, tenant, {
|
|
504
458
|
roles: ((_body$subTenantsRoles = body.subTenantsRoles.find(roleUpdate => roleUpdate.tenantId === tenant.tenantId)) == null ? void 0 : _body$subTenantsRoles.roleIds.map(roleId => {
|
|
505
459
|
const role = teamState.roles.find(({
|
|
@@ -510,7 +464,6 @@ function* setUserRolesForSubTenants({
|
|
|
510
464
|
});
|
|
511
465
|
});
|
|
512
466
|
}
|
|
513
|
-
|
|
514
467
|
yield put(actions.setTeamState({
|
|
515
468
|
allUsers: [...teamState.allUsers.filter(user => user.id !== userId), ...(updatedUser ? [_extends({}, updatedUser, {
|
|
516
469
|
tenants: newTenants
|
|
@@ -531,22 +484,19 @@ function* setUserRolesForSubTenants({
|
|
|
531
484
|
callback == null ? void 0 : callback(null, e.message);
|
|
532
485
|
}
|
|
533
486
|
}
|
|
534
|
-
|
|
535
487
|
function* deleteUserFromSubTenants({
|
|
536
488
|
payload
|
|
537
489
|
}) {
|
|
538
490
|
const {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
491
|
+
callback
|
|
492
|
+
} = payload,
|
|
493
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded7);
|
|
543
494
|
const teamState = yield selectTeamState();
|
|
544
495
|
yield put(actions.setTeamState({
|
|
545
496
|
deleteUserDialogState: _extends({}, teamState.deleteUserDialogState, {
|
|
546
497
|
loading: true
|
|
547
498
|
})
|
|
548
499
|
}));
|
|
549
|
-
|
|
550
500
|
try {
|
|
551
501
|
yield call(api.subTenants.removeUserFromTenantAndSubTenants, body);
|
|
552
502
|
callback == null ? void 0 : callback(true);
|
|
@@ -567,20 +517,17 @@ function* deleteUserFromSubTenants({
|
|
|
567
517
|
callback == null ? void 0 : callback(null, e.message);
|
|
568
518
|
}
|
|
569
519
|
}
|
|
570
|
-
|
|
571
520
|
function* resendActivationLink({
|
|
572
521
|
payload
|
|
573
522
|
}) {
|
|
574
523
|
const {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
524
|
+
callback
|
|
525
|
+
} = payload,
|
|
526
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded8);
|
|
579
527
|
yield put(actions.setTeamLoader({
|
|
580
528
|
key: TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
581
529
|
value: body.userId
|
|
582
530
|
}));
|
|
583
|
-
|
|
584
531
|
try {
|
|
585
532
|
yield call(api.teams.resendActivationLink, body);
|
|
586
533
|
callback == null ? void 0 : callback(true);
|
|
@@ -591,26 +538,22 @@ function* resendActivationLink({
|
|
|
591
538
|
}));
|
|
592
539
|
callback == null ? void 0 : callback(null, e.message);
|
|
593
540
|
}
|
|
594
|
-
|
|
595
541
|
yield put(actions.setTeamLoader({
|
|
596
542
|
key: TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
597
543
|
value: false
|
|
598
544
|
}));
|
|
599
545
|
}
|
|
600
|
-
|
|
601
546
|
function* resendInvitationLink({
|
|
602
547
|
payload
|
|
603
548
|
}) {
|
|
604
549
|
const {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
550
|
+
callback
|
|
551
|
+
} = payload,
|
|
552
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded9);
|
|
609
553
|
yield put(actions.setTeamLoader({
|
|
610
554
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
611
555
|
value: body.email
|
|
612
556
|
}));
|
|
613
|
-
|
|
614
557
|
try {
|
|
615
558
|
yield call(api.teams.resendInvitationLink, body);
|
|
616
559
|
callback == null ? void 0 : callback(true);
|
|
@@ -621,26 +564,22 @@ function* resendInvitationLink({
|
|
|
621
564
|
}));
|
|
622
565
|
callback == null ? void 0 : callback(null, e.message);
|
|
623
566
|
}
|
|
624
|
-
|
|
625
567
|
yield put(actions.setTeamLoader({
|
|
626
568
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
627
569
|
value: false
|
|
628
570
|
}));
|
|
629
571
|
}
|
|
630
|
-
|
|
631
572
|
function* resendInvitationEmail({
|
|
632
573
|
payload
|
|
633
574
|
}) {
|
|
634
575
|
const {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
576
|
+
callback
|
|
577
|
+
} = payload,
|
|
578
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded10);
|
|
639
579
|
yield put(actions.setTeamLoader({
|
|
640
580
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
641
581
|
value: body.email
|
|
642
582
|
}));
|
|
643
|
-
|
|
644
583
|
try {
|
|
645
584
|
yield call(api.auth.resendInvitationEmail, body);
|
|
646
585
|
callback == null ? void 0 : callback(true);
|
|
@@ -651,26 +590,22 @@ function* resendInvitationEmail({
|
|
|
651
590
|
}));
|
|
652
591
|
callback == null ? void 0 : callback(null, e.message);
|
|
653
592
|
}
|
|
654
|
-
|
|
655
593
|
yield put(actions.setTeamLoader({
|
|
656
594
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
657
595
|
value: false
|
|
658
596
|
}));
|
|
659
597
|
}
|
|
660
|
-
|
|
661
598
|
function* resendInvitationLinkToAllSubTenants({
|
|
662
599
|
payload
|
|
663
600
|
}) {
|
|
664
601
|
const {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
602
|
+
callback
|
|
603
|
+
} = payload,
|
|
604
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded11);
|
|
669
605
|
yield put(actions.setTeamLoader({
|
|
670
606
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
671
607
|
value: body.email
|
|
672
608
|
}));
|
|
673
|
-
|
|
674
609
|
try {
|
|
675
610
|
yield call(api.teams.resendInvitationLinkToAllTenants, body);
|
|
676
611
|
callback == null ? void 0 : callback(true);
|
|
@@ -681,19 +616,16 @@ function* resendInvitationLinkToAllSubTenants({
|
|
|
681
616
|
}));
|
|
682
617
|
callback == null ? void 0 : callback(null, e.message);
|
|
683
618
|
}
|
|
684
|
-
|
|
685
619
|
yield put(actions.setTeamLoader({
|
|
686
620
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
687
621
|
value: false
|
|
688
622
|
}));
|
|
689
623
|
}
|
|
690
|
-
|
|
691
624
|
function* getInvitationLinkConfig() {
|
|
692
625
|
yield put(actions.setTeamError({
|
|
693
626
|
key: TeamStateKeys.CONFIG_TOKEN_LINK,
|
|
694
627
|
value: false
|
|
695
628
|
}));
|
|
696
|
-
|
|
697
629
|
try {
|
|
698
630
|
const invitationLinkConfig = yield call(api.teams.getInviteLinkConfiguration);
|
|
699
631
|
yield put(actions.setTeamState({
|
|
@@ -706,13 +638,11 @@ function* getInvitationLinkConfig() {
|
|
|
706
638
|
}));
|
|
707
639
|
}
|
|
708
640
|
}
|
|
709
|
-
|
|
710
641
|
function* getInvitationLink() {
|
|
711
642
|
yield put(actions.setTeamError({
|
|
712
643
|
key: TeamStateKeys.GET_TOKEN_LINK,
|
|
713
644
|
value: false
|
|
714
645
|
}));
|
|
715
|
-
|
|
716
646
|
try {
|
|
717
647
|
yield call(getInvitationLinkConfig);
|
|
718
648
|
const data = yield call(api.teams.getInviteUserLink);
|
|
@@ -729,7 +659,6 @@ function* getInvitationLink() {
|
|
|
729
659
|
}));
|
|
730
660
|
}
|
|
731
661
|
}
|
|
732
|
-
|
|
733
662
|
function* createInvitationLink({
|
|
734
663
|
payload: {
|
|
735
664
|
callback
|
|
@@ -742,7 +671,6 @@ function* createInvitationLink({
|
|
|
742
671
|
const {
|
|
743
672
|
inviteTokenState
|
|
744
673
|
} = yield selectTeamState();
|
|
745
|
-
|
|
746
674
|
try {
|
|
747
675
|
const data = yield call(api.teams.createInviteUserLink, {
|
|
748
676
|
expiresInMinutes: 43200
|
|
@@ -759,7 +687,6 @@ function* createInvitationLink({
|
|
|
759
687
|
}));
|
|
760
688
|
}
|
|
761
689
|
}
|
|
762
|
-
|
|
763
690
|
function* updateInvitationLink({
|
|
764
691
|
payload: {
|
|
765
692
|
callback,
|
|
@@ -774,7 +701,6 @@ function* updateInvitationLink({
|
|
|
774
701
|
key: TeamStateKeys.UPDATE_TOKEN_LINK,
|
|
775
702
|
value: false
|
|
776
703
|
}));
|
|
777
|
-
|
|
778
704
|
try {
|
|
779
705
|
const data = yield call(api.teams.updateInviteUserLink, {
|
|
780
706
|
expiresInMinutes,
|
|
@@ -792,7 +718,6 @@ function* updateInvitationLink({
|
|
|
792
718
|
}));
|
|
793
719
|
}
|
|
794
720
|
}
|
|
795
|
-
|
|
796
721
|
function* deleteInvitationLink({
|
|
797
722
|
payload
|
|
798
723
|
}) {
|
|
@@ -803,7 +728,6 @@ function* deleteInvitationLink({
|
|
|
803
728
|
key: TeamStateKeys.DELETE_TOKEN_LINK,
|
|
804
729
|
value: false
|
|
805
730
|
}));
|
|
806
|
-
|
|
807
731
|
try {
|
|
808
732
|
yield call(api.teams.deleteInviteUserLink);
|
|
809
733
|
yield put(actions.setTeamState({
|
|
@@ -818,7 +742,6 @@ function* deleteInvitationLink({
|
|
|
818
742
|
callback == null ? void 0 : callback(false, e.message);
|
|
819
743
|
}
|
|
820
744
|
}
|
|
821
|
-
|
|
822
745
|
function* openAddUserDialog({
|
|
823
746
|
payload
|
|
824
747
|
}) {
|
|
@@ -830,7 +753,6 @@ function* openAddUserDialog({
|
|
|
830
753
|
}, payload)
|
|
831
754
|
}));
|
|
832
755
|
}
|
|
833
|
-
|
|
834
756
|
function* closeAddUserDialog({
|
|
835
757
|
payload
|
|
836
758
|
}) {
|
|
@@ -849,7 +771,6 @@ function* closeAddUserDialog({
|
|
|
849
771
|
}
|
|
850
772
|
}));
|
|
851
773
|
}
|
|
852
|
-
|
|
853
774
|
function* openDeleteUserDialog({
|
|
854
775
|
payload
|
|
855
776
|
}) {
|
|
@@ -861,7 +782,6 @@ function* openDeleteUserDialog({
|
|
|
861
782
|
}, payload)
|
|
862
783
|
}));
|
|
863
784
|
}
|
|
864
|
-
|
|
865
785
|
function* closeDeleteUserDialog({
|
|
866
786
|
payload
|
|
867
787
|
}) {
|
|
@@ -880,7 +800,6 @@ function* closeDeleteUserDialog({
|
|
|
880
800
|
}
|
|
881
801
|
}));
|
|
882
802
|
}
|
|
883
|
-
|
|
884
803
|
export function* teamSagas() {
|
|
885
804
|
yield takeLatest(actions.loadUsers, loadUsers);
|
|
886
805
|
yield takeLatest(actions.loadAllSubTenantsUsers, loadAllSubTenantsUsers);
|
|
@@ -905,6 +824,7 @@ export function* teamSagas() {
|
|
|
905
824
|
yield takeEvery(actions.openDeleteUserDialog, openDeleteUserDialog);
|
|
906
825
|
yield takeEvery(actions.closeDeleteUserDialog, closeDeleteUserDialog);
|
|
907
826
|
}
|
|
827
|
+
|
|
908
828
|
/*********************************
|
|
909
829
|
* Preview Sagas
|
|
910
830
|
*********************************/
|
|
@@ -913,7 +833,6 @@ function* loadUsersMock({
|
|
|
913
833
|
payload
|
|
914
834
|
}) {
|
|
915
835
|
var _payload$pageSize2, _payload$pageOffset2, _payload$filter2, _payload$sort2;
|
|
916
|
-
|
|
917
836
|
const {
|
|
918
837
|
silentLoading,
|
|
919
838
|
callback
|
|
@@ -949,28 +868,20 @@ function* loadUsersMock({
|
|
|
949
868
|
}));
|
|
950
869
|
callback == null ? void 0 : callback(usersDemo);
|
|
951
870
|
}
|
|
952
|
-
|
|
953
871
|
function* loadAllSubTenantsUsersMock({
|
|
954
872
|
payload
|
|
955
873
|
}) {
|
|
956
874
|
var _payload$_limit2, _payload$_offset2, _payload$_filter2, _payload$_sortBy2, _payload$_order2;
|
|
957
|
-
|
|
958
875
|
const {
|
|
959
876
|
silentLoading,
|
|
960
877
|
callback
|
|
961
878
|
} = payload;
|
|
962
879
|
const teamState = yield selectTeamState();
|
|
963
|
-
|
|
964
880
|
const _limit = (_payload$_limit2 = payload._limit) != null ? _payload$_limit2 : teamState.allUsersQueryParams._limit;
|
|
965
|
-
|
|
966
881
|
const _offset = (_payload$_offset2 = payload._offset) != null ? _payload$_offset2 : teamState.allUsersQueryParams._offset;
|
|
967
|
-
|
|
968
882
|
const _filter = (_payload$_filter2 = payload._filter) != null ? _payload$_filter2 : teamState.allUsersQueryParams._filter;
|
|
969
|
-
|
|
970
883
|
const _sortBy = (_payload$_sortBy2 = payload._sortBy) != null ? _payload$_sortBy2 : teamState.allUsersQueryParams._sortBy;
|
|
971
|
-
|
|
972
884
|
const _order = (_payload$_order2 = payload._order) != null ? _payload$_order2 : teamState.allUsersQueryParams._order;
|
|
973
|
-
|
|
974
885
|
yield put(actions.setTeamLoader({
|
|
975
886
|
key: TeamStateKeys.USERS,
|
|
976
887
|
value: !silentLoading
|
|
@@ -1000,12 +911,10 @@ function* loadAllSubTenantsUsersMock({
|
|
|
1000
911
|
}));
|
|
1001
912
|
callback == null ? void 0 : callback(allUsersDemo);
|
|
1002
913
|
}
|
|
1003
|
-
|
|
1004
914
|
function* loadRolesMock({
|
|
1005
915
|
payload
|
|
1006
916
|
}) {
|
|
1007
917
|
var _payload$callback3;
|
|
1008
|
-
|
|
1009
918
|
yield put(actions.setTeamLoader({
|
|
1010
919
|
key: TeamStateKeys.ROLES_AND_PERMISSIONS,
|
|
1011
920
|
value: true
|
|
@@ -1024,15 +933,13 @@ function* loadRolesMock({
|
|
|
1024
933
|
permissions: permissionsDemo
|
|
1025
934
|
});
|
|
1026
935
|
}
|
|
1027
|
-
|
|
1028
936
|
function* addUserMock({
|
|
1029
937
|
payload
|
|
1030
938
|
}) {
|
|
1031
939
|
const {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
940
|
+
callback
|
|
941
|
+
} = payload,
|
|
942
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded12);
|
|
1036
943
|
const teamState = yield selectTeamState();
|
|
1037
944
|
yield put(actions.setTeamState({
|
|
1038
945
|
addUserDialogState: _extends({}, teamState.addUserDialogState, {
|
|
@@ -1040,11 +947,9 @@ function* addUserMock({
|
|
|
1040
947
|
})
|
|
1041
948
|
}));
|
|
1042
949
|
yield delay();
|
|
1043
|
-
|
|
1044
950
|
const newUser = _extends({}, userTeamDemo, body, {
|
|
1045
951
|
id: `${uuidv4()}`
|
|
1046
952
|
});
|
|
1047
|
-
|
|
1048
953
|
callback == null ? void 0 : callback(newUser);
|
|
1049
954
|
yield put(actions.setTeamState({
|
|
1050
955
|
users: [newUser, ...teamState.users],
|
|
@@ -1054,15 +959,13 @@ function* addUserMock({
|
|
|
1054
959
|
}
|
|
1055
960
|
}));
|
|
1056
961
|
}
|
|
1057
|
-
|
|
1058
962
|
function* addUserToSubTenantsMock({
|
|
1059
963
|
payload
|
|
1060
964
|
}) {
|
|
1061
965
|
const {
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
966
|
+
callback
|
|
967
|
+
} = payload,
|
|
968
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded13);
|
|
1066
969
|
const teamState = yield selectTeamState();
|
|
1067
970
|
yield put(actions.setTeamState({
|
|
1068
971
|
addUserDialogState: _extends({}, teamState.addUserDialogState, {
|
|
@@ -1070,11 +973,9 @@ function* addUserToSubTenantsMock({
|
|
|
1070
973
|
})
|
|
1071
974
|
}));
|
|
1072
975
|
yield delay();
|
|
1073
|
-
|
|
1074
976
|
const newUser = _extends({}, userTeamDemo, body, {
|
|
1075
977
|
id: `${uuidv4()}`
|
|
1076
978
|
});
|
|
1077
|
-
|
|
1078
979
|
yield put(actions.setTeamState({
|
|
1079
980
|
users: [newUser, ...teamState.users],
|
|
1080
981
|
addUserDialogState: {
|
|
@@ -1084,17 +985,14 @@ function* addUserToSubTenantsMock({
|
|
|
1084
985
|
}));
|
|
1085
986
|
callback == null ? void 0 : callback(null);
|
|
1086
987
|
}
|
|
1087
|
-
|
|
1088
988
|
function* updateUserMock({
|
|
1089
989
|
payload
|
|
1090
990
|
}) {
|
|
1091
991
|
var _body$roleIds2;
|
|
1092
|
-
|
|
1093
992
|
const {
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
993
|
+
callback
|
|
994
|
+
} = payload,
|
|
995
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded14);
|
|
1098
996
|
const {
|
|
1099
997
|
id: userId
|
|
1100
998
|
} = body;
|
|
@@ -1117,19 +1015,14 @@ function* updateUserMock({
|
|
|
1117
1015
|
if (user.id === body.id) {
|
|
1118
1016
|
return _extends({}, user, body);
|
|
1119
1017
|
}
|
|
1120
|
-
|
|
1121
1018
|
return user;
|
|
1122
1019
|
})
|
|
1123
1020
|
}));
|
|
1124
|
-
|
|
1125
1021
|
if (oldUserData.roleIds.length > 0 && ((_body$roleIds2 = body.roleIds) == null ? void 0 : _body$roleIds2.length) === 0) {
|
|
1126
1022
|
body.roleIds = [''];
|
|
1127
1023
|
}
|
|
1128
|
-
|
|
1129
1024
|
yield delay();
|
|
1130
|
-
|
|
1131
1025
|
const newUser = _extends({}, oldUserData, body);
|
|
1132
|
-
|
|
1133
1026
|
callback == null ? void 0 : callback(newUser);
|
|
1134
1027
|
yield put(actions.setTeamState({
|
|
1135
1028
|
users: teamState.users.map(user => user.id === newUser.id ? _extends({}, user, newUser, {
|
|
@@ -1143,15 +1036,13 @@ function* updateUserMock({
|
|
|
1143
1036
|
value: false
|
|
1144
1037
|
}));
|
|
1145
1038
|
}
|
|
1146
|
-
|
|
1147
1039
|
function* deleteUserMock({
|
|
1148
1040
|
payload
|
|
1149
1041
|
}) {
|
|
1150
1042
|
const {
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1043
|
+
callback
|
|
1044
|
+
} = payload,
|
|
1045
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded15);
|
|
1155
1046
|
const teamState = yield selectTeamState();
|
|
1156
1047
|
yield put(actions.setTeamState({
|
|
1157
1048
|
deleteUserDialogState: _extends({}, teamState.deleteUserDialogState, {
|
|
@@ -1168,15 +1059,13 @@ function* deleteUserMock({
|
|
|
1168
1059
|
}
|
|
1169
1060
|
}));
|
|
1170
1061
|
}
|
|
1171
|
-
|
|
1172
1062
|
function* deleteUserFromSubTenantsMock({
|
|
1173
1063
|
payload
|
|
1174
1064
|
}) {
|
|
1175
1065
|
const {
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1066
|
+
callback
|
|
1067
|
+
} = payload,
|
|
1068
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded16);
|
|
1180
1069
|
const teamState = yield selectTeamState();
|
|
1181
1070
|
yield put(actions.setTeamState({
|
|
1182
1071
|
deleteUserDialogState: _extends({}, teamState.deleteUserDialogState, {
|
|
@@ -1193,15 +1082,13 @@ function* deleteUserFromSubTenantsMock({
|
|
|
1193
1082
|
}
|
|
1194
1083
|
}));
|
|
1195
1084
|
}
|
|
1196
|
-
|
|
1197
1085
|
function* resendActivationLinkMock({
|
|
1198
1086
|
payload
|
|
1199
1087
|
}) {
|
|
1200
1088
|
const {
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1089
|
+
callback
|
|
1090
|
+
} = payload,
|
|
1091
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded17);
|
|
1205
1092
|
yield put(actions.setTeamLoader({
|
|
1206
1093
|
key: TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
1207
1094
|
value: body.userId
|
|
@@ -1213,15 +1100,13 @@ function* resendActivationLinkMock({
|
|
|
1213
1100
|
value: false
|
|
1214
1101
|
}));
|
|
1215
1102
|
}
|
|
1216
|
-
|
|
1217
1103
|
function* resendInvitationLinkMock({
|
|
1218
1104
|
payload
|
|
1219
1105
|
}) {
|
|
1220
1106
|
const {
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1107
|
+
callback
|
|
1108
|
+
} = payload,
|
|
1109
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded18);
|
|
1225
1110
|
yield put(actions.setTeamLoader({
|
|
1226
1111
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
1227
1112
|
value: body.email
|
|
@@ -1233,15 +1118,13 @@ function* resendInvitationLinkMock({
|
|
|
1233
1118
|
value: false
|
|
1234
1119
|
}));
|
|
1235
1120
|
}
|
|
1236
|
-
|
|
1237
1121
|
function* resendInvitationEmailMock({
|
|
1238
1122
|
payload
|
|
1239
1123
|
}) {
|
|
1240
1124
|
const {
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1125
|
+
callback
|
|
1126
|
+
} = payload,
|
|
1127
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded19);
|
|
1245
1128
|
yield put(actions.setTeamLoader({
|
|
1246
1129
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
1247
1130
|
value: body.email
|
|
@@ -1253,15 +1136,13 @@ function* resendInvitationEmailMock({
|
|
|
1253
1136
|
value: false
|
|
1254
1137
|
}));
|
|
1255
1138
|
}
|
|
1256
|
-
|
|
1257
1139
|
function* resendInvitationLinkToAllSubTenantsMock({
|
|
1258
1140
|
payload
|
|
1259
1141
|
}) {
|
|
1260
1142
|
const {
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1143
|
+
callback
|
|
1144
|
+
} = payload,
|
|
1145
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded20);
|
|
1265
1146
|
yield put(actions.setTeamLoader({
|
|
1266
1147
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
1267
1148
|
value: body.email
|
|
@@ -1273,7 +1154,6 @@ function* resendInvitationLinkToAllSubTenantsMock({
|
|
|
1273
1154
|
value: false
|
|
1274
1155
|
}));
|
|
1275
1156
|
}
|
|
1276
|
-
|
|
1277
1157
|
export function* teamSagasMock() {
|
|
1278
1158
|
yield takeLatest(actions.loadUsers, loadUsersMock);
|
|
1279
1159
|
yield takeLatest(actions.loadAllSubTenantsUsers, loadAllSubTenantsUsersMock);
|