@dexteel/mesf-core 4.0.0-alpha → 4.0.2-alpha
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 +5 -1
- package/dist/configuration/pages/profiles/components/ProceduresOfProfile/{ProceduresOfProfile.d.ts → ActionsOfProfile.d.ts} +1 -1
- package/dist/configuration/pages/profiles/components/ProceduresOfProfile/ProceduresDataTable/index.d.ts +3 -3
- package/dist/configuration/pages/profiles/models/Action.d.ts +4 -0
- package/dist/configuration/pages/profiles/repositories/ProfilesRepository.d.ts +4 -31
- package/dist/index.esm.js +64 -58
- package/package.json +1 -1
- package/dist/configuration/pages/profiles/models/Procedure.d.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
|
-
##
|
|
2
|
+
## 4.0.0 - BREAKING CHANGE
|
|
3
3
|
- Use ProfileProcedure structure in Profiles and Procedures Configuration
|
|
4
|
+
## USE 3.X if ProfileProcedure Structure is not used
|
|
5
|
+
|
|
6
|
+
## 3.12.4
|
|
7
|
+
- Remove bugs in Assets Tree Configuration Page
|
|
4
8
|
## 3.12.3
|
|
5
9
|
- Remove bugs in Assets Tree Configuration Page
|
|
6
10
|
## 3.12.1
|
|
@@ -5,5 +5,5 @@ type Props = {
|
|
|
5
5
|
show: boolean;
|
|
6
6
|
onHide: (shouldUpdate: boolean) => void;
|
|
7
7
|
};
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const ActionsOfProfile: ({ profileForEdit, show, onHide }: Props) => React.JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import 'ag-grid-enterprise/styles/ag-grid.css';
|
|
3
3
|
import 'ag-grid-enterprise/styles/ag-theme-balham.min.css';
|
|
4
|
-
import {
|
|
4
|
+
import { Action } from '../../../models/Action';
|
|
5
5
|
interface Props {
|
|
6
|
-
|
|
6
|
+
actionsOfProfile: Action[];
|
|
7
7
|
onSelectionChanged: Function;
|
|
8
8
|
}
|
|
9
|
-
export declare const DataTable: ({
|
|
9
|
+
export declare const DataTable: ({ actionsOfProfile, onSelectionChanged }: Props) => React.JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Profile } from "../../profiles/models/Profile";
|
|
2
|
-
import {
|
|
2
|
+
import { Action } from "../models/Action";
|
|
3
3
|
export declare const getProfiles: () => Promise<{
|
|
4
4
|
ok: boolean;
|
|
5
5
|
data: any;
|
|
@@ -9,15 +9,6 @@ export declare const getProfiles: () => Promise<{
|
|
|
9
9
|
message: any;
|
|
10
10
|
data?: undefined;
|
|
11
11
|
}>;
|
|
12
|
-
export declare const getPermissions: () => Promise<{
|
|
13
|
-
ok: boolean;
|
|
14
|
-
data: any;
|
|
15
|
-
message?: undefined;
|
|
16
|
-
} | {
|
|
17
|
-
ok: boolean;
|
|
18
|
-
message: any;
|
|
19
|
-
data?: undefined;
|
|
20
|
-
}>;
|
|
21
12
|
export declare const upsertProfile: (profile: Profile) => Promise<{
|
|
22
13
|
ok: boolean;
|
|
23
14
|
message: any;
|
|
@@ -27,16 +18,7 @@ export declare const upsertProfile: (profile: Profile) => Promise<{
|
|
|
27
18
|
data: any;
|
|
28
19
|
message?: undefined;
|
|
29
20
|
}>;
|
|
30
|
-
export declare const
|
|
31
|
-
ok: boolean;
|
|
32
|
-
message: any;
|
|
33
|
-
data?: undefined;
|
|
34
|
-
} | {
|
|
35
|
-
ok: boolean;
|
|
36
|
-
data: any;
|
|
37
|
-
message?: undefined;
|
|
38
|
-
}>;
|
|
39
|
-
export declare const getProceduresByProfileId: (profile: Profile) => Promise<{
|
|
21
|
+
export declare const getActions: () => Promise<{
|
|
40
22
|
ok: boolean;
|
|
41
23
|
message: any;
|
|
42
24
|
data?: undefined;
|
|
@@ -45,7 +27,7 @@ export declare const getProceduresByProfileId: (profile: Profile) => Promise<{
|
|
|
45
27
|
data: any;
|
|
46
28
|
message?: undefined;
|
|
47
29
|
}>;
|
|
48
|
-
export declare const
|
|
30
|
+
export declare const getActionsByProfileId: (profile: Profile) => Promise<{
|
|
49
31
|
ok: boolean;
|
|
50
32
|
message: any;
|
|
51
33
|
data?: undefined;
|
|
@@ -54,16 +36,7 @@ export declare const upsertProfilesProcedures: (profile: Profile, procedures: Pr
|
|
|
54
36
|
data: any;
|
|
55
37
|
message?: undefined;
|
|
56
38
|
}>;
|
|
57
|
-
export declare const
|
|
58
|
-
ok: boolean;
|
|
59
|
-
data: any;
|
|
60
|
-
message?: undefined;
|
|
61
|
-
} | {
|
|
62
|
-
ok: boolean;
|
|
63
|
-
message: any;
|
|
64
|
-
data?: undefined;
|
|
65
|
-
}>;
|
|
66
|
-
export declare const setProfilesToProfile: (ProfileId: number, HasProfilesId: number[]) => Promise<{
|
|
39
|
+
export declare const upsertProfileActions: (profile: Profile, actions: Action[]) => Promise<{
|
|
67
40
|
ok: boolean;
|
|
68
41
|
message: any;
|
|
69
42
|
data?: undefined;
|
package/dist/index.esm.js
CHANGED
|
@@ -1140,7 +1140,7 @@ var Alert = function (props) {
|
|
|
1140
1140
|
return React__default.createElement(Alert$2, __assign({ elevation: 6, variant: "filled" }, props));
|
|
1141
1141
|
};
|
|
1142
1142
|
|
|
1143
|
-
var useStyles$
|
|
1143
|
+
var useStyles$o = makeStyles(function (theme) {
|
|
1144
1144
|
return createStyles({
|
|
1145
1145
|
root: {
|
|
1146
1146
|
'& .MuiDataGrid-row': {
|
|
@@ -1170,7 +1170,7 @@ var useStyles$p = makeStyles(function (theme) {
|
|
|
1170
1170
|
});
|
|
1171
1171
|
});
|
|
1172
1172
|
var TableJobs = function () {
|
|
1173
|
-
var classes = useStyles$
|
|
1173
|
+
var classes = useStyles$o();
|
|
1174
1174
|
var _a = useState(true), loading = _a[0], setLoading = _a[1];
|
|
1175
1175
|
var actions = useJobsContext().actions;
|
|
1176
1176
|
var _b = useState(false), messageLoading = _b[0], setMessageLoading = _b[1];
|
|
@@ -1456,7 +1456,7 @@ var useGetLogsFromAPI = function (_a) {
|
|
|
1456
1456
|
return update;
|
|
1457
1457
|
};
|
|
1458
1458
|
|
|
1459
|
-
var useStyles$
|
|
1459
|
+
var useStyles$n = makeStyles(function (theme) {
|
|
1460
1460
|
return createStyles({
|
|
1461
1461
|
title: {
|
|
1462
1462
|
fontSize: 15
|
|
@@ -1475,7 +1475,7 @@ var formatTime = function (nowTime) {
|
|
|
1475
1475
|
};
|
|
1476
1476
|
var ModalLogSelected = function (_a) {
|
|
1477
1477
|
var show = _a.show, onHide = _a.onHide, selectedLog = _a.selectedLog;
|
|
1478
|
-
var classes = useStyles$
|
|
1478
|
+
var classes = useStyles$n();
|
|
1479
1479
|
return (React__default.createElement(Grid, { container: true, justifyContent: "center", alignItems: "center" },
|
|
1480
1480
|
React__default.createElement(Modal$2, __assign({}, { show: show }, { onHide: function () { return onHide(false); }, size: "lg", "aria-labelledby": "contained-modal-title-vcenter", centered: true }),
|
|
1481
1481
|
React__default.createElement(Modal$2.Header, { closeButton: true, style: { padding: "10px 30px" } },
|
|
@@ -1560,7 +1560,7 @@ var SearchFilter = function (_a) {
|
|
|
1560
1560
|
React__default.createElement(FormHelperText, { style: { marginBottom: 10, marginTop: -15 } }, "Search by Source, Message or User")));
|
|
1561
1561
|
};
|
|
1562
1562
|
|
|
1563
|
-
var useStyles$
|
|
1563
|
+
var useStyles$m = makeStyles(function (theme) {
|
|
1564
1564
|
return createStyles({
|
|
1565
1565
|
root: {
|
|
1566
1566
|
'& .MuiDataGrid-row': {
|
|
@@ -1591,7 +1591,7 @@ var useStyles$n = makeStyles(function (theme) {
|
|
|
1591
1591
|
});
|
|
1592
1592
|
var TableLogs = function () {
|
|
1593
1593
|
var _a = useLogsContext(), _b = _a.state.searchData, Start = _b.Start, End = _b.End, Search = _b.Search, LogTypeCode = _b.LogTypeCode, _c = _a.actions, setStartFilter = _c.setStartFilter, setEndFilter = _c.setEndFilter, setSearchFilter = _c.setSearchFilter, setLogTypeCodeFilter = _c.setLogTypeCodeFilter, resetFilters = _c.resetFilters;
|
|
1594
|
-
var classes = useStyles$
|
|
1594
|
+
var classes = useStyles$m();
|
|
1595
1595
|
var _d = useState(false), showLogModal = _d[0], setShowLogModal = _d[1];
|
|
1596
1596
|
var _e = useState(true), loading = _e[0], setLoading = _e[1];
|
|
1597
1597
|
var _f = useState(undefined), selectedLog = _f[0], setSelectedLog = _f[1];
|
|
@@ -1808,7 +1808,7 @@ var getProfiles$1 = function () { return __awaiter(void 0, void 0, void 0, funct
|
|
|
1808
1808
|
}); };
|
|
1809
1809
|
//fx crear/insertar new profile
|
|
1810
1810
|
var upsertProfile = function (profile) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1811
|
-
var apiService, parameters, resp,
|
|
1811
|
+
var apiService, parameters, resp, e_2;
|
|
1812
1812
|
return __generator(this, function (_a) {
|
|
1813
1813
|
switch (_a.label) {
|
|
1814
1814
|
case 0:
|
|
@@ -1833,24 +1833,24 @@ var upsertProfile = function (profile) { return __awaiter(void 0, void 0, void 0
|
|
|
1833
1833
|
data: getError(resp)
|
|
1834
1834
|
}];
|
|
1835
1835
|
case 3:
|
|
1836
|
-
|
|
1836
|
+
e_2 = _a.sent();
|
|
1837
1837
|
return [2 /*return*/, {
|
|
1838
1838
|
ok: true,
|
|
1839
|
-
data: getError(
|
|
1839
|
+
data: getError(e_2)
|
|
1840
1840
|
}];
|
|
1841
1841
|
case 4: return [2 /*return*/];
|
|
1842
1842
|
}
|
|
1843
1843
|
});
|
|
1844
1844
|
}); };
|
|
1845
1845
|
// PROFILES PROCEDURES
|
|
1846
|
-
var
|
|
1846
|
+
var getActions = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1847
1847
|
var apiService, parameters, resp;
|
|
1848
1848
|
return __generator(this, function (_a) {
|
|
1849
1849
|
switch (_a.label) {
|
|
1850
1850
|
case 0:
|
|
1851
1851
|
apiService = new MESApiService();
|
|
1852
1852
|
parameters = [];
|
|
1853
|
-
return [4 /*yield*/, apiService.callV2("[SEC].[
|
|
1853
|
+
return [4 /*yield*/, apiService.callV2("[SEC].[GetActions]", parameters)];
|
|
1854
1854
|
case 1:
|
|
1855
1855
|
resp = _a.sent();
|
|
1856
1856
|
if (apiService.hasErrors) {
|
|
@@ -1866,7 +1866,7 @@ var getProcedures = function () { return __awaiter(void 0, void 0, void 0, funct
|
|
|
1866
1866
|
}
|
|
1867
1867
|
});
|
|
1868
1868
|
}); };
|
|
1869
|
-
var
|
|
1869
|
+
var getActionsByProfileId = function (profile) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1870
1870
|
var apiService, parameters, resp;
|
|
1871
1871
|
return __generator(this, function (_a) {
|
|
1872
1872
|
switch (_a.label) {
|
|
@@ -1874,7 +1874,7 @@ var getProceduresByProfileId = function (profile) { return __awaiter(void 0, voi
|
|
|
1874
1874
|
apiService = new MESApiService();
|
|
1875
1875
|
parameters = [];
|
|
1876
1876
|
parameters.push({ name: "ProfileId", value: profile.ProfileId });
|
|
1877
|
-
return [4 /*yield*/, apiService.callV2("[SEC].[
|
|
1877
|
+
return [4 /*yield*/, apiService.callV2("[SEC].[GetActionsByProfileId]", parameters)];
|
|
1878
1878
|
case 1:
|
|
1879
1879
|
resp = _a.sent();
|
|
1880
1880
|
if (apiService.hasErrors) {
|
|
@@ -1890,18 +1890,18 @@ var getProceduresByProfileId = function (profile) { return __awaiter(void 0, voi
|
|
|
1890
1890
|
}
|
|
1891
1891
|
});
|
|
1892
1892
|
}); };
|
|
1893
|
-
var
|
|
1894
|
-
var apiService,
|
|
1893
|
+
var upsertProfileActions = function (profile, actions) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1894
|
+
var apiService, actionsIds, actionIdsString, parameters, resp;
|
|
1895
1895
|
return __generator(this, function (_a) {
|
|
1896
1896
|
switch (_a.label) {
|
|
1897
1897
|
case 0:
|
|
1898
1898
|
apiService = new MESApiService();
|
|
1899
|
-
|
|
1900
|
-
|
|
1899
|
+
actionsIds = actions.map(function (item) { return item.ActionId; });
|
|
1900
|
+
actionIdsString = actionsIds.join(',');
|
|
1901
1901
|
parameters = [];
|
|
1902
1902
|
parameters.push({ name: "ProfileId", value: profile.ProfileId });
|
|
1903
|
-
parameters.push({ name: "
|
|
1904
|
-
return [4 /*yield*/, apiService.callV2("[SEC].[
|
|
1903
|
+
parameters.push({ name: "ActionIds", value: actionIdsString });
|
|
1904
|
+
return [4 /*yield*/, apiService.callV2("[SEC].[UpsertProfileActions]", parameters)];
|
|
1905
1905
|
case 1:
|
|
1906
1906
|
resp = _a.sent();
|
|
1907
1907
|
if (apiService.hasErrors) {
|
|
@@ -1917,9 +1917,10 @@ var upsertProfilesProcedures = function (profile, procedures) { return __awaiter
|
|
|
1917
1917
|
}
|
|
1918
1918
|
});
|
|
1919
1919
|
}); };
|
|
1920
|
+
//fx setear profiles de un profile
|
|
1920
1921
|
// fx eliminar profile
|
|
1921
1922
|
var deleteProfile = function (profileId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1922
|
-
var apiService, parameters, resp,
|
|
1923
|
+
var apiService, parameters, resp, e_3;
|
|
1923
1924
|
return __generator(this, function (_a) {
|
|
1924
1925
|
switch (_a.label) {
|
|
1925
1926
|
case 0:
|
|
@@ -1937,14 +1938,14 @@ var deleteProfile = function (profileId) { return __awaiter(void 0, void 0, void
|
|
|
1937
1938
|
data: resp
|
|
1938
1939
|
}];
|
|
1939
1940
|
case 3:
|
|
1940
|
-
|
|
1941
|
-
return [2 /*return*/, { ok: false, message:
|
|
1941
|
+
e_3 = _a.sent();
|
|
1942
|
+
return [2 /*return*/, { ok: false, message: e_3.toString() }];
|
|
1942
1943
|
case 4: return [2 /*return*/];
|
|
1943
1944
|
}
|
|
1944
1945
|
});
|
|
1945
1946
|
}); };
|
|
1946
1947
|
|
|
1947
|
-
var useStyles$
|
|
1948
|
+
var useStyles$l = makeStyles(function (theme) {
|
|
1948
1949
|
return createStyles({
|
|
1949
1950
|
title: {
|
|
1950
1951
|
fontSize: 15
|
|
@@ -1973,7 +1974,7 @@ var useStyles$m = makeStyles(function (theme) {
|
|
|
1973
1974
|
var EditProfile = function (_a) {
|
|
1974
1975
|
var _b;
|
|
1975
1976
|
var profileForEdit = _a.profileForEdit, show = _a.show, onHide = _a.onHide;
|
|
1976
|
-
var classes = useStyles$
|
|
1977
|
+
var classes = useStyles$l();
|
|
1977
1978
|
var _c = useState(null); _c[0]; _c[1];
|
|
1978
1979
|
var _d = useState(false), open = _d[0], setOpen = _d[1];
|
|
1979
1980
|
var _e = useState(true), isLoading = _e[0], setIsLoading = _e[1];
|
|
@@ -2045,7 +2046,7 @@ var EditProfile = function (_a) {
|
|
|
2045
2046
|
React.createElement(ErrorModal, { error: error, onHide: function () { return setError(""); } })));
|
|
2046
2047
|
};
|
|
2047
2048
|
|
|
2048
|
-
var useStyles$
|
|
2049
|
+
var useStyles$k = makeStyles(function (theme) {
|
|
2049
2050
|
return createStyles({
|
|
2050
2051
|
title: {
|
|
2051
2052
|
fontSize: 15
|
|
@@ -2070,7 +2071,7 @@ var CreateProfile = function (_a) {
|
|
|
2070
2071
|
var _d = useState(""), message = _d[0], setMessage = _d[1];
|
|
2071
2072
|
var _e = useState(false), isSubmitLoading = _e[0], setIsSubmitLoading = _e[1];
|
|
2072
2073
|
var _f = useState(''), error = _f[0], setError = _f[1];
|
|
2073
|
-
var classes = useStyles$
|
|
2074
|
+
var classes = useStyles$k();
|
|
2074
2075
|
var _g = useForm({ defaultValues: INITIAL_VALUES$2 }), register = _g.register, handleSubmit = _g.handleSubmit, reset = _g.reset, errors = _g.formState.errors;
|
|
2075
2076
|
var onSubmit = function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2076
2077
|
var res;
|
|
@@ -2129,7 +2130,7 @@ var CreateProfile = function (_a) {
|
|
|
2129
2130
|
React.createElement(ErrorModal, { error: error, onHide: function () { return setError(''); } })));
|
|
2130
2131
|
};
|
|
2131
2132
|
|
|
2132
|
-
var useStyles$
|
|
2133
|
+
var useStyles$j = makeStyles(function (theme) {
|
|
2133
2134
|
return createStyles({
|
|
2134
2135
|
title: {
|
|
2135
2136
|
fontSize: 15
|
|
@@ -2145,7 +2146,7 @@ var useStyles$k = makeStyles(function (theme) {
|
|
|
2145
2146
|
});
|
|
2146
2147
|
var DeleteProfile = function (_a) {
|
|
2147
2148
|
var profileForDelete = _a.profileForDelete, show = _a.show, onHide = _a.onHide;
|
|
2148
|
-
useStyles$
|
|
2149
|
+
useStyles$j();
|
|
2149
2150
|
var _b = useState(false), open = _b[0], setOpen = _b[1];
|
|
2150
2151
|
var _c = useState(""), error = _c[0], setError = _c[1];
|
|
2151
2152
|
var _d = useState(true), isLoading = _d[0], setIsLoading = _d[1];
|
|
@@ -2285,9 +2286,9 @@ var useTableData$2 = function (_a) {
|
|
|
2285
2286
|
};
|
|
2286
2287
|
|
|
2287
2288
|
var DataTable = function (_a) {
|
|
2288
|
-
var
|
|
2289
|
+
var actionsOfProfile = _a.actionsOfProfile, onSelectionChanged = _a.onSelectionChanged;
|
|
2289
2290
|
var _b = useState(""), filterInput = _b[0], setFilterInput = _b[1];
|
|
2290
|
-
var _c = useState([]),
|
|
2291
|
+
var _c = useState([]), allActions = _c[0], setAllActions = _c[1];
|
|
2291
2292
|
var _d = useState(""), error = _d[0], setError = _d[1];
|
|
2292
2293
|
var _e = useState(null), gridApi = _e[0], setGridApi = _e[1];
|
|
2293
2294
|
var _f = useState(null); _f[0]; var setColumnApi = _f[1];
|
|
@@ -2297,24 +2298,24 @@ var DataTable = function (_a) {
|
|
|
2297
2298
|
var sortRows = function (event) {
|
|
2298
2299
|
event.columnApi.applyColumnState({
|
|
2299
2300
|
state: [
|
|
2300
|
-
{ colId: '
|
|
2301
|
+
{ colId: 'ActionName', sort: 'asc', sortIndex: 0 }
|
|
2301
2302
|
]
|
|
2302
2303
|
});
|
|
2303
2304
|
};
|
|
2304
2305
|
var rows = useMemo(function () {
|
|
2305
|
-
return
|
|
2306
|
+
return allActions
|
|
2306
2307
|
.map(function (_a) {
|
|
2307
|
-
var
|
|
2308
|
+
var ActionId = _a.ActionId, ActionName = _a.ActionName;
|
|
2308
2309
|
return {
|
|
2309
|
-
|
|
2310
|
-
|
|
2310
|
+
ActionId: ActionId,
|
|
2311
|
+
ActionName: ActionName
|
|
2311
2312
|
};
|
|
2312
2313
|
});
|
|
2313
|
-
}, [
|
|
2314
|
+
}, [allActions]);
|
|
2314
2315
|
var columns = [
|
|
2315
2316
|
{
|
|
2316
|
-
field: "
|
|
2317
|
-
headerName: "
|
|
2317
|
+
field: "ActionId",
|
|
2318
|
+
headerName: "#",
|
|
2318
2319
|
flex: 1,
|
|
2319
2320
|
maxWidth: 100,
|
|
2320
2321
|
checkboxSelection: true,
|
|
@@ -2322,7 +2323,7 @@ var DataTable = function (_a) {
|
|
|
2322
2323
|
sortIndex: 1
|
|
2323
2324
|
},
|
|
2324
2325
|
{
|
|
2325
|
-
field: "
|
|
2326
|
+
field: "ActionName",
|
|
2326
2327
|
headerName: "Name",
|
|
2327
2328
|
flex: 4,
|
|
2328
2329
|
sortIndex: 0,
|
|
@@ -2335,7 +2336,7 @@ var DataTable = function (_a) {
|
|
|
2335
2336
|
return 1;
|
|
2336
2337
|
}
|
|
2337
2338
|
else {
|
|
2338
|
-
return (_a = nodeA.data.
|
|
2339
|
+
return (_a = nodeA.data.ActionName) === null || _a === void 0 ? void 0 : _a.localeCompare(nodeB.data.ActionName);
|
|
2339
2340
|
}
|
|
2340
2341
|
}
|
|
2341
2342
|
},
|
|
@@ -2352,7 +2353,7 @@ var DataTable = function (_a) {
|
|
|
2352
2353
|
};
|
|
2353
2354
|
var onFirstDataRendered = useCallback(function (params) {
|
|
2354
2355
|
params.api.forEachNode(function (node) {
|
|
2355
|
-
node.setSelected(!!node.data && !isNil(
|
|
2356
|
+
node.setSelected(!!node.data && !isNil(actionsOfProfile.find(function (p) { return p.ActionId === node.data.ActionId; })));
|
|
2356
2357
|
});
|
|
2357
2358
|
sortRows(params);
|
|
2358
2359
|
}, [sortRows]);
|
|
@@ -2368,11 +2369,11 @@ var DataTable = function (_a) {
|
|
|
2368
2369
|
var resp;
|
|
2369
2370
|
return __generator(this, function (_a) {
|
|
2370
2371
|
switch (_a.label) {
|
|
2371
|
-
case 0: return [4 /*yield*/,
|
|
2372
|
+
case 0: return [4 /*yield*/, getActions()];
|
|
2372
2373
|
case 1:
|
|
2373
2374
|
resp = _a.sent();
|
|
2374
2375
|
if (resp.ok)
|
|
2375
|
-
|
|
2376
|
+
setAllActions(get$1(resp, "data.tables[0].rows", []));
|
|
2376
2377
|
else
|
|
2377
2378
|
setError(resp.message);
|
|
2378
2379
|
return [2 /*return*/];
|
|
@@ -2384,11 +2385,11 @@ var DataTable = function (_a) {
|
|
|
2384
2385
|
React__default.createElement(Grid$1, { md: 12, xs: 12, style: { width: "100rem", padding: "10px 0px" } },
|
|
2385
2386
|
React__default.createElement(TextField, { id: "outlined-basic", label: "Filter...", variant: "outlined", style: { width: "100%" }, value: filterInput, onChange: handlerFilter })),
|
|
2386
2387
|
React__default.createElement("div", { className: "ag-theme-balham", style: { width: "100%", height: "60vh" } },
|
|
2387
|
-
React__default.createElement(AgGridReact, { getRowId: function (params) { return params.data.
|
|
2388
|
+
React__default.createElement(AgGridReact, { getRowId: function (params) { return params.data.ActionId; }, onGridReady: onGridReady, rowData: rows, columnDefs: columns, defaultColDef: defaultColDef, onFirstDataRendered: onFirstDataRendered, rowSelection: "multiple", rowMultiSelectWithClick: true, onSelectionChanged: onAgGridSelectionChanged })),
|
|
2388
2389
|
React__default.createElement(ErrorModal, { error: error, onHide: function () { return setError(""); } })));
|
|
2389
2390
|
};
|
|
2390
2391
|
|
|
2391
|
-
|
|
2392
|
+
makeStyles(function (theme) {
|
|
2392
2393
|
return createStyles({
|
|
2393
2394
|
title: {
|
|
2394
2395
|
fontSize: 15
|
|
@@ -2414,14 +2415,13 @@ var useStyles$j = makeStyles(function (theme) {
|
|
|
2414
2415
|
}
|
|
2415
2416
|
});
|
|
2416
2417
|
});
|
|
2417
|
-
var
|
|
2418
|
+
var ActionsOfProfile = function (_a) {
|
|
2418
2419
|
var profileForEdit = _a.profileForEdit, show = _a.show, onHide = _a.onHide;
|
|
2419
|
-
|
|
2420
|
-
var _b = useState(null), proceduresOfProfile = _b[0], setProceduresOfProfile = _b[1];
|
|
2420
|
+
var _b = useState(null), actionsOfProfile = _b[0], setActionsOfProfile = _b[1];
|
|
2421
2421
|
var _c = useState(false), open = _c[0], setOpen = _c[1];
|
|
2422
2422
|
var _d = useState(true), isLoading = _d[0], setIsLoading = _d[1];
|
|
2423
2423
|
var _e = useState(false), isSubmitLoading = _e[0], setIsSubmitLoading = _e[1];
|
|
2424
|
-
var _f = useState([]),
|
|
2424
|
+
var _f = useState([]), actionsSelected = _f[0], setActionsSelected = _f[1];
|
|
2425
2425
|
var _g = useState(""), error = _g[0], setError = _g[1];
|
|
2426
2426
|
var _h = useForm({ defaultValues: INITIAL_VALUES$2 }), handleSubmit = _h.handleSubmit; _h.formState.errors;
|
|
2427
2427
|
var handleClose = function (event, reason) {
|
|
@@ -2436,7 +2436,7 @@ var ProceduresOfProfile = function (_a) {
|
|
|
2436
2436
|
switch (_a.label) {
|
|
2437
2437
|
case 0:
|
|
2438
2438
|
setIsSubmitLoading(true);
|
|
2439
|
-
return [4 /*yield*/,
|
|
2439
|
+
return [4 /*yield*/, upsertProfileActions(profileForEdit, actionsSelected)];
|
|
2440
2440
|
case 1:
|
|
2441
2441
|
resp = _a.sent();
|
|
2442
2442
|
if (!resp.ok) {
|
|
@@ -2461,11 +2461,11 @@ var ProceduresOfProfile = function (_a) {
|
|
|
2461
2461
|
setIsLoading(true);
|
|
2462
2462
|
setIsSubmitLoading(false);
|
|
2463
2463
|
if (!profileForEdit) return [3 /*break*/, 2];
|
|
2464
|
-
return [4 /*yield*/,
|
|
2464
|
+
return [4 /*yield*/, getActionsByProfileId(profileForEdit)];
|
|
2465
2465
|
case 1:
|
|
2466
2466
|
resp = _a.sent();
|
|
2467
2467
|
if (resp.ok)
|
|
2468
|
-
|
|
2468
|
+
setActionsOfProfile(get$1(resp, "data.tables[0].rows", []));
|
|
2469
2469
|
else
|
|
2470
2470
|
setError(resp.message);
|
|
2471
2471
|
setIsLoading(false);
|
|
@@ -2486,15 +2486,15 @@ var ProceduresOfProfile = function (_a) {
|
|
|
2486
2486
|
React.createElement(Modal$2.Body, { style: { padding: "15px 30px" } },
|
|
2487
2487
|
isLoading && (React.createElement(Grid, { container: true, justifyContent: "center", alignItems: "center", style: { minHeight: "60px" } },
|
|
2488
2488
|
React.createElement(CircularProgress$1, { size: "3rem" }))),
|
|
2489
|
-
!error && !isLoading &&
|
|
2490
|
-
React.createElement(DataTable, {
|
|
2489
|
+
!error && !isLoading && actionsOfProfile &&
|
|
2490
|
+
React.createElement(DataTable, { actionsOfProfile: actionsOfProfile, onSelectionChanged: setActionsSelected })),
|
|
2491
2491
|
React.createElement(Modal$2.Footer, { style: { padding: "20px 30px 30px" } }, !isLoading && (React.createElement(Grid, { container: true, spacing: 2, justifyContent: "flex-end" },
|
|
2492
2492
|
React.createElement(Grid, { item: true, md: 3, xs: 12, style: { margin: 0 } },
|
|
2493
2493
|
React.createElement(Button, { fullWidth: true, variant: "contained", color: "default", onClick: function () { return onHide(false); } }, "Cancel")),
|
|
2494
2494
|
React.createElement(Grid, { item: true, md: 3, xs: 12, style: { margin: 0 } },
|
|
2495
2495
|
React.createElement(Button, { fullWidth: true, startIcon: isSubmitLoading && React.createElement(CircularProgress$1, { size: "1rem" }), disabled: isSubmitLoading, variant: "contained", color: "primary", type: 'submit' }, "Save"))))))),
|
|
2496
2496
|
React.createElement(Snackbar, { open: open, autoHideDuration: 2500, onClose: handleClose },
|
|
2497
|
-
React.createElement(Alert, { severity: "info", onClose: handleClose }, "The
|
|
2497
|
+
React.createElement(Alert, { severity: "info", onClose: handleClose }, "The actions of the profile were edited successfully")),
|
|
2498
2498
|
React.createElement(ErrorModal, { error: error, onHide: function () { return setError(""); } })));
|
|
2499
2499
|
};
|
|
2500
2500
|
|
|
@@ -2562,7 +2562,7 @@ var TableProfiles = function (_a) {
|
|
|
2562
2562
|
if (shouldUpdate)
|
|
2563
2563
|
getProfilesFromAPI().then(function () { });
|
|
2564
2564
|
} }),
|
|
2565
|
-
React.createElement(
|
|
2565
|
+
React.createElement(ActionsOfProfile, { show: modalProceduresProfile, profileForEdit: profileForEdit, onHide: function (shouldUpdate) {
|
|
2566
2566
|
setModalProceduresProfile(false);
|
|
2567
2567
|
setProfileForEdit(null);
|
|
2568
2568
|
if (shouldUpdate)
|
|
@@ -4839,6 +4839,12 @@ var AssetViewComponent = function () {
|
|
|
4839
4839
|
setShowViewerAssetDialog(true);
|
|
4840
4840
|
}
|
|
4841
4841
|
};
|
|
4842
|
+
var handleOnHideViewer = function () {
|
|
4843
|
+
setShowViewerAssetDialog(false);
|
|
4844
|
+
setIsDoubleClick(false);
|
|
4845
|
+
setShowCreateNewContextMenu(false);
|
|
4846
|
+
setShowContextMenu(false);
|
|
4847
|
+
};
|
|
4842
4848
|
useEffect(function () {
|
|
4843
4849
|
var handleKeyDown = function (e) {
|
|
4844
4850
|
if (e.key.toLowerCase() === "escape") {
|
|
@@ -4905,7 +4911,7 @@ var AssetViewComponent = function () {
|
|
|
4905
4911
|
} })))))),
|
|
4906
4912
|
React__default.createElement(CreateNewAssetDialog, { show: showCreateNewAssetDialog, onHide: function () { return setShowCreateNewAssetDialog(false); } }),
|
|
4907
4913
|
React__default.createElement(EditAssetDialog, { show: showEditAssetDialog, onHide: function () { return setShowEditAssetDialog(false); } }),
|
|
4908
|
-
React__default.createElement(ViewerAssetDialog, { show: showViewerAssetDialog, onHide: function () {
|
|
4914
|
+
React__default.createElement(ViewerAssetDialog, { show: showViewerAssetDialog, onHide: function () { return handleOnHideViewer(); } }),
|
|
4909
4915
|
React__default.createElement(RemoveAssetDialog, { show: showRemoveAssetDialog, onHide: function () { return setShowRemoveAssetDialog(false); } }))),
|
|
4910
4916
|
React__default.createElement(Snackbar$1, { open: updatedSuccessfullyMessage, autoHideDuration: 2500, onClose: handleClose },
|
|
4911
4917
|
React__default.createElement(Alert$3, { severity: "success", onClose: handleClose }, "Asset updated successfully")),
|
|
@@ -7514,7 +7520,7 @@ function Configuration() {
|
|
|
7514
7520
|
React__default.createElement(MenuItem, { selected: option === 'shifts', className: "p-0" },
|
|
7515
7521
|
React__default.createElement(Link, { to: "/configuration/shifts", className: "nav-link" }, "Shift / Crews")),
|
|
7516
7522
|
React__default.createElement(MenuItem, { selected: option === 'asset', className: "p-0" },
|
|
7517
|
-
React__default.createElement(Link, { to: "/configuration/asset", className: "nav-link" }, "
|
|
7523
|
+
React__default.createElement(Link, { to: "/configuration/asset", className: "nav-link" }, "Assets Tree"))),
|
|
7518
7524
|
React__default.createElement("h3", { className: "mes-menu-group" }, "Security"),
|
|
7519
7525
|
React__default.createElement(MenuList, { className: "mes-submenu" },
|
|
7520
7526
|
React__default.createElement(MenuItem, { selected: option === 'users', className: "p-0" },
|
package/package.json
CHANGED