@dexteel/mesf-core 3.7.1 → 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/index.d.ts +1 -0
- package/dist/index.esm.js +238 -111
- package/dist/reducers/UserReducer.d.ts +15 -0
- package/dist/services/ApiService.d.ts +1 -0
- 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
|
};
|
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) {
|
|
@@ -4787,6 +4788,27 @@ var MESApiService = /** @class */ (function () {
|
|
|
4787
4788
|
});
|
|
4788
4789
|
});
|
|
4789
4790
|
};
|
|
4791
|
+
MESApiService.prototype.uploadFiles = function (selectedFiles, folderName) {
|
|
4792
|
+
if (folderName === void 0) { folderName = ""; }
|
|
4793
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4794
|
+
var formData, _i, selectedFiles_1, file;
|
|
4795
|
+
return __generator(this, function (_a) {
|
|
4796
|
+
formData = new FormData();
|
|
4797
|
+
for (_i = 0, selectedFiles_1 = selectedFiles; _i < selectedFiles_1.length; _i++) {
|
|
4798
|
+
file = selectedFiles_1[_i];
|
|
4799
|
+
formData.append('files', file, file.name);
|
|
4800
|
+
}
|
|
4801
|
+
formData.append('folderName', folderName);
|
|
4802
|
+
return [2 /*return*/, fetch(this.config.API_PROCEDURE_URL + '/uploadFiles', {
|
|
4803
|
+
method: 'POST',
|
|
4804
|
+
headers: {
|
|
4805
|
+
Authorization: 'Bearer ' + this.TOKEN
|
|
4806
|
+
},
|
|
4807
|
+
body: formData
|
|
4808
|
+
}).then(function (res) { return res.json(); })];
|
|
4809
|
+
});
|
|
4810
|
+
});
|
|
4811
|
+
};
|
|
4790
4812
|
MESApiService.prototype.call = function (procedure, parameters, database) {
|
|
4791
4813
|
if (database === void 0) { database = ''; }
|
|
4792
4814
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -4814,7 +4836,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4814
4836
|
mode: "cors",
|
|
4815
4837
|
headers: {
|
|
4816
4838
|
"Content-Type": "application/json",
|
|
4817
|
-
'Authorization': 'Bearer ' +
|
|
4839
|
+
'Authorization': 'Bearer ' + getTokenFromLS()
|
|
4818
4840
|
},
|
|
4819
4841
|
body: JSON.stringify(data)
|
|
4820
4842
|
})["catch"](function (errorMsg) {
|
|
@@ -4822,7 +4844,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4822
4844
|
})
|
|
4823
4845
|
.then(function (response) {
|
|
4824
4846
|
if (response.status === 401) {
|
|
4825
|
-
window.location.href = "".concat(base$
|
|
4847
|
+
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4826
4848
|
}
|
|
4827
4849
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
4828
4850
|
return response.json();
|
|
@@ -4866,7 +4888,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4866
4888
|
mode: "cors",
|
|
4867
4889
|
headers: {
|
|
4868
4890
|
"Content-Type": "application/json",
|
|
4869
|
-
'Authorization': 'Bearer ' +
|
|
4891
|
+
'Authorization': 'Bearer ' + getTokenFromLS()
|
|
4870
4892
|
},
|
|
4871
4893
|
body: JSON.stringify(data)
|
|
4872
4894
|
})["catch"](function (errorMsg) {
|
|
@@ -4874,7 +4896,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4874
4896
|
})
|
|
4875
4897
|
.then(function (response) {
|
|
4876
4898
|
if (response.status === 401) {
|
|
4877
|
-
window.location.href = "".concat(base$
|
|
4899
|
+
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4878
4900
|
}
|
|
4879
4901
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
4880
4902
|
return response.json();
|
|
@@ -4921,7 +4943,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4921
4943
|
method: "POST",
|
|
4922
4944
|
mode: "cors",
|
|
4923
4945
|
headers: {
|
|
4924
|
-
'Authorization': 'Bearer ' +
|
|
4946
|
+
'Authorization': 'Bearer ' + getTokenFromLS()
|
|
4925
4947
|
},
|
|
4926
4948
|
body: formData
|
|
4927
4949
|
})["catch"](function (errorMsg) {
|
|
@@ -4929,7 +4951,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4929
4951
|
})
|
|
4930
4952
|
.then(function (response) {
|
|
4931
4953
|
if (response.status === 401) {
|
|
4932
|
-
window.location.href = "".concat(base$
|
|
4954
|
+
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4933
4955
|
}
|
|
4934
4956
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
4935
4957
|
return response.json();
|
|
@@ -4974,7 +4996,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4974
4996
|
mode: "cors",
|
|
4975
4997
|
headers: {
|
|
4976
4998
|
"Content-Type": "application/json",
|
|
4977
|
-
'Authorization': 'Bearer ' +
|
|
4999
|
+
'Authorization': 'Bearer ' + getTokenFromLS()
|
|
4978
5000
|
},
|
|
4979
5001
|
body: JSON.stringify(data)
|
|
4980
5002
|
})["catch"](function (errorMsg) {
|
|
@@ -4982,7 +5004,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4982
5004
|
})
|
|
4983
5005
|
.then(function (response) {
|
|
4984
5006
|
if (response.status === 401) {
|
|
4985
|
-
window.location.href = "".concat(base$
|
|
5007
|
+
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4986
5008
|
}
|
|
4987
5009
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
4988
5010
|
if (!isError.ok)
|
|
@@ -5043,7 +5065,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
5043
5065
|
mode: "cors",
|
|
5044
5066
|
headers: {
|
|
5045
5067
|
"Content-Type": "application/json",
|
|
5046
|
-
'Authorization': 'Bearer ' +
|
|
5068
|
+
'Authorization': 'Bearer ' + getTokenFromLS()
|
|
5047
5069
|
},
|
|
5048
5070
|
body: JSON.stringify(data)
|
|
5049
5071
|
})["catch"](function (errorMsg) {
|
|
@@ -5051,7 +5073,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
5051
5073
|
})
|
|
5052
5074
|
.then(function (response) {
|
|
5053
5075
|
if (response.status === 401) {
|
|
5054
|
-
window.location.href = "".concat(base$
|
|
5076
|
+
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
5055
5077
|
}
|
|
5056
5078
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
5057
5079
|
if (!isError.ok)
|
|
@@ -5215,21 +5237,71 @@ function ChangePassword(props) {
|
|
|
5215
5237
|
React__default.createElement(Button, { onClick: handleOk, color: "primary", disabled: !canChange }, "Change Password"))));
|
|
5216
5238
|
}
|
|
5217
5239
|
|
|
5240
|
+
var UserInitialState = {
|
|
5241
|
+
userLastName: "",
|
|
5242
|
+
userId: null,
|
|
5243
|
+
defaultAreaId: null,
|
|
5244
|
+
defaultAreaName: "",
|
|
5245
|
+
userLogged: false
|
|
5246
|
+
};
|
|
5247
|
+
var UserReducer = createSlice({
|
|
5248
|
+
name: "__",
|
|
5249
|
+
initialState: UserInitialState,
|
|
5250
|
+
reducers: {
|
|
5251
|
+
setUserId: function (state, _a) {
|
|
5252
|
+
var payload = _a.payload;
|
|
5253
|
+
state.userId = payload;
|
|
5254
|
+
},
|
|
5255
|
+
setUserLastName: function (state, _a) {
|
|
5256
|
+
var payload = _a.payload;
|
|
5257
|
+
state.userLastName = payload;
|
|
5258
|
+
},
|
|
5259
|
+
setDefaultAreaId: function (state, _a) {
|
|
5260
|
+
var payload = _a.payload;
|
|
5261
|
+
state.defaultAreaId = payload;
|
|
5262
|
+
},
|
|
5263
|
+
setDefaultAreaName: function (state, _a) {
|
|
5264
|
+
var payload = _a.payload;
|
|
5265
|
+
state.defaultAreaName = payload;
|
|
5266
|
+
},
|
|
5267
|
+
setUserLogged: function (state, _a) {
|
|
5268
|
+
var payload = _a.payload;
|
|
5269
|
+
state.userLogged = payload;
|
|
5270
|
+
}
|
|
5271
|
+
}
|
|
5272
|
+
});
|
|
5273
|
+
|
|
5274
|
+
var UserContext = createContext({
|
|
5275
|
+
state: UserReducer.getInitialState(),
|
|
5276
|
+
actions: UserReducer.actions
|
|
5277
|
+
});
|
|
5278
|
+
var useUserContext = function () { return useContext(UserContext); };
|
|
5279
|
+
var UserProvider = function (_a) {
|
|
5280
|
+
var children = _a.children;
|
|
5281
|
+
var _b = useComplexState({
|
|
5282
|
+
initialState: UserReducer.getInitialState(),
|
|
5283
|
+
reducers: UserReducer.caseReducers
|
|
5284
|
+
}), state = _b[0], actions = _b[1];
|
|
5285
|
+
return (React__default.createElement(UserContext.Provider, { value: { state: state, actions: actions } }, children));
|
|
5286
|
+
};
|
|
5287
|
+
|
|
5288
|
+
var getTokenFromLS = function () {
|
|
5289
|
+
return localStorage.getItem('token');
|
|
5290
|
+
};
|
|
5218
5291
|
function useToken() {
|
|
5219
|
-
var
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
return userToken === null || userToken === void 0 ? void 0 : userToken.token;
|
|
5223
|
-
};
|
|
5224
|
-
var _a = useState(getToken()), token = _a[0], setToken = _a[1];
|
|
5225
|
-
// TODO: userToken typings
|
|
5226
|
-
var saveToken = function (userToken) {
|
|
5292
|
+
var setUserLogged = useUserContext().actions.setUserLogged;
|
|
5293
|
+
var _a = useState(getTokenFromLS()), token = _a[0], setToken = _a[1];
|
|
5294
|
+
var saveUserData = function (userToken) {
|
|
5227
5295
|
localStorage.setItem('userMESData', JSON.stringify(userToken));
|
|
5228
|
-
|
|
5296
|
+
localStorage.setItem('refreshToken', userToken['refreshToken']);
|
|
5297
|
+
localStorage.setItem('token', userToken['token']);
|
|
5298
|
+
setToken(userToken['token']);
|
|
5299
|
+
setUserLogged(true);
|
|
5229
5300
|
};
|
|
5230
5301
|
var clearUserData = function () {
|
|
5231
5302
|
localStorage.removeItem('userMESData');
|
|
5232
|
-
setToken(
|
|
5303
|
+
setToken('');
|
|
5304
|
+
setUserLogged(false);
|
|
5233
5305
|
};
|
|
5234
5306
|
var getUserName = function () {
|
|
5235
5307
|
var sessionData = localStorage.getItem('userMESData');
|
|
@@ -5249,6 +5321,7 @@ function useToken() {
|
|
|
5249
5321
|
var getUserId = function () {
|
|
5250
5322
|
var sessionData = localStorage.getItem('userMESData');
|
|
5251
5323
|
var userData = JSON.parse(sessionData);
|
|
5324
|
+
setUserLogged(true);
|
|
5252
5325
|
return ((userData || {}).id || (-1));
|
|
5253
5326
|
};
|
|
5254
5327
|
var hasPermission = function (permissionId) {
|
|
@@ -5261,8 +5334,8 @@ function useToken() {
|
|
|
5261
5334
|
};
|
|
5262
5335
|
return {
|
|
5263
5336
|
getUserName: getUserName,
|
|
5264
|
-
|
|
5265
|
-
|
|
5337
|
+
saveUserData: saveUserData,
|
|
5338
|
+
clearUserData: clearUserData,
|
|
5266
5339
|
getFirstName: getFirstName,
|
|
5267
5340
|
getLastName: getLastName,
|
|
5268
5341
|
getUserId: getUserId,
|
|
@@ -5369,6 +5442,7 @@ var AuthContext = React__default.createContext({});
|
|
|
5369
5442
|
var AuthProvider = function (_a) {
|
|
5370
5443
|
var children = _a.children, authConfig = _a.authConfig;
|
|
5371
5444
|
var useTokenHook = useToken();
|
|
5445
|
+
console.log(useTokenHook.token);
|
|
5372
5446
|
return (React__default.createElement(React__default.Fragment, null,
|
|
5373
5447
|
React__default.createElement(AuthContext.Provider, { value: useTokenHook },
|
|
5374
5448
|
!!useTokenHook.token && React__default.createElement(Authenticated, null, children),
|
|
@@ -5388,14 +5462,14 @@ var LoginWithEmailAndPassword = function () {
|
|
|
5388
5462
|
var _b = useState(''), password = _b[0], setPassword = _b[1];
|
|
5389
5463
|
var _c = React__default.useState(false), showError = _c[0], setShowError = _c[1];
|
|
5390
5464
|
var _d = React__default.useState(undefined), error = _d[0], setError = _d[1];
|
|
5391
|
-
var
|
|
5392
|
-
var apiService = new MESApiService();
|
|
5465
|
+
var saveUserData = React__default.useContext(AuthContext).saveUserData;
|
|
5393
5466
|
var login = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5394
|
-
var response;
|
|
5467
|
+
var apiService, response;
|
|
5395
5468
|
return __generator(this, function (_a) {
|
|
5396
5469
|
switch (_a.label) {
|
|
5397
5470
|
case 0:
|
|
5398
5471
|
e.preventDefault();
|
|
5472
|
+
apiService = new MESApiService();
|
|
5399
5473
|
return [4 /*yield*/, apiService.authenticate(username, password)];
|
|
5400
5474
|
case 1:
|
|
5401
5475
|
response = _a.sent();
|
|
@@ -5404,17 +5478,12 @@ var LoginWithEmailAndPassword = function () {
|
|
|
5404
5478
|
setError(apiService.error);
|
|
5405
5479
|
}
|
|
5406
5480
|
else {
|
|
5407
|
-
|
|
5481
|
+
saveUserData(response);
|
|
5408
5482
|
}
|
|
5409
5483
|
return [2 /*return*/];
|
|
5410
5484
|
}
|
|
5411
5485
|
});
|
|
5412
5486
|
}); };
|
|
5413
|
-
var handleKeypress = function (e) {
|
|
5414
|
-
if (e.charCode === 13) {
|
|
5415
|
-
login(e);
|
|
5416
|
-
}
|
|
5417
|
-
};
|
|
5418
5487
|
return (React__default.createElement(React__default.Fragment, null,
|
|
5419
5488
|
React__default.createElement("form", { onSubmit: login },
|
|
5420
5489
|
React__default.createElement(Alert$1, { show: showError, variant: "danger", dismissible: true, onClose: function () {
|
|
@@ -5429,7 +5498,7 @@ var LoginWithEmailAndPassword = function () {
|
|
|
5429
5498
|
React__default.createElement("div", { className: "form-group row" },
|
|
5430
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" })),
|
|
5431
5500
|
React__default.createElement("div", { className: "form-group row" },
|
|
5432
|
-
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" })),
|
|
5433
5502
|
React__default.createElement("div", { className: "row" },
|
|
5434
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")))));
|
|
5435
5504
|
};
|
|
@@ -5488,7 +5557,7 @@ var loginRequest = {
|
|
|
5488
5557
|
};
|
|
5489
5558
|
|
|
5490
5559
|
var LoginWithAzureADForm = function () {
|
|
5491
|
-
var
|
|
5560
|
+
var saveUserData = React__default.useContext(AuthContext).saveUserData;
|
|
5492
5561
|
var instance = useMsal().instance;
|
|
5493
5562
|
var login = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5494
5563
|
var result, api, loginResponse, e_1, e_2;
|
|
@@ -5509,7 +5578,7 @@ var LoginWithAzureADForm = function () {
|
|
|
5509
5578
|
return [4 /*yield*/, api.loginWithAzureAD(result.accessToken)];
|
|
5510
5579
|
case 4:
|
|
5511
5580
|
loginResponse = _a.sent();
|
|
5512
|
-
|
|
5581
|
+
saveUserData(loginResponse);
|
|
5513
5582
|
return [3 /*break*/, 6];
|
|
5514
5583
|
case 5:
|
|
5515
5584
|
e_1 = _a.sent();
|
|
@@ -5542,7 +5611,7 @@ var LoginWithAzureAD = function (_a) {
|
|
|
5542
5611
|
var LoginAsGuest = function () {
|
|
5543
5612
|
var _a = React__default.useState(false), showError = _a[0], setShowError = _a[1];
|
|
5544
5613
|
var _b = React__default.useState(undefined), error = _b[0], setError = _b[1];
|
|
5545
|
-
var
|
|
5614
|
+
var saveUserData = React__default.useContext(AuthContext).saveUserData;
|
|
5546
5615
|
var apiService = new MESApiService();
|
|
5547
5616
|
var loginAsGuest = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5548
5617
|
var response;
|
|
@@ -5558,7 +5627,7 @@ var LoginAsGuest = function () {
|
|
|
5558
5627
|
setError(apiService.error);
|
|
5559
5628
|
}
|
|
5560
5629
|
else {
|
|
5561
|
-
|
|
5630
|
+
saveUserData(response);
|
|
5562
5631
|
}
|
|
5563
5632
|
return [2 /*return*/];
|
|
5564
5633
|
}
|
|
@@ -5618,12 +5687,14 @@ function Login(_a) {
|
|
|
5618
5687
|
|
|
5619
5688
|
function Logout() {
|
|
5620
5689
|
var _this = this;
|
|
5621
|
-
var
|
|
5690
|
+
var clearUserData = useContext(AuthContext).clearUserData;
|
|
5622
5691
|
var navigate = useNavigate();
|
|
5623
5692
|
var _a = useSearchParams(), params = _a[0]; _a[1];
|
|
5693
|
+
var setUserLogged = useUserContext().actions.setUserLogged;
|
|
5624
5694
|
var logout = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5625
5695
|
return __generator(this, function (_a) {
|
|
5626
|
-
|
|
5696
|
+
setUserLogged(false);
|
|
5697
|
+
clearUserData();
|
|
5627
5698
|
navigate("/?".concat(params.toString()));
|
|
5628
5699
|
return [2 /*return*/];
|
|
5629
5700
|
});
|
|
@@ -5669,49 +5740,6 @@ var AssetProvider = function (_a) {
|
|
|
5669
5740
|
return (React__default.createElement(AssetContext.Provider, { value: { state: state, actions: actions } }, children));
|
|
5670
5741
|
};
|
|
5671
5742
|
|
|
5672
|
-
var UserInitialState = {
|
|
5673
|
-
userLastName: "",
|
|
5674
|
-
userId: null,
|
|
5675
|
-
defaultAreaId: null,
|
|
5676
|
-
defaultAreaName: ""
|
|
5677
|
-
};
|
|
5678
|
-
var UserReducer = createSlice({
|
|
5679
|
-
name: "__",
|
|
5680
|
-
initialState: UserInitialState,
|
|
5681
|
-
reducers: {
|
|
5682
|
-
setUserId: function (state, _a) {
|
|
5683
|
-
var payload = _a.payload;
|
|
5684
|
-
state.userId = payload;
|
|
5685
|
-
},
|
|
5686
|
-
setUserLastName: function (state, _a) {
|
|
5687
|
-
var payload = _a.payload;
|
|
5688
|
-
state.userLastName = payload;
|
|
5689
|
-
},
|
|
5690
|
-
setDefaultAreaId: function (state, _a) {
|
|
5691
|
-
var payload = _a.payload;
|
|
5692
|
-
state.defaultAreaId = payload;
|
|
5693
|
-
},
|
|
5694
|
-
setDefaultAreaName: function (state, _a) {
|
|
5695
|
-
var payload = _a.payload;
|
|
5696
|
-
state.defaultAreaName = payload;
|
|
5697
|
-
}
|
|
5698
|
-
}
|
|
5699
|
-
});
|
|
5700
|
-
|
|
5701
|
-
var UserContext = createContext({
|
|
5702
|
-
state: UserReducer.getInitialState(),
|
|
5703
|
-
actions: UserReducer.actions
|
|
5704
|
-
});
|
|
5705
|
-
var useUserContext = function () { return useContext(UserContext); };
|
|
5706
|
-
var UserProvider = function (_a) {
|
|
5707
|
-
var children = _a.children;
|
|
5708
|
-
var _b = useComplexState({
|
|
5709
|
-
initialState: UserReducer.getInitialState(),
|
|
5710
|
-
reducers: UserReducer.caseReducers
|
|
5711
|
-
}), state = _b[0], actions = _b[1];
|
|
5712
|
-
return (React__default.createElement(UserContext.Provider, { value: { state: state, actions: actions } }, children));
|
|
5713
|
-
};
|
|
5714
|
-
|
|
5715
5743
|
var RouterContext = React__default.createContext(function () { return React__default.createElement(React__default.Fragment, null); });
|
|
5716
5744
|
var ConfigurationContext = React__default.createContext([
|
|
5717
5745
|
[],
|
|
@@ -5749,6 +5777,7 @@ function Header(_a) {
|
|
|
5749
5777
|
var CustomNavbar = useContext(NavbarContext);
|
|
5750
5778
|
var userName = useState(getUserName())[0];
|
|
5751
5779
|
var searchAssets = useSearchAssets().searchAssets;
|
|
5780
|
+
var userLogged = useUserContext().state.userLogged;
|
|
5752
5781
|
var tick = function () {
|
|
5753
5782
|
setDate(new Date());
|
|
5754
5783
|
};
|
|
@@ -5760,9 +5789,11 @@ function Header(_a) {
|
|
|
5760
5789
|
clearTimeout(timerID);
|
|
5761
5790
|
};
|
|
5762
5791
|
});
|
|
5763
|
-
useEffect(function () {
|
|
5764
|
-
|
|
5765
|
-
|
|
5792
|
+
useEffect(function () {
|
|
5793
|
+
if (showAreaSelector && userLogged) {
|
|
5794
|
+
searchAssets();
|
|
5795
|
+
}
|
|
5796
|
+
}, [userLogged]);
|
|
5766
5797
|
return (React__default.createElement(Navbar, { variant: "dark", expand: "lg", className: "mes-primary-color mes-menu-top" },
|
|
5767
5798
|
React__default.createElement(Container, { fluid: true },
|
|
5768
5799
|
React__default.createElement(Navbar.Brand, { as: Link, to: "/home" }, "MESF"),
|
|
@@ -5876,7 +5907,6 @@ var Navigation = function (_a) {
|
|
|
5876
5907
|
var _c = useSearchParams(), params = _c[0]; _c[1];
|
|
5877
5908
|
var mounted = useRef(true);
|
|
5878
5909
|
useEffect(function () {
|
|
5879
|
-
mounted.current = true;
|
|
5880
5910
|
if (params.has('redirectTo')) {
|
|
5881
5911
|
setTimeout(function () {
|
|
5882
5912
|
if (mounted.current) {
|
|
@@ -5896,7 +5926,7 @@ var Navigation = function (_a) {
|
|
|
5896
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 ";
|
|
5897
5927
|
n(css,{});
|
|
5898
5928
|
|
|
5899
|
-
var base = document.getElementsByTagName('base')[0].getAttribute('href') || '/';
|
|
5929
|
+
var base$1 = document.getElementsByTagName('base')[0].getAttribute('href') || '/';
|
|
5900
5930
|
function MESFMain(_a) {
|
|
5901
5931
|
var authentication = _a.authentication, routes = _a.routes, navbar = _a.navbar, configurations = _a.configurations, _b = _a.showAreaSelector, showAreaSelector = _b === void 0 ? false : _b;
|
|
5902
5932
|
return (React__default.createElement(AuthProvider, { authConfig: authentication },
|
|
@@ -5905,12 +5935,109 @@ function MESFMain(_a) {
|
|
|
5905
5935
|
React__default.createElement(RouterContext.Provider, { value: routes },
|
|
5906
5936
|
React__default.createElement(NavbarContext.Provider, { value: navbar },
|
|
5907
5937
|
React__default.createElement(ConfigurationContext.Provider, { value: configurations },
|
|
5908
|
-
React__default.createElement(BrowserRouter, { basename: base },
|
|
5938
|
+
React__default.createElement(BrowserRouter, { basename: base$1 },
|
|
5909
5939
|
React__default.createElement(Routes, null,
|
|
5910
5940
|
React__default.createElement(Route, { path: "/logout", element: React__default.createElement(Logout, null) })),
|
|
5911
5941
|
React__default.createElement(Navigation, { showAreaSelector: showAreaSelector })))))))));
|
|
5912
5942
|
}
|
|
5913
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
|
+
|
|
5914
6041
|
var useDefaultAreaId = function () {
|
|
5915
6042
|
var _a = useUserContext(), userId = _a.state.userId, setDefaultAreaId = _a.actions.setDefaultAreaId;
|
|
5916
6043
|
return function () {
|
|
@@ -6040,4 +6167,4 @@ var areaSelector = /*#__PURE__*/Object.freeze({
|
|
|
6040
6167
|
AreaSelector: AreaSelector
|
|
6041
6168
|
});
|
|
6042
6169
|
|
|
6043
|
-
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,12 +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
|
+
userLogged: boolean;
|
|
6
7
|
}, {
|
|
7
8
|
setUserId(state: import("immer/dist/internal").WritableDraft<{
|
|
8
9
|
userLastName: string;
|
|
9
10
|
userId: number | null;
|
|
10
11
|
defaultAreaId: number | string | null;
|
|
11
12
|
defaultAreaName: string | null;
|
|
13
|
+
userLogged: boolean;
|
|
12
14
|
}>, { payload }: {
|
|
13
15
|
payload: any;
|
|
14
16
|
type: string;
|
|
@@ -18,6 +20,7 @@ export declare const UserReducer: import("@reduxjs/toolkit").Slice<{
|
|
|
18
20
|
userId: number | null;
|
|
19
21
|
defaultAreaId: number | string | null;
|
|
20
22
|
defaultAreaName: string | null;
|
|
23
|
+
userLogged: boolean;
|
|
21
24
|
}>, { payload }: {
|
|
22
25
|
payload: any;
|
|
23
26
|
type: string;
|
|
@@ -27,6 +30,7 @@ export declare const UserReducer: import("@reduxjs/toolkit").Slice<{
|
|
|
27
30
|
userId: number | null;
|
|
28
31
|
defaultAreaId: number | string | null;
|
|
29
32
|
defaultAreaName: string | null;
|
|
33
|
+
userLogged: boolean;
|
|
30
34
|
}>, { payload }: {
|
|
31
35
|
payload: any;
|
|
32
36
|
type: string;
|
|
@@ -36,6 +40,17 @@ export declare const UserReducer: import("@reduxjs/toolkit").Slice<{
|
|
|
36
40
|
userId: number | null;
|
|
37
41
|
defaultAreaId: number | string | null;
|
|
38
42
|
defaultAreaName: string | null;
|
|
43
|
+
userLogged: boolean;
|
|
44
|
+
}>, { payload }: {
|
|
45
|
+
payload: any;
|
|
46
|
+
type: string;
|
|
47
|
+
}): void;
|
|
48
|
+
setUserLogged(state: import("immer/dist/internal").WritableDraft<{
|
|
49
|
+
userLastName: string;
|
|
50
|
+
userId: number | null;
|
|
51
|
+
defaultAreaId: number | string | null;
|
|
52
|
+
defaultAreaName: string | null;
|
|
53
|
+
userLogged: boolean;
|
|
39
54
|
}>, { payload }: {
|
|
40
55
|
payload: any;
|
|
41
56
|
type: string;
|
|
@@ -28,6 +28,7 @@ export declare class MESApiService {
|
|
|
28
28
|
changePassword(userId: string, password: string): Promise<any>;
|
|
29
29
|
authenticate(userName: string, password: string): Promise<any>;
|
|
30
30
|
loginWithAzureAD(accessToken: string): Promise<any>;
|
|
31
|
+
uploadFiles(selectedFiles: File[], folderName?: string): Promise<any>;
|
|
31
32
|
call(procedure: string, parameters: any[], database?: string): Promise<any>;
|
|
32
33
|
callJSON(procedure: string, parameters: any[], database?: string): Promise<any>;
|
|
33
34
|
import(procedure: string, parameters: any[], files: any[], uniqueFile: any, database?: string): Promise<any>;
|
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"
|