acsi-core 1.2.42 → 1.2.43
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/README.md +46 -3
- package/dist/index.js +62 -45
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +62 -45
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -5
package/README.md
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# Getting Started with Create React App
|
|
2
|
+
|
|
3
|
+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
|
4
|
+
|
|
5
|
+
## Available Scripts
|
|
6
|
+
|
|
7
|
+
In the project directory, you can run:
|
|
8
|
+
|
|
9
|
+
### `npm start`
|
|
10
|
+
|
|
11
|
+
Runs the app in the development mode.\
|
|
12
|
+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
|
13
|
+
|
|
14
|
+
The page will reload if you make edits.\
|
|
15
|
+
You will also see any lint errors in the console.
|
|
16
|
+
|
|
17
|
+
### `npm test`
|
|
18
|
+
|
|
19
|
+
Launches the test runner in the interactive watch mode.\
|
|
20
|
+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
21
|
+
|
|
22
|
+
### `npm run build`
|
|
23
|
+
|
|
24
|
+
Builds the app for production to the `build` folder.\
|
|
25
|
+
It correctly bundles React in production mode and optimizes the build for the best performance.
|
|
26
|
+
|
|
27
|
+
The build is minified and the filenames include the hashes.\
|
|
28
|
+
Your app is ready to be deployed!
|
|
29
|
+
|
|
30
|
+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
|
31
|
+
|
|
32
|
+
### `npm run eject`
|
|
33
|
+
|
|
34
|
+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
|
|
35
|
+
|
|
36
|
+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
|
37
|
+
|
|
38
|
+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
|
|
39
|
+
|
|
40
|
+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
|
|
41
|
+
|
|
42
|
+
## Learn More
|
|
43
|
+
|
|
44
|
+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
|
45
|
+
|
|
46
|
+
To learn React, check out the [React documentation](https://reactjs.org/).
|
package/dist/index.js
CHANGED
|
@@ -160,9 +160,6 @@ function _catch(body, recover) {
|
|
|
160
160
|
return result;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
var _process$env$PUBLIC_U;
|
|
164
|
-
var PUBLIC_URL = (_process$env$PUBLIC_U = process.env.PUBLIC_URL) != null ? _process$env$PUBLIC_U : '';
|
|
165
|
-
|
|
166
163
|
var styles = {"core-button":"_xvNBN","primary":"_U9Qyp","secondary":"_1VzMy","text":"_pZNuj","danger":"_2uYm1","light":"_wxH5S"};
|
|
167
164
|
|
|
168
165
|
var _excluded = ["type", "children", "onClick", "icon", "disabled", "htmlType"];
|
|
@@ -1733,9 +1730,9 @@ var apiUpload = axios.create({
|
|
|
1733
1730
|
if (imPersonate) {
|
|
1734
1731
|
config.headers.ImPersonate = imPersonate;
|
|
1735
1732
|
}
|
|
1736
|
-
var tenantId =
|
|
1733
|
+
var tenantId = localStorage.getItem(ORGANIZATION_TENANT);
|
|
1737
1734
|
if (tenantId) {
|
|
1738
|
-
config.headers["X-
|
|
1735
|
+
config.headers["X-TenantId"] = tenantId;
|
|
1739
1736
|
}
|
|
1740
1737
|
return config;
|
|
1741
1738
|
}, function (error) {
|
|
@@ -1744,39 +1741,63 @@ var apiUpload = axios.create({
|
|
|
1744
1741
|
});
|
|
1745
1742
|
[api, apiUpload].forEach(function (i) {
|
|
1746
1743
|
return i.interceptors.response.use(function (response) {
|
|
1744
|
+
if (response.data && response.data.message === "RedirectToTenantDomain" && response.data.redirectDomain) {
|
|
1745
|
+
var token = localStorage.getItem(ACCESS_TOKEN) || "";
|
|
1746
|
+
var redirectUrl = response.data.redirectDomain;
|
|
1747
|
+
if (!/^https?:\/\//i.test(redirectUrl)) {
|
|
1748
|
+
redirectUrl = window.location.protocol + "//" + redirectUrl;
|
|
1749
|
+
}
|
|
1750
|
+
redirectUrl = redirectUrl.replace(/\/$/, "");
|
|
1751
|
+
window.location.href = redirectUrl + "/login?token=" + encodeURIComponent(token);
|
|
1752
|
+
return new Promise(function () {});
|
|
1753
|
+
}
|
|
1747
1754
|
return response;
|
|
1748
1755
|
}, function (error) {
|
|
1749
|
-
if (error.response
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1756
|
+
if (error.response && error.response.data) {
|
|
1757
|
+
var data = error.response.data;
|
|
1758
|
+
if (data.message === "RedirectToTenantDomain" && data.redirectDomain) {
|
|
1759
|
+
var token = localStorage.getItem(ACCESS_TOKEN) || "";
|
|
1760
|
+
var redirectUrl = data.redirectDomain;
|
|
1761
|
+
if (!/^https?:\/\//i.test(redirectUrl)) {
|
|
1762
|
+
redirectUrl = window.location.protocol + "//" + redirectUrl;
|
|
1763
|
+
}
|
|
1764
|
+
redirectUrl = redirectUrl.replace(/\/$/, "");
|
|
1765
|
+
window.location.href = redirectUrl + "/login?token=" + encodeURIComponent(token);
|
|
1766
|
+
return new Promise(function () {});
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
if (error.response) {
|
|
1770
|
+
if (error.response.status === 401) {
|
|
1771
|
+
window.location.href = "/login";
|
|
1772
|
+
}
|
|
1773
|
+
if (error.response.status == 403) {
|
|
1774
|
+
var hostname = window.location.hostname;
|
|
1775
|
+
var parts = hostname.split('.');
|
|
1776
|
+
var domain = parts.slice(-2).join('.');
|
|
1777
|
+
localStorage.removeItem(ACCESS_TOKEN);
|
|
1778
|
+
localStorage.removeItem(ORGANIZATION_TENANT);
|
|
1779
|
+
localStorage.removeItem(TIMEZONE_ID);
|
|
1780
|
+
localStorage.removeItem(ORGANIZATION_TEAM);
|
|
1781
|
+
Cookies.remove('auth', {
|
|
1782
|
+
path: '/',
|
|
1783
|
+
domain: "." + domain
|
|
1784
|
+
});
|
|
1785
|
+
localStorage.removeItem("USER_EMAIL");
|
|
1786
|
+
window.location.href = "/login";
|
|
1787
|
+
}
|
|
1766
1788
|
}
|
|
1767
1789
|
return Promise.reject(error);
|
|
1768
1790
|
});
|
|
1769
1791
|
});
|
|
1770
1792
|
|
|
1771
|
-
var IDP_URL = "" + process.env.REACT_APP_IDP_API_URL;
|
|
1772
1793
|
var apiLoginGoogle = function apiLoginGoogle(body) {
|
|
1773
|
-
return api.post(
|
|
1794
|
+
return api.post(BASE_URL + "/api/Auth/login", body);
|
|
1774
1795
|
};
|
|
1775
1796
|
var apiSendEmailCode = function apiSendEmailCode(body) {
|
|
1776
|
-
return api.post(
|
|
1797
|
+
return api.post(BASE_URL + "/api/Auth/send-code-email", body);
|
|
1777
1798
|
};
|
|
1778
1799
|
var apiCheckEmailCode = function apiCheckEmailCode(params) {
|
|
1779
|
-
return api.get(
|
|
1800
|
+
return api.get(BASE_URL + "/api/Auth/check-code-email", {
|
|
1780
1801
|
params: params
|
|
1781
1802
|
});
|
|
1782
1803
|
};
|
|
@@ -1872,8 +1893,6 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
1872
1893
|
var _useState5 = React.useState(0),
|
|
1873
1894
|
currentImageIndex = _useState5[0],
|
|
1874
1895
|
setCurrentImageIndex = _useState5[1];
|
|
1875
|
-
var search = new URLSearchParams(window.location.search);
|
|
1876
|
-
var returnUrl = search.get("returnUrl") || "";
|
|
1877
1896
|
var handleGetImage = function handleGetImage() {
|
|
1878
1897
|
try {
|
|
1879
1898
|
var _temp = _catch(function () {
|
|
@@ -1964,7 +1983,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
1964
1983
|
dispatch(setLoading(false));
|
|
1965
1984
|
}
|
|
1966
1985
|
localStorage.setItem(ACCESS_TOKEN, tokenJWT);
|
|
1967
|
-
onNavigate(
|
|
1986
|
+
onNavigate("/dashboard");
|
|
1968
1987
|
dispatch(setLoading(false));
|
|
1969
1988
|
});
|
|
1970
1989
|
}
|
|
@@ -2047,11 +2066,11 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2047
2066
|
}
|
|
2048
2067
|
};
|
|
2049
2068
|
var redirectUrl = getRedirectUrl(authResult.data.role);
|
|
2050
|
-
window.location.href = redirectUrl + "
|
|
2069
|
+
window.location.href = redirectUrl + "/dashboard";
|
|
2051
2070
|
dispatch(setLoading(false));
|
|
2052
2071
|
}
|
|
2053
2072
|
localStorage.setItem(ACCESS_TOKEN, tokenJWT);
|
|
2054
|
-
onNavigate(
|
|
2073
|
+
onNavigate("/dashboard");
|
|
2055
2074
|
dispatch(setLoading(false));
|
|
2056
2075
|
});
|
|
2057
2076
|
}
|
|
@@ -2144,7 +2163,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2144
2163
|
to: "/",
|
|
2145
2164
|
className: "d-flex"
|
|
2146
2165
|
}, React__default.createElement("img", {
|
|
2147
|
-
src:
|
|
2166
|
+
src: "/images/Logo.png",
|
|
2148
2167
|
alt: "",
|
|
2149
2168
|
height: 37,
|
|
2150
2169
|
width: 155,
|
|
@@ -2171,7 +2190,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2171
2190
|
width: 24,
|
|
2172
2191
|
height: 24,
|
|
2173
2192
|
alt: "Google sign-in",
|
|
2174
|
-
src:
|
|
2193
|
+
src: "/images/icons/Google__G__logo.png"
|
|
2175
2194
|
}), "Sign in with Google")), MICROSOFT_SSO_ENABLED === "true" && React__default.createElement("div", {
|
|
2176
2195
|
className: "" + styleGlobal["microsoft_button"]
|
|
2177
2196
|
}, React__default.createElement("button", {
|
|
@@ -2182,7 +2201,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2182
2201
|
width: 24,
|
|
2183
2202
|
height: 24,
|
|
2184
2203
|
alt: "Google sign-in",
|
|
2185
|
-
src:
|
|
2204
|
+
src: "/images/Single-Sign-On-logo.png"
|
|
2186
2205
|
}), "Sign in with Microsoft")), React__default.createElement("span", {
|
|
2187
2206
|
className: "" + styleGlobal["box-field"]
|
|
2188
2207
|
}, "OR"), React__default.createElement("div", {
|
|
@@ -2202,7 +2221,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2202
2221
|
width: 20,
|
|
2203
2222
|
height: 20,
|
|
2204
2223
|
alt: "Email sign-in",
|
|
2205
|
-
src:
|
|
2224
|
+
src: "/images/icons/Login_icon.png"
|
|
2206
2225
|
}), "Sign in with Email")), React__default.createElement("div", {
|
|
2207
2226
|
className: styleGlobal["box-signin-text"] + " "
|
|
2208
2227
|
}, React__default.createElement("span", {
|
|
@@ -2236,7 +2255,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2236
2255
|
}))) : React__default.createElement("div", {
|
|
2237
2256
|
className: "" + styleGlobal["box-right"],
|
|
2238
2257
|
style: {
|
|
2239
|
-
backgroundImage: "url('
|
|
2258
|
+
backgroundImage: "url('/images/bg_login.png')"
|
|
2240
2259
|
}
|
|
2241
2260
|
}, React__default.createElement("div", {
|
|
2242
2261
|
className: "" + styleGlobal["box-right-body"]
|
|
@@ -2265,7 +2284,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2265
2284
|
}, React__default.createElement("img", {
|
|
2266
2285
|
className: "img-fluid",
|
|
2267
2286
|
alt: "",
|
|
2268
|
-
src:
|
|
2287
|
+
src: "/images/image_login.png",
|
|
2269
2288
|
style: {
|
|
2270
2289
|
width: "15vw"
|
|
2271
2290
|
}
|
|
@@ -2276,7 +2295,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2276
2295
|
marginTop: "-15px"
|
|
2277
2296
|
},
|
|
2278
2297
|
alt: "",
|
|
2279
|
-
src:
|
|
2298
|
+
src: "/images/icons/Vector 22.png"
|
|
2280
2299
|
}))))))), role === "LandingPage" && React__default.createElement(reactstrap.Col, {
|
|
2281
2300
|
sm: 12,
|
|
2282
2301
|
lg: 5,
|
|
@@ -2284,7 +2303,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2284
2303
|
}, React__default.createElement("div", {
|
|
2285
2304
|
className: "" + styleGlobal["box-right"],
|
|
2286
2305
|
style: {
|
|
2287
|
-
backgroundImage: "url('
|
|
2306
|
+
backgroundImage: "url('/images/bg_login.png')"
|
|
2288
2307
|
}
|
|
2289
2308
|
}, React__default.createElement("div", {
|
|
2290
2309
|
className: "" + styleGlobal["box-right-body"]
|
|
@@ -2313,7 +2332,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2313
2332
|
}, React__default.createElement("img", {
|
|
2314
2333
|
className: "img-fluid",
|
|
2315
2334
|
alt: "",
|
|
2316
|
-
src:
|
|
2335
|
+
src: "/images/image_login.png",
|
|
2317
2336
|
style: {
|
|
2318
2337
|
width: "15vw"
|
|
2319
2338
|
}
|
|
@@ -2324,7 +2343,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2324
2343
|
marginTop: "-15px"
|
|
2325
2344
|
},
|
|
2326
2345
|
alt: "",
|
|
2327
|
-
src:
|
|
2346
|
+
src: "/images/icons/Vector 22.png"
|
|
2328
2347
|
})))))))), React__default.createElement(reactstrap.Modal, {
|
|
2329
2348
|
isOpen: isScreenCode,
|
|
2330
2349
|
toggle: function toggle() {
|
|
@@ -2450,8 +2469,6 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
|
|
|
2450
2469
|
var _useState6 = React.useState(minutes * 60),
|
|
2451
2470
|
timeLeft = _useState6[0],
|
|
2452
2471
|
setTimeLeft = _useState6[1];
|
|
2453
|
-
var search = new URLSearchParams(window.location.search);
|
|
2454
|
-
var returnUrl = search.get("returnUrl") || "/dashboard";
|
|
2455
2472
|
var loginWithEmail = function loginWithEmail(role) {
|
|
2456
2473
|
try {
|
|
2457
2474
|
var _temp2 = function _temp2() {
|
|
@@ -2518,9 +2535,9 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
|
|
|
2518
2535
|
if ((_data$data$roles = data.data.roles) !== null && _data$data$roles !== void 0 && _data$data$roles.includes("Admin")) {
|
|
2519
2536
|
domain = ADMIN_ORIGIN;
|
|
2520
2537
|
}
|
|
2521
|
-
window.location.href =
|
|
2538
|
+
window.location.href = domain + "/dashboard";
|
|
2522
2539
|
} else {
|
|
2523
|
-
onNavigate(
|
|
2540
|
+
onNavigate("/dashboard");
|
|
2524
2541
|
}
|
|
2525
2542
|
} else {
|
|
2526
2543
|
reactToastify.toast.error("The code is not correct. Please check again.");
|