@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,52 +1,36 @@
|
|
|
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.restrictionsSagaMock = restrictionsSagaMock;
|
|
9
8
|
exports.restrictionsSagas = restrictionsSagas;
|
|
10
|
-
|
|
11
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
-
|
|
13
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
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 _uuid = require("uuid");
|
|
22
|
-
|
|
23
15
|
var _constants = require("../../constants");
|
|
24
|
-
|
|
25
16
|
var _dummy = require("../dummy");
|
|
26
|
-
|
|
27
17
|
var _utils = require("../utils");
|
|
28
|
-
|
|
29
18
|
const _excluded = ["callback"],
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
_excluded2 = ["callback"],
|
|
20
|
+
_excluded3 = ["callback"],
|
|
21
|
+
_excluded4 = ["callback"],
|
|
22
|
+
_excluded5 = ["callback"],
|
|
23
|
+
_excluded6 = ["callback"],
|
|
24
|
+
_excluded7 = ["callback"],
|
|
25
|
+
_excluded8 = ["callback"];
|
|
38
26
|
const selectIpRestrictionsState = () => (0, _effects.select)(_ => _[_constants.authStoreName].restrictionsState.ipRestrictions);
|
|
39
|
-
|
|
40
27
|
const selectUserIp = () => (0, _effects.select)(_ => _[_constants.authStoreName].userIp);
|
|
41
|
-
|
|
42
28
|
const selectEmailDomainRestrictionsState = () => (0, _effects.select)(_ => _[_constants.authStoreName].restrictionsState.emailDomainRestrictions);
|
|
43
|
-
|
|
44
29
|
function* loadEmailDomainRestrictions() {
|
|
45
30
|
yield (0, _effects.put)(_reducer.actions.setEmailDomainRestrictionsState({
|
|
46
31
|
loading: true,
|
|
47
32
|
error: null
|
|
48
33
|
}));
|
|
49
|
-
|
|
50
34
|
try {
|
|
51
35
|
const restrictionsConfig = yield (0, _effects.call)(_restApi.api.auth.getDomainRestrictionsConfig);
|
|
52
36
|
const restrictions = yield (0, _effects.call)(_restApi.api.auth.getDomainRestrictions);
|
|
@@ -65,28 +49,24 @@ function* loadEmailDomainRestrictions() {
|
|
|
65
49
|
}));
|
|
66
50
|
}
|
|
67
51
|
}
|
|
68
|
-
|
|
69
52
|
function* saveEmailDomainRestriction(_ref) {
|
|
70
53
|
let {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
payload: {
|
|
55
|
+
callback
|
|
56
|
+
}
|
|
57
|
+
} = _ref,
|
|
58
|
+
newRestriction = (0, _objectWithoutPropertiesLoose2.default)(_ref.payload, _excluded);
|
|
76
59
|
yield (0, _effects.put)(_reducer.actions.setEmailDomainRestrictionsState({
|
|
77
60
|
saving: true,
|
|
78
61
|
error: null
|
|
79
62
|
}));
|
|
80
63
|
const emailDomainRestrictionsState = yield selectEmailDomainRestrictionsState();
|
|
81
|
-
|
|
82
64
|
try {
|
|
83
65
|
var _emailDomainRestricti2;
|
|
84
|
-
|
|
85
66
|
yield (0, _effects.call)(_restApi.api.auth.createDomainRestriction, newRestriction);
|
|
86
67
|
const restrictions = yield (0, _effects.call)(_restApi.api.auth.getDomainRestrictions);
|
|
87
68
|
const filteredRestrictions = restrictions.items.filter(restriction => {
|
|
88
69
|
var _emailDomainRestricti;
|
|
89
|
-
|
|
90
70
|
return restriction.type === ((_emailDomainRestricti = emailDomainRestrictionsState.data) == null ? void 0 : _emailDomainRestricti.config.listType);
|
|
91
71
|
});
|
|
92
72
|
yield (0, _effects.put)(_reducer.actions.setEmailDomainRestrictionsState({
|
|
@@ -109,19 +89,17 @@ function* saveEmailDomainRestriction(_ref) {
|
|
|
109
89
|
callback == null ? void 0 : callback(null, e);
|
|
110
90
|
}
|
|
111
91
|
}
|
|
112
|
-
|
|
113
92
|
function* saveEmailDomainRestrictionConfig(_ref2) {
|
|
114
93
|
let {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
94
|
+
payload: {
|
|
95
|
+
callback
|
|
96
|
+
}
|
|
97
|
+
} = _ref2,
|
|
98
|
+
config = (0, _objectWithoutPropertiesLoose2.default)(_ref2.payload, _excluded2);
|
|
120
99
|
yield (0, _effects.put)(_reducer.actions.setEmailDomainRestrictionsState({
|
|
121
100
|
saving: true,
|
|
122
101
|
error: null
|
|
123
102
|
}));
|
|
124
|
-
|
|
125
103
|
try {
|
|
126
104
|
const updatedConfig = yield (0, _effects.call)(_restApi.api.auth.updateDomainRestrictionConfig, config);
|
|
127
105
|
const restrictions = yield (0, _effects.call)(_restApi.api.auth.getDomainRestrictions);
|
|
@@ -142,7 +120,6 @@ function* saveEmailDomainRestrictionConfig(_ref2) {
|
|
|
142
120
|
callback == null ? void 0 : callback(null, e);
|
|
143
121
|
}
|
|
144
122
|
}
|
|
145
|
-
|
|
146
123
|
function* deleteEmailDomainRestriction({
|
|
147
124
|
payload: {
|
|
148
125
|
id
|
|
@@ -153,15 +130,12 @@ function* deleteEmailDomainRestriction({
|
|
|
153
130
|
error: null
|
|
154
131
|
}));
|
|
155
132
|
const emailDomainRestrictionsState = yield selectEmailDomainRestrictionsState();
|
|
156
|
-
|
|
157
133
|
try {
|
|
158
134
|
var _emailDomainRestricti4;
|
|
159
|
-
|
|
160
135
|
yield (0, _effects.call)(_restApi.api.auth.deleteDomainRestriction, id);
|
|
161
136
|
const restrictions = yield (0, _effects.call)(_restApi.api.auth.getDomainRestrictions);
|
|
162
137
|
const filteredRestrictions = restrictions.items.filter(restriction => {
|
|
163
138
|
var _emailDomainRestricti3;
|
|
164
|
-
|
|
165
139
|
return restriction.type === ((_emailDomainRestricti3 = emailDomainRestrictionsState.data) == null ? void 0 : _emailDomainRestricti3.config.listType);
|
|
166
140
|
});
|
|
167
141
|
yield (0, _effects.put)(_reducer.actions.setEmailDomainRestrictionsState({
|
|
@@ -182,23 +156,19 @@ function* deleteEmailDomainRestriction({
|
|
|
182
156
|
}));
|
|
183
157
|
}
|
|
184
158
|
}
|
|
185
|
-
|
|
186
159
|
const getPagination = statePagination => {
|
|
187
160
|
var _statePagination$_fil, _statePagination$_lim, _statePagination$_off;
|
|
188
|
-
|
|
189
161
|
return {
|
|
190
162
|
_filter: (_statePagination$_fil = statePagination == null ? void 0 : statePagination._filter) != null ? _statePagination$_fil : _restApi.RestrictionType.ALLOW,
|
|
191
163
|
_limit: (_statePagination$_lim = statePagination == null ? void 0 : statePagination._limit) != null ? _statePagination$_lim : 10,
|
|
192
164
|
_offset: (_statePagination$_off = statePagination == null ? void 0 : statePagination._offset) != null ? _statePagination$_off : 0
|
|
193
165
|
};
|
|
194
166
|
};
|
|
195
|
-
|
|
196
167
|
function* loadIpRestrictions() {
|
|
197
168
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
198
169
|
loading: true,
|
|
199
170
|
error: null
|
|
200
171
|
}));
|
|
201
|
-
|
|
202
172
|
try {
|
|
203
173
|
const ipRestrictionState = yield selectIpRestrictionsState();
|
|
204
174
|
const restrictionsConfig = yield (0, _effects.call)(_restApi.api.auth.getIPRestrictionsConfig);
|
|
@@ -229,7 +199,6 @@ function* loadIpRestrictions() {
|
|
|
229
199
|
}));
|
|
230
200
|
}
|
|
231
201
|
}
|
|
232
|
-
|
|
233
202
|
function* checkIfUserIpValid() {
|
|
234
203
|
try {
|
|
235
204
|
const {
|
|
@@ -244,7 +213,6 @@ function* checkIfUserIpValid() {
|
|
|
244
213
|
}));
|
|
245
214
|
}
|
|
246
215
|
}
|
|
247
|
-
|
|
248
216
|
function* addCurrentUserIpAndActivate({
|
|
249
217
|
payload: {
|
|
250
218
|
callback
|
|
@@ -254,7 +222,6 @@ function* addCurrentUserIpAndActivate({
|
|
|
254
222
|
saving: true,
|
|
255
223
|
error: null
|
|
256
224
|
}));
|
|
257
|
-
|
|
258
225
|
try {
|
|
259
226
|
const userIp = yield selectUserIp();
|
|
260
227
|
yield (0, _effects.all)([(0, _effects.call)(_restApi.api.auth.createIPRestriction, {
|
|
@@ -295,23 +262,20 @@ function* addCurrentUserIpAndActivate({
|
|
|
295
262
|
callback == null ? void 0 : callback(false, e);
|
|
296
263
|
}
|
|
297
264
|
}
|
|
298
|
-
|
|
299
265
|
function* saveIpRestriction(_ref3) {
|
|
300
266
|
let {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
267
|
+
payload: {
|
|
268
|
+
callback
|
|
269
|
+
}
|
|
270
|
+
} = _ref3,
|
|
271
|
+
newRestriction = (0, _objectWithoutPropertiesLoose2.default)(_ref3.payload, _excluded3);
|
|
306
272
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
307
273
|
saving: true,
|
|
308
274
|
error: null
|
|
309
275
|
}));
|
|
310
276
|
const ipRestrictionsState = yield selectIpRestrictionsState();
|
|
311
|
-
|
|
312
277
|
try {
|
|
313
278
|
var _ipRestrictionsState$, _ipRestrictionsState$2;
|
|
314
|
-
|
|
315
279
|
yield (0, _effects.call)(_restApi.api.auth.createIPRestriction, newRestriction);
|
|
316
280
|
const ipRestrictionState = yield selectIpRestrictionsState();
|
|
317
281
|
const pagination = getPagination(ipRestrictionState.pagination);
|
|
@@ -343,19 +307,17 @@ function* saveIpRestriction(_ref3) {
|
|
|
343
307
|
callback == null ? void 0 : callback(null, e);
|
|
344
308
|
}
|
|
345
309
|
}
|
|
346
|
-
|
|
347
310
|
function* saveIpRestrictionsConfig(_ref4) {
|
|
348
311
|
let {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
312
|
+
payload: {
|
|
313
|
+
callback
|
|
314
|
+
}
|
|
315
|
+
} = _ref4,
|
|
316
|
+
config = (0, _objectWithoutPropertiesLoose2.default)(_ref4.payload, _excluded4);
|
|
354
317
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
355
318
|
saving: true,
|
|
356
319
|
error: null
|
|
357
320
|
}));
|
|
358
|
-
|
|
359
321
|
try {
|
|
360
322
|
yield (0, _effects.call)(_restApi.api.auth.updateIPRestrictionConfig, config);
|
|
361
323
|
const ipRestrictionState = yield selectIpRestrictionsState();
|
|
@@ -388,7 +350,6 @@ function* saveIpRestrictionsConfig(_ref4) {
|
|
|
388
350
|
callback == null ? void 0 : callback(null, e);
|
|
389
351
|
}
|
|
390
352
|
}
|
|
391
|
-
|
|
392
353
|
function* deleteIpRestriction({
|
|
393
354
|
payload: {
|
|
394
355
|
id,
|
|
@@ -400,10 +361,8 @@ function* deleteIpRestriction({
|
|
|
400
361
|
error: null
|
|
401
362
|
}));
|
|
402
363
|
const ipRestrictionsState = yield selectIpRestrictionsState();
|
|
403
|
-
|
|
404
364
|
try {
|
|
405
365
|
var _ipRestrictionsState$3;
|
|
406
|
-
|
|
407
366
|
yield (0, _effects.call)(_restApi.api.auth.deleteIPRestriction, id);
|
|
408
367
|
const ipRestrictionState = yield selectIpRestrictionsState();
|
|
409
368
|
const pagination = getPagination(ipRestrictionState.pagination);
|
|
@@ -435,7 +394,6 @@ function* deleteIpRestriction({
|
|
|
435
394
|
callback == null ? void 0 : callback(null, e);
|
|
436
395
|
}
|
|
437
396
|
}
|
|
438
|
-
|
|
439
397
|
function* restrictionsSagas() {
|
|
440
398
|
yield (0, _effects.takeLeading)(_reducer.actions.loadIpRestrictions, loadIpRestrictions);
|
|
441
399
|
yield (0, _effects.takeLeading)(_reducer.actions.loadEmailDomainRestrictions, loadEmailDomainRestrictions);
|
|
@@ -448,11 +406,11 @@ function* restrictionsSagas() {
|
|
|
448
406
|
yield (0, _effects.takeEvery)(_reducer.actions.saveEmailDomainRestrictionsConfig, saveEmailDomainRestrictionConfig);
|
|
449
407
|
yield (0, _effects.takeEvery)(_reducer.actions.deleteEmailDomainRestriction, deleteEmailDomainRestriction);
|
|
450
408
|
}
|
|
409
|
+
|
|
451
410
|
/*********************************
|
|
452
411
|
* Preview Sagas
|
|
453
412
|
*********************************/
|
|
454
413
|
|
|
455
|
-
|
|
456
414
|
function* loadIpRestrictionsMock() {
|
|
457
415
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
458
416
|
loading: true,
|
|
@@ -472,13 +430,11 @@ function* loadIpRestrictionsMock() {
|
|
|
472
430
|
loading: false
|
|
473
431
|
}));
|
|
474
432
|
}
|
|
475
|
-
|
|
476
433
|
function* checkIfUserIpValidMock() {
|
|
477
434
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
478
435
|
loading: true,
|
|
479
436
|
error: null
|
|
480
437
|
}));
|
|
481
|
-
|
|
482
438
|
try {
|
|
483
439
|
const ipRestrictionState = yield selectIpRestrictionsState();
|
|
484
440
|
const userIp = _dummy.dummyIps[0].ip;
|
|
@@ -494,16 +450,14 @@ function* checkIfUserIpValidMock() {
|
|
|
494
450
|
}));
|
|
495
451
|
}
|
|
496
452
|
}
|
|
497
|
-
|
|
498
453
|
function* saveIpRestrictionMock(_ref5) {
|
|
499
454
|
var _ipRestrictionsState$4, _ipRestrictionsState$5, _newRestriction$isAct;
|
|
500
|
-
|
|
501
455
|
let {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
456
|
+
payload: {
|
|
457
|
+
callback
|
|
458
|
+
}
|
|
459
|
+
} = _ref5,
|
|
460
|
+
newRestriction = (0, _objectWithoutPropertiesLoose2.default)(_ref5.payload, _excluded5);
|
|
507
461
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
508
462
|
saving: true,
|
|
509
463
|
error: null
|
|
@@ -534,16 +488,14 @@ function* saveIpRestrictionMock(_ref5) {
|
|
|
534
488
|
}));
|
|
535
489
|
callback == null ? void 0 : callback(true);
|
|
536
490
|
}
|
|
537
|
-
|
|
538
491
|
function* saveIpRestrictionsConfigMock(_ref6) {
|
|
539
492
|
var _ipRestrictionsState$6, _ipRestrictionsState$7, _ipRestrictionsState$8;
|
|
540
|
-
|
|
541
493
|
let {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
494
|
+
payload: {
|
|
495
|
+
callback
|
|
496
|
+
}
|
|
497
|
+
} = _ref6,
|
|
498
|
+
config = (0, _objectWithoutPropertiesLoose2.default)(_ref6.payload, _excluded6);
|
|
547
499
|
const ipRestrictionsState = yield selectIpRestrictionsState();
|
|
548
500
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
549
501
|
saving: true,
|
|
@@ -568,7 +520,6 @@ function* saveIpRestrictionsConfigMock(_ref6) {
|
|
|
568
520
|
}));
|
|
569
521
|
callback == null ? void 0 : callback(true);
|
|
570
522
|
}
|
|
571
|
-
|
|
572
523
|
function* deleteIpRestrictionMock({
|
|
573
524
|
payload: {
|
|
574
525
|
id,
|
|
@@ -576,7 +527,6 @@ function* deleteIpRestrictionMock({
|
|
|
576
527
|
}
|
|
577
528
|
}) {
|
|
578
529
|
var _ipRestrictionsState$9;
|
|
579
|
-
|
|
580
530
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
581
531
|
saving: true,
|
|
582
532
|
error: null
|
|
@@ -601,7 +551,6 @@ function* deleteIpRestrictionMock({
|
|
|
601
551
|
}));
|
|
602
552
|
callback == null ? void 0 : callback(true);
|
|
603
553
|
}
|
|
604
|
-
|
|
605
554
|
function* addCurrentUserIpAndActivateMock({
|
|
606
555
|
payload: {
|
|
607
556
|
callback
|
|
@@ -611,7 +560,6 @@ function* addCurrentUserIpAndActivateMock({
|
|
|
611
560
|
saving: true,
|
|
612
561
|
error: null
|
|
613
562
|
}));
|
|
614
|
-
|
|
615
563
|
try {
|
|
616
564
|
const userIp = yield selectUserIp();
|
|
617
565
|
yield (0, _effects.put)(_reducer.actions.saveIpRestriction({
|
|
@@ -631,7 +579,6 @@ function* addCurrentUserIpAndActivateMock({
|
|
|
631
579
|
callback == null ? void 0 : callback(false, e);
|
|
632
580
|
}
|
|
633
581
|
}
|
|
634
|
-
|
|
635
582
|
function* loadEmailDomainRestrictionsMock() {
|
|
636
583
|
yield (0, _effects.put)(_reducer.actions.setEmailDomainRestrictionsState({
|
|
637
584
|
loading: true,
|
|
@@ -653,16 +600,14 @@ function* loadEmailDomainRestrictionsMock() {
|
|
|
653
600
|
}
|
|
654
601
|
}));
|
|
655
602
|
}
|
|
656
|
-
|
|
657
603
|
function* saveEmailDomainRestrictionMock(_ref7) {
|
|
658
604
|
var _emailDomainRestricti5, _emailDomainRestricti6;
|
|
659
|
-
|
|
660
605
|
let {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
606
|
+
payload: {
|
|
607
|
+
callback
|
|
608
|
+
}
|
|
609
|
+
} = _ref7,
|
|
610
|
+
restriction = (0, _objectWithoutPropertiesLoose2.default)(_ref7.payload, _excluded7);
|
|
666
611
|
const emailDomainRestrictionsState = yield selectEmailDomainRestrictionsState();
|
|
667
612
|
yield (0, _effects.put)(_reducer.actions.setEmailDomainRestrictionsState({
|
|
668
613
|
saving: true,
|
|
@@ -684,16 +629,14 @@ function* saveEmailDomainRestrictionMock(_ref7) {
|
|
|
684
629
|
saving: false
|
|
685
630
|
}));
|
|
686
631
|
}
|
|
687
|
-
|
|
688
632
|
function* saveEmailDomainRestrictionConfigMock(_ref8) {
|
|
689
633
|
var _emailDomainRestricti7;
|
|
690
|
-
|
|
691
634
|
let {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
635
|
+
payload: {
|
|
636
|
+
callback
|
|
637
|
+
}
|
|
638
|
+
} = _ref8,
|
|
639
|
+
config = (0, _objectWithoutPropertiesLoose2.default)(_ref8.payload, _excluded8);
|
|
697
640
|
const emailDomainRestrictionsState = yield selectEmailDomainRestrictionsState();
|
|
698
641
|
yield (0, _effects.put)(_reducer.actions.setEmailDomainRestrictionsState({
|
|
699
642
|
saving: true,
|
|
@@ -713,14 +656,12 @@ function* saveEmailDomainRestrictionConfigMock(_ref8) {
|
|
|
713
656
|
saving: false
|
|
714
657
|
}));
|
|
715
658
|
}
|
|
716
|
-
|
|
717
659
|
function* deleteEmailDomainRestrictionMock({
|
|
718
660
|
payload: {
|
|
719
661
|
id
|
|
720
662
|
}
|
|
721
663
|
}) {
|
|
722
664
|
var _emailDomainRestricti8, _emailDomainRestricti9;
|
|
723
|
-
|
|
724
665
|
const emailDomainRestrictionsState = yield selectEmailDomainRestrictionsState();
|
|
725
666
|
yield (0, _effects.put)(_reducer.actions.setEmailDomainRestrictionsState({
|
|
726
667
|
saving: true,
|
|
@@ -739,7 +680,6 @@ function* deleteEmailDomainRestrictionMock({
|
|
|
739
680
|
saving: false
|
|
740
681
|
}));
|
|
741
682
|
}
|
|
742
|
-
|
|
743
683
|
function* restrictionsSagaMock() {
|
|
744
684
|
yield (0, _effects.takeLeading)(_reducer.actions.loadIpRestrictions, loadIpRestrictionsMock);
|
|
745
685
|
yield (0, _effects.takeLeading)(_reducer.actions.loadEmailDomainRestrictions, loadEmailDomainRestrictionsMock);
|
|
@@ -750,12 +690,15 @@ function* restrictionsSagaMock() {
|
|
|
750
690
|
yield (0, _effects.takeEvery)(_reducer.actions.saveEmailDomainRestriction, saveEmailDomainRestrictionMock);
|
|
751
691
|
yield (0, _effects.takeEvery)(_reducer.actions.saveEmailDomainRestrictionsConfig, saveEmailDomainRestrictionConfigMock);
|
|
752
692
|
yield (0, _effects.takeEvery)(_reducer.actions.deleteEmailDomainRestriction, deleteEmailDomainRestrictionMock);
|
|
753
|
-
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
// export function* restrictionsSagas() {
|
|
754
696
|
// yield takeLeading(actions.loadEmailDomainRestrictions, loadEmailDomainRestrictions);
|
|
755
697
|
// yield takeEvery(actions.saveEmailDomainRestriction, saveEmailDomainRestriction);
|
|
756
698
|
// yield takeEvery(actions.saveEmailDomainRestrictionsConfig, saveEmailDomainRestrictionConfig);
|
|
757
699
|
// yield takeEvery(actions.deleteEmailDomainRestriction, deleteEmailDomainRestriction);
|
|
758
700
|
// }
|
|
701
|
+
|
|
759
702
|
// /*********************************
|
|
760
703
|
// * Preview Sagas
|
|
761
704
|
// *********************************/
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.rolesState = exports.rolesReducers = exports.rolesActions = void 0;
|
|
7
|
-
|
|
8
7
|
var _toolkit = require("@reduxjs/toolkit");
|
|
9
|
-
|
|
10
8
|
var _utils = require("../utils");
|
|
11
|
-
|
|
12
9
|
var _constants = require("../../constants");
|
|
13
|
-
|
|
14
10
|
const rolesState = {
|
|
15
11
|
loading: false,
|
|
16
12
|
roles: [],
|
|
@@ -45,14 +41,13 @@ const actions = {
|
|
|
45
41
|
payload
|
|
46
42
|
}))
|
|
47
43
|
};
|
|
44
|
+
|
|
48
45
|
/**
|
|
49
46
|
* To be used for actions types after dispatch, and should contains
|
|
50
47
|
* the reducers and actions as standalone function
|
|
51
48
|
*/
|
|
52
|
-
|
|
53
49
|
exports.rolesActions = actions;
|
|
54
50
|
// noinspection JSUnusedLocalSymbols
|
|
55
|
-
|
|
56
51
|
/**
|
|
57
52
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
58
53
|
* contains the same functions in reducers and actions
|
|
@@ -1,39 +1,29 @@
|
|
|
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.rolesSagas = rolesSagas;
|
|
9
8
|
exports.rolesSagasMock = rolesSagasMock;
|
|
10
|
-
|
|
11
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
|
-
|
|
13
10
|
var _effects = require("redux-saga/effects");
|
|
14
|
-
|
|
15
11
|
var _restApi = require("@frontegg/rest-api");
|
|
16
|
-
|
|
17
12
|
var _reducer = require("../reducer");
|
|
18
|
-
|
|
19
13
|
var _dummy = require("../dummy");
|
|
20
|
-
|
|
21
14
|
const _excluded = ["callback"],
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
_excluded2 = ["callback"],
|
|
16
|
+
_excluded3 = ["callback"],
|
|
17
|
+
_excluded4 = ["callback"],
|
|
18
|
+
_excluded5 = ["callback"];
|
|
27
19
|
function* loadRolesAndPermissions({
|
|
28
20
|
payload
|
|
29
21
|
}) {
|
|
30
22
|
var _payload$silentLoadin;
|
|
31
|
-
|
|
32
23
|
yield (0, _effects.put)(_reducer.actions.setRolesState({
|
|
33
24
|
loading: !((_payload$silentLoadin = payload == null ? void 0 : payload.silentLoading) != null ? _payload$silentLoadin : false),
|
|
34
25
|
error: null
|
|
35
26
|
}));
|
|
36
|
-
|
|
37
27
|
try {
|
|
38
28
|
const result = yield (0, _effects.all)([(0, _effects.call)(_restApi.api.roles.getRoles), (0, _effects.call)(_restApi.api.roles.getPermissions), (0, _effects.call)(_restApi.api.roles.getPermissionCategories)]);
|
|
39
29
|
const [roles, permissions, permissionCategories] = result;
|
|
@@ -50,18 +40,16 @@ function* loadRolesAndPermissions({
|
|
|
50
40
|
}));
|
|
51
41
|
}
|
|
52
42
|
}
|
|
53
|
-
|
|
54
43
|
function* addRole(_ref) {
|
|
55
44
|
let {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
payload: {
|
|
46
|
+
callback
|
|
47
|
+
}
|
|
48
|
+
} = _ref,
|
|
49
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref.payload, _excluded);
|
|
61
50
|
yield (0, _effects.put)(_reducer.actions.setRolesState({
|
|
62
51
|
saving: true
|
|
63
52
|
}));
|
|
64
|
-
|
|
65
53
|
try {
|
|
66
54
|
const role = yield (0, _effects.call)(_restApi.api.roles.addRole, body);
|
|
67
55
|
const roles = yield (0, _effects.call)(_restApi.api.roles.getRoles);
|
|
@@ -81,18 +69,16 @@ function* addRole(_ref) {
|
|
|
81
69
|
callback == null ? void 0 : callback(null, e);
|
|
82
70
|
}
|
|
83
71
|
}
|
|
84
|
-
|
|
85
72
|
function* deleteRole(_ref2) {
|
|
86
73
|
let {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
74
|
+
payload: {
|
|
75
|
+
callback
|
|
76
|
+
}
|
|
77
|
+
} = _ref2,
|
|
78
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref2.payload, _excluded2);
|
|
92
79
|
yield (0, _effects.put)(_reducer.actions.setRolesState({
|
|
93
80
|
saving: true
|
|
94
81
|
}));
|
|
95
|
-
|
|
96
82
|
try {
|
|
97
83
|
yield (0, _effects.call)(_restApi.api.roles.deleteRole, body);
|
|
98
84
|
yield (0, _effects.put)(_reducer.actions.loadRolesAndPermissions({
|
|
@@ -110,18 +96,16 @@ function* deleteRole(_ref2) {
|
|
|
110
96
|
callback == null ? void 0 : callback(false, e);
|
|
111
97
|
}
|
|
112
98
|
}
|
|
113
|
-
|
|
114
99
|
function* updateRole(_ref3) {
|
|
115
100
|
let {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
101
|
+
payload: {
|
|
102
|
+
callback
|
|
103
|
+
}
|
|
104
|
+
} = _ref3,
|
|
105
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref3.payload, _excluded3);
|
|
121
106
|
yield (0, _effects.put)(_reducer.actions.setRolesState({
|
|
122
107
|
saving: true
|
|
123
108
|
}));
|
|
124
|
-
|
|
125
109
|
try {
|
|
126
110
|
const role = yield (0, _effects.call)(_restApi.api.roles.updateRole, body);
|
|
127
111
|
yield (0, _effects.put)(_reducer.actions.loadRolesAndPermissions({
|
|
@@ -139,18 +123,16 @@ function* updateRole(_ref3) {
|
|
|
139
123
|
callback == null ? void 0 : callback(null, e);
|
|
140
124
|
}
|
|
141
125
|
}
|
|
142
|
-
|
|
143
126
|
function* attachPermissionsToRole(_ref4) {
|
|
144
127
|
let {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
128
|
+
payload: {
|
|
129
|
+
callback
|
|
130
|
+
}
|
|
131
|
+
} = _ref4,
|
|
132
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref4.payload, _excluded4);
|
|
150
133
|
yield (0, _effects.put)(_reducer.actions.setRolesState({
|
|
151
134
|
saving: true
|
|
152
135
|
}));
|
|
153
|
-
|
|
154
136
|
try {
|
|
155
137
|
const role = yield (0, _effects.call)(_restApi.api.roles.attachPermissionsToRole, body);
|
|
156
138
|
yield (0, _effects.put)(_reducer.actions.loadRolesAndPermissions({
|
|
@@ -168,18 +150,16 @@ function* attachPermissionsToRole(_ref4) {
|
|
|
168
150
|
callback == null ? void 0 : callback(null, e);
|
|
169
151
|
}
|
|
170
152
|
}
|
|
171
|
-
|
|
172
153
|
function* attachPermissionToRoles(_ref5) {
|
|
173
154
|
let {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
155
|
+
payload: {
|
|
156
|
+
callback
|
|
157
|
+
}
|
|
158
|
+
} = _ref5,
|
|
159
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref5.payload, _excluded5);
|
|
179
160
|
yield (0, _effects.put)(_reducer.actions.setRolesState({
|
|
180
161
|
saving: true
|
|
181
162
|
}));
|
|
182
|
-
|
|
183
163
|
try {
|
|
184
164
|
const permission = yield (0, _effects.call)(_restApi.api.roles.attachPermissionToRoles, body);
|
|
185
165
|
yield (0, _effects.put)(_reducer.actions.loadRolesAndPermissions({
|
|
@@ -197,7 +177,6 @@ function* attachPermissionToRoles(_ref5) {
|
|
|
197
177
|
callback == null ? void 0 : callback(null, e);
|
|
198
178
|
}
|
|
199
179
|
}
|
|
200
|
-
|
|
201
180
|
function* rolesSagas() {
|
|
202
181
|
yield (0, _effects.takeLeading)(_reducer.actions.loadRolesAndPermissions, loadRolesAndPermissions);
|
|
203
182
|
yield (0, _effects.takeEvery)(_reducer.actions.addRole, addRole);
|
|
@@ -206,21 +185,19 @@ function* rolesSagas() {
|
|
|
206
185
|
yield (0, _effects.takeEvery)(_reducer.actions.attachPermissionsToRole, attachPermissionsToRole);
|
|
207
186
|
yield (0, _effects.takeEvery)(_reducer.actions.attachPermissionToRoles, attachPermissionToRoles);
|
|
208
187
|
}
|
|
188
|
+
|
|
209
189
|
/*********************************
|
|
210
190
|
* Preview Sagas
|
|
211
191
|
*********************************/
|
|
212
192
|
|
|
213
|
-
|
|
214
193
|
function* loadRolesAndPermissionsMock({
|
|
215
194
|
payload
|
|
216
195
|
}) {
|
|
217
196
|
var _payload$silentLoadin2;
|
|
218
|
-
|
|
219
197
|
yield (0, _effects.put)(_reducer.actions.setRolesState({
|
|
220
198
|
loading: !((_payload$silentLoadin2 = payload == null ? void 0 : payload.silentLoading) != null ? _payload$silentLoadin2 : false),
|
|
221
199
|
error: null
|
|
222
200
|
}));
|
|
223
|
-
|
|
224
201
|
try {
|
|
225
202
|
yield (0, _effects.put)(_reducer.actions.setRolesState({
|
|
226
203
|
roles: _dummy.rolesAdminViewerDemo,
|
|
@@ -233,7 +210,6 @@ function* loadRolesAndPermissionsMock({
|
|
|
233
210
|
}));
|
|
234
211
|
}
|
|
235
212
|
}
|
|
236
|
-
|
|
237
213
|
function* rolesSagasMock() {
|
|
238
214
|
yield (0, _effects.takeLeading)(_reducer.actions.loadRolesAndPermissions, loadRolesAndPermissionsMock);
|
|
239
215
|
}
|