@dexteel/mesf-core 3.8.0 → 3.9.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/CHANGELOG.md +3 -0
- package/dist/account/AuthProvider.d.ts +10 -1
- package/dist/account/useToken.d.ts +4 -3
- package/dist/context/axiosInstance.d.ts +2 -0
- package/dist/context/userContext.d.ts +0 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +183 -88
- package/dist/reducers/UserReducer.d.ts +7 -7
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const AuthContext: React.Context<
|
|
2
|
+
export declare const AuthContext: React.Context<{
|
|
3
|
+
getUserName: () => string;
|
|
4
|
+
saveUserData: (userToken: any) => void;
|
|
5
|
+
clearUserData: () => void;
|
|
6
|
+
getFirstName: () => any;
|
|
7
|
+
getLastName: () => any;
|
|
8
|
+
getUserId: () => any;
|
|
9
|
+
hasPermission: (permissionId: number) => boolean;
|
|
10
|
+
token: string;
|
|
11
|
+
}>;
|
|
3
12
|
export type AuthConfig = {
|
|
4
13
|
guestIsEnabled: boolean;
|
|
5
14
|
useEmailAndPassword: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export declare const getTokenFromLS: () => string;
|
|
1
2
|
export declare function useToken(): {
|
|
2
3
|
getUserName: () => string;
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
saveUserData: (userToken: any) => void;
|
|
5
|
+
clearUserData: () => void;
|
|
5
6
|
getFirstName: () => any;
|
|
6
7
|
getLastName: () => any;
|
|
7
8
|
getUserId: () => any;
|
|
8
9
|
hasPermission: (permissionId: number) => boolean;
|
|
9
|
-
token:
|
|
10
|
+
token: string;
|
|
10
11
|
};
|
|
@@ -5,7 +5,6 @@ export declare const useUserContext: () => {
|
|
|
5
5
|
userId: number | null;
|
|
6
6
|
defaultAreaId: string | number | null;
|
|
7
7
|
defaultAreaName: string | null;
|
|
8
|
-
userLoged: boolean;
|
|
9
8
|
};
|
|
10
9
|
actions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
11
10
|
setUserId(state: import("immer/dist/internal").WritableDraft<{
|
|
@@ -13,7 +12,6 @@ export declare const useUserContext: () => {
|
|
|
13
12
|
userId: number | null;
|
|
14
13
|
defaultAreaId: string | number | null;
|
|
15
14
|
defaultAreaName: string | null;
|
|
16
|
-
userLoged: boolean;
|
|
17
15
|
}>, { payload }: {
|
|
18
16
|
payload: any;
|
|
19
17
|
type: string;
|
|
@@ -23,7 +21,6 @@ export declare const useUserContext: () => {
|
|
|
23
21
|
userId: number | null;
|
|
24
22
|
defaultAreaId: string | number | null;
|
|
25
23
|
defaultAreaName: string | null;
|
|
26
|
-
userLoged: boolean;
|
|
27
24
|
}>, { payload }: {
|
|
28
25
|
payload: any;
|
|
29
26
|
type: string;
|
|
@@ -33,7 +30,6 @@ export declare const useUserContext: () => {
|
|
|
33
30
|
userId: number | null;
|
|
34
31
|
defaultAreaId: string | number | null;
|
|
35
32
|
defaultAreaName: string | null;
|
|
36
|
-
userLoged: boolean;
|
|
37
33
|
}>, { payload }: {
|
|
38
34
|
payload: any;
|
|
39
35
|
type: string;
|
|
@@ -43,17 +39,6 @@ export declare const useUserContext: () => {
|
|
|
43
39
|
userId: number | null;
|
|
44
40
|
defaultAreaId: string | number | null;
|
|
45
41
|
defaultAreaName: string | null;
|
|
46
|
-
userLoged: boolean;
|
|
47
|
-
}>, { payload }: {
|
|
48
|
-
payload: any;
|
|
49
|
-
type: string;
|
|
50
|
-
}): void;
|
|
51
|
-
setUserLoged(state: import("immer/dist/internal").WritableDraft<{
|
|
52
|
-
userLastName: string;
|
|
53
|
-
userId: number | null;
|
|
54
|
-
defaultAreaId: string | number | null;
|
|
55
|
-
defaultAreaName: string | null;
|
|
56
|
-
userLoged: boolean;
|
|
57
42
|
}>, { payload }: {
|
|
58
43
|
payload: any;
|
|
59
44
|
type: string;
|
package/dist/index.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -2,48 +2,39 @@ import { Typography, TextField, FormHelperText, CircularProgress as CircularProg
|
|
|
2
2
|
import { get as get$1, isEmpty } from 'lodash-es';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useState, useRef, useEffect, Component, createContext, useContext, useCallback, lazy, Suspense } from 'react';
|
|
5
|
-
import
|
|
6
|
-
import { ResponsiveBar } from '@nivo/bar';
|
|
7
|
-
import MenuItem from '@material-ui/core/MenuItem';
|
|
8
|
-
import Select from '@material-ui/core/Select';
|
|
9
|
-
import { withStyles, alpha, makeStyles, createStyles, useTheme } from '@material-ui/core/styles';
|
|
10
|
-
import Button from '@material-ui/core/Button';
|
|
5
|
+
import { Alert as Alert$1, Modal as Modal$2, Navbar, Container, Nav, NavDropdown } from 'react-bootstrap';
|
|
11
6
|
import DialogTitle$1 from '@material-ui/core/DialogTitle';
|
|
12
7
|
import DialogContent$1 from '@material-ui/core/DialogContent';
|
|
13
8
|
import DialogActions$1 from '@material-ui/core/DialogActions';
|
|
14
9
|
import Dialog from '@material-ui/core/Dialog';
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import Collapse from '@material-ui/core/Collapse';
|
|
19
|
-
import Code from '@material-ui/icons/Code';
|
|
20
|
-
import Folder from '@material-ui/icons/Folder';
|
|
21
|
-
import { useSpring, animated } from 'react-spring';
|
|
10
|
+
import Button from '@material-ui/core/Button';
|
|
11
|
+
import { Outlet, useNavigate, useSearchParams, Link, useParams, Navigate, Routes, Route, BrowserRouter } from 'react-router-dom';
|
|
12
|
+
import Paper from '@material-ui/core/Paper';
|
|
22
13
|
import Grid from '@material-ui/core/Grid';
|
|
23
|
-
import { DataGrid, GridOverlay } from '@material-ui/data-grid';
|
|
24
|
-
import Card from '@material-ui/core/Card';
|
|
25
|
-
import CardActions from '@material-ui/core/CardActions';
|
|
26
|
-
import CardContent from '@material-ui/core/CardContent';
|
|
27
|
-
import Typography$1 from '@material-ui/core/Typography';
|
|
28
|
-
import { Alert as Alert$1, Modal as Modal$2, Navbar, Container, Nav, NavDropdown } from 'react-bootstrap';
|
|
29
14
|
import { useMsal, MsalProvider } from '@azure/msal-react';
|
|
30
15
|
import { LogLevel, PublicClientApplication } from '@azure/msal-browser';
|
|
31
|
-
import
|
|
32
|
-
import Paper from '@material-ui/core/Paper';
|
|
16
|
+
import MenuItem from '@material-ui/core/MenuItem';
|
|
33
17
|
import MenuList from '@material-ui/core/MenuList';
|
|
18
|
+
import axios from 'axios';
|
|
34
19
|
import PersonPinCircleIcon from '@material-ui/icons/PersonPinCircle';
|
|
35
20
|
import { useComplexState } from 'use-complex-state';
|
|
36
21
|
import { createSlice } from '@reduxjs/toolkit';
|
|
37
22
|
import moment from 'moment';
|
|
23
|
+
import { withStyles, alpha, makeStyles, createStyles, useTheme } from '@material-ui/core/styles';
|
|
38
24
|
import { get, useForm, Controller } from 'react-hook-form';
|
|
39
25
|
import DialogContentText from '@material-ui/core/DialogContentText';
|
|
26
|
+
import Typography$1 from '@material-ui/core/Typography';
|
|
27
|
+
import { DataGrid, GridOverlay } from '@material-ui/data-grid';
|
|
40
28
|
import Snackbar from '@material-ui/core/Snackbar';
|
|
41
29
|
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
42
30
|
import MuiAlert from '@material-ui/lab/Alert';
|
|
31
|
+
import Card from '@material-ui/core/Card';
|
|
32
|
+
import CardContent from '@material-ui/core/CardContent';
|
|
43
33
|
import TextField$1 from '@material-ui/core/TextField';
|
|
44
34
|
import { Alert as Alert$2, AlertTitle } from '@material-ui/lab';
|
|
45
35
|
import { MuiPickersUtilsProvider, KeyboardDatePicker, KeyboardTimePicker } from '@material-ui/pickers';
|
|
46
36
|
import MomentUtils from '@date-io/moment';
|
|
37
|
+
import Select from '@material-ui/core/Select';
|
|
47
38
|
import InputLabel from '@material-ui/core/InputLabel';
|
|
48
39
|
import FormControl from '@material-ui/core/FormControl';
|
|
49
40
|
import FormGroup from '@material-ui/core/FormGroup';
|
|
@@ -58,6 +49,16 @@ import Chip from '@material-ui/core/Chip';
|
|
|
58
49
|
import LockOutlinedIcon from '@material-ui/icons/LockOutlined';
|
|
59
50
|
import IconButton from '@material-ui/core/IconButton';
|
|
60
51
|
import CloseIcon from '@material-ui/icons/Close';
|
|
52
|
+
import PropTypes from 'prop-types';
|
|
53
|
+
import { ResponsiveBar } from '@nivo/bar';
|
|
54
|
+
import TreeView from '@material-ui/lab/TreeView';
|
|
55
|
+
import SvgIcon from '@material-ui/core/SvgIcon';
|
|
56
|
+
import TreeItem from '@material-ui/lab/TreeItem';
|
|
57
|
+
import Collapse from '@material-ui/core/Collapse';
|
|
58
|
+
import Code from '@material-ui/icons/Code';
|
|
59
|
+
import Folder from '@material-ui/icons/Folder';
|
|
60
|
+
import { useSpring, animated } from 'react-spring';
|
|
61
|
+
import CardActions from '@material-ui/core/CardActions';
|
|
61
62
|
|
|
62
63
|
/******************************************************************************
|
|
63
64
|
Copyright (c) Microsoft Corporation.
|
|
@@ -4658,7 +4659,7 @@ var Configuration$1 = /** @class */ (function () {
|
|
|
4658
4659
|
return Configuration;
|
|
4659
4660
|
}());
|
|
4660
4661
|
|
|
4661
|
-
var base$
|
|
4662
|
+
var base$2 = document.getElementsByTagName('base')[0].getAttribute('href') || '/';
|
|
4662
4663
|
var MESApiService = /** @class */ (function () {
|
|
4663
4664
|
function MESApiService() {
|
|
4664
4665
|
this.config = new Configuration$1();
|
|
@@ -4685,7 +4686,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4685
4686
|
mode: "cors",
|
|
4686
4687
|
headers: {
|
|
4687
4688
|
"Content-Type": "application/json",
|
|
4688
|
-
'Authorization': 'Bearer ' +
|
|
4689
|
+
'Authorization': 'Bearer ' + getTokenFromLS()
|
|
4689
4690
|
},
|
|
4690
4691
|
body: JSON.stringify(data)
|
|
4691
4692
|
})["catch"](function (errorMsg) {
|
|
@@ -4835,7 +4836,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4835
4836
|
mode: "cors",
|
|
4836
4837
|
headers: {
|
|
4837
4838
|
"Content-Type": "application/json",
|
|
4838
|
-
'Authorization': 'Bearer ' +
|
|
4839
|
+
'Authorization': 'Bearer ' + getTokenFromLS()
|
|
4839
4840
|
},
|
|
4840
4841
|
body: JSON.stringify(data)
|
|
4841
4842
|
})["catch"](function (errorMsg) {
|
|
@@ -4843,7 +4844,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4843
4844
|
})
|
|
4844
4845
|
.then(function (response) {
|
|
4845
4846
|
if (response.status === 401) {
|
|
4846
|
-
window.location.href = "".concat(base$
|
|
4847
|
+
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4847
4848
|
}
|
|
4848
4849
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
4849
4850
|
return response.json();
|
|
@@ -4887,7 +4888,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4887
4888
|
mode: "cors",
|
|
4888
4889
|
headers: {
|
|
4889
4890
|
"Content-Type": "application/json",
|
|
4890
|
-
'Authorization': 'Bearer ' +
|
|
4891
|
+
'Authorization': 'Bearer ' + getTokenFromLS()
|
|
4891
4892
|
},
|
|
4892
4893
|
body: JSON.stringify(data)
|
|
4893
4894
|
})["catch"](function (errorMsg) {
|
|
@@ -4895,7 +4896,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4895
4896
|
})
|
|
4896
4897
|
.then(function (response) {
|
|
4897
4898
|
if (response.status === 401) {
|
|
4898
|
-
window.location.href = "".concat(base$
|
|
4899
|
+
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4899
4900
|
}
|
|
4900
4901
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
4901
4902
|
return response.json();
|
|
@@ -4942,7 +4943,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4942
4943
|
method: "POST",
|
|
4943
4944
|
mode: "cors",
|
|
4944
4945
|
headers: {
|
|
4945
|
-
'Authorization': 'Bearer ' +
|
|
4946
|
+
'Authorization': 'Bearer ' + getTokenFromLS()
|
|
4946
4947
|
},
|
|
4947
4948
|
body: formData
|
|
4948
4949
|
})["catch"](function (errorMsg) {
|
|
@@ -4950,7 +4951,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4950
4951
|
})
|
|
4951
4952
|
.then(function (response) {
|
|
4952
4953
|
if (response.status === 401) {
|
|
4953
|
-
window.location.href = "".concat(base$
|
|
4954
|
+
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4954
4955
|
}
|
|
4955
4956
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
4956
4957
|
return response.json();
|
|
@@ -4995,7 +4996,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4995
4996
|
mode: "cors",
|
|
4996
4997
|
headers: {
|
|
4997
4998
|
"Content-Type": "application/json",
|
|
4998
|
-
'Authorization': 'Bearer ' +
|
|
4999
|
+
'Authorization': 'Bearer ' + getTokenFromLS()
|
|
4999
5000
|
},
|
|
5000
5001
|
body: JSON.stringify(data)
|
|
5001
5002
|
})["catch"](function (errorMsg) {
|
|
@@ -5003,7 +5004,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
5003
5004
|
})
|
|
5004
5005
|
.then(function (response) {
|
|
5005
5006
|
if (response.status === 401) {
|
|
5006
|
-
window.location.href = "".concat(base$
|
|
5007
|
+
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
5007
5008
|
}
|
|
5008
5009
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
5009
5010
|
if (!isError.ok)
|
|
@@ -5064,7 +5065,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
5064
5065
|
mode: "cors",
|
|
5065
5066
|
headers: {
|
|
5066
5067
|
"Content-Type": "application/json",
|
|
5067
|
-
'Authorization': 'Bearer ' +
|
|
5068
|
+
'Authorization': 'Bearer ' + getTokenFromLS()
|
|
5068
5069
|
},
|
|
5069
5070
|
body: JSON.stringify(data)
|
|
5070
5071
|
})["catch"](function (errorMsg) {
|
|
@@ -5072,7 +5073,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
5072
5073
|
})
|
|
5073
5074
|
.then(function (response) {
|
|
5074
5075
|
if (response.status === 401) {
|
|
5075
|
-
window.location.href = "".concat(base$
|
|
5076
|
+
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
5076
5077
|
}
|
|
5077
5078
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
5078
5079
|
if (!isError.ok)
|
|
@@ -5241,7 +5242,7 @@ var UserInitialState = {
|
|
|
5241
5242
|
userId: null,
|
|
5242
5243
|
defaultAreaId: null,
|
|
5243
5244
|
defaultAreaName: "",
|
|
5244
|
-
|
|
5245
|
+
userLogged: false
|
|
5245
5246
|
};
|
|
5246
5247
|
var UserReducer = createSlice({
|
|
5247
5248
|
name: "__",
|
|
@@ -5263,9 +5264,9 @@ var UserReducer = createSlice({
|
|
|
5263
5264
|
var payload = _a.payload;
|
|
5264
5265
|
state.defaultAreaName = payload;
|
|
5265
5266
|
},
|
|
5266
|
-
|
|
5267
|
+
setUserLogged: function (state, _a) {
|
|
5267
5268
|
var payload = _a.payload;
|
|
5268
|
-
state.
|
|
5269
|
+
state.userLogged = payload;
|
|
5269
5270
|
}
|
|
5270
5271
|
}
|
|
5271
5272
|
});
|
|
@@ -5284,47 +5285,47 @@ var UserProvider = function (_a) {
|
|
|
5284
5285
|
return (React__default.createElement(UserContext.Provider, { value: { state: state, actions: actions } }, children));
|
|
5285
5286
|
};
|
|
5286
5287
|
|
|
5288
|
+
var getTokenFromLS = function () {
|
|
5289
|
+
return localStorage.getItem('token');
|
|
5290
|
+
};
|
|
5287
5291
|
function useToken() {
|
|
5288
|
-
var
|
|
5289
|
-
var
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
localStorage.setItem("userMESData", JSON.stringify(userToken));
|
|
5297
|
-
setToken(userToken.token);
|
|
5292
|
+
var setUserLogged = useUserContext().actions.setUserLogged;
|
|
5293
|
+
var _a = useState(getTokenFromLS()), token = _a[0], setToken = _a[1];
|
|
5294
|
+
var saveUserData = function (userToken) {
|
|
5295
|
+
localStorage.setItem('userMESData', JSON.stringify(userToken));
|
|
5296
|
+
localStorage.setItem('refreshToken', userToken['refreshToken']);
|
|
5297
|
+
localStorage.setItem('token', userToken['token']);
|
|
5298
|
+
setToken(userToken['token']);
|
|
5299
|
+
setUserLogged(true);
|
|
5298
5300
|
};
|
|
5299
5301
|
var clearUserData = function () {
|
|
5300
|
-
localStorage.removeItem(
|
|
5301
|
-
setToken(
|
|
5302
|
+
localStorage.removeItem('userMESData');
|
|
5303
|
+
setToken('');
|
|
5304
|
+
setUserLogged(false);
|
|
5302
5305
|
};
|
|
5303
5306
|
var getUserName = function () {
|
|
5304
|
-
var sessionData = localStorage.getItem(
|
|
5307
|
+
var sessionData = localStorage.getItem('userMESData');
|
|
5305
5308
|
var userData = JSON.parse(sessionData);
|
|
5306
|
-
return ((
|
|
5307
|
-
", " +
|
|
5308
|
-
((userData || {}).firstName || ""));
|
|
5309
|
+
return ((userData || {}).lastName || '') + ', ' + ((userData || {}).firstName || '');
|
|
5309
5310
|
};
|
|
5310
5311
|
var getFirstName = function () {
|
|
5311
|
-
var sessionData = localStorage.getItem(
|
|
5312
|
+
var sessionData = localStorage.getItem('userMESData');
|
|
5312
5313
|
var userData = JSON.parse(sessionData);
|
|
5313
|
-
return (userData || {}).firstName ||
|
|
5314
|
+
return ((userData || {}).firstName || '');
|
|
5314
5315
|
};
|
|
5315
5316
|
var getLastName = function () {
|
|
5316
|
-
var sessionData = localStorage.getItem(
|
|
5317
|
+
var sessionData = localStorage.getItem('userMESData');
|
|
5317
5318
|
var userData = JSON.parse(sessionData);
|
|
5318
|
-
return (userData || {}).lastName ||
|
|
5319
|
+
return ((userData || {}).lastName || '');
|
|
5319
5320
|
};
|
|
5320
5321
|
var getUserId = function () {
|
|
5321
|
-
var sessionData = localStorage.getItem(
|
|
5322
|
+
var sessionData = localStorage.getItem('userMESData');
|
|
5322
5323
|
var userData = JSON.parse(sessionData);
|
|
5323
|
-
|
|
5324
|
-
return (userData || {}).id || -1;
|
|
5324
|
+
setUserLogged(true);
|
|
5325
|
+
return ((userData || {}).id || (-1));
|
|
5325
5326
|
};
|
|
5326
5327
|
var hasPermission = function (permissionId) {
|
|
5327
|
-
var sessionData = localStorage.getItem(
|
|
5328
|
+
var sessionData = localStorage.getItem('userMESData');
|
|
5328
5329
|
if (sessionData === undefined)
|
|
5329
5330
|
return false;
|
|
5330
5331
|
var userData = JSON.parse(sessionData);
|
|
@@ -5333,8 +5334,8 @@ function useToken() {
|
|
|
5333
5334
|
};
|
|
5334
5335
|
return {
|
|
5335
5336
|
getUserName: getUserName,
|
|
5336
|
-
|
|
5337
|
-
|
|
5337
|
+
saveUserData: saveUserData,
|
|
5338
|
+
clearUserData: clearUserData,
|
|
5338
5339
|
getFirstName: getFirstName,
|
|
5339
5340
|
getLastName: getLastName,
|
|
5340
5341
|
getUserId: getUserId,
|
|
@@ -5441,6 +5442,7 @@ var AuthContext = React__default.createContext({});
|
|
|
5441
5442
|
var AuthProvider = function (_a) {
|
|
5442
5443
|
var children = _a.children, authConfig = _a.authConfig;
|
|
5443
5444
|
var useTokenHook = useToken();
|
|
5445
|
+
console.log(useTokenHook.token);
|
|
5444
5446
|
return (React__default.createElement(React__default.Fragment, null,
|
|
5445
5447
|
React__default.createElement(AuthContext.Provider, { value: useTokenHook },
|
|
5446
5448
|
!!useTokenHook.token && React__default.createElement(Authenticated, null, children),
|
|
@@ -5460,14 +5462,14 @@ var LoginWithEmailAndPassword = function () {
|
|
|
5460
5462
|
var _b = useState(''), password = _b[0], setPassword = _b[1];
|
|
5461
5463
|
var _c = React__default.useState(false), showError = _c[0], setShowError = _c[1];
|
|
5462
5464
|
var _d = React__default.useState(undefined), error = _d[0], setError = _d[1];
|
|
5463
|
-
var
|
|
5464
|
-
var apiService = new MESApiService();
|
|
5465
|
+
var saveUserData = React__default.useContext(AuthContext).saveUserData;
|
|
5465
5466
|
var login = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5466
|
-
var response;
|
|
5467
|
+
var apiService, response;
|
|
5467
5468
|
return __generator(this, function (_a) {
|
|
5468
5469
|
switch (_a.label) {
|
|
5469
5470
|
case 0:
|
|
5470
5471
|
e.preventDefault();
|
|
5472
|
+
apiService = new MESApiService();
|
|
5471
5473
|
return [4 /*yield*/, apiService.authenticate(username, password)];
|
|
5472
5474
|
case 1:
|
|
5473
5475
|
response = _a.sent();
|
|
@@ -5476,17 +5478,12 @@ var LoginWithEmailAndPassword = function () {
|
|
|
5476
5478
|
setError(apiService.error);
|
|
5477
5479
|
}
|
|
5478
5480
|
else {
|
|
5479
|
-
|
|
5481
|
+
saveUserData(response);
|
|
5480
5482
|
}
|
|
5481
5483
|
return [2 /*return*/];
|
|
5482
5484
|
}
|
|
5483
5485
|
});
|
|
5484
5486
|
}); };
|
|
5485
|
-
var handleKeypress = function (e) {
|
|
5486
|
-
if (e.charCode === 13) {
|
|
5487
|
-
login(e);
|
|
5488
|
-
}
|
|
5489
|
-
};
|
|
5490
5487
|
return (React__default.createElement(React__default.Fragment, null,
|
|
5491
5488
|
React__default.createElement("form", { onSubmit: login },
|
|
5492
5489
|
React__default.createElement(Alert$1, { show: showError, variant: "danger", dismissible: true, onClose: function () {
|
|
@@ -5501,7 +5498,7 @@ var LoginWithEmailAndPassword = function () {
|
|
|
5501
5498
|
React__default.createElement("div", { className: "form-group row" },
|
|
5502
5499
|
React__default.createElement("input", { id: "txtUserName", placeholder: "User", name: "userName", onChange: function (e) { return setUserName(e.target.value); }, type: "text", autoComplete: "off", className: "form-control" })),
|
|
5503
5500
|
React__default.createElement("div", { className: "form-group row" },
|
|
5504
|
-
React__default.createElement("input", { id: "txtPassword", placeholder: "Password", name: "password", onChange: function (e) { return setPassword(e.target.value); },
|
|
5501
|
+
React__default.createElement("input", { id: "txtPassword", placeholder: "Password", name: "password", onChange: function (e) { return setPassword(e.target.value); }, type: "password", className: "form-control" })),
|
|
5505
5502
|
React__default.createElement("div", { className: "row" },
|
|
5506
5503
|
React__default.createElement("button", { className: "btn btn-primary mes-button-primary mx-auto col-md-12 mt-3 ", type: "submit", disabled: password.length === 0 || username.length === 0 }, "Login")))));
|
|
5507
5504
|
};
|
|
@@ -5560,7 +5557,7 @@ var loginRequest = {
|
|
|
5560
5557
|
};
|
|
5561
5558
|
|
|
5562
5559
|
var LoginWithAzureADForm = function () {
|
|
5563
|
-
var
|
|
5560
|
+
var saveUserData = React__default.useContext(AuthContext).saveUserData;
|
|
5564
5561
|
var instance = useMsal().instance;
|
|
5565
5562
|
var login = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5566
5563
|
var result, api, loginResponse, e_1, e_2;
|
|
@@ -5581,7 +5578,7 @@ var LoginWithAzureADForm = function () {
|
|
|
5581
5578
|
return [4 /*yield*/, api.loginWithAzureAD(result.accessToken)];
|
|
5582
5579
|
case 4:
|
|
5583
5580
|
loginResponse = _a.sent();
|
|
5584
|
-
|
|
5581
|
+
saveUserData(loginResponse);
|
|
5585
5582
|
return [3 /*break*/, 6];
|
|
5586
5583
|
case 5:
|
|
5587
5584
|
e_1 = _a.sent();
|
|
@@ -5614,7 +5611,7 @@ var LoginWithAzureAD = function (_a) {
|
|
|
5614
5611
|
var LoginAsGuest = function () {
|
|
5615
5612
|
var _a = React__default.useState(false), showError = _a[0], setShowError = _a[1];
|
|
5616
5613
|
var _b = React__default.useState(undefined), error = _b[0], setError = _b[1];
|
|
5617
|
-
var
|
|
5614
|
+
var saveUserData = React__default.useContext(AuthContext).saveUserData;
|
|
5618
5615
|
var apiService = new MESApiService();
|
|
5619
5616
|
var loginAsGuest = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5620
5617
|
var response;
|
|
@@ -5630,7 +5627,7 @@ var LoginAsGuest = function () {
|
|
|
5630
5627
|
setError(apiService.error);
|
|
5631
5628
|
}
|
|
5632
5629
|
else {
|
|
5633
|
-
|
|
5630
|
+
saveUserData(response);
|
|
5634
5631
|
}
|
|
5635
5632
|
return [2 /*return*/];
|
|
5636
5633
|
}
|
|
@@ -5690,14 +5687,14 @@ function Login(_a) {
|
|
|
5690
5687
|
|
|
5691
5688
|
function Logout() {
|
|
5692
5689
|
var _this = this;
|
|
5693
|
-
var
|
|
5690
|
+
var clearUserData = useContext(AuthContext).clearUserData;
|
|
5694
5691
|
var navigate = useNavigate();
|
|
5695
5692
|
var _a = useSearchParams(), params = _a[0]; _a[1];
|
|
5696
|
-
var
|
|
5693
|
+
var setUserLogged = useUserContext().actions.setUserLogged;
|
|
5697
5694
|
var logout = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5698
5695
|
return __generator(this, function (_a) {
|
|
5699
|
-
|
|
5700
|
-
|
|
5696
|
+
setUserLogged(false);
|
|
5697
|
+
clearUserData();
|
|
5701
5698
|
navigate("/?".concat(params.toString()));
|
|
5702
5699
|
return [2 /*return*/];
|
|
5703
5700
|
});
|
|
@@ -5780,7 +5777,7 @@ function Header(_a) {
|
|
|
5780
5777
|
var CustomNavbar = useContext(NavbarContext);
|
|
5781
5778
|
var userName = useState(getUserName())[0];
|
|
5782
5779
|
var searchAssets = useSearchAssets().searchAssets;
|
|
5783
|
-
var
|
|
5780
|
+
var userLogged = useUserContext().state.userLogged;
|
|
5784
5781
|
var tick = function () {
|
|
5785
5782
|
setDate(new Date());
|
|
5786
5783
|
};
|
|
@@ -5792,9 +5789,11 @@ function Header(_a) {
|
|
|
5792
5789
|
clearTimeout(timerID);
|
|
5793
5790
|
};
|
|
5794
5791
|
});
|
|
5795
|
-
useEffect(function () {
|
|
5796
|
-
|
|
5797
|
-
|
|
5792
|
+
useEffect(function () {
|
|
5793
|
+
if (showAreaSelector && userLogged) {
|
|
5794
|
+
searchAssets();
|
|
5795
|
+
}
|
|
5796
|
+
}, [userLogged]);
|
|
5798
5797
|
return (React__default.createElement(Navbar, { variant: "dark", expand: "lg", className: "mes-primary-color mes-menu-top" },
|
|
5799
5798
|
React__default.createElement(Container, { fluid: true },
|
|
5800
5799
|
React__default.createElement(Navbar.Brand, { as: Link, to: "/home" }, "MESF"),
|
|
@@ -5908,7 +5907,6 @@ var Navigation = function (_a) {
|
|
|
5908
5907
|
var _c = useSearchParams(), params = _c[0]; _c[1];
|
|
5909
5908
|
var mounted = useRef(true);
|
|
5910
5909
|
useEffect(function () {
|
|
5911
|
-
mounted.current = true;
|
|
5912
5910
|
if (params.has('redirectTo')) {
|
|
5913
5911
|
setTimeout(function () {
|
|
5914
5912
|
if (mounted.current) {
|
|
@@ -5928,7 +5926,7 @@ var Navigation = function (_a) {
|
|
|
5928
5926
|
var css = "body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background-color: #fafbfc !important;\n}\n.container-fluid-main{\n padding-right: 0px !important; \n padding-left: 0px !important;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n\n.mes-primary-color {\n background-color: #479dc4 !important;\n}\n.mes-button-primary{\n background-color: #479dc4 !important;\n border-color: #479dc4 !important;\n}\n\n.mes-selectable-datagrid .MuiDataGrid-row{\n cursor: pointer;\n}\n\n.mes-menu-top .navbar-brand{\n color: #FFFF !important;\n}\n.mes-menu-top .nav-link {\n color: #FFFF !important;\n}\n.mes-menu-top .navbar-toggler {\n color: #FFFF !important;\n}\n.mes-menu-top .navbar-text {\n color: #FFFF !important;\n}\n.mes-footer-login{\n position: absolute;\n bottom: 0;\n width: 100%;\n height: 10em;\n line-height: 60px;\n text-align:center;\n}\n.mes-filter-datepicker{\n padding: unset !important;\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n padding-top: 0.375rem !important;\n padding-bottom: 0.375rem !important;\n padding-left: 0.75rem !important;\n cursor: pointer !important;\n max-width: 120px;\n}\n.mes-filter-datetimepicker{\n max-width: 97px;\n}\n.mes-not-rounded{\n border-radius: unset !important;\n}\n\n.mes-numeric{\n text-align: right;\n}\n.mes-drag-over{\n border: 3px dotted #666;\n background-color: #479dc4 !important;\n}\n.mes-drag-start{\n border: 3px solid #666;\n}\n\n.mes-selectable{\n cursor: pointer !important;\n}\n\n.mes-custom-select{\n width: auto !important;\n padding: 0.375rem 0 0.375rem 0 !important;\n background: unset !important;\n font-family: inherit !important;\n}\n.mes-custom-select .MuiSelect-select{\n padding-left: 14px;\n}\n\n.mes-custom-select::before{\n border-bottom: unset !important;\n}\n.mes-custom-select::after{\n border-bottom: unset !important;\n}\n.mes-no-border{\n border: unset;\n}\n.mes-no-border:focus-visible {\n outline: unset;\n}\n.mes-div-submenu{\n border-right: 1px solid #cfdbe2; \n}\n.mes-submenu a{\n width: 100% !important;\n /* color: rgba(0, 0, 0, 0.87); */\n color: #479dc4\n}\n.mes-submenu .Mui-selected{\n border-right: 3px solid #479dc4; \n}\n.mes-menu-group{\n font-size: 20px;\n line-height: 1.1;\n color: #929292; \n font-weight: normal; \n}\n\n/********************MUI DATAGRID*****************************/\n.Mui-selected{\n font-weight: bolder !important;\n opacity: 1 !important;\n}\n\n.mes-upload-control{\n\n}\n.mes-upload-control .file-box{\n /* border : 1px solid black; */\n height : 100px;\n position: relative; \n}\n.mes-upload-control .file-detail{\n position: absolute;\n left: 0px;\n top: 0px; \n z-index: 1;\n height: 100%;\n width: 100%;\n}\n\n.mes-upload-control input[type=file]{\n left: 0px;\n top: 0px;\n opacity: 0;\n z-index: 10000;\n height: 100%;\n cursor: pointer;\n}\n.mes-upload-control table{\n width: 100%;\n}\n.mes-upload-control td{\n font-size: 0.8rem !important;\n max-width:0;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;\n}\n\n\n.input-group-text{\n background-color: #ced2cc !important;\n /* border: 1px solid #ced4da !important; */\n /* color: #000000 !important; */\n}\n\n\n\n\n.content-wrapper {\n padding: 15px;\n width: 100%;\n border-top: 1px solid rgba(0, 0, 0, 0.15);\n margin-top: -1px;\n}\n.content-wrapper > .unwrap {\n margin: -15px;\n}\n@media only screen and (min-width: 768px) {\n .content-wrapper > .unwrap {\n margin: -20px;\n }\n}\n.content-wrapper > h3,\n.content-wrapper > .content-heading {\n font-size: 24px;\n line-height: 1.1;\n color: #929292;\n margin: -15px;\n margin-bottom: 20px;\n padding: 15px;\n font-weight: normal;\n background-color: #fafbfc;\n border-bottom: 1px solid #cfdbe2;\n}\n.content-wrapper > h3 > small,\n.content-wrapper > .content-heading > small {\n display: block;\n font-size: 12px;\n color: #909fa7;\n}\n.content-wrapper > button,\n.content-wrapper > .btn {\n margin: 10px 10px 0 0;\n}\n.content-wrapper .container,\n.content-wrapper .container-fluid {\n padding-left: 0;\n padding-right: 0;\n}\n@media only screen and (min-width: 768px) {\n .content-wrapper {\n padding: 20px;\n }\n .content-wrapper > h3,\n .content-wrapper > .content-heading {\n margin: -20px;\n margin-bottom: 5px;\n padding: 15px;\n }\n .content-wrapper > button,\n .content-wrapper > .btn {\n margin: 0;\n }\n}\n\n @media print {\n .sidebar,\n .topnavbar,\n .offsidebar,\n .btn {\n display: none !important;\n width: 0 !important;\n height: 0 !important;\n }\n .wrapper,\n .wrapper > section,\n .content-wrapper {\n margin: 0 !important;\n /* remove margin used for sidebar and expand the content */\n padding: 0 !important;\n width: 100% !important;\n }\n .content-wrapper {\n overflow: hidden !important;\n }\n }\n ";
|
|
5929
5927
|
n(css,{});
|
|
5930
5928
|
|
|
5931
|
-
var base = document.getElementsByTagName('base')[0].getAttribute('href') || '/';
|
|
5929
|
+
var base$1 = document.getElementsByTagName('base')[0].getAttribute('href') || '/';
|
|
5932
5930
|
function MESFMain(_a) {
|
|
5933
5931
|
var authentication = _a.authentication, routes = _a.routes, navbar = _a.navbar, configurations = _a.configurations, _b = _a.showAreaSelector, showAreaSelector = _b === void 0 ? false : _b;
|
|
5934
5932
|
return (React__default.createElement(AuthProvider, { authConfig: authentication },
|
|
@@ -5937,12 +5935,109 @@ function MESFMain(_a) {
|
|
|
5937
5935
|
React__default.createElement(RouterContext.Provider, { value: routes },
|
|
5938
5936
|
React__default.createElement(NavbarContext.Provider, { value: navbar },
|
|
5939
5937
|
React__default.createElement(ConfigurationContext.Provider, { value: configurations },
|
|
5940
|
-
React__default.createElement(BrowserRouter, { basename: base },
|
|
5938
|
+
React__default.createElement(BrowserRouter, { basename: base$1 },
|
|
5941
5939
|
React__default.createElement(Routes, null,
|
|
5942
5940
|
React__default.createElement(Route, { path: "/logout", element: React__default.createElement(Logout, null) })),
|
|
5943
5941
|
React__default.createElement(Navigation, { showAreaSelector: showAreaSelector })))))))));
|
|
5944
5942
|
}
|
|
5945
5943
|
|
|
5944
|
+
var base = document.getElementsByTagName('base')[0].getAttribute('href') || '/';
|
|
5945
|
+
function renewToken() {
|
|
5946
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5947
|
+
var refreshToken, config, fd, response, token;
|
|
5948
|
+
return __generator(this, function (_a) {
|
|
5949
|
+
switch (_a.label) {
|
|
5950
|
+
case 0:
|
|
5951
|
+
refreshToken = localStorage.getItem("refreshToken");
|
|
5952
|
+
if (!refreshToken) {
|
|
5953
|
+
throw new Error('refresh token does not exist');
|
|
5954
|
+
}
|
|
5955
|
+
config = new Configuration$1();
|
|
5956
|
+
fd = new FormData();
|
|
5957
|
+
fd.append('refreshToken', refreshToken);
|
|
5958
|
+
return [4 /*yield*/, axios.post("".concat(config.API_AUTH_URL, "/refresh"), fd, {
|
|
5959
|
+
headers: {
|
|
5960
|
+
"Content-Type": 'application/json'
|
|
5961
|
+
},
|
|
5962
|
+
params: {
|
|
5963
|
+
refreshToken: refreshToken
|
|
5964
|
+
}
|
|
5965
|
+
})];
|
|
5966
|
+
case 1:
|
|
5967
|
+
response = _a.sent();
|
|
5968
|
+
token = response.data.result;
|
|
5969
|
+
if (token) {
|
|
5970
|
+
return [2 /*return*/, [token, refreshToken]];
|
|
5971
|
+
}
|
|
5972
|
+
else {
|
|
5973
|
+
throw new Error("Token is not valid");
|
|
5974
|
+
}
|
|
5975
|
+
}
|
|
5976
|
+
});
|
|
5977
|
+
});
|
|
5978
|
+
}
|
|
5979
|
+
function isUnauthorizedError(error) {
|
|
5980
|
+
var _a = error.response, status = _a.status; _a.statusText;
|
|
5981
|
+
return status === 401;
|
|
5982
|
+
}
|
|
5983
|
+
var axiosInstance = axios.create();
|
|
5984
|
+
var refreshingFunc;
|
|
5985
|
+
axiosInstance.interceptors.response.use(function (res) { return res; }, function (error) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5986
|
+
var originalConfig, token, _a, newToken, newRefreshToken, innerError_1;
|
|
5987
|
+
return __generator(this, function (_b) {
|
|
5988
|
+
switch (_b.label) {
|
|
5989
|
+
case 0:
|
|
5990
|
+
originalConfig = error.config;
|
|
5991
|
+
if (originalConfig.headers.MESF_Retries === 1) {
|
|
5992
|
+
localStorage.removeItem("token");
|
|
5993
|
+
localStorage.removeItem("refreshToken");
|
|
5994
|
+
window.location.href = "".concat(base, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
5995
|
+
}
|
|
5996
|
+
token = getTokenFromLS();
|
|
5997
|
+
if (!token || !isUnauthorizedError(error)) {
|
|
5998
|
+
return [2 /*return*/, Promise.reject(error)];
|
|
5999
|
+
}
|
|
6000
|
+
_b.label = 1;
|
|
6001
|
+
case 1:
|
|
6002
|
+
_b.trys.push([1, 7, 8, 9]);
|
|
6003
|
+
// the trick here, that `refreshingFunc` is global, e.g. 2 expired requests will get the same function pointer and await same function.
|
|
6004
|
+
if (!refreshingFunc)
|
|
6005
|
+
refreshingFunc = renewToken();
|
|
6006
|
+
return [4 /*yield*/, refreshingFunc];
|
|
6007
|
+
case 2:
|
|
6008
|
+
_a = _b.sent(), newToken = _a[0], newRefreshToken = _a[1];
|
|
6009
|
+
localStorage.setItem("token", newToken);
|
|
6010
|
+
localStorage.setItem("refreshToken", newRefreshToken);
|
|
6011
|
+
axiosInstance.defaults.headers.Authorization = "Bearer ".concat(newToken);
|
|
6012
|
+
originalConfig.headers.Authorization = "Bearer ".concat(newToken);
|
|
6013
|
+
originalConfig.headers.MESF_Retries = 1;
|
|
6014
|
+
_b.label = 3;
|
|
6015
|
+
case 3:
|
|
6016
|
+
_b.trys.push([3, 5, , 6]);
|
|
6017
|
+
return [4 /*yield*/, axios.request(originalConfig)];
|
|
6018
|
+
case 4: return [2 /*return*/, _b.sent()];
|
|
6019
|
+
case 5:
|
|
6020
|
+
innerError_1 = _b.sent();
|
|
6021
|
+
// if original req failed with 401 again - it means server returned not valid token for refresh request
|
|
6022
|
+
if (isUnauthorizedError(innerError_1)) {
|
|
6023
|
+
return [2 /*return*/, innerError_1];
|
|
6024
|
+
}
|
|
6025
|
+
return [2 /*return*/, innerError_1];
|
|
6026
|
+
case 6: return [3 /*break*/, 9];
|
|
6027
|
+
case 7:
|
|
6028
|
+
_b.sent();
|
|
6029
|
+
localStorage.removeItem("token");
|
|
6030
|
+
localStorage.removeItem("refreshToken");
|
|
6031
|
+
window.location.href = "".concat(base, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
6032
|
+
return [3 /*break*/, 9];
|
|
6033
|
+
case 8:
|
|
6034
|
+
refreshingFunc = undefined;
|
|
6035
|
+
return [7 /*endfinally*/];
|
|
6036
|
+
case 9: return [2 /*return*/];
|
|
6037
|
+
}
|
|
6038
|
+
});
|
|
6039
|
+
}); }, {});
|
|
6040
|
+
|
|
5946
6041
|
var useDefaultAreaId = function () {
|
|
5947
6042
|
var _a = useUserContext(), userId = _a.state.userId, setDefaultAreaId = _a.actions.setDefaultAreaId;
|
|
5948
6043
|
return function () {
|
|
@@ -6072,4 +6167,4 @@ var areaSelector = /*#__PURE__*/Object.freeze({
|
|
|
6072
6167
|
AreaSelector: AreaSelector
|
|
6073
6168
|
});
|
|
6074
6169
|
|
|
6075
|
-
export { Account, AssetProvider, AuthContext, AuthProvider, BarChartControl, ChangePassword, CheckBoxControl, Configuration$1 as Configuration, CurrencyFormatter, DataGridControl, DateFormatter, DateTimeFormatter, FetchError, FilterPanel, GenericPanel, GenericTable, GetCrewColor, GetShiftColor, HorizontalTextControl, IntegerFormatter, Login, Logout, LongFilterPanel, MESApiService, MESFMain, MESSAGE_API, MESSAGE_ERRORS, MasterDetailPanel, ModalTreeFilterControl, MultipleSelectorControl, NumberFormatter, NumericTextControl, SimplePasswordControl, SimpleSelectorControl, SimpleTextAreaControl, SimpleTextControl, TimeFormatter, TreePickerControl, USER_LABELS, UploadFileControl, UserProvider, formatNumber, getCrewStyle, getShiftStyle, useAssetContext, useToken, useUserContext };
|
|
6170
|
+
export { Account, AssetProvider, AuthContext, AuthProvider, BarChartControl, ChangePassword, CheckBoxControl, Configuration$1 as Configuration, CurrencyFormatter, DataGridControl, DateFormatter, DateTimeFormatter, FetchError, FilterPanel, GenericPanel, GenericTable, GetCrewColor, GetShiftColor, HorizontalTextControl, IntegerFormatter, Login, Logout, LongFilterPanel, MESApiService, MESFMain, MESSAGE_API, MESSAGE_ERRORS, MasterDetailPanel, ModalTreeFilterControl, MultipleSelectorControl, NumberFormatter, NumericTextControl, SimplePasswordControl, SimpleSelectorControl, SimpleTextAreaControl, SimpleTextControl, TimeFormatter, TreePickerControl, USER_LABELS, UploadFileControl, UserProvider, axiosInstance, formatNumber, getCrewStyle, getShiftStyle, getTokenFromLS, renewToken, useAssetContext, useToken, useUserContext };
|
|
@@ -3,14 +3,14 @@ export declare const UserReducer: import("@reduxjs/toolkit").Slice<{
|
|
|
3
3
|
userId: number | null;
|
|
4
4
|
defaultAreaId: number | string | null;
|
|
5
5
|
defaultAreaName: string | null;
|
|
6
|
-
|
|
6
|
+
userLogged: boolean;
|
|
7
7
|
}, {
|
|
8
8
|
setUserId(state: import("immer/dist/internal").WritableDraft<{
|
|
9
9
|
userLastName: string;
|
|
10
10
|
userId: number | null;
|
|
11
11
|
defaultAreaId: number | string | null;
|
|
12
12
|
defaultAreaName: string | null;
|
|
13
|
-
|
|
13
|
+
userLogged: boolean;
|
|
14
14
|
}>, { payload }: {
|
|
15
15
|
payload: any;
|
|
16
16
|
type: string;
|
|
@@ -20,7 +20,7 @@ export declare const UserReducer: import("@reduxjs/toolkit").Slice<{
|
|
|
20
20
|
userId: number | null;
|
|
21
21
|
defaultAreaId: number | string | null;
|
|
22
22
|
defaultAreaName: string | null;
|
|
23
|
-
|
|
23
|
+
userLogged: boolean;
|
|
24
24
|
}>, { payload }: {
|
|
25
25
|
payload: any;
|
|
26
26
|
type: string;
|
|
@@ -30,7 +30,7 @@ export declare const UserReducer: import("@reduxjs/toolkit").Slice<{
|
|
|
30
30
|
userId: number | null;
|
|
31
31
|
defaultAreaId: number | string | null;
|
|
32
32
|
defaultAreaName: string | null;
|
|
33
|
-
|
|
33
|
+
userLogged: boolean;
|
|
34
34
|
}>, { payload }: {
|
|
35
35
|
payload: any;
|
|
36
36
|
type: string;
|
|
@@ -40,17 +40,17 @@ export declare const UserReducer: import("@reduxjs/toolkit").Slice<{
|
|
|
40
40
|
userId: number | null;
|
|
41
41
|
defaultAreaId: number | string | null;
|
|
42
42
|
defaultAreaName: string | null;
|
|
43
|
-
|
|
43
|
+
userLogged: boolean;
|
|
44
44
|
}>, { payload }: {
|
|
45
45
|
payload: any;
|
|
46
46
|
type: string;
|
|
47
47
|
}): void;
|
|
48
|
-
|
|
48
|
+
setUserLogged(state: import("immer/dist/internal").WritableDraft<{
|
|
49
49
|
userLastName: string;
|
|
50
50
|
userId: number | null;
|
|
51
51
|
defaultAreaId: number | string | null;
|
|
52
52
|
defaultAreaName: string | null;
|
|
53
|
-
|
|
53
|
+
userLogged: boolean;
|
|
54
54
|
}>, { payload }: {
|
|
55
55
|
payload: any;
|
|
56
56
|
type: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexteel/mesf-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"author": "Dexteel Team",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"react-dom": "^17.0.2",
|
|
71
71
|
"react-router-dom": "^6.2.1",
|
|
72
72
|
"react-spring": "^9.4.3",
|
|
73
|
+
"rimraf": "^3.0.2",
|
|
73
74
|
"string-to-color": "^2.2.2",
|
|
74
|
-
"use-complex-state": "^1.1.0"
|
|
75
|
-
"rimraf": "^3.0.2"
|
|
75
|
+
"use-complex-state": "^1.1.0"
|
|
76
76
|
},
|
|
77
77
|
"browserslist": {
|
|
78
78
|
"production": [
|
|
@@ -90,6 +90,7 @@
|
|
|
90
90
|
"@azure/msal-browser": "^2.18.0",
|
|
91
91
|
"@azure/msal-react": "^1.1.0",
|
|
92
92
|
"@date-io/moment": "^1.3.13",
|
|
93
|
+
"axios": "^1.3.5",
|
|
93
94
|
"lodash-es": "^4.17.21",
|
|
94
95
|
"string-to-color": "^2.2.2",
|
|
95
96
|
"tsc": "^2.0.3"
|